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

machine_core: Add Machine.ws_container runtime detection #7361

Merged
merged 1 commit into from
Jan 30, 2025

Conversation

martinpitt
Copy link
Member

@martinpitt martinpitt commented Jan 28, 2025

We want to introduce proper bootc image testing for cockpit. In that scenario we want to install the actual rpm, not use the cockpit/ws container. This conflicts with cockpit-ostree's current assumption that the centos-9-bootc image always uses the ws container.

Thus make this check dynamic: If cockpit-ws package is installed (check for /usr/share/cockpit/static as that's the same on all distros and a cheap test), use it, otherwise use the ws container. Keep the TEST_SCENARIO=ws-container check, at least until we update cockpit-ostree's image preparation to remove cockpit-ws.rpm.

We can't yet run .execute() in the Machine constructor, so delay the detection by making ws_container a (cached) property.


This will be used in cockpit-project/cockpit#21559 . I triggered a set of ostree/bootc/standard RPM tests here to check for regressions.

@martinpitt
Copy link
Member Author

While this isn't sufficient for cockpit-project/cockpit#21559, I'd like to land this separately. This PR potentially affects other projects, and the other required changes require image refreshes. Mixing these up is too many combinatorics.

We want to introduce proper bootc image testing for cockpit. In that
scenario we want to install the actual rpm, not use the cockpit/ws
container. This conflicts with cockpit-ostree's current assumption that
the centos-9-bootc image always uses the ws container.

Thus make this check dynamic: If cockpit-ws package is installed (check
for `/usr/share/cockpit/static` as that's the same on all distros and a
cheap test), use it, otherwise use the ws container. Keep the
`TEST_SCENARIO=ws-container` check, at least until we update
cockpit-ostree's image preparation to remove cockpit-ws.rpm.

We can't yet run `.execute()` in the Machine constructor, so delay the
detection by making `ws_container` a (cached) property.
@martinpitt martinpitt force-pushed the ws-container-dynamic branch from 4dc09c8 to 92eb6b2 Compare January 29, 2025 14:18
@martinpitt
Copy link
Member Author

Cleaned up the obsolete cached value (replaced by functools)

@jelly jelly merged commit 8fa8fdc into cockpit-project:main Jan 30, 2025
10 checks passed
@martinpitt martinpitt deleted the ws-container-dynamic branch January 30, 2025 08:45
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