[kepler-dev] Passing arguments to Kepler

Jianwu Wang jianwu at sdsc.edu
Thu Jul 23 23:39:18 PDT 2009


Hi Michal,

   From your exception, I think you are using Kepler 1.0, right? Did you 
get exception when using 'kepler.sh -runwf -gui -cache -property1 value1 
workflow.xml'?

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().

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?

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 actor or parameter values. I didn't test it in Kepler 1.0 since I don't have 1.0 installed in my notebook.


Best wishes

Sincerely yours

Jianwu Wang
jianwu at sdsc.edu
http://users.sdsc.edu/~jianwu/

Scientific Workflow Automation Technologies (SWAT) Laboratory
San Diego Supercomputer Center 
University of California, San Diego
San Diego, CA, U.S.A. 



Michal Owsiak wrote:
> Hello David, hello Jianwu,
>
> thanks for your solutions. I have tried to pass the argument into Kepler
> but it still fails :(
>
> I am still receiving the error stating that parameter can not be parsed:
>
> Command failed
> Arguments: -kepler -parameter1 value1
>
> java.lang.Exception: Failed to parse "-kepler -parameter1 value1"
> 	at
> ptolemy.actor.gui.MoMLApplication.throwArgsException(MoMLApplication.java:584)
> 	at ptolemy.actor.gui.MoMLApplication.<init>(MoMLApplication.java:245)
> 	at ptolemy.vergil.VergilApplication.<init>(VergilApplication.java:98)
> 	at ptolemy.vergil.VergilApplication$1.run(VergilApplication.java:141)
> 	at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:226)
> 	at java.awt.EventQueue.dispatchEvent(EventQueue.java:602)
> 	at
> java.awt.EventDispatchThread.pumpOneEventForFilters(EventDispatchThread.java:275)
>
> Strange thing is, that I do not pass "-kepler" as argument. At least not
> intentionally. I am using ./kepler.sh from the default installation.
>
> I have two additional questions:
>
> 1. If I pass something into JVM as a Property, is there a default way
> for accessing these values from the Kepler?
> 2. If I pass arguments into Kepler (as application arguments) - can I
> access the by simply using "$parameter1"?
> 3. Is there a default mechanism in Kepler for accessing environment
> variables?
>
> Thanks in advance for the answers.
>
> Cheers
>
> Michal
>
>   
>> Hi Michal,
>>
>>    For Kepler.sh, you should be able to do like this: kepler.sh -runwf
>> -nogui -nocache -property1 value1  -property2 value2 -property3 value3
>> workflow.xml. For gui and cache choices:
>>
>> -gui run with GUI support (default).
>> -nogui run without GUI support.
>> -cache run with kepler cache (default).
>> -nocache run without kepler cache.
>>
>>
>>  
>> Best wishes
>>
>> Sincerely yours
>>
>> Jianwu Wang
>> jianwu at sdsc.edu
>> http://users.sdsc.edu/~jianwu/
>>
>> Scientific Workflow Automation Technologies (SWAT) Laboratory
>> San Diego Supercomputer Center University of California, San Diego
>> San Diego, CA, U.S.A.
>>
>>
>> David Welker wrote:
>>     
>>> Hi Michal,
>>>
>>> I don't know about kepler.sh. However, using, the build system to
>>> either run Kepler or a workflow, it is possible to pass in either
>>> command-line arguments or properties that are then accessible from
>>> your program. For example:
>>>
>>> ant run -Dargs="arg1 arg2 arg3"
>>>
>>> or
>>>
>>> ant run -Dproperties=property1=value1,property2=value2,property3=value3
>>>
>>>
>>> You can also pass parameters (but you cannot use arguments) in the
>>> following commands:
>>>
>>> ant run-workflow
>>> ant run-workflow-no-gui
>>> ant run-workflow-no-gui-server
>>> ant run-workflow-no-cache
>>>
>>> If you must use kepler.sh instead of the build system to run Kepler or
>>> your workflows, perhaps someone more knowledgeable about kepler.sh
>>> could chime in...
>>>
>>> David
>>>
>>>
>>>       
>>>> Dearl All,
>>>>
>>>> is it possible to pass arguments into Kepler that will be available from
>>>> the workflow?
>>>>
>>>> I want to do something like this:
>>>>
>>>> shell>kepler.sh arg1 arg2 arg2
>>>>
>>>> Then, I'd like to use these arguments within Kepler - something like
>>>> this:
>>>>
>>>> $arg1
>>>>
>>>> I have checked: ptolemy.vergil.VergilApplication and it seems like this
>>>> class passes all unrecognized parameters into model - but I don't know
>>>> how to access it.
>>>>
>>>> When I try to pass something into kepler.sh I get this error:
>>>>
>>>> shell>./kepler argument
>>>>
>>>> Command failed
>>>> Arguments: -kepler argument
>>>>
>>>> java.lang.Exception: Failed to parse "-kepler argument"
>>>>     at
>>>> ptolemy.actor.gui.MoMLApplication.throwArgsException(MoMLApplication.java:584)
>>>>
>>>> Regards
>>>>
>>>> Michal
>>>>
>>>>   
>>>>         
>>> _______________________________________________
>>> Kepler-dev mailing list
>>> Kepler-dev at kepler-project.org
>>> http://mercury.nceas.ucsb.edu/kepler/mailman/listinfo/kepler-dev
>>>       
>
>
>   
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mercury.nceas.ucsb.edu/kepler/pipermail/kepler-dev/attachments/20090723/0adb1677/attachment.html>


More information about the Kepler-dev mailing list