Skip to content

ci: Add Packit CI with RPM builds and TMT integration tests#3576

Merged
cgwalters merged 4 commits intoostreedev:mainfrom
henrywang:tmt-integration
Mar 30, 2026
Merged

ci: Add Packit CI with RPM builds and TMT integration tests#3576
cgwalters merged 4 commits intoostreedev:mainfrom
henrywang:tmt-integration

Conversation

@henrywang
Copy link
Copy Markdown
Collaborator

Add Packit-based CI pipeline that builds RPMs via COPR and runs TMT integration tests on bootc image-mode systems. This follows the bootc-dev/bootc pattern of per-plan VM isolation using bcvk.

Key changes:

  • Dockerfile: Add rpmbuild stage, use RPM overlay for rootfs, run provision-derived.sh for VM provisioning (cloud-init, rsync, etc.)
  • Justfile: Add package target, test-tmt target with bcvk per-plan VMs, longer SSH wait for cloud-init first boot
  • .github/workflows/bootc.yaml: Split into unit-tests and integration jobs, archive TMT logs with PR number in artifact name
  • .packit.yaml: COPR builds + TMT tests for centos-stream-9/10 and fedora-43/44 on x86_64/aarch64
  • tmt/: FMF test plans and shell-based tests (booted verification, privileged ostree tests) translated from Rust integration tests
  • hack/: Packit provisioning scripts to convert package-mode VMs to image-mode via bootc install to-filesystem

@openshift-ci
Copy link
Copy Markdown

openshift-ci Bot commented Mar 20, 2026

Hi @henrywang. Thanks for your PR.

I'm waiting for a ostreedev member to verify that this patch is reasonable to test. If it is, they should reply with /ok-to-test on its own line. Until that is done, I will not automatically test new commits in this PR, but the usual testing commands by org members will still work.

Regular contributors should join the org to skip this step.

Once the patch is verified, the new status will be reflected by the ok-to-test label.

I understand the commands that are listed here.

Details

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository.

Copy link
Copy Markdown

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

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 introduces a Packit-based CI pipeline, which is a significant enhancement. The changes are extensive, adding new configurations for Packit and TMT, modifying the Dockerfile, and including new test scripts. My review has identified a critical bug in a provisioning script that needs to be addressed, as well as several instances of code duplication and opportunities to improve the robustness and maintainability of the new CI infrastructure. Addressing these points will help ensure the new pipeline is reliable and easy to manage.

