Skip to content
Snippets Groups Projects

Use the UML fakemachine/Debos backend in the image builder

Merged Emanuele Aina requested to merge wip/em/image-builder-uml into apertis/v2021dev2
All threads resolved!

The image builder so far required /dev/kvm to be available in the container.

Unfortunately this is not possible on workers hosted on cloud providers, like our autoscaling workers on AWS, nor on the Azure ones.

The chroot backend for Debos cannot run inside a container as it needs to do actually privileged operatins like mounting filesystems.

The new User Mode Linux backend for fakemachine/Debos allows us to avoid those issues and run unprivileged builds in places where KVM is not available, like cloud CI workers or like the Apertis SDK under VirtualBox.

This MR changes the way containers should be invoked. Exposing /dev/kvm is no longer needed, but UML needs the ptrace capability and a executable tmpfs mounted on /scratch (--cap-add=SYS_PTRACE --tmpfs /scratch:exec on the docker run command line).

The last build of the KVM-based version is saved as registry.gitlab.apertis.org/infrastructure/apertis-docker-images/v2021dev2-image-builder:latest-kvm.

Edited by Emanuele Aina

Merge request reports

Pipeline #133367 passed

Pipeline passed for 07eefc8c on wip/em/image-builder-uml

Approval is optional

Merged by Emanuele AinaEmanuele Aina 5 years ago (Apr 9, 2020 1:41pm UTC)

Merge details

  • Changes merged into apertis/v2021dev2 with 07eefc8c.
  • Deleted the source branch.

Pipeline #133852 passed

Pipeline passed for 07eefc8c on apertis/v2021dev2

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • Emanuele Aina mentioned in merge request !108 (closed)

    mentioned in merge request !108 (closed)

  • Emanuele Aina added 12 commits

    added 12 commits

    • b9de87f5 - Explicitly use ARG for variables used in FROM
    • 203a5858 - image-builder: Add the UML bits for Debos
    • 0d8dd16c - debos-wrapper: Use slirp-seq not slirp-helper
    • 641758f9 - image-builder: Copy by name not number
    • 2fc4395d - image-builder: Explain why /scratch is used
    • da32d8c6 - image-builder: Correct package installation
    • 13edbdea - image-builder: Don't set HOME to a non-existing directory
    • 27466691 - gitlab-ci: Convert calculate-release to before_script
    • 5cb9551f - gitlab-ci: Tag build-base-rootfs job with kvm
    • e98e402c - image-builder: Add a test job buidling a simple Debos recipe
    • 79dd6682 - image-builder: Install qemu-user-static
    • 07eefc8c - image-builder: Fix the fakemachine setup

    Compare with previous version

  • Author Owner

    @martyn do you think it is useful to keep all the history on this MR, or should I squash some stuff?

  • @em I was happy with these patches as they didn't build upon each other (IIRC).

  • Emanuele Aina changed the description

    changed the description

  • Emanuele Aina changed the description

    changed the description

  • Author Owner

    Now merging. Thanks @sjoerd and @martyn!

  • Emanuele Aina resolved all threads

    resolved all threads

  • merged

  • Emanuele Aina changed the description

    changed the description

  • Please register or sign in to reply
    Loading