Introducing DebProotstrap

66 views
Skip to first unread message

gre...@siwhine.net

unread,
Feb 27, 2015, 12:48:28 PM2/27/15
to proo...@googlegroups.com
Hi all,

I got inspired by Juju from Archlinux and wanted the same thing for debian/ubuntu :)

Here comes DebProotstrap : https://github.com/gboddin/debprootstrap

Usage :

./debprootstrap amd64 jessie
installer-jessie-amd64-201502260200.bundle generated
./installer-jessie-amd64-201502260200.bundle my-user-dir && my-user-dir/start-container

ced...@reproducible.io

unread,
Feb 27, 2015, 12:50:13 PM2/27/15
to gre...@siwhine.net, proo...@googlegroups.com
Hello Gregory,

> I got inspired by Juju from Archlinux and wanted the same thing for
> debian/ubuntu :)

I definitely like this kind of good news! :)


> Here comes DebProotstrap : https://github.com/gboddin/debprootstrap

I'll add a link to your project in http://proot.me/#ecosystem soon.


I took a look at the documentation and sources; here follow my
comments.


From start-container:

> if [ -z $@ ]; then
> HOME=/root PATH=${PATH}:/sbin:/usr/sbin:/usr/local/sbin ./proot -w /root -b /etc/hostname -b /etc/resolv.conf -b /etc/localtime -b /dev -b /sys -b /proc -r ${CONTAINER_PATH} -0 /bin/bash
> else
> HOME=/root PATH=${PATH}:/sbin:/usr/sbin:/usr/local/sbin ./proot -w /root -b /etc/hostname -b /etc/resolv.conf -b /etc/localtime -b /dev -b /sys -b /proc -r ${CONTAINER_PATH} -0 /bin/bash -c "$@"
> fi

* I think these 5 lines could be simplified down to 1 single line:

HOME=/root PATH=${PATH}:/sbin:/usr/sbin:/usr/local/sbin ./proot -w /root -b /etc/hostname -b /etc/resolv.conf -b /etc/localtime -b /dev -b /sys -b /proc -r ${CONTAINER_PATH} -0 $@

* Do you plan to add a mode where the id is not faked? (ie. without -0)

* Why don't you use the -S option instead of a specifying so much
bindings individually?


From: debprootstrap

> # TODO cdebootstrap still requires root because proot can't handle the unshare call ... to investigate

* I'll take a look at this next week.


Regards,
Cédric.

Gregory Boddin

unread,
Feb 27, 2015, 2:26:46 PM2/27/15
to ced...@reproducible.io, proo...@googlegroups.com
Hello Cedric,

Replies are inmail :

Hello Gregory,

> I got inspired by Juju from Archlinux and wanted the same thing for
> debian/ubuntu :)

I definitely like this kind of good news! :)

Thanks, I have nothing against Archlinux, but having LTS packages might do it for some business/institutions :)
 
 


> Here comes DebProotstrap : https://github.com/gboddin/debprootstrap

I'll add a link to your project in http://proot.me/#ecosystem soon.


I took a look at the documentation and sources; here follow my
comments.


From start-container:

>    if [ -z $@ ]; then
>        HOME=/root PATH=${PATH}:/sbin:/usr/sbin:/usr/local/sbin ./proot -w /root -b /etc/hostname -b /etc/resolv.conf -b /etc/localtime -b /dev -b /sys -b /proc -r ${CONTAINER_PATH} -0 /bin/bash
>   else
>        HOME=/root PATH=${PATH}:/sbin:/usr/sbin:/usr/local/sbin ./proot -w /root -b /etc/hostname -b /etc/resolv.conf -b /etc/localtime -b /dev -b /sys -b /proc -r ${CONTAINER_PATH} -0 /bin/bash -c "$@"
>    fi

* I think these 5 lines could be simplified down to 1 single line:

    HOME=/root PATH=${PATH}:/sbin:/usr/sbin:/usr/local/sbin ./proot -w /root -b /etc/hostname -b /etc/resolv.conf -b /etc/localtime -b /dev -b /sys -b /proc -r ${CONTAINER_PATH} -0 $@

Of course it can, (debprootstrap was just a testing-script, till I realized proot was really doing it \o/, thanks btw) 

I pwnd the release at night, there are already some refactoring done, I also have some bug fixing to send upstream for the cdebootstrap-static config files.

Ubuntu is seriously broken with cdebootstrap at various level for various suites, for instance: see the ugly ln -sf awk
 

* Do you plan to add a mode where the id is not faked? (ie. without -0)

I actually wonder if we could end up with a Better Vagrant for Debian/Ubuntu, so yes, definitely, multiple mode should be handled by start-container (shell,run,admin,up/down).
One of my goal is to integrate http://saltstack.com/community/ (a rename to debprootstack, maybe, or bigger, prootstack ;)) and some kind of recipe system.
Saltstack : https://gist.github.com/gboddin/604b24763f5d8d87c1cd this is how Saltstack install latest mysql from mysql.com and keeps it up-to-date.
 

* Why don't you use the -S option instead of a specifying so much
  bindings individually?

At first I started with -S, then those were fine-tuned during the project. I don't recall the exact issues I encountered with -S (maybe that was a debprootstrap bug at first), I'll torture proot and debprootstrap to remove unnecessary code verbosity.
 


From: debprootstrap

> # TODO cdebootstrap still requires root because proot can't handle the unshare call ... to investigate

* I'll take a look at this next week.

Yup, this is the tiny bitty part I would like to tackle so we can forget about root and target a real user-land Debian container manager from scratch on any distro.

I got a "Operation not permitted: unshare" during cdebootstrap-static, but I didn't investigate further.
 


Regards,
Cédric.

Thanks for having a look, this is still REALLY messy (but stable) code-base and cleaning needs to be done.

Btw, I did a benchmark with sysbench on native vs proot :

https://docs.google.com/spreadsheets/d/1qIAesyLrMgNyUIsDyDeymPfKU57Xb8djxVoP-Y26Bnk/edit?usp=sharing

The numbers are not especially accurate since it was on my running laptop (especially the first set of numbers, was a bench of 1minute), but the second set reveals it's pretty much all the same. I'll update the spreadsheet with numbers from native rhel6 next week.

Thanks for proot and all the hours it will save :)

Now, TGIF \o/

Gregory Boddin

unread,
Mar 5, 2015, 2:23:42 PM3/5/15
to ced...@reproducible.io, proo...@googlegroups.com
I didn't have time to do the benchmarking stuff :)

But I'm announcing debprootstrap 0.4.4

A lot happened :

- user/admin mode
- daemonize mode
- saltstrap mode
- integrated with travis so it generates install bundles https://github.com/gboddin/debprootstrap/releases (and test the whole strapping) 
- forked debproot which is just a prootainer (like it ? :)) manager https://github.com/gboddin/debproot feeded by a stupid debproot.cfg file fetching a recipe (eg: https://github.com/gboddin/debproot-lamp-stack)
- debproot -> added up/down mode and supervisor to overcome all systemd issues (with recipes we can assume the sysadmin writes the supervisor conf easily anyway)
- no need for root to deboostrap , I splitted the process in 2 stage which allows
 - better deletion of not needed package in chroot (deboostrap was not meant for that, but handles the download job pretty well)
 - building for foreign arch trough your qemu support (thanks for that, http://debproot.siwhine.net/bundles/ now have armhf bundles as well)
 - work around the unshare call issue I'm facing with a full bootstrap (which won't build for foreign in 1 step anyway)

And that's enough for 1 week :)

Reply all
Reply to author
Forward
0 new messages