Comment thread hack/provision-packit.sh Outdated
Comment thread hack/provision-packit.sh Outdated
Comment thread Dockerfile
Comment thread Justfile Outdated
Comment thread .packit.yaml
Comment thread .packit.yaml
Comment thread Justfile Outdated
Comment thread hack/provision-derived.sh
# Stock extra cleaning of logs and caches in general (mostly dnf)
rm /var/log/* /var/cache /var/lib/{dnf,rpm-state,rhsm} -rf
# And clean root's homedir
rm /var/roothome/.config -rf
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

The arguments for the rm command are in a non-standard order. While this may work with GNU rm, the standard and more portable syntax is rm [options] [file...]. Please adjust for correctness and clarity.

Suggested change
rm /var/roothome/.config -rf
rm -rf /var/roothome/.config

Comment thread tmt/plans/integration.fmf
Comment on lines +27 to +28
playbook:
- https://github.com/bootc-dev/bootc/raw/refs/heads/main/hack/packit-reboot.yml
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

medium

Fetching the Ansible playbook from an external GitHub URL makes the tests fragile. The URL could change, or the resource could become temporarily unavailable, causing test failures. It would be more robust to vendor this playbook within the repository to ensure test reliability.

@packit-as-a-service
Copy link
Copy Markdown

Failed to load packit config file:

Cannot parse package config. ValidationError({'jobs': {0: {'packages': defaultdict(<class 'dict'>, {'ostree': {'value': {'actions': ["Unknown action(s) provided: ['post_upstream_clone']"]}}})}, 1: {'packages': defaultdict(<class 'dict'>, {'ostree': {'value': {'actions': ["Unknown action(s) provided: ['post_upstream_clone']"]}}})}}, 'packages': defaultdict(<class 'dict'>, {'ostree': {'value': {'actions': ["Unknown action(s) provided: ['post_upstream_clone']"]}}})})

For more info, please check out the documentation or contact the Packit team. You can also use our CLI command config validate or our pre-commit hooks for validation of the configuration.

@henrywang henrywang force-pushed the tmt-integration branch 2 times, most recently from 7d096f7 to 2b2a175 Compare March 20, 2026 10:42
@henrywang henrywang changed the title [WIP] ci: Add Packit CI with RPM builds and TMT integration tests ci: Add Packit CI with RPM builds and TMT integration tests Mar 20, 2026
@henrywang henrywang marked this pull request as ready for review March 20, 2026 11:21
Comment thread tmt/tests/booted/test-booted-verification.sh Outdated
Comment thread Justfile Outdated
Comment thread Justfile Outdated
Comment on lines +174 to +175
if tmt run --id "${vm_name}" --all \
provision --how connect \
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.

That said it is probably time to open up the conversation with tmt upstream about supporting bcvk directly...it would remove a lot of gnarly code.

@cgwalters
Copy link
Copy Markdown
Member

One approach may be for us to factor out like a testutils shared crate - doesn't have to be published on crates.io but could be bootc-dev/testutils and we reuse that in various repos?

➡️ bootc-dev/bcvk#231

Add Packit-based CI pipeline that builds RPMs via COPR and runs TMT
integration tests on bootc image-mode systems. This follows the
bootc-dev/bootc pattern of per-plan VM isolation using bcvk.

Key changes:
- Dockerfile: Add rpmbuild stage, use RPM overlay for rootfs, run
  provision-derived.sh for VM provisioning (cloud-init, rsync, etc.)
- Justfile: Add package target, test-tmt target with bcvk per-plan VMs,
  longer SSH wait for cloud-init first boot
- .github/workflows/bootc.yaml: Split into unit-tests and integration
  jobs, archive TMT logs with PR number in artifact name
- .packit.yaml: COPR builds + TMT tests for centos-stream-9/10 and
  fedora-43/44 on x86_64/aarch64
- tmt/: FMF test plans and shell-based tests (booted verification,
  privileged ostree tests) translated from Rust integration tests
- hack/: Packit provisioning scripts to convert package-mode VMs to
  image-mode via bootc install to-filesystem

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
henrywang and others added 3 commits March 23, 2026 16:56
VM deployment is now handled externally by `just test-tmt` (bcvk + tmt)
or `just integration-container` (bcvk direct SSH). The Rust test binary
runs inside the VM as root, so the require_root/RunMode dispatch logic
is no longer needed.

- Remove require_root(), RunMode enum, and bcvk dispatch code
- Simplify booted_test! and privileged_test! macros to just register
  and run tests directly
- Remove rustix dependency (no longer checking getuid)

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
Replace the inline bash script in the Justfile test-tmt target with a
Rust xtask crate (tests/xtask/) that handles TMT plan discovery, bcvk
VM lifecycle, SSH readiness polling, and tmt invocation. This follows
the bootc-dev/bootc cargo xtask run-tmt pattern.

Also fix tests.fmf to pass test names individually with --exact, since
libtest_mimic only accepts a single filter argument.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
Set CARGO_HOME=/var/tmp/.cargo to avoid conflict with /root/.cargo
which exists as a non-directory on Fedora 43/44 base images, causing
"failed to create directory: File exists (os error 17)".

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Signed-off-by: Xiaofeng Wang <henrywangxf@me.com>
@henrywang henrywang requested a review from cgwalters March 30, 2026 13:10
@cgwalters
Copy link
Copy Markdown
Member

Looks like it needs cargo fmt, we should also sync over from bootc the linting/style checks.

@cgwalters cgwalters merged commit eb27be7 into ostreedev:main Mar 30, 2026
43 of 46 checks passed
@henrywang henrywang deleted the tmt-integration branch March 31, 2026 01:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants