feat(image): describe every image: labels, a readme page and build metadata
The registry page shows the description as plain text, every label, and links to source, documentation and licence; it renders no readme. Each Dockerfile now carries one label block (title, description, source, url, documentation, licenses, authors, base.name and net.rkdr.mortis.purpose/contents/usage), the build adds version, revision and created, and docs/images/<name>.md says what the image is for, what it contains and how to use it. check_image_versions.py pins fails when a label or that page is missing. The labels are image inputs, so the three images get their PATCH bump. Co-Authored-By: Claude Sonnet 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01MmzvM9skAvYcph2c9EiPcm
This commit is contained in:
1 parent
01f90c1f6a
commit
c3c665e799
11 files changed
+363
-11
No files matched your search
@@ -0,0 +1,66 @@
|
||||
# ci
|
||||
|
||||
The **CI tooling image** of the [`mortis.kamino`](https://git.rkdr.net/mortis/kamino) Collection: everything the Lint and Build
|
||||
workflows used to install on each run is baked in, so a job only checks out the code and runs.
|
||||
|
||||
## What is in it
|
||||
|
||||
Ubuntu 26.04 with:
|
||||
|
||||
- **Python tools** in `/opt/venv` (on `PATH`), from `requirements-dev.txt`: `ansible-core`,
|
||||
`ansible-lint`, `pre-commit`, `antsibull-changelog`, `galaxy-importer`, `reuse`.
|
||||
- **Every pre-commit hook environment** of `.pre-commit-config.yaml` in `/opt/pre-commit`
|
||||
(`PRE_COMMIT_HOME`): conventional-pre-commit, gitleaks, yamllint, pre-commit-hooks, actionlint and the
|
||||
local hooks. The Go hooks are prebuilt; their toolchains are removed to keep layers small.
|
||||
- **`ansible-test sanity` virtualenvs**, primed in `/root/.ansible/test`, and Python 3.11 and 3.13 as
|
||||
`python3.11` / `python3.13` next to the distribution's 3.12, so sanity runs its compile test for all three.
|
||||
- `git`, `shellcheck` (actionlint runs it over `run:` blocks) and `ca-certificates`.
|
||||
- `/opt/ci-pins.sha256`: the checksums of the two pin files this image was built from.
|
||||
|
||||
It has no Node, so JavaScript actions (`actions/checkout`) cannot run in it: clone with `git`.
|
||||
|
||||
## How to use it
|
||||
|
||||
As the job container of a workflow on the `kamino-docker` runner, pinned by tag and digest:
|
||||
|
||||
```yaml
|
||||
jobs:
|
||||
lint:
|
||||
runs-on: kamino-docker
|
||||
container:
|
||||
image: git.rkdr.net/mortis/ci:<version>@sha256:<digest>
|
||||
env:
|
||||
PRE_COMMIT_HOME: /opt/pre-commit
|
||||
steps:
|
||||
- run: git clone "$REPO_URL" . && git checkout "$SHA" # see .gitea/workflows/lint.yml
|
||||
- run: sha256sum --quiet -c /opt/ci-pins.sha256 && pre-commit run --all-files
|
||||
```
|
||||
|
||||
A job first compares the checkout's `requirements-dev.txt` and `.pre-commit-config.yaml` with
|
||||
`/opt/ci-pins.sha256`. When they match, the baked tools are used as they are. When a pull request changes a
|
||||
pin, the check fails and the job installs the pinned tools itself for that run (slower, same result), until
|
||||
the image is rebuilt from `main`. See `.gitea/workflows/lint.yml` and `build.yml`.
|
||||
|
||||
## Tags and pinning
|
||||
|
||||
- `<version>` is semver, independent of the Collection's version. A published version is never moved or
|
||||
rebuilt, so one digest belongs to exactly one version. `latest` is the newest version, for looking only.
|
||||
- Pin `ci:<version>@sha256:<digest>`; the digest is what is enforced. Consumers: `lint.yml` and `build.yml`.
|
||||
- Renovate moves the pins to a new version after the image is built on `main`.
|
||||
|
||||
## How it is built and kept up to date
|
||||
|
||||
`.gitea/workflows/image.yml` builds it with kaniko (repository root as build context, because the pin
|
||||
files are copied in) on every push to `main` that changes its inputs: `images/ci/`, `requirements-dev.txt`
|
||||
or `.pre-commit-config.yaml`. Renovate's bump of one of those files carries the PATCH bump of the image
|
||||
version, and the merge builds the image. Each pushed layer stays below 100 MB (Cloudflare's request limit),
|
||||
which is why the Go toolchains are deleted from the hook cache.
|
||||
|
||||
## Image metadata
|
||||
|
||||
The `org.opencontainers.image.*` labels (title, description, version, revision, created, source,
|
||||
documentation, licenses, authors) and `net.rkdr.mortis.*` labels (what it is for, what it contains,
|
||||
how to use it, the Ubuntu release) are listed on the package page of the registry; `version`,
|
||||
`revision` and `created` are set by the build.
|
||||
|
||||
Source: [https://git.rkdr.net/mortis/kamino](https://git.rkdr.net/mortis/kamino), `images/ci/Dockerfile`. Licence: GPL-3.0-or-later.
|
||||
@@ -0,0 +1,77 @@
|
||||
# molecule-ubuntu2404
|
||||
|
||||
A disposable **Ubuntu 24.04** test target for the molecule scenarios of the
|
||||
[`mortis.kamino`](https://git.rkdr.net/mortis/kamino) Ansible Collection: a container that behaves like a small
|
||||
24.04 host (systemd as PID 1), so a role can be converged and verified in it without a VM.
|
||||
It is the release most of the hosts run today.
|
||||
|
||||
## What is in it
|
||||
|
||||
- Ubuntu 24.04 (the official `ubuntu:24.04` image, pinned by digest in the Dockerfile).
|
||||
- systemd as the init system (`systemd`, `systemd-sysv`), D-Bus, `sudo`, `iproute2`,
|
||||
`ca-certificates`.
|
||||
- Python for Ansible on the target: `python3`, `python3-apt`, `python3-systemd`.
|
||||
- The packages the roles manage, preinstalled so a converge makes no network calls:
|
||||
`iptables`, `ufw`, `fail2ban`, `openssh-server` (the `ssh` unit is enabled).
|
||||
- Throwaway SSH host keys and a machine-id generated at build time. They are not secrets and the
|
||||
image is a test target that must never be exposed to a network.
|
||||
|
||||
Package versions are not pinned: they are whatever the 24.04 archive held at build time.
|
||||
`image-smoke`-style checks (below) assert the contract, not versions.
|
||||
|
||||
## How to use it
|
||||
|
||||
In a molecule scenario (`extensions/molecule/*/molecule.yml` or `roles/*/molecule/*/molecule.yml`)
|
||||
with the docker driver:
|
||||
|
||||
```yaml
|
||||
driver:
|
||||
name: docker
|
||||
platforms:
|
||||
- name: instance
|
||||
image: ${MOLECULE_IMAGE} # <name>:<version>@sha256:<digest>, set by .gitea/workflows/molecule.yml
|
||||
pre_build_image: true
|
||||
pull: true
|
||||
command: /sbin/init
|
||||
cgroupns_mode: host
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||
tmpfs:
|
||||
- /run
|
||||
- /run/lock
|
||||
capabilities:
|
||||
- NET_ADMIN
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
```
|
||||
|
||||
systemd needs a writable cgroup, the firewall tools need `NET_ADMIN`, and nothing runs privileged.
|
||||
|
||||
The scenario `extensions/molecule/image-smoke` tests this image against that contract (release,
|
||||
systemd, packages, the `dbus` and `ssh` units, the Python bindings, `NET_ADMIN`).
|
||||
|
||||
## Tags and pinning
|
||||
|
||||
- `<version>` is semver (`MAJOR.MINOR.PATCH`), independent of the Collection's version. A published
|
||||
version is never moved or rebuilt, so one digest belongs to exactly one version. `latest` is the
|
||||
newest version and is for looking, not for pinning.
|
||||
- Pin `molecule-ubuntu2404:<version>@sha256:<digest>`; the digest is what is enforced. Consumers here:
|
||||
`.gitea/workflows/molecule.yml`.
|
||||
- Renovate moves the pin to a new version after the image is built on `main`.
|
||||
|
||||
## How it is built and kept up to date
|
||||
|
||||
`.gitea/workflows/image.yml` builds it with kaniko on every push to `main` that changes its inputs
|
||||
(`images/molecule-ubuntu2404/`), never on a pull request. A change to the image needs a new `version:` in that
|
||||
workflow's matrix (Renovate's bump step does it for dependency updates). The base image
|
||||
and the Ubuntu release are fixed by the name: a new Ubuntu release is a new image
|
||||
(`molecule-ubuntuNNNN`), and the roles are tested on every release the hosts run or are moving to.
|
||||
|
||||
## Image metadata
|
||||
|
||||
The `org.opencontainers.image.*` labels (title, description, version, revision, created, source,
|
||||
documentation, licenses, authors) and `net.rkdr.mortis.*` labels (what it is for, what it contains,
|
||||
how to use it, the Ubuntu release) are listed on the package page of the registry; `version`,
|
||||
`revision` and `created` are set by the build.
|
||||
|
||||
Source: [https://git.rkdr.net/mortis/kamino](https://git.rkdr.net/mortis/kamino), `images/molecule-ubuntu2404/Dockerfile`. Licence: GPL-3.0-or-later.
|
||||
@@ -0,0 +1,77 @@
|
||||
# molecule-ubuntu2604
|
||||
|
||||
A disposable **Ubuntu 26.04** test target for the molecule scenarios of the
|
||||
[`mortis.kamino`](https://git.rkdr.net/mortis/kamino) Ansible Collection: a container that behaves like a small
|
||||
26.04 host (systemd as PID 1), so a role can be converged and verified in it without a VM.
|
||||
It is the release the hosts are moving to; the roles are tested on it next to 24.04.
|
||||
|
||||
## What is in it
|
||||
|
||||
- Ubuntu 26.04 (the official `ubuntu:26.04` image, pinned by digest in the Dockerfile).
|
||||
- systemd as the init system (`systemd`, `systemd-sysv`), D-Bus, `sudo`, `iproute2`,
|
||||
`ca-certificates`.
|
||||
- Python for Ansible on the target: `python3`, `python3-apt`, `python3-systemd`.
|
||||
- The packages the roles manage, preinstalled so a converge makes no network calls:
|
||||
`iptables`, `ufw`, `fail2ban`, `openssh-server` (the `ssh` unit is enabled).
|
||||
- Throwaway SSH host keys and a machine-id generated at build time. They are not secrets and the
|
||||
image is a test target that must never be exposed to a network.
|
||||
|
||||
Package versions are not pinned: they are whatever the 26.04 archive held at build time.
|
||||
`image-smoke`-style checks (below) assert the contract, not versions.
|
||||
|
||||
## How to use it
|
||||
|
||||
In a molecule scenario (`extensions/molecule/*/molecule.yml` or `roles/*/molecule/*/molecule.yml`)
|
||||
with the docker driver:
|
||||
|
||||
```yaml
|
||||
driver:
|
||||
name: docker
|
||||
platforms:
|
||||
- name: instance
|
||||
image: ${MOLECULE_IMAGE_2604} # <name>:<version>@sha256:<digest>, set by .gitea/workflows/molecule.yml
|
||||
pre_build_image: true
|
||||
pull: true
|
||||
command: /sbin/init
|
||||
cgroupns_mode: host
|
||||
volumes:
|
||||
- /sys/fs/cgroup:/sys/fs/cgroup:rw
|
||||
tmpfs:
|
||||
- /run
|
||||
- /run/lock
|
||||
capabilities:
|
||||
- NET_ADMIN
|
||||
security_opts:
|
||||
- apparmor=unconfined
|
||||
```
|
||||
|
||||
systemd needs a writable cgroup, the firewall tools need `NET_ADMIN`, and nothing runs privileged.
|
||||
|
||||
The scenario `extensions/molecule/image-smoke-2604` tests this image against that contract (release,
|
||||
systemd, packages, the `dbus` and `ssh` units, the Python bindings, `NET_ADMIN`).
|
||||
|
||||
## Tags and pinning
|
||||
|
||||
- `<version>` is semver (`MAJOR.MINOR.PATCH`), independent of the Collection's version. A published
|
||||
version is never moved or rebuilt, so one digest belongs to exactly one version. `latest` is the
|
||||
newest version and is for looking, not for pinning.
|
||||
- Pin `molecule-ubuntu2604:<version>@sha256:<digest>`; the digest is what is enforced. Consumers here:
|
||||
`.gitea/workflows/molecule.yml`.
|
||||
- Renovate moves the pin to a new version after the image is built on `main`.
|
||||
|
||||
## How it is built and kept up to date
|
||||
|
||||
`.gitea/workflows/image.yml` builds it with kaniko on every push to `main` that changes its inputs
|
||||
(`images/molecule-ubuntu2604/`), never on a pull request. A change to the image needs a new `version:` in that
|
||||
workflow's matrix (Renovate's bump step does it for dependency updates). The base image
|
||||
and the Ubuntu release are fixed by the name: a new Ubuntu release is a new image
|
||||
(`molecule-ubuntuNNNN`), and the roles are tested on every release the hosts run or are moving to.
|
||||
|
||||
## Image metadata
|
||||
|
||||
The `org.opencontainers.image.*` labels (title, description, version, revision, created, source,
|
||||
documentation, licenses, authors) and `net.rkdr.mortis.*` labels (what it is for, what it contains,
|
||||
how to use it, the Ubuntu release) are listed on the package page of the registry; `version`,
|
||||
`revision` and `created` are set by the build.
|
||||
|
||||
Source: [https://git.rkdr.net/mortis/kamino](https://git.rkdr.net/mortis/kamino), `images/molecule-ubuntu2604/Dockerfile`. Licence: GPL-3.0-or-later.
|
||||
Reference in new issue
Block a user