[workflow-plugin] Running a worker job on executor allocated by workflow job

13 views
Skip to first unread message

may...@gmail.com

unread,
Dec 1, 2015, 7:35:58 AM12/1/15
to Jenkins Users
Hi,

I have a set of jobs that I want to integrate using a common Workflow. Some of them contains complex plugin configuration that is hard to duplicate within a workflow, i.e. xunit plugin, extended email, etc.
Concurrent executions of this workflow should be allowed. At the same time I have a bunch of slaves each with only one executor (to lock non-shareable resources). In addition it should be guaranteed that no other job is able to grab the node in the middle of the workflow, so that

node('slave1'){
    build('step_1')
}
node('slave1'){
    build('step_2')
}

approach is not applicable as a concurrent execution may be wedged in between two steps.
 
My initial desire was to allocate a node within a workflow and then call build() within its closure, I thought those jobs will use the same executor as the workflow. However, it's not like that, the child job also want to grab an executor.

node('slave1'){ //will hang infinitely if slave1 has only one executor
    build('step_1')
    build('step_2')
}

So my question: is it possible to share an executor allocated by a workflow with child jobs? Or lock it in any other way?

I found this JIRA on locks support for Workflow: https://issues.jenkins-ci.org/browse/JENKINS-30269. It seems that at the moment there is no consistent way for locking in Workflow. Maybe there is some workaround?

Thanks,
Nick
Reply all
Reply to author
Forward
0 new messages