-
Notifications
You must be signed in to change notification settings - Fork 162
Description
Summary
Add support for bootc guests in the prepare/shell step, allowing shell scripts to be executed as part of the bootc image build process rather than on the live guest.
Background
When using bootc guests, most preparation commands should be collected and executed during the container image build (via Containerfile), followed by a reboot. Only test commands should run on the live guest.
Related draft PR: #3947
Proposed Implementation
Based on discussions in #3947, the implementation should:
-
Hide bootc behavior behind the Guest class API - Plugins should not need to be aware they are talking to a bootc guest. The different behavior should be transparent to plugin users.
-
Add
make_changesparameter toGuest.execute()- Commands that modify the system (defaultmake_changes=True) would be collected for the Containerfile, while probe/check commands (make_changes=False) would execute immediately on the live guest. -
Determine when to build the collected Containerfile - Options include:
- Lazy approach: Build when
test_session=Trueis seen (test is about to run) - Add explicit
on_start/on_finishevents to phase/step workflow
- Lazy approach: Build when
-
Support
Guest.push()for Containerfile COPY operations - Needed for cases likeprepare/shellwith URL + script, where content needs to be available during the build:prepare: how: shell url: https://github.com/teemtee/tmt.git ref: main script: cd $TMT_PREPARE_SHELL_URL_REPOSITORY && make docs
Open Questions
- How to handle the
finishstep (no test after it, so collected commands would remain in the buffer)? - Which specific commands need to run live vs. be collected (probe commands, package presence checks, bootc status commands)?
References
- Draft PR: add bootc support for prepare shell step #3947
- Related to bootc package manager implementation pattern (separating command construction and execution)