[Buildbot-devel] acquiring multi-step locks/lock until the end of the build

Jared Grubb jared.grubb at gmail.com
Sun Feb 15 02:43:54 UTC 2015


One idea I’ve discussed in the past is to have a BuildStep that can contain other BuildSteps (more logical than literal). That way, the normal attributes of a step (doStepIf, haltOnFailure, locks) would have a hierarchical meaning.

For example, you would be able to fail a group of steps together (eg, children have haltOnFailure=True, but the parent has haltOnFailure=False). You could have a lock span multiple steps. You could even let the Waterfall collapse a group of steps in the Waterfall view (which would help make my 116-step builder more friendly to that view!). And so forth.

I’ve sketched some of the implementation out, but havent had a chance to take it far yet… feel free :) I’d love to use it :)

Jared

> On Feb 13, 2015, at 09:09, Vitali Lovich <vlovich at gmail.com> wrote:
> 
> Oh yeah - UnlockBuildLock probably couldn’t just call self.build.releaseLocks since it would only release a particular lock.
> Would probably have to introspect the build state a little.
> 
> Seems like a feasible solution though.
> 
> -Vitali
> 
>> On Feb 13, 2015, at 9:07 AM, Vitali Lovich <vlovich at gmail.com <mailto:vlovich at gmail.com>> wrote:
>> 
>> Cool.  Thanks for the suggestion.
>> 
>> -Vitali
>> 
>>> On Feb 13, 2015, at 9:06 AM, Pierre Tardy <tardyp at gmail.com <mailto:tardyp at gmail.com>> wrote:
>>> 
>>> You could create a step:
>>> 
>>> LockUntilEndOfBuild(MasterLock("foo"))
>>> 
>>> This step would modify self.build.locks to add this new lock, and then call self.build.acquireLocks()
>>> 
>>> This should effectively do option 2.
>>> 
>>> For option 1, you could create a UnlockBuildLock() step that does call self.build.releaseLocks()
>>> 
>>> There might be some interesting details though :)
>>> 
>>> 
>>> Le Fri Feb 13 2015 at 5:39:50 PM, Vitali Lovich <vlovich at gmail.com <mailto:vlovich at gmail.com>> a écrit :
>>> Hi,
>>> 
>>> Is there a straightforward way to acquire a lock for the remainder of a build?
>>> 
>>> It looks like we have 2 kinds of locking strategies at the moment:
>>> Up-front locks for each build generated by a builder
>>> Step-level locks acquired only for the duration of a single step
>>> The two that are super-useful but missing:
>>> Acquire a lock for the next N steps or until some later step (worst case is acquire/release steps but probably can be done more elegantly as “lock until build step with name X” or “lock for next Y steps").
>>> Acquire a lock for the remainder of the build.
>>> Does anyone know if the latter is easy to inject?  I haven’t looked into it yet; I’m hoping that it would be possible but maybe someone has looked into this already & has thoughts?
>>> Any pointers on which class owns the locks?
>>> 
>>> I already have a custom Build class & am OK mucking with the internal state of a build.
>>> I’m looking primarily at option #2 - would I get away with generating a lock & then appending it to some internal state in Build
>>> for it to get unlocked at the end of the build?
>>> 
>>> Thanks,
>>> Vitali
>>> ------------------------------------------------------------------------------
>>> Dive into the World of Parallel Programming. The Go Parallel Website,
>>> sponsored by Intel and developed in partnership with Slashdot Media, is your
>>> hub for all things parallel software development, from weekly thought
>>> leadership blogs to news, videos, case studies, tutorials and more. Take a
>>> look and join the conversation now. http://goparallel.sourceforge.net/ <http://goparallel.sourceforge.net/>_______________________________________________
>>> Buildbot-devel mailing list
>>> Buildbot-devel at lists.sourceforge.net <mailto:Buildbot-devel at lists.sourceforge.net>
>>> https://lists.sourceforge.net/lists/listinfo/buildbot-devel <https://lists.sourceforge.net/lists/listinfo/buildbot-devel>
>> 
> 
> ------------------------------------------------------------------------------
> Dive into the World of Parallel Programming. The Go Parallel Website,
> sponsored by Intel and developed in partnership with Slashdot Media, is your
> hub for all things parallel software development, from weekly thought
> leadership blogs to news, videos, case studies, tutorials and more. Take a
> look and join the conversation now. http://goparallel.sourceforge.net/_______________________________________________
> Buildbot-devel mailing list
> Buildbot-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/buildbot-devel

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://buildbot.net/pipermail/devel/attachments/20150214/a5174377/attachment.html>


More information about the devel mailing list