EscapeWE Escape Workflow Engine

judgedrunkshipServers

Nov 17, 2013 (3 years and 6 months ago)

113 views

Simon Ebner, 23 May 2008

Escape
WE



Escape Workflow Engine

Version 0.4

Simon Ebner, 23 May 2008

Overview



Simon Ebner, 23 May 2008

Highlevel Design Goals



Flexible architecture that can be easily extended



Highly configurable service so that it can be used by various beamlines



Seamless integration into environment


No changes in current infrastructure/existing applications are required

Simon Ebner, 23 May 2008

Overview Architecture



EPICS

Workflow Engine

(Service)

Escape

(Service)


Escape Client

WE Client

EPICS

Client

Client Application

Simon Ebner, 23 May 2008

Escape
WE

Design


Overview



Use and leverage of existing (workflow) scripts



Standardized and easy access and execution of workflows (scripts)



Workflow Engine provides detailed information about available workflows


Parameters, description, …

Simon Ebner, 23 May 2008

Details



Simon Ebner, 23 May 2008

Details Escape
WE


workflowmap.xml
is the main configuration file of Escape
WE
(comes with the

Escape
WE
binaries)


Defines sub directories in which workflow scripts and definitions can be placed


Workflow definitions are named <scriptname>.xml


Escape
WE

will load workflows from configured directories


Workflow Engine

(Service)

configuration

(
workflowmap.xml
)

script.sh

script.sh.xml

script.py

script.py.xml

Simon Ebner, 23 May 2008

Details

Workflowmap


Specification of available workflows, the implementation class, their description
and their parameters


Specification of additional paths to search for workflow configurations

Simon Ebner, 23 May 2008

Details

Workflowmap



<?xml version="1.0" encoding="UTF
-
8"?>

<workflows xmlns="http://www.sls.psi.ch/controls/escape">


<type name="epicspv">



<class name="
ch.psi.sls.escapewe.workflow.SimpleEpicsPVWorkflow
"/>



<configuration>


<parameter name="addressList" value="129.129.145.26"/>


</configuration>



<workflow name="simple_pv">


<description>Simple workflow that set specified epics records</description>


<parameter name="TEST_ESCAPE:RECORD1.VAL" value="0"/>


</workflow>



<searchpath>


<path>/opt/escapewe/current/sbin</path>


</searchpath>



</type>




<type name="script">


...


</type>


...

</workflows>

workflow definition

(0
-
*) <workflow>

implementation class

(1) <class>

configuration of implementation class

(0
-
1) <configuration>

(0
-
*) <parameter>

search path additional workflow definitions

(0
-
1) <searchpath>

(0
-
*) <path>

grouping of workflows of the

same type (same implementation class)

(1
-
*) <type>

Simon Ebner, 23 May 2008

Examle

Workflowmap



<?xml version="1.0" encoding="UTF
-
8"?>

<workflows xmlns="http://www.sls.psi.ch/controls/escape">


<type name="script">


<class name="ch.psi.sls.escapewe.workflow.SimpleScriptWorkflow"/>


<configuration>


<parameter name="expectedExitValue" value="0"/>


</configuration>


<searchpath>


<path>/opt/escapewe/current/sbin</path>


</searchpath>


</type>


<type name="counter">


<class name="ch.psi.sls.escapewe.workflow.SimpleCounterWorkflow"/>


<workflow name="simple_count">


<description>Simple workflow to count and sleep</description>


<parameter name="count" value="2"/><!
--

how namy sleep cycles
--
>


<parameter name="sleep" value="2000"/> <!
--

sleep time in ms
--
>


</workflow>


</type>


<type name="epicspv">


<class name="ch.psi.sls.escapewe.workflow.SimpleEpicsPVWorkflow"/>


<configuration>


<parameter name="addressList" value="129.129.145.26"/>


</configuration>


<workflow name="simple_pv">


<description>Simple workflow that set specified epics records</description>


<parameter name="TEST_ESCAPE:RECORD1.VAL" value="0"/>


</workflow>


<searchpath>


<path>/opt/escapewe/current/sbin</path>


</searchpath>


</type>

</workflows>

Simon Ebner, 23 May 2008

Details
<scriptname>.xml



<?xml version="1.0" encoding="UTF
-
8"?>


<workflow type="epicspv" xmlns="http://www.sls.psi.ch/controls/escape">



<description>


