feat: add xtask for parameterized task workflows#2254
Open
krishicks wants to merge 2 commits into
Open
Conversation
|
Auto-sync is disabled for draft pull requests in this repository. Workflows must be run manually. Contributors can view more details about this message here. |
Run cargo fmt for both the root workspace and the standalone e2e Rust workspace from the rust format and format-check tasks. Apply rustfmt to the e2e sources so the expanded formatting check passes. Signed-off-by: Kris Hicks <khicks@nvidia.com>
This commit adds a cargo xtask framework for orchestrating complex development workflows with typed parameter validation and tested composition. The initial implementation provides two tasks: * e2e runs Podman end-to-end suites locally or in a Lima-managed Linux machine. * release-smoke-test installs a supplied Debian package in a Lima machine, creates a sandbox, and verifies a policy-denied curl request. Machine-backed e2e testing supports Ubuntu 24.04, Ubuntu 26.04, and CentOS Stream 10. Each target is prepared with the OpenShell development environment and rootless Podman, with target-specific setup for packages and container configuration. CentOS Stream coverage runs under enforcing SELinux, labels shared bind mounts correctly, and checks the audit log for unexpected denials. The Lima provider manages machine lifecycle, persistent ext4 build disks, prepared snapshots for faster reruns, relevant GitHub credentials, and cleanup of incomplete machines. Explicitly retained machines remain available for inspection. Rust models operating systems, suites, providers, resources, snapshot identities, and machine lifecycle, while focused shell scripts handle guest setup. This structure allows a single parameterized command to exercise an expanding Linux matrix without encoding conditional behavior in the mise task graph. GitHub Actions does not invoke these tasks as part of this change. Additional background: There is a desire to run tasks against a matrix of environments, for example we should be able to run the e2e tests for Podman against a variety of Linux environments: Ubuntu with Podman 4.x, 5.x, and 6.x, CentOS Stream 10 with SELinux enabled, etc. Our current `mise` task graph models many variants as separate named tasks, with the actual parameter handling and conditional behavior pushed into shell scripts. Although `mise` supports parameterized tasks, implementing this matrix there would encode conditional behavior in the `mise` task graph. Encoding it as an xtask lets us model that behavior with reusable Rust types and unit tests. `cargo xtask` adds orchestration, parameter validation, and composition in typed and tested Rust, while retaining focused shell scripts for guest setup and existing suite execution. This gives us the ability to have a single, parameterized task that can handle, for example, spinning up an Ubuntu VM, preparing it appropriately, running a test in it, and shutting it down, with optional behavior like enabling snapshots for faster feedback loops. Signed-off-by: Kris Hicks <khicks@nvidia.com>
0a09431 to
93c0246
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This commit adds a cargo xtask framework for orchestrating complex development workflows with typed parameter validation and tested composition.
The initial implementation provides two tasks:
Machine-backed e2e testing supports Ubuntu 24.04, Ubuntu 26.04, and CentOS Stream 10. Each target is prepared with the OpenShell development environment and rootless Podman, with target-specific setup for packages and container configuration. CentOS Stream coverage runs under enforcing SELinux, labels shared bind mounts correctly, and checks the audit log for unexpected denials.
The Lima provider manages machine lifecycle, persistent ext4 build disks, prepared snapshots for faster reruns, relevant GitHub credentials, and cleanup of incomplete machines. Explicitly retained machines remain available for inspection.
Rust models operating systems, suites, providers, resources, snapshot identities, and machine lifecycle, while focused shell scripts handle guest setup. This structure allows a single parameterized command to exercise an expanding Linux matrix without encoding conditional behavior in the mise task graph.
GitHub Actions does not invoke these tasks as part of this change.
Additional background
There is a desire to run tasks against a matrix of environments, for example we should be able to run the e2e tests for Podman against a variety of Linux environments: Ubuntu with Podman 4.x, 5.x, and 6.x, CentOS Stream 10 with SELinux enabled, etc.
Our current
misetask graph models many variants as separate named tasks, with the actual parameter handling and conditional behavior pushed into shell scripts. Althoughmisesupports parameterized tasks, implementing this matrix there would encode conditional behavior in themisetask graph. Encoding it as an xtask lets us model that behavior with reusable Rust types and unit tests.cargo xtaskadds orchestration, parameter validation, and composition in typed and tested Rust, while retaining focused shell scripts for guest setup and existing suite execution. This gives us the ability to have a single, parameterized task that can handle, for example, spinning up an Ubuntu VM, preparing it appropriately, running a test in it, and shutting it down, with optional behavior like enabling snapshots for faster feedback loops.Usage
Details
E2E tests
Release smoke tests
--keep-machine can be added to either command to leave the machine available for inspection.
Related Issue
Changes
Testing
mise run pre-commitpassesChecklist