Skip to content

Draft: gitlab_runner: Add custom libvirt executor

arch-boxes and archiso currently runs the build inside a TCG accelerated qemu VM. It works but it is slow and adds unnecessary complexity to both projects.

With this MR I want to add a custom executor which would allow us to run the jobs inside a real KVM accelerated VM. It would make the builds faster and remove complexity from both arch-boxes and archiso (and add some complexity to the infra).

The basic idea (from the issue: #283 (closed) (slightly modified)):

  • Create a script which download the newest arch-boxes basic image once a day and:
    • Create a new VM (virtio-rng, virtio-balloon, watchdog?)
    • Boot it and wait for network
    • Set mirror to https://mirror.pkgbuild.com
    • pacman -Syu
    • Install all the relevant packages required by gitlab (git, git-lfs and gitlab-runner)
    • IgnorePkg = linux
  • Create a custom executor (inspiration)
    • It should clone the VM prepared by the mentioned script
    • Wait for it to boot and SSH into it
    • Run the job
    • Delete the VM

TODO:

  • Is the idea feasible / worth it? Go/no go?
  • Add libvirt role
  • Switch from the arch-boxes basic image to the cloud image (should remove some complexity in theory)
  • Finish the custom executor scripts (they are POC at best right now)
  • Add systemd service and timer for syncing

Ref #283 (closed)

Edited by Kristian Klausen

Merge request reports