flatcar / sysext-bakery

Recipes for baking systemd-sysext images
Apache License 2.0
73 stars 39 forks source link

Docker-Compose extension: Failed to read metadata [...] No medium found #52

Closed gcavalcante8808 closed 8 months ago

gcavalcante8808 commented 8 months ago

Description

Docker-compose sysext is not recognized by the systemd-sysext and thus we can't use it.

Impact

Systemd-sysext can't start and the other extensions aren't mounted/read.

Environment and steps to reproduce

  1. Set-up: I'm using a stable flatcar that I got from https://stable.release.flatcar-linux.net/amd64-usr/current/flatcar_production_qemu_image.img with the following butane config:
    
    variant: flatcar
    version: 1.0.0
    kernel_arguments:
    should_not_exist:
    - flatcar.autologin

passwd: users:

systemd: units:

storage: files:

  1. Task: Create a flatcar VM using a butane configuration transpiled to ignition;

  2. Action(s): a. Create the VM with the fw_cfg configuration on libvirt; b. SSH into the VM; c. Check systemd-sysext status with systemctl status systemd-sysext command; d. Verify the docker-compose extension with the command system-dissec /etc/extensions/docker-compose.raw

  3. Error: systemd-sysext nor systemd-dissect can use the image.

image image

Also, systemd-ext doesn't mount the other extensions.

Expected behavior

Docker-compose sysext should identified as an extension by systemd-sysext and systemd-dissect and we should be able to use it with docker.

Additional information

I tried to generate the raw image using the scripts on this repo and had the same result.

gcavalcante8808 commented 8 months ago

Interestingly, I got a different result from systemd-dissect on my desktop - systemd 255 (fedora silverblue rawhide):

image

But on the Flatcar (systemd 252) the dissect does´t recognize it as a sysext for system:

image

pothos commented 8 months ago

Hi, the name on disk must be /etc/extensions/docker_compose.raw as in https://github.com/flatcar/sysext-bakery/releases/download/latest/docker_compose.conf Instead of only downloading a particular version, I would rather recommend you to set up sysupdate which not only updates the extension but also can set it up correctly if you do an initial run. This example in https://github.com/flatcar/sysext-bakery?tab=readme-ov-file#consuming-the-published-images doesn't have docker-compose but if you adapt the wasmtime parts it would look like this:

variant: flatcar
version: 1.0.0
storage:
  files:
    - path: /opt/extensions/docker_compose/docker_compose-2.24.5-x86-64.raw
      contents:
        source: https://github.com/flatcar/sysext-bakery/releases/download/latest/docker_compose-2.24.5-x86-64.raw
    - path: /etc/sysupdate.d/noop.conf
      contents:
        source: https://github.com/flatcar/sysext-bakery/releases/download/latest/noop.conf
    - path: /etc/sysupdate.docker_compose.d/docker_compose.conf
      contents:
        source: https://github.com/flatcar/sysext-bakery/releases/download/latest/docker_compose.conf
  links:
    - target: /opt/extensions/docker_compose/docker_compose-2.24.5-x86-64.raw
      path: /etc/extensions/docker_compose.raw
systemd:
  units:
    - name: systemd-sysupdate.timer
      enabled: true
    - name: systemd-sysupdate.service
      dropins:
        - name: docker_compose.conf
          contents: |
            [Service]
            ExecStartPre=/usr/lib/systemd/systemd-sysupdate -C docker_compose update
        - name: sysext.conf
          contents: |
            [Service]
            ExecStartPost=systemctl restart systemd-sysext