[users at bb.net] Running builds in a new machine instance every time

Jim Rowan jmr at computing.com
Tue Oct 10 16:04:30 UTC 2017


> On Oct 10, 2017, at 9:45 AM, Damiano Boppart <damiano+buildbotu at pep-security.net> wrote:
> 
> Hi,
> 
> I would like to know what the most elegant way is for running builds
> with buildbot when I need to set up the environment that is used for
> building anew every time. 

…

> In the case of Linux/LXC, I can use the libvirt latent worker to
> implement what I want, but how can I do this for the other two platforms?

I think you’re already on the right track.    Sounds to me like you need to write new latentWorker implementations for these other two situations.  http://buildbot.readthedocs.io/en/latest/manual/customization.html?highlight=latent#writing-a-new-latent-worker-implementation

Given that you can script the process of establishing the desired build environment, it shouldn’t be too much work; it amounts to triggering that script.  In your Mac case, you might want to think about what the “delete user / recreate user” actually accomplishes, and do those items more directly, perhaps inside the build recipe.   You might be able to get away with a normal long-running worker and avoid writing the new latentWorker class.   In the windows case, you’d probably put the worker into the VM image, and your work amounts to simply starting up the VM.

> 
> Can I run the Windows/macOS worker "outside" of the place where I
> actually execute my build?

Sure, depending on exactly what you mean by “outside" … that implies that your steps will have to reach “inside” in order to execute in the correct context.   If “outside” simply means a different WorkDir, that’s easy.   If it means “operate as a different userid”, you’d have to wrap every step in sudo(), and it will get complex quickly.



More information about the users mailing list