An other simple workflow that set specified epics records


</description>



<parameter name="TEST_ESCAPE:RECORD1.VAL" value="4"/>


<parameter name="TEST_ESCAPE:RECORD2.VAL" value="5"/>


<parameter name="TEST_ESCAPE:RECORD3.VAL" value="6"/>


</workflow>

workflow definition

(0
-
*) <workflow>

(see workflowmap)

type refering to a type declared in
workflowmap.xml

description of workflow

workflow parameter

Simon Ebner, 23 May 2008

Details
<scriptname>.xml


Name/Id of workflow will be <type>::<scriptname>

Simon Ebner, 23 May 2008

Workflow Type
script


All workflow parameters are passed to the script as follows:


scriptname

<parameter1>
=
<value1>

<parameterX>
=
<valueX>


Messages written to standard out or standard error will show up in the
EscapeWE log file located in /opt/escapewe/current/var


All exit codes other than 0 are interpreted as failure of the workflow/script.


If there is a parameter
expectedExitValue
this value will be the exit code that
is interpreted as success of the workflow/script.

Simon Ebner, 23 May 2008

Escape
WE

Test Client



Simon Ebner, 23 May 2008

Overview Functions



View/terminate currently executed workflows



View workflows and their default parameters/configuration



Execute workflows



Re
-
load Escape
WE

configuration

Simon Ebner, 23 May 2008

Escape
WE

Client

The client can be accessed via
http://localhost:8080/ch.psi.sls.escapewe


goto Escape test client

goto Escape/EscapeWE wiki

home

client API description (WSDL)

test client

online help

Simon Ebner, 23 May 2008

Escape
WE

Client



reload EscapeWE configuration

get running workflow instances

get details loaded workflows/execute workflows

Simon Ebner, 23 May 2008

Escape
WE

Client



get id of running workflow instances

terminate workflow instance

Simon Ebner, 23 May 2008

Escape
WE

Client



adaption parameter

synchronous/asynchronous execution of workflow

(gui will report success/will not report result)

selection workflow

workflow details

Simon Ebner, 23 May 2008

Deployment



Simon Ebner, 23 May 2008

ESCAPE Deployment Configuration



CVS

Workflows/Definitions



<<commit>>

Development Machine (Linux/Windows/…)

Beamline Machine (Linux
-
SL5)

Workflow Engine

(Service)

Apache Tomcat

<<checkout>>

escapewe
-
config
-
mgr

supporting scripts

configuration

configuration

Simon Ebner, 23 May 2008

ESCAPE Deployment Service(s)



Beamline Machine (Linux
-
SL5)

Workflow Engine

(Service)

Apache Tomcat

supporting scripts

<<deploy/undeploy>>

escapewe
-
mgr <deploy|undeploy|info>

configuration

Simon Ebner, 23 May 2008

HowTo’s



Simon Ebner, 23 May 2008

HowTo


Register a script as a workflow


Copy script into /opt/escapewe/current/sbin

cp test.sh /opt/escapewe/current/sbin/test.sh


Create a configuration file <scriptname>.xml

touch /opt/escapewe/current/sbin/test.sh.xml

vi /opt/escapewe/current/sbin/test.sh.xml

<?xml version="1.0" encoding="UTF
-
8"?>

<workflow type="script" xmlns="http://www.sls.psi.ch/controls/escape">

<description>Simple test script workflow</description>

<parameter name="paramOne" value="p1"/>

</workflow>


Reload EscapeWE configuration via the GUI

reload EscapeWE configuration

Simon Ebner, 23 May 2008

Questions / TODOs



Simon Ebner, 23 May 2008


Questions

???????????????????????????????????????????????????????????????????
????????????????????????????
Questions
??????????????????????????????
???????????????????????????????????????????????????????????????????
?????????????
Suggestions
???????????????????????????????????????????
???????????????????????????????????????????????????????????????????
??????????????????????????????????????????
Remarks
?????????????????
???????????????????????????????????????????????????????????????????
????????????????????
Feedback
??????????????????????????????????????
???????????????????????????????????????????????????????????????????
????????????????????????????
Ideas
??????????????????????????????????
???????????????????????????????????????????????????????????????????

Simon Ebner, 23 May 2008

More Infos

ESCAPE WIKI:

https://controls.web.psi.ch/cgi
-
bin/twiki/view/Main/ExperimentStateController