From 615baad7f63a4a4046935e1c21167af57aa7ac7f Mon Sep 17 00:00:00 2001 From: Emil Simeonov Date: Wed, 30 Sep 2026 18:34:50 +0200 Subject: [PATCH] feat(molecule): label platforms with S08 runner leases; bump devx to v0.56.0 --- .../molecule/default/molecule.yml | 4 ++ .../molecule/deregister/molecule.yml | 4 ++ .../molecule/lifecycle/molecule.yml | 4 ++ .../molecule/multi-instance/molecule.yml | 4 ++ .../gitea_runner/molecule/remove/molecule.yml | 4 ++ .../molecule/template-content/molecule.yml | 4 ++ .../gitea_runner/molecule/update/molecule.yml | 4 ++ docs/specs/GRM-174.md | 53 +++++++++++++++++++ pyproject.toml | 4 +- 9 files changed, 83 insertions(+), 2 deletions(-) create mode 100644 docs/specs/GRM-174.md diff --git a/ansible/roles/gitea_runner/molecule/default/molecule.yml b/ansible/roles/gitea_runner/molecule/default/molecule.yml index 926ae50..026c13e 100644 --- a/ansible/roles/gitea_runner/molecule/default/molecule.yml +++ b/ansible/roles/gitea_runner/molecule/default/molecule.yml @@ -4,6 +4,10 @@ driver: platforms: - name: ${MOLECULE_PLATFORM_NAME:-ubuntu-2204} + # Implements: REQ-1 (GRM-174) — S08 lease labels for runner cleanup + labels: + org.oblachno.lease-until: "${MOLECULE_LEASE_UNTIL:-0}" + org.oblachno.owner: "${MOLECULE_OWNER:-molecule-local}" image: ${MOLECULE_PLATFORM_IMAGE:-ubuntu:26.04} command: ${MOLECULE_PLATFORM_COMMAND:-sleep infinity} volumes: diff --git a/ansible/roles/gitea_runner/molecule/deregister/molecule.yml b/ansible/roles/gitea_runner/molecule/deregister/molecule.yml index 99a2df9..da4d30d 100644 --- a/ansible/roles/gitea_runner/molecule/deregister/molecule.yml +++ b/ansible/roles/gitea_runner/molecule/deregister/molecule.yml @@ -4,6 +4,10 @@ driver: platforms: - name: ${MOLECULE_PLATFORM_NAME:-ubuntu-2204} + # Implements: REQ-1 (GRM-174) — S08 lease labels for runner cleanup + labels: + org.oblachno.lease-until: "${MOLECULE_LEASE_UNTIL:-0}" + org.oblachno.owner: "${MOLECULE_OWNER:-molecule-local}" image: ${MOLECULE_PLATFORM_IMAGE:-ubuntu:26.04} command: ${MOLECULE_PLATFORM_COMMAND:-sleep infinity} volumes: diff --git a/ansible/roles/gitea_runner/molecule/lifecycle/molecule.yml b/ansible/roles/gitea_runner/molecule/lifecycle/molecule.yml index 99a2df9..da4d30d 100644 --- a/ansible/roles/gitea_runner/molecule/lifecycle/molecule.yml +++ b/ansible/roles/gitea_runner/molecule/lifecycle/molecule.yml @@ -4,6 +4,10 @@ driver: platforms: - name: ${MOLECULE_PLATFORM_NAME:-ubuntu-2204} + # Implements: REQ-1 (GRM-174) — S08 lease labels for runner cleanup + labels: + org.oblachno.lease-until: "${MOLECULE_LEASE_UNTIL:-0}" + org.oblachno.owner: "${MOLECULE_OWNER:-molecule-local}" image: ${MOLECULE_PLATFORM_IMAGE:-ubuntu:26.04} command: ${MOLECULE_PLATFORM_COMMAND:-sleep infinity} volumes: diff --git a/ansible/roles/gitea_runner/molecule/multi-instance/molecule.yml b/ansible/roles/gitea_runner/molecule/multi-instance/molecule.yml index 926ae50..026c13e 100644 --- a/ansible/roles/gitea_runner/molecule/multi-instance/molecule.yml +++ b/ansible/roles/gitea_runner/molecule/multi-instance/molecule.yml @@ -4,6 +4,10 @@ driver: platforms: - name: ${MOLECULE_PLATFORM_NAME:-ubuntu-2204} + # Implements: REQ-1 (GRM-174) — S08 lease labels for runner cleanup + labels: + org.oblachno.lease-until: "${MOLECULE_LEASE_UNTIL:-0}" + org.oblachno.owner: "${MOLECULE_OWNER:-molecule-local}" image: ${MOLECULE_PLATFORM_IMAGE:-ubuntu:26.04} command: ${MOLECULE_PLATFORM_COMMAND:-sleep infinity} volumes: diff --git a/ansible/roles/gitea_runner/molecule/remove/molecule.yml b/ansible/roles/gitea_runner/molecule/remove/molecule.yml index 4cd0e5d..e6be7af 100644 --- a/ansible/roles/gitea_runner/molecule/remove/molecule.yml +++ b/ansible/roles/gitea_runner/molecule/remove/molecule.yml @@ -4,6 +4,10 @@ driver: platforms: - name: ${MOLECULE_PLATFORM_NAME:-ubuntu-2204} + # Implements: REQ-1 (GRM-174) — S08 lease labels for runner cleanup + labels: + org.oblachno.lease-until: "${MOLECULE_LEASE_UNTIL:-0}" + org.oblachno.owner: "${MOLECULE_OWNER:-molecule-local}" image: ${MOLECULE_PLATFORM_IMAGE:-ubuntu:26.04} command: ${MOLECULE_PLATFORM_COMMAND:-sleep infinity} volumes: diff --git a/ansible/roles/gitea_runner/molecule/template-content/molecule.yml b/ansible/roles/gitea_runner/molecule/template-content/molecule.yml index 926ae50..026c13e 100644 --- a/ansible/roles/gitea_runner/molecule/template-content/molecule.yml +++ b/ansible/roles/gitea_runner/molecule/template-content/molecule.yml @@ -4,6 +4,10 @@ driver: platforms: - name: ${MOLECULE_PLATFORM_NAME:-ubuntu-2204} + # Implements: REQ-1 (GRM-174) — S08 lease labels for runner cleanup + labels: + org.oblachno.lease-until: "${MOLECULE_LEASE_UNTIL:-0}" + org.oblachno.owner: "${MOLECULE_OWNER:-molecule-local}" image: ${MOLECULE_PLATFORM_IMAGE:-ubuntu:26.04} command: ${MOLECULE_PLATFORM_COMMAND:-sleep infinity} volumes: diff --git a/ansible/roles/gitea_runner/molecule/update/molecule.yml b/ansible/roles/gitea_runner/molecule/update/molecule.yml index 99a2df9..da4d30d 100644 --- a/ansible/roles/gitea_runner/molecule/update/molecule.yml +++ b/ansible/roles/gitea_runner/molecule/update/molecule.yml @@ -4,6 +4,10 @@ driver: platforms: - name: ${MOLECULE_PLATFORM_NAME:-ubuntu-2204} + # Implements: REQ-1 (GRM-174) — S08 lease labels for runner cleanup + labels: + org.oblachno.lease-until: "${MOLECULE_LEASE_UNTIL:-0}" + org.oblachno.owner: "${MOLECULE_OWNER:-molecule-local}" image: ${MOLECULE_PLATFORM_IMAGE:-ubuntu:26.04} command: ${MOLECULE_PLATFORM_COMMAND:-sleep infinity} volumes: diff --git a/docs/specs/GRM-174.md b/docs/specs/GRM-174.md new file mode 100644 index 0000000..1f46c7c --- /dev/null +++ b/docs/specs/GRM-174.md @@ -0,0 +1,53 @@ +# GRM-174: Apply S08 runner lease labels to gitea_runner molecule platforms + bump devx + +- Task: GRM-174 +- Status: draft + +## Problem + +DEVX-181's `start_docker` emits `MOLECULE_LEASE_UNTIL`/`MOLECULE_OWNER` +into `GITHUB_ENV` for CI molecule jobs, and this repo's own +`runner_cleanup.sh` (GRM-173) honors `org.oblachno.lease-until`/ +`org.oblachno.owner` labels. The gitea_runner molecule scenarios still +don't map those env vars onto Docker platform labels, so cleanup can +reap an in-flight molecule container/network on the shared runner +daemon. The devx pin also predates the emitter. + +## Approach + +REQ-1: Add platform labels `org.oblachno.lease-until: +"${MOLECULE_LEASE_UNTIL:-0}"` and `org.oblachno.owner: +"${MOLECULE_OWNER:-molecule-local}"` to all 7 +`ansible/roles/gitea_runner/molecule/*/molecule.yml` files. + +REQ-2: Bump both `devx` pins in `pyproject.toml` to the first release +containing the emitter. + +REQ-3: Unset `MOLECULE_*` env vars resolve to `0`/`molecule-local` — an +already-expired lease — preserving today's local cleanup behavior via +the `:-0`/`:-molecule-local` defaults. + +## Test Plan + +- `make lint-all` — yamllint + full lint. +- `make pytest-cov` — unchanged 100 % coverage gate. +- PR CI `fast-molecule` converges a touched scenario on the runner with + the env vars present. + +## Deploy Plan + +- Merge; post-merge auto-publishes the package and auto-creates the + infra devx-pin PR downstream. + +## Rollback Plan + +- Revert the merge commit; absent labels restore prior cleanup + semantics. + +## Acceptance Criteria + +- [x] REQ-1: all 7 molecule platforms carry the lease labels — + verified by `grep` across the files. +- [x] REQ-2: devx pins bumped to the release containing the emitter. +- [x] REQ-3: unset env vars produce an expired lease (`0`), preserving + local behavior — enforced by `:-0` defaults. diff --git a/pyproject.toml b/pyproject.toml index 91a26bf..949107b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ ci = [ "build==1.5.1", "twine==6.2.0", # Reusable CI/CD and dev tools (auto-merge, pr-review, pre-push checks, etc.) - "devx @ git+https://git.oblachno.oblachno.fyi/oblachno-oss/devx.git@v0.51.9", + "devx @ git+https://git.oblachno.oblachno.fyi/oblachno-oss/devx.git@v0.56.0", ] # Lint and type-checking tools (validate job) lint = [ @@ -56,7 +56,7 @@ molecule = [ dev = [ "grm[ci,lint,molecule]", # Reusable CI/CD and dev tools (pre-push hooks, create-task, create-pr) - "devx @ git+https://git.oblachno.oblachno.fyi/oblachno-oss/devx.git@v0.51.9", + "devx @ git+https://git.oblachno.oblachno.fyi/oblachno-oss/devx.git@v0.56.0", # Non-Python dev dependency: checkmake (Makefile linter) # Install via: go install github.com/checkmake/checkmake/cmd/checkmake@latest ] -- 2.54.0