Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switch NeonVMs to systemd #728

Open
sharnoff opened this issue Jan 8, 2024 · 1 comment
Open

Switch NeonVMs to systemd #728

sharnoff opened this issue Jan 8, 2024 · 1 comment
Assignees
Labels
c/autoscaling/neonvm Component: autoscaling: NeonVM t/feature Issue type: feature, for new features or requests

Comments

@sharnoff
Copy link
Member

sharnoff commented Jan 8, 2024

Problem description / Motivation

There's a few reasons why we might want to switch to using systemd:

  1. Better lifecycle management for "daemons", which may help with Epic: Unify vm-builders #577
  2. Ability to use preexisting logging infrastructure like journalctl, for Epic: Separately tagged logs for VM processes, dmesg, and runner  #578
  3. It's a more "standard" init system, so should hopefully make NeonVM easier to hack on and maintain

DoD

NeonVMs use systemd as the init system.

Implementation ideas

This probably also involves switching where we get all the binaries and shared libs — currently those are from alpine, but switching to debian would probably make this much easier. Relevant code is here:

# add udevd and agetty (with shared libs)
RUN set -e \
&& apk add --no-cache --no-progress --quiet \
acpid \
udev \
agetty \
su-exec \
e2fsprogs-extra \
blkid \
flock \
&& mv /sbin/acpid /neonvm/bin/ \
&& mv /sbin/udevd /neonvm/bin/ \
&& mv /sbin/agetty /neonvm/bin/ \
&& mv /sbin/su-exec /neonvm/bin/ \
&& mv /usr/sbin/resize2fs /neonvm/bin/resize2fs \
&& mv /sbin/blkid /neonvm/bin/blkid \
&& mv /usr/bin/flock /neonvm/bin/flock \
&& mkdir -p /neonvm/lib \
&& cp -f /lib/ld-musl-x86_64.so.1 /neonvm/lib/ \
&& cp -f /lib/libblkid.so.1.1.0 /neonvm/lib/libblkid.so.1 \
&& cp -f /lib/libcrypto.so.1.1 /neonvm/lib/ \
&& cp -f /lib/libkmod.so.2.3.7 /neonvm/lib/libkmod.so.2 \
&& cp -f /lib/libudev.so.1.6.3 /neonvm/lib/libudev.so.1 \
&& cp -f /lib/libz.so.1.2.12 /neonvm/lib/libz.so.1 \
&& cp -f /usr/lib/liblzma.so.5.2.5 /neonvm/lib/liblzma.so.5 \
&& cp -f /usr/lib/libzstd.so.1.5.2 /neonvm/lib/libzstd.so.1 \
&& cp -f /lib/libe2p.so.2 /neonvm/lib/libe2p.so.2 \
&& cp -f /lib/libext2fs.so.2 /neonvm/lib/libext2fs.so.2 \
&& cp -f /lib/libcom_err.so.2 /neonvm/lib/libcom_err.so.2 \
&& cp -f /lib/libblkid.so.1 /neonvm/lib/libblkid.so.1 \
&& mv /usr/share/udhcpc/default.script /neonvm/bin/udhcpc.script \
&& sed -i 's/#!\/bin\/sh/#!\/neonvm\/bin\/sh/' /neonvm/bin/udhcpc.script \
&& sed -i 's/export PATH=.*/export PATH=\/neonvm\/bin/' /neonvm/bin/udhcpc.script

(and, maybe this could be easier by just chroot + install? or, it'll be much easier if we're running proper containers inside the VM, because then we don't need to worry about isolating host files)

@sharnoff sharnoff added t/feature Issue type: feature, for new features or requests c/autoscaling/neonvm Component: autoscaling: NeonVM labels Jan 8, 2024
@Omrigan Omrigan self-assigned this Jan 9, 2024
@Omrigan
Copy link
Contributor

Omrigan commented Jan 25, 2024

We should research if systemd can be used to startup containers inside the VM.

Alternative approach is to use CoreOS

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c/autoscaling/neonvm Component: autoscaling: NeonVM t/feature Issue type: feature, for new features or requests
Projects
None yet
Development

No branches or pull requests

2 participants