Uploaded image for project: 'Insights Experiences'
  1. Insights Experiences
  2. HMS-9392

[RFC] many: switch to bootc based anaconda (away from rpm)

    • Icon: Task Task
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • None
    • Image Builder
    • None

      This spike show how we could use bootc based containers with anaconda. So instead of building our iso from rpm packages and just putting the bootc container into the rpm generated ISO this spike builds the ISO from a bootc container.

      This requires that the container has the right content of course (i.e. anaconda). We would move some of the responsibility to the user (or to a tool that helps the user and hides the complexity here like bootc-iso-imagectl or something) to ensure that.

      The `Containerfile` to generate an installer looks something like:
      ```Containerfile
      FROM quay.io/centos-bootc/centos-bootc:stream9
      RUN dnf install -y \
      anaconda \
      anaconda-install-env-deps \
      anaconda-dracut \
      dracut-config-generic \
      dracut-network \
      net-tools \
      squashfs-tools \
      grub2-efi-x64-cdboot \
      python3-mako \
      lorax-templates-* \
      biosdevname \
      prefixdevname \
      && dnf clean all

      1. shim-x64 is marked installed but the files are not in the expected
      2. place for https://github.com/osbuild/osbuild/blob/v160/stages/org.osbuild.grub2.iso#L91
      3. workaround via reinstall, we could add a config to the grub2.iso
      4. stage to allow a different prefix that then would be used by anaconda
        RUN dnf reinstall -y shim-x64
      5. remove strange lorax template line (XXX: figure out what this is about or if there is a different workaround, it seems not needed)
        RUN sed -i 's,symlink ../run/install mnt/install,,' /usr/share/lorax/templates.d/*/runtime-postinstall.tmpl || true
      6. the fedora version of anaconda needs a real /root dir (instead of the bootc default /root -> /var/roothome)
      7. centos9 is fine, it seems https://github.com/weldr/lorax/blob/master/share/templates.d/99-generic/runtime-postinstall.tmpl#L73 is the reason but its unclear why the symlink is not working
        RUN rm -f /root
        RUN mkdir -m0700 /root
        ```
        this basic template works for cs9,cs10,f42

      This branch also has a "--installer-payload" switch so to use this one would essentially write: `bib --type iso --installer-payload quay.io/centos-bootc/centos-bootc:stream9 quay.io/centos-bootc-anaconda:stream9` (as currently the containerfile changes things like /root which makes it no longer a proper bootc container). We could of course explore making this more user friendly, either by a convention like "suffix -installer" for type iso or by creating a derrived constainer locally ourselfs with the above containerfile or helper or by fixing the issues that require /root to be a real dir (but even with that it would probably be undesired to install a container that contains a full anaconda env so something like installer-payload is probably still be needed).

      Note that this is big departure from our current approach and we would need to think about a transition strategy/communication if we go down this route.

      Thanks to Ondrej, Colin for their help/inputs in this, I hope it captures what they suggested to explore.

      /jira-epic HMS-8839

              rh-ee-mvogt Michael Vogt
              imagebuilder-bot Image-Builder Bot
              None
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: