ci: reduce Ansible lint cold-start time #7

Open
opened 2026-09-09 18:22:59 +00:00 by panxiao81 · 0 comments
Owner

Problem

The Ansible lint job is green but takes about 5 minutes, while YAML and Terraform finish within roughly 30 seconds.

Measured on successful workflow run 18, job 53:

  • total Ansible job: 18:15:56–18:21:06 (5m10s)
  • tool/bootstrap and Galaxy installation: until 18:20:28 (about 4m27s after bootstrap starts)
  • actual lint across openbao, samba-ad and proxmox: about 37s

The bottleneck is repeated cold installation of ansible-core, ansible-lint, pywinrm and the declared Galaxy collections. It is not lint computation and is not a missing VyOS declaration.

Preferred direction

Build and pin a dedicated CI image containing:

  • uv
  • ansible-core and ansible-lint
  • paramiko and pywinrm
  • collections from all three requirements.yml files

Publish it to the local Gitea container registry and use it only as the Ansible job container. Keep the image build definition and dependency versions in Git. Renovation/upgrades should happen through reviewed PRs.

This is preferable to relying only on runner cache: job containers are ephemeral, while a prebuilt image gives deterministic versions and fast cold starts. DinD layer caching will make subsequent pulls cheap.

Alternatives

  • persist uv and Galaxy directories in runner-managed job volumes
  • merge and pin collection requirements, then cache them by a lock/hash key
  • split the three projects into parallel jobs after eliminating shared bootstrap cost

Acceptance criteria

  • Ansible lint remains green for all three projects
  • no network dependency installation occurs during the lint job
  • cold and warm job duration are recorded; target under 60 seconds warm
  • image version or digest is pinned in the workflow
  • rebuild procedure and dependency update path are documented

Low priority; current 5-minute job is acceptable during bootstrap.

## Problem The Ansible lint job is green but takes about 5 minutes, while YAML and Terraform finish within roughly 30 seconds. Measured on successful workflow run 18, job 53: - total Ansible job: 18:15:56–18:21:06 (5m10s) - tool/bootstrap and Galaxy installation: until 18:20:28 (about 4m27s after bootstrap starts) - actual lint across openbao, samba-ad and proxmox: about 37s The bottleneck is repeated cold installation of ansible-core, ansible-lint, pywinrm and the declared Galaxy collections. It is not lint computation and is not a missing VyOS declaration. ## Preferred direction Build and pin a dedicated CI image containing: - uv - ansible-core and ansible-lint - paramiko and pywinrm - collections from all three requirements.yml files Publish it to the local Gitea container registry and use it only as the Ansible job container. Keep the image build definition and dependency versions in Git. Renovation/upgrades should happen through reviewed PRs. This is preferable to relying only on runner cache: job containers are ephemeral, while a prebuilt image gives deterministic versions and fast cold starts. DinD layer caching will make subsequent pulls cheap. ## Alternatives - persist uv and Galaxy directories in runner-managed job volumes - merge and pin collection requirements, then cache them by a lock/hash key - split the three projects into parallel jobs after eliminating shared bootstrap cost ## Acceptance criteria - Ansible lint remains green for all three projects - no network dependency installation occurs during the lint job - cold and warm job duration are recorded; target under 60 seconds warm - image version or digest is pinned in the workflow - rebuild procedure and dependency update path are documented Low priority; current 5-minute job is acceptable during bootstrap.
Sign in to join this conversation.
No labels
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: panxiao81/homelab-infra#7