[kepler-dev] Passing arguments to Kepler

Michal Owsiak michalo at man.poznan.pl
Thu Jul 23 23:55:42 PDT 2009


Hello Jianwu,

>   From your exception, I think you are using Kepler 1.0, right? 

Exactly. I am using Kepler 1.0

>Did you get exception when using 'kepler.sh -runwf -gui -cache -property1 value1
> workflow.xml'?

No. I am getting this exception when calling:

java -Xmx512m -Xss5m -DKEPLER="$KEP" -DKEPLER_DOCS="$KEP"
-Djava.endorsed.dirs=./lib/jar/base-jars/apache
-Djava.library.path=./lib org.kepler.loader.Kepler $*

Which is a line that starts Kepler 1.0 from kepler.sh

> About your additional questions:
> 
> 1. If I pass something into JVM as a Property, is there a default way
> for accessing these values from the Kepler?
> 
>   You should be able to get the value in Kepler by System.getProperty().

OK. Accessing properties using System.getProperty is fine with me -
that's what I am doing now within fire() method. What I was thinking of
is a some sort of already existing actor that wraps this functionality
(e.g. Expression actor). This way I can make property to be accessible
at the workflow level. If there is no such an actor it is not a big
issue - I will write one. But I don't want to double the functionality
of the actors.

> 2. If I pass arguments into Kepler (as application arguments) - can I
> access the by simply using "$parameter1"?
> 
>   I don't get it. what are application arguments? You want to access
> them in Kepler programatically?

Let's say I am starting kepler like this:

java -jar kepler.jar arg1 arg2 arg3 arg4

arg1, arg2, ... are the application arguments that I am thinking of.

I can see (in the code) that ptolemy.vergil.VergilApplication puts all
unrecognized arguments into some sort of table and passes them further
into the model. Question is: can I access them inside workflow somehow?

> 3. Is there a default mechanism in Kepler for accessing environment
> variables?
> 
>   In version of Kepler trunk, you can get environment variables by using
> expression like getenv("JAVA_HOME"). You can either put it in Expression

That's exactly what I wanted to now! I was looking for an actor that is
able to read environment variables. I will check that in Kepler 1.0.

> actor or parameter values. I didn't test it in Kepler 1.0 since I don't
> have 1.0 installed in my notebook.

Cheers

Michal

-- 
Michal Owsiak <michalo at man.poznan.pl>
Poznan Supercomputing and Networking Center
ul. Noskowskiego 10, 61-704 Poznan, POLAND
http://www.man.poznan.pl


More information about the Kepler-dev mailing list