Skip to content

build: check the built image before pushing it - #2828

Merged
berendt merged 1 commit into
mainfrom
image-dependency-baseline
Oct 26, 2026
Merged

berendt merged 1 commit into
mainfrom
image-dependency-baseline

Conversation

@ideaship

Copy link
Copy Markdown
Contributor

The Containerfile installs python-osism, the bundled managers, openstackclient, ansible, openstack-project-manager and openstack-simple-stress with separate uv pip install runs. Each run resolves on its own and may change versions an earlier run installed, so nothing checks the requirements of the final environment together. The unit and integration tests run in a separate pipenv virtualenv and never exercise the shipped image either.

This adds a step to playbooks/build.yml, after the build and before the push, that runs inside the built image:

  • uv pip check --system lists every installed package whose declared requirements are not met. Such conflicts can come from requirements declared by packages released from other repositories, so conflicts (exit code 1) are reported in the build log and do not fail the job. Any other non-zero exit code means the check itself could not run (e.g. 127 for a missing uv, 125 for an image that cannot be started) and fails the job.
  • --help or --version of every command the image bundles: osism, netbox-manager, openstack-image-manager, openstack-flavor-manager, openstack, ansible, the openstack-project-manager scripts manage.py and create.py (run the way osism invokes them), and the openstack-simple-stress main.py. A failing command fails the job.

The frontend image does not bundle these commands, so the step is skipped for it.

The step runs in container-image-python-osism-build (check) and container-image-python-osism-push (post, tag, periodic-midnight). In the push jobs, a failing smoke test stops the image from being pushed.

Tested locally with podman against the published image built from 180cf92 (registry.osism.tech/osism/osism@sha256:98a47c05d7a6c79a314f3a4c8f3a8f82568c92619172752949409cc67f89ac9e): the check reports 10 incompatibilities with exit code 1, which the step tolerates, and all smoke tests succeed. Against an image without uv, the step fails with exit code 127.

🤖 Generated with Claude Code

The Containerfile installs python-osism, the bundled managers,
openstackclient, ansible, openstack-project-manager and
openstack-simple-stress with separate `uv pip install` runs. Each run
resolves on its own and may change versions an earlier run installed,
so nothing checks the requirements of the final environment together.
The unit and integration tests run in a separate pipenv virtualenv and
never exercise the shipped image either.

Add a step after the build, before the push, that runs inside the
built image:

- `uv pip check --system`, which lists every installed package whose
  declared requirements are not met. Such conflicts can come from
  requirements declared by packages that are released from other
  repositories, so the check reports them in the build log instead of
  failing the job (exit code 1). Any other non-zero exit code means
  the check itself could not run, e.g. a missing uv (127) or an image
  that cannot be started (125), and fails the job.
- `--help` or `--version` of every command the image bundles: osism,
  netbox-manager, openstack-image-manager, openstack-flavor-manager,
  openstack, ansible, the openstack-project-manager scripts
  manage.py and create.py (run the way osism invokes them), and the
  openstack-simple-stress main.py. A failing command fails the job.

The frontend image does not bundle these, so the step is skipped for
it.

Tested against the published image built from 180cf92,

  registry.osism.tech/osism/osism@sha256:98a47c05d7a6c79a314f3a4c8f3a8f82568c92619172752949409cc67f89ac9e

where the check reports 10 incompatibilities with exit code 1, which
the step tolerates, and all smoke tests succeed. Against an image
without uv, the step fails with exit code 127.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: Roger Luethi <luethi@osism.tech>
@ideaship
ideaship marked this pull request as ready for review October 26, 2026 09:33

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Hey - I've reviewed your changes and they look great!

Sourcery assessment

Approved.


Sourcery is free for open source - if you like our reviews please consider sharing them ✨

@ideaship ideaship self-assigned this Oct 26, 2026
@berendt
berendt merged commit 81a19a8 into main Oct 26, 2026
4 checks passed
@berendt
berendt deleted the image-dependency-baseline branch October 26, 2026 15:32
@github-project-automation github-project-automation Bot moved this from New to Done in Human Board Oct 26, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants