workflow - allocate node(s) for user?

34 views
Skip to first unread message

Les Mikesell

unread,
Dec 24, 2014, 1:16:10 PM12/24/14
to jenkinsci-users
Is there - or could there be - a workflow step that pre-allocates and
locks a set of nodes that a given user is allowed to use? Under the
covers, this might involve spinning up some VMs and/or waiting for
other jobs to complete on nodes with the requested label(s). For
some test jobs it may be necessary to have a guarantee of exclusive
access on multiple nodes before starting.

--
Les Mikesell
lesmi...@gmail.com

Jesse Glick

unread,
Jan 7, 2015, 6:40:40 PM1/7/15
to jenkins...@googlegroups.com
On Wednesday, December 24, 2014 1:16:10 PM UTC-5, LesMikesell wrote:
Is there - or could there be - a workflow step that pre-allocates and
locks a set of nodes that a given user is allowed to use?

The access control aspect can be handled by independent plugins, such as


in Jenkins Enterprise by CloudBees (but there may be other ways of doing this I am less familiar with).

“Waiting for other jobs to complete” is automatic; the ‘node’ step will simply defer its body until it can grab an open executor slot on a matching node.

For some test jobs it may be necessary to have a guarantee of  exclusive
access on multiple nodes before starting.

Well Workflow 1.2 will have a ‘waitUntil’ step so I guess you could make a DIY semaphore:

def acquired = 0
def branch(label) {
  node(label) {
    acquired++
    waitUntil {acquired == 2}
    // run stuff on this node
  }
}
parallel server: {branch('server')}, client: {branch('client')}

This is prone to deadlocks, though. Making a deadlock-free semaphore is trickier (you need to sometimes back out of a workspace lock and wait before trying again); probably best left to a custom step.

Åsmund Østvold

unread,
Aug 2, 2016, 4:52:45 AM8/2/16
to jenkins...@googlegroups.com
Les, did you find a solution that worked for you? 
Do anybody have a working solution they could share?

Regards,
Asmund


--
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/832eae2a-b7ad-4cab-a437-e6ad6e23d40d%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages