devrandom / gitian-builder

Build packages in a secure deterministic fashion inside a VM
https://gitian.org/
Other
402 stars 227 forks source link

LXC templates instead of vmbuilder #43

Open defreez opened 11 years ago

defreez commented 11 years ago

I've been playing around with Gitian using LXC. It's great, but I'm not a fan of the dependency on vmbuilder for LXC container creation. LXC already has a way of creating containers, and most distros don't ship with vmbuilder.

Would you accept a patch that adds the ability (through parameters) to use LXC templates, instead of vmbuilder?

devrandom commented 11 years ago

Yes, I would be happy to see that.

defreez commented 11 years ago

defreez/gitian-builder@7ad593397283b07a9006613e16ec95974c724465 adds the ability to use lxc templates. It needs to be cleaned up, documented, and then I can send a pull request if it makes sense to do so.

Is there a gitian-using project that makes a good test case? I want to make sure that builds inside a template-built container match builds inside a vmbuilder container.

Details: I add an extra environment variable (USE_LXC_TEMPLATE) and add make-base-vm --lxc --template. It relies on the stock ubuntu lxc template. It does go back to relying on start/stop target when templates are in use. It shouldn't break any of the existing lxc stuff.

devrandom commented 11 years ago

I believe some of the Bitcoin devs would be interested in this. I know at least one of them uses gentoo.

Bitcoin has some interesting dependencies, so I'm not sure it's the simple test case that you might want. But it's definitely a good test.

Are ubuntu templates available on non-ubuntu distros?

defreez commented 11 years ago

The templates are included in the lxc build process, so I think they end up in the lxc package that most distros use. I know Debian has modified the templates, but the momentum there is to start going with upstream. It does require that the distro have a recent version of lxc (>= 0.9), since it needs to be able to get the container ip from lxc-ls.

Bitcoin on Gentoo sounds like fun. According to the Gentoo wiki installing debootstrap is sufficient to get the Ubuntu template to work. I'll give it a shot by this time next week.

devrandom commented 11 years ago

Great, thank you.