go-debos / debos

Debian OS builder
Apache License 2.0
533 stars 136 forks source link

actions: Add mmdebstrap action #515

Open nbuchwitz opened 2 weeks ago

nbuchwitz commented 2 weeks ago

Add mmdebstrap [1] as a faster and more flexible alternative to debootstrap.

[1] https://gitlab.mister-muffin.de/josch/mmdebstrap

I am not really familar with go (day to day language is Python or C). Therefore I ask for your patience :-)

Comparison to deboostrap

Example recipe on a Raspberry Pi 5 in docker container with KVM enabled:

---
{{- $architecture := or .architecture "arm64"}}
{{- $tool := or .tool "mmdebstrap" }}
architecture: {{$architecture}}

actions:
  - action: {{ $tool }}
    suite: bookworm
    variant: minbase

  - action: apt
    description: Install some base packages
    packages:
      - procps

With deboostrap:

real    0m53.590s
user    0m38.792s
sys     0m25.345s

With mmdebstrap:

real    0m33.400s
user    0m24.239s
sys     0m8.838s

=> 20 seconds faster. I plan to build a kinda build-on-demand service around debos, so every second matters :smile:

obbardc commented 2 weeks ago

looks fine to me, but I remember @sjoerdsimons had some reservations about ai ply integrating another tool and would rather rewrite debootstrap in go utilising more efficient system libs (debootstrap is single threaded, assumes not much is installed on the target system etc etc)

nbuchwitz commented 2 weeks ago

looks fine to me, but I remember @sjoerdsimons had some reservations about ai ply integrating another tool and would rather rewrite debootstrap in go utilising more efficient system libs (debootstrap is single threaded, assumes not much is installed on the target system etc etc)

Thanks for the fast response and the heads up. mmdebstrap deals with some major issues of deboostrap (some of them are even wontfix, like multiple mirrors etc). So maybe it is worth considering it (as an intermediate solution). Looking forward to @sjoerdsimons feedback

With uml or qemu the performance gain is even more: about 2 minutes less with uml and more than 3 minutes less with qemu in the ci tests.