Files
grm/ansible/roles/gitea_runner/tasks/pre_pull_images.yml
T
Emil SimeonovandDevin <158243242+devin-ai-integration[bot]@users.noreply.github.com> e32ba51a7d fix: pre-configure daemon.json before rootless setuptool + add DBUS_SESSION_BUS_ADDRESS
Five fixes for rootless Docker setup on Arch Linux runners:

1. Write daemon.json (with containerd-snapshotter: false) BEFORE running
   dockerd-rootless-setuptool.sh, so Docker 29 starts with overlay2 from
   the very first boot instead of containerd snapshots.

2. Add DBUS_SESSION_BUS_ADDRESS to all systemctl --user tasks. Without it,
   systemctl --user fails with "Connection refused" on Arch Linux where
   the D-Bus session bus isn't auto-discovered.

3. Fix pre-configure override port driver: use 'builtin' for slirp4netns
   and 'implicit' only for pasta. The previous unconditional 'implicit'
   caused dockerd to exit immediately on slirp4netns hosts.

4. Fix prune timer schedule from '*-* * */6:00:00' (invalid) to
   '*-*-* 00/6:00:00' (every 6 hours, valid systemd calendar spec).

5. Add explicit Docker 29→28 downgrade task for Debian/Ubuntu using
   version-pinned apt install with allow_downgrades.

Closes GRM-158

Generated with [Devin](https://devin.ai)

Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
2026-08-05 23:46:47 +00:00

29 lines
1.2 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 }}"
DBUS_SESSION_BUS_ADDRESS: "unix:path=/run/user/{{ gitea_runner_uid | default(0) }}/bus"
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