After #8 Build takes ~37s, most of it ansible-test sanity --requirements creating one virtualenv per sanity test (~/.ansible/test/venv/<label>/<python>/<hash>) and pip-installing into each. ansible-test caches them by the hash of the test's requirements and reuses them, and has --prime-venvs to create them without running tests.
Change
images/ci/Dockerfile, build stage: symlink the uv-managed python3.11/python3.13 onto PATH, create a stub collection (ansible_collections/mortis/kamino with a minimal galaxy.yml), run ansible-test sanity --prime-venvs --requirements, print the sizes. Final stage: COPY --from=build /root/.ansible/test /root/.ansible/test as its own layer.
image.yml: the ci image version 0.1.0 → 0.2.0, so the new content gets a new tag (a rebuild never moves a published tag).
Risks (no container runtime here, so only the first build on main tells)
The venvs for the baked 3.11/3.13 are created from the uv-managed interpreters (bootstrap via get-pip, as on 3.12); if --prime-venvs fails for one the build fails with the ansible-test output.
Layer size: the pylint venv is the largest; the build prints sizes. A 413 on the push means splitting the COPY per label directory.
The hash includes the requirement versions, i.e. the ansible-core pin; a pin bump rebuilds the venvs at run time (the pin-drift fallback already covers that case) until the image is rebuilt.
After merge
image.yml publishes ci:0.2.0; a follow-up PR points Lint/Build at its digest and compares the Build time (37s now).
## Why
After #8 Build takes ~37s, most of it `ansible-test sanity --requirements` creating one virtualenv per sanity test (`~/.ansible/test/venv/<label>/<python>/<hash>`) and pip-installing into each. ansible-test caches them by the hash of the test's requirements and reuses them, and has `--prime-venvs` to create them without running tests.
## Change
- `images/ci/Dockerfile`, build stage: symlink the uv-managed `python3.11`/`python3.13` onto PATH, create a stub collection (`ansible_collections/mortis/kamino` with a minimal `galaxy.yml`), run `ansible-test sanity --prime-venvs --requirements`, print the sizes. Final stage: `COPY --from=build /root/.ansible/test /root/.ansible/test` as its own layer.
- `image.yml`: the ci image version `0.1.0` → `0.2.0`, so the new content gets a new tag (a rebuild never moves a published tag).
## Risks (no container runtime here, so only the first build on `main` tells)
- The venvs for the baked 3.11/3.13 are created from the uv-managed interpreters (bootstrap via get-pip, as on 3.12); if `--prime-venvs` fails for one the build fails with the ansible-test output.
- Layer size: the pylint venv is the largest; the build prints sizes. A 413 on the push means splitting the COPY per label directory.
- The hash includes the requirement versions, i.e. the ansible-core pin; a pin bump rebuilds the venvs at run time (the pin-drift fallback already covers that case) until the image is rebuilt.
## After merge
`image.yml` publishes `ci:0.2.0`; a follow-up PR points Lint/Build at its digest and compares the Build time (37s now).
🤖 Generated with [Claude Code](https://claude.com/claude-code)
`ansible-test sanity --requirements` builds one virtualenv per test under
~/.ansible/test/venv (keyed by the requirements hash) on every run: about
25s of the Build job. Prime them at image build time with --prime-venvs
against a stub collection, for the controller Python and the baked 3.11 and
3.13, and copy ~/.ansible/test into the final image as its own layer.
Co-Authored-By: Claude Sonnet 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Why
After #8 Build takes ~37s, most of it
ansible-test sanity --requirementscreating one virtualenv per sanity test (~/.ansible/test/venv/<label>/<python>/<hash>) and pip-installing into each. ansible-test caches them by the hash of the test's requirements and reuses them, and has--prime-venvsto create them without running tests.Change
images/ci/Dockerfile, build stage: symlink the uv-managedpython3.11/python3.13onto PATH, create a stub collection (ansible_collections/mortis/kaminowith a minimalgalaxy.yml), runansible-test sanity --prime-venvs --requirements, print the sizes. Final stage:COPY --from=build /root/.ansible/test /root/.ansible/testas its own layer.image.yml: the ci image version0.1.0→0.2.0, so the new content gets a new tag (a rebuild never moves a published tag).Risks (no container runtime here, so only the first build on
maintells)--prime-venvsfails for one the build fails with the ansible-test output.After merge
image.ymlpublishesci:0.2.0; a follow-up PR points Lint/Build at its digest and compares the Build time (37s now).🤖 Generated with Claude Code