[workflow-plugin] dependencies between parallel steps?

61 views
Skip to first unread message

Alexander Bertram

unread,
Dec 14, 2014, 9:26:58 PM12/14/14
to jenkins...@googlegroups.com
I'm experimenting with the moving some hacky build proccesses into the great new workflow plugin, but not sure how to best handle dependencies between parallel steps.

The workflow is meant to test a release candidate of an R-language interpreter against a library of a few thousand packages, some of which depend on each other.

ideally my flow would look like this:

def packages = fetchPackageIds()
builds = [:]
for p in packages {
builds[p] = {
waitFor dependencyPackageIds(p)
node { buildPackage p }
}
}
parallel builds

But it looks like I need to implement a waitFor primitive that is similar to stage but local to the flow rather than global?

Or is there another approach I'm missing?

Thanks,
Alex



Kohsuke Kawaguchi

unread,
Dec 16, 2014, 5:45:29 PM12/16/14
to jenkins...@googlegroups.com
I think JENKINS-26052 would be a natural solution for this. parallel() has a different emphasis from yours.

I also thought about building a library on top of workflow that lets you declare tasks with dependencies and have the library figure out what to execute in what order (including parallelism), which might work well for this, too. The idea is something like the following:

task(name:"foo") {
  // whatever computation you fancy
  sh '...'
}

task(name:"bar", depends:["foo"]) {
  ...
}

task(name:"zot", depends:["foo"]) {
  ...
}

attain "zot"  // foo runs, then bar+zot runs in parallel





--
You received this message because you are subscribed to the Google Groups "Jenkins Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to jenkinsci-use...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/jenkinsci-users/ba1047d2-c7bd-4b9b-9f78-463573e99877%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.


--
Kohsuke Kawaguchi

Alexander Bertram

unread,
Dec 19, 2014, 10:57:30 AM12/19/14
to jenkins...@googlegroups.com
Yes! That's perfect.

Are you working on JENKINS-26052 now or is this something I could submit a pull request for?

Will comment further on JENKINS-26052.

Best,
Alex

Jesse Glick

unread,
Jan 7, 2015, 7:03:15 PM1/7/15
to jenkins...@googlegroups.com
On Sunday, December 14, 2014 9:26:58 PM UTC-5, Alexander Bertram wrote:
But it looks like I need to implement a waitFor primitive

JENKINS-25570 is implemented in 1.2 and adds a waitUntil step. 
Reply all
Reply to author
Forward
0 new messages