Skip to content

pkg/utils: add ELN as supported distro - #1814

Open
yselkowitz wants to merge 1 commit into
containers:mainfrom
yselkowitz:eln
Open

pkg/utils: add ELN as supported distro#1814
yselkowitz wants to merge 1 commit into
containers:mainfrom
yselkowitz:eln

Conversation

@yselkowitz

Copy link
Copy Markdown

No description provided.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds support for Fedora ELN to Toolbx by introducing ELN-specific utility functions, registering the "eln" distribution, and updating the documentation and tests. The reviewer noted that the host detection logic in getHostID() must be updated to check for VARIANT_ID == "eln" when ID == "fedora" to ensure Fedora ELN hosts are correctly identified and default to ELN containers instead of standard Fedora containers.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread src/pkg/utils/utils.go
@yselkowitz

Copy link
Copy Markdown
Author

ping @debarshiray

@debarshiray debarshiray left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Interesting idea!

If Fedora ELN has ID=eln in os-release(5), then it seems natural to add it as a separate distro. Although, I hope we don't run into any namespace problems with other downstream distributors by not having a fedora prefix.

However, does this really work? From reading the changes, it seems that it uses the quay.io/fedora/eln:latest image. If I got that right, then:

$ toolbox create --image quay.io/fedora/eln:latest
Created container: eln-latest
Enter with: toolbox enter eln-latest
$ toolbox enter eln-latest 
Error: failed to modify user rishi with UID 1000: usermod(1) not found

Poking at the image with podman run confirms the problem:

$ podman run --interactive --rm --tty quay.io/fedora/eln:latest /bin/bash
[root@bb0c5c79fdcc /]# useradd
bash: useradd: command not found
[root@bb0c5c79fdcc /]# usermod
bash: usermod: command not found
[root@bb0c5c79fdcc /]# passwd
bash: passwd: command not found

In terms of having a similar user experience as the default host shell on Fedora or Red Hat Enterprise Linux Workstation, I see:

$ podman run --interactive --rm --tty quay.io/fedora/eln:latest /bin/bash
[root@e8a5adf33a34 /]# 
[root@e8a5adf33a34 /]# which
bash: which: command not found
[root@e8a5adf33a34 /]# man
bash: man: command not found

Here is a complete list of image requirements for Toolbx with some context and explanation.

I wonder if it will be possible to add an eln-toolbox image, just like we have the fedora-toolbox and the UBI-based toolbox images. The reason for the separate Toolbx images is to reliably deal with problems like these without getting into a tug-of-war with the default base images for the distribution, which have different goals.

In this particular case, just like ELN is (Red Hat) Enterprise Linux Next, the eln-toolbox image can help with the onboarding of the toolbox image for the upcoming RHEL.

@debarshiray

Copy link
Copy Markdown
Member

Build failed. https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/local/buildset/ec85aa64270a4c6faf391eeb10b3ab4c

unit-test RETRY_LIMIT in 29s

[...]

unit-test-restricted RETRY_LIMIT in 28s
system-test-fedora-rawhide-commands-options RETRY_LIMIT in 30s
system-test-fedora-rawhide-runtime-environment-arch-fedora RETRY_LIMIT in 27s
system-test-fedora-rawhide-runtime-environment-ubuntu RETRY_LIMIT in 33s

These CI failures should be solved by rebasing against main, specifically commit 93f882c04cbc5a81.

@yselkowitz

Copy link
Copy Markdown
Author

We already have a toolbox image, quay.io/fedora/eln-toolbox, and this code uses it.

@debarshiray

Copy link
Copy Markdown
Member

We already have a toolbox image, quay.io/fedora/eln-toolbox, and this code uses it.

That's fantastic!

My apologies for misreading the code and assuming that this pull request uses quay.io/fedora/eln:latest. I forgot and missed that the image's basename is mentioned in Distro.ImageBasename in src/pkg/utils/utils.go and not in src/pkg/utils/<distro>.go.

Could you please point me to the sources of the quay.io/fedora/eln-toolbox image for reference? I am curious if the sources are a Container/Dockerfile or KIWI descriptions or something else. I couldn't find it in fedora-kiwi-descriptions, where the fedora-toolbox image is defined - neither as a branch nor in teams/cloud/container.xml.

We try to have a copy of the image sources in toolbox.git/images. For the Arch Linux and Ubuntu images, these are the canonical sources and they are built and published by the CI, because those distributions don't have their own image building and publishing infrastructure. For the Fedora and RHEL images, they are copies to make it easier for those not familiar with the distributions to see how the images look like and make changes if changes to the toolbox(1) code require any. Unfortunately, we haven't updated the copies for Fedora after the move away from Container/Dockerfiles due to lack of time to extract the relevant KIWI description subset from fedora-kiwi-descriptions.

@yselkowitz

yselkowitz commented Aug 25, 2026

Copy link
Copy Markdown
Author

@debarshiray debarshiray left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks very good to me! Just a few bureaucratic and nitpicky details:

Would you be willing to add yourself to .github/CODEOWNERS for the src/pkg/utils/eln.go file? You clearly know more about Fedora ELN than me. If you are unavailable, then I will be the fallback, but having you there will formally clarify who the subject matter expert is.

It will be good to add some system tests for the Fedora ELN image to test/system. The tests are tagged to make it possible run subsets of them. eg., simultaneously on different CI hosts to reduce time. It's done using a mixture of Bats' tags and a hacky TOOLBX_TEST_SYSTEM_TAGS environment variable to work around some missing feature in Bats.

The are some deficiencies in how the system tests handle multiple distributions and releases, but it shouldn't matter for a rolling-release distribution like ELN and you can mimic what's done for Arch Linux. eg., you have to add the name of the ELN Toolbx image to the IMAGES associative array or hash table in test/system/libs/helpers.bash, do the _pull_and_cache_distro_image dance in test/system/setup_suite.bash, and then sprinkle the tests across the test/system/*.bats files.

Some of the tests look a bit silly, but it seems worth it because of the growing host and container distro matrix. We might as well automate everything at the risk of repeating some things for the sake of mental peace and reassurance. :)

Nitpick: could you please add a link to this pull request to the Git commit message?

Comment thread doc/toolbox.1.md
Comment thread src/pkg/utils/utils_test.go
Comment thread src/pkg/utils/eln.go Outdated
@debarshiray

Copy link
Copy Markdown
Member

https://forge.fedoraproject.org/releng/kiwi-descriptions/src/branch/rawhide/teams/eln/container.xml

Aha, cool! I should have noticed the eln subdirectory there. Sorry about that.

@debarshiray

Copy link
Copy Markdown
Member

Build failed. https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/local/buildset/ec85aa64270a4c6faf391eeb10b3ab4c
unit-test RETRY_LIMIT in 29s
[...]
unit-test-restricted RETRY_LIMIT in 28s
system-test-fedora-rawhide-commands-options RETRY_LIMIT in 30s
system-test-fedora-rawhide-runtime-environment-arch-fedora RETRY_LIMIT in 27s
system-test-fedora-rawhide-runtime-environment-ubuntu RETRY_LIMIT in 33s

These CI failures should be solved by rebasing against main, specifically commit 93f882c04cbc5a81.

Could you please rebase against main? It would be good to see the CI turn green.

containers#1814

Signed-off-by: Yaakov Selkowitz <yselkowi@redhat.com>
@yselkowitz

Copy link
Copy Markdown
Author

Rebased and incorporated your suggestions. Haven't looked at test/system yet.

@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed.
https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/local/buildset/c81a538e4f0b47239af525f545e823df

✔️ unit-test SUCCESS in 2m 16s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 12s
✔️ unit-test-restricted SUCCESS in 3m 13s
✔️ system-test-fedora-rawhide-commands-options SUCCESS in 45m 24s
✔️ system-test-fedora-rawhide-runtime-environment-arch-fedora SUCCESS in 30m 41s
✔️ system-test-fedora-rawhide-runtime-environment-ubuntu SUCCESS in 7m 26s
✔️ system-test-fedora-44-commands-options SUCCESS in 43m 04s
✔️ system-test-fedora-44-runtime-environment-arch-fedora SUCCESS in 31m 31s
✔️ system-test-fedora-44-runtime-environment-ubuntu SUCCESS in 8m 25s
✔️ system-test-fedora-43-commands-options SUCCESS in 42m 04s
✔️ system-test-fedora-43-runtime-environment-arch-fedora SUCCESS in 31m 40s
✔️ system-test-fedora-43-runtime-environment-ubuntu SUCCESS in 7m 47s
✔️ system-test-fedora-42-commands-options SUCCESS in 37m 25s
✔️ system-test-fedora-42-runtime-environment-arch-fedora SUCCESS in 25m 17s
✔️ system-test-fedora-42-runtime-environment-ubuntu SUCCESS in 6m 43s
system-test-fedora-coreos-next-commands-options NODE_FAILURE Node(set) request 200-0000184451 failed in 0s
system-test-fedora-coreos-next-runtime-environment-arch-fedora NODE_FAILURE Node(set) request 200-0000184452 failed in 0s
system-test-fedora-coreos-next-runtime-environment-ubuntu NODE_FAILURE Node(set) request 200-0000184453 failed in 0s
✔️ system-test-fedora-coreos-stable-commands-options SUCCESS in 42m 05s
✔️ system-test-fedora-coreos-stable-runtime-environment-arch-fedora SUCCESS in 33m 54s
✔️ system-test-fedora-coreos-stable-runtime-environment-ubuntu SUCCESS in 9m 15s
system-test-fedora-coreos-testing-commands-options NODE_FAILURE Node(set) request 200-0000184457 failed in 0s
system-test-fedora-coreos-testing-runtime-environment-arch-fedora NODE_FAILURE Node(set) request 200-0000184458 failed in 0s
system-test-fedora-coreos-testing-runtime-environment-ubuntu NODE_FAILURE Node(set) request 200-0000184459 failed in 0s

@debarshiray

Copy link
Copy Markdown
Member

recheck

@centosinfra-prod-github-app

Copy link
Copy Markdown

Build failed.
https://gateway-cloud-softwarefactory.apps.ocp.cloud.ci.centos.org/zuul/t/local/buildset/e3219230f9f94af98d0ddb9a90a6ef08

✔️ unit-test SUCCESS in 2m 17s
✔️ unit-test-migration-path-for-coreos-toolbox SUCCESS in 3m 12s
✔️ unit-test-restricted SUCCESS in 2m 17s
✔️ system-test-fedora-rawhide-commands-options SUCCESS in 44m 03s
✔️ system-test-fedora-rawhide-runtime-environment-arch-fedora SUCCESS in 33m 10s
✔️ system-test-fedora-rawhide-runtime-environment-ubuntu SUCCESS in 7m 16s
✔️ system-test-fedora-44-commands-options SUCCESS in 41m 27s
✔️ system-test-fedora-44-runtime-environment-arch-fedora SUCCESS in 32m 46s
✔️ system-test-fedora-44-runtime-environment-ubuntu SUCCESS in 7m 30s
✔️ system-test-fedora-43-commands-options SUCCESS in 38m 04s
✔️ system-test-fedora-43-runtime-environment-arch-fedora SUCCESS in 26m 39s
✔️ system-test-fedora-43-runtime-environment-ubuntu SUCCESS in 7m 47s
✔️ system-test-fedora-42-commands-options SUCCESS in 33m 02s
✔️ system-test-fedora-42-runtime-environment-arch-fedora SUCCESS in 28m 45s
✔️ system-test-fedora-42-runtime-environment-ubuntu SUCCESS in 6m 03s
system-test-fedora-coreos-next-commands-options NODE_FAILURE Node(set) request 200-0000184789 failed in 0s
system-test-fedora-coreos-next-runtime-environment-arch-fedora NODE_FAILURE Node(set) request 200-0000184790 failed in 0s
system-test-fedora-coreos-next-runtime-environment-ubuntu NODE_FAILURE Node(set) request 200-0000184791 failed in 0s
✔️ system-test-fedora-coreos-stable-commands-options SUCCESS in 37m 23s
✔️ system-test-fedora-coreos-stable-runtime-environment-arch-fedora SUCCESS in 35m 08s
✔️ system-test-fedora-coreos-stable-runtime-environment-ubuntu SUCCESS in 8m 35s
system-test-fedora-coreos-testing-commands-options NODE_FAILURE Node(set) request 200-0000184795 failed in 0s
system-test-fedora-coreos-testing-runtime-environment-arch-fedora NODE_FAILURE Node(set) request 200-0000184796 failed in 0s
system-test-fedora-coreos-testing-runtime-environment-ubuntu NODE_FAILURE Node(set) request 200-0000184797 failed in 0s

@debarshiray

Copy link
Copy Markdown
Member

recheck

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants