Python. After writing several spouts and bolts this way, I put together a
framework so the "standard" code is in a reusable script and you only have
a write a short script with your spout or bolt-specific code.
If you take a look starting at line 147 of this file:
https://github.com/AirSage/Petrel/blob/master/petrel/petrel/package.py
you'll see some of the things we're doing in our startup script such as:
- Setting up a temporary directory for this topology (Storm doesn't like
it if you create additional directories under the one with your scripts)
- Checking that the right version of Python is installed
- Creating a private Python environment (a.k.a. virtualenv) for the
libraries required by this topology
- Installing required libraries (we use a lock file so that all the
spouts and bolts for a topology can share the same library installations)
Barry
On Tuesday, December 4, 2012 3:55:16 PM UTC-5, Jim Baugh wrote:
In the environment that I am running I use perlbrew to set the version of
perl I want to use prior to running a perl script. I do this by sourcing a
file that has all of my env vars set.
What is the best way to do this in storm?
Currently, I am wrapping my perl job with a bash script and call the bash
script from storm.
e.g. splitsentence.sh
#!/bin/bash
path=MultiLangDir
source "${path}/splitsentence.sh"
perl "${path}/splitsentence.pl"
e.g. storm call
public SplitSentence() {
super("sh", "splitsentence.sh");
}
Is there a better way to do this?
Thanks,
James
In the environment that I am running I use perlbrew to set the version of
perl I want to use prior to running a perl script. I do this by sourcing a
file that has all of my env vars set.
What is the best way to do this in storm?
Currently, I am wrapping my perl job with a bash script and call the bash
script from storm.
e.g. splitsentence.sh
#!/bin/bash
path=MultiLangDir
source "${path}/splitsentence.sh"
perl "${path}/splitsentence.pl"
e.g. storm call
public SplitSentence() {
super("sh", "splitsentence.sh");
}
Is there a better way to do this?
Thanks,
James