CI / validate (pull_request) Failing after 18s
CI / molecule-tests (1) (pull_request) Skipped
CI / molecule-tests (2) (pull_request) Skipped
CI / molecule-tests (3) (pull_request) Skipped
CI / molecule-tests (4) (pull_request) Skipped
CI / molecule-tests (5) (pull_request) Skipped
CI / molecule-tests (6) (pull_request) Skipped
CI / auto-merge (pull_request) Skipped
The healthcheck script used 'docker image prune -af' which removes ALL unused images including tagged ones like ci-full:latest. When disk usage hit 85%, the healthcheck would delete the ci-full image, causing the next CI run to fail with 'No such image'. Fix: use 'docker image prune -f' (dangling only) and 'docker system prune -f' (without -a) to preserve tagged images. Also fix 'docker volume prune -f' (without -a) for consistency.
28 lines
1.1 KiB
YAML
28 lines
1.1 KiB
YAML
---
|
|
# Pre-pull Docker images that CI runners need to avoid pulling them on
|
|
# every CI run. The runner container image (ci-full) is large (~3.3GB)
|
|
# and pulling it on every run causes timeouts and disk pressure.
|
|
#
|
|
# The healthcheck script's disk-space prune only removes dangling images
|
|
# (not tagged ones), so pre-pulled images persist between CI runs.
|
|
#
|
|
# Set gitea_runner_pre_pull_images to a list of image refs to pull, or
|
|
# empty list to skip pre-pulling.
|
|
|
|
- name: Pre-pull Docker images for CI runner
|
|
ansible.builtin.command: "docker pull {{ item }}"
|
|
become: true
|
|
become_user: "{{ gitea_runner_service_user }}"
|
|
environment:
|
|
DOCKER_HOST: "unix:///run/user/{{ gitea_runner_uid }}/docker.sock"
|
|
XDG_RUNTIME_DIR: "/run/user/{{ gitea_runner_uid }}"
|
|
register: gitea_runner_pre_pull_result
|
|
changed_when: "'Status: Downloaded' in gitea_runner_pre_pull_result.stdout or 'Status: Downloaded' in gitea_runner_pre_pull_result.stderr"
|
|
retries: 3
|
|
delay: 5
|
|
until: gitea_runner_pre_pull_result is success
|
|
loop: "{{ gitea_runner_pre_pull_images }}"
|
|
when:
|
|
- gitea_runner_docker_rootless_setup
|
|
- gitea_runner_pre_pull_images | length > 0
|