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

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

Closed
gcavalcante8808 opened this issue Mar 22, 2024 · 2 comments
Labels
kind/bug Something isn't working

Comments

@gcavalcante8808
Copy link
Contributor

gcavalcante8808 commented Mar 22, 2024

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:
    - name: core
      ssh_authorized_keys:
        - "ssh-ed25519 ...."

systemd:
  units:
    - name: locksmithd.service
      enabled: true

storage:
  files:
    - path: /etc/flatcar/update.conf
      overwrite: true
      contents:
        inline: |
          REBOOT_STRATEGY=reboot
          LOCKSMITHD_REBOOT_WINDOW_START="Sun 4:00"
          LOCKSMITHD_REBOOT_WINDOW_LENGTH=1h
      mode: 0644
    - path: /etc/extensions/docker-compose.raw
      contents:
        source: https://github.com/flatcar/sysext-bakery/releases/download/latest/docker_compose-2.24.5-x86_64.raw
  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 gcavalcante8808 added the kind/bug Something isn't working label Mar 22, 2024
@gcavalcante8808 gcavalcante8808 changed the title Docker-Compose extension: Failed to read meatadata [...] No medium found Docker-Compose extension: Failed to read metadata [...] No medium found Mar 22, 2024
@gcavalcante8808
Copy link
Contributor Author

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
Copy link
Member

pothos commented Mar 25, 2024

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants