job dependency graph?

74 views
Skip to first unread message

Andrew Munn

unread,
Jan 21, 2020, 5:51:49 PM1/21/20
to rundeck-discuss
I see this talks about creating a DAG:


Is there a way I can create jobs A, B and C and C starts when A and B complete successfully?

Thanks






Message has been deleted

Reiner Acuña

unread,
Jan 22, 2020, 9:23:23 AM1/22/20
to rundeck-discuss
Hi Andrew,

A good way to do that is to use Job State Conditional step in the Job C (maybe scheduled) pointing and evaluating the status of JobA and JobB (in your case latest succeeded execution).

I leave an example for testing, feel free to modify it:

JobA:

<joblist>
 
<job>
   
<defaultTab>nodes</defaultTab>
   
<description></description>
   
<executionEnabled>true</executionEnabled>
   
<id>b152d59b-7d6d-440c-95ea-23dc9fc1db07</id>
   
<loglevel>INFO</loglevel>
   
<name>JobA</name>
   
<nodeFilterEditable>false</nodeFilterEditable>
   
<scheduleEnabled>true</scheduleEnabled>
   
<sequence keepgoing='false' strategy='node-first'>
     
<command>
       
<exec>echo "hi, i am the job a"</exec>
     
</command>
   
</sequence>
   
<uuid>b152d59b-7d6d-440c-95ea-23dc9fc1db07</uuid>
 
</job>
</joblist>

Job B:

<joblist>
 
<job>
   
<defaultTab>nodes</defaultTab>
   
<description></description>
   
<executionEnabled>true</executionEnabled>
   
<id>2eaf6d55-0000-49d6-9f02-9d94b64cc444</id>
   
<loglevel>INFO</loglevel>
   
<name>JobB</name>
   
<nodeFilterEditable>false</nodeFilterEditable>
   
<scheduleEnabled>true</scheduleEnabled>
   
<sequence keepgoing='false' strategy='node-first'>
     
<command>
       
<exec>echo "hi, i am the job b"</exec>
     
</command>
   
</sequence>
   
<uuid>2eaf6d55-0000-49d6-9f02-9d94b64cc444</uuid>
 
</job>
</joblist>


JobC:

<joblist>
 
<job>
   
<defaultTab>nodes</defaultTab>
   
<description></description>
   
<executionEnabled>true</executionEnabled>
   
<id>285fda04-288e-4566-99fb-d7f25fd9ad75</id>
   
<loglevel>INFO</loglevel>
   
<name>JobC</name>
   
<nodeFilterEditable>false</nodeFilterEditable>
   
<scheduleEnabled>true</scheduleEnabled>
   
<sequence keepgoing='false' strategy='sequential'>
     
<command>
       
<step-plugin type='job-state-conditional'>
         
<configuration>
           
<entry key='condition' value='Equals' />
           
<entry key='executionState' value='Succeeded' />
           
<entry key='fail' value='true' />
           
<entry key='halt' value='true' />
           
<entry key='jobName' value='JobA' />
           
<entry key='jobUUID' value='b152d59b-7d6d-440c-95ea-23dc9fc1db07' />
           
<entry key='running' value='false' />
         
</configuration>
       
</step-plugin>
     
</command>
     
<command>
       
<step-plugin type='job-state-conditional'>
         
<configuration>
           
<entry key='condition' value='Equals' />
           
<entry key='executionState' value='Succeeded' />
           
<entry key='fail' value='true' />
           
<entry key='halt' value='true' />
           
<entry key='jobName' value='JobB' />
           
<entry key='jobUUID' value='2eaf6d55-0000-49d6-9f02-9d94b64cc444' />
           
<entry key='running' value='false' />
         
</configuration>
       
</step-plugin>
     
</command>
     
<command>
       
<exec>echo "i am the job c"</exec>
     
</command>
   
</sequence>
   
<uuid>285fda04-288e-4566-99fb-d7f25fd9ad75</uuid>
 
</job>
</joblist>

Another option is to create a workflow based on data values similar to this:

https://groups.google.com/d/msg/rundeck-discuss/Vp16iR1ZRHI/1NrXsWoGDQAJ

About the DAG Graph plugin, it doesn't work under 3.2 yet (only under Rundeck 3.1 in my tests).

You can follow the issue here:

https://github.com/rundeck-plugins/ui-job-graph/issues/2

PD: I deleted the last message to fix JobC :-)

Regards!

rac...@rundeck.com

unread,
Dec 14, 2020, 10:05:42 AM12/14/20
to rundeck-discuss
Just updating this thread: UI Job Graph plugin now is usable on Rundeck 3.2 and 3.3 branches on the latest update.
Reply all
Reply to author
Forward
0 new messages