DO NOT MERGE: fixed path and environment variables references for monanas

Change-Id: I772756a0eb052bea7ff790e7f13f932dc40a32c6
This commit is contained in:
Marco Lotz 2016-09-19 17:15:48 +01:00
parent bd1352a68b
commit ba3d5e5dcf
2 changed files with 6 additions and 5 deletions

View File

@ -24,7 +24,7 @@ To test this example, perform the following steps.
#### Configuration File
Before running MoNanas, we need to create a configuration file describing how
we want MoNanas to orchestrate the data execution (creating a pipeline). You can find the following configuration in `$HOME/config/markov_source_config.json`:
we want MoNanas to orchestrate the data execution (creating a pipeline). You can find the following configuration in `$MONANAS_HOME/config/markov_source_config.json`:
```json
@ -174,7 +174,7 @@ $KAFKA_HOME/bin/kafka-server-start.sh \
After that, start MoNanas as follows.
```bash
python $MONANAS_HOME/run.py -p $SPARK_HOME -c $HOME/tmp/alert_example.json \
python $MONANAS_HOME/run.py -p $SPARK_HOME -c $MONANAS_HOME/config/markov_source_config.json \
-l $MONANAS_HOME/config/logging.json
```
@ -276,7 +276,7 @@ To test this example, perform the following steps.
#### Configuration File
Before running MoNanas, we need to create a configuration file describing how
we want MoNanas to orchestrate the data execution (creating a pipeline). You can find the following configuration in `$HOME/config/iptables_anomalies.json`:
we want MoNanas to orchestrate the data execution (creating a pipeline). You can find the following configuration in `$MONANAS_HOME/config/iptables_anomalies.json`:
```json
{
@ -349,7 +349,7 @@ As you can see, the flow described in the previous section is mapped to the conf
Start MoNanas as follows:
```bash
python $MONANAS_HOME/run.py -p $SPARK_HOME -c $HOME/config/iptables_anomalies.json \
python $MONANAS_HOME/run.py -p $SPARK_HOME -c $MONANAS_HOME/config/iptables_anomalies.json \
-l $MONANAS_HOME/config/logging.json
```
If you want to run your own configuration you will need to change the value of the -c parameter.

3
run.py
View File

@ -60,6 +60,7 @@ class RunnerError(Exception):
def main(arguments):
spark_submit = "{0}/bin/spark-submit".format(arguments["<spark_path>"])
monanas_path = os.environ.get('MONANAS_HOME', "")
kafka_jar = None
try:
@ -79,7 +80,7 @@ def main(arguments):
format(arguments["<spark_path>"], kafka_jar)
command = [
spark_submit, "--master", "local[2]",
"--jars", spark_kafka_jar, "monasca_analytics/monanas.py",
"--jars", spark_kafka_jar, monanas_path + "/monasca_analytics/monanas.py",
arguments["<config>"], arguments["<log_config>"]
]
command += arguments["<sources>"]