Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## [0.1.4] - 2026-08-10
### Fixed
- First playbook run no longer fails with `UnixHTTPConnectionPool ... Read timed out (read timeout=60)` when replacing an existing runner container. Stopping and removing a crash-looping or wedged runner can exceed the Docker SDK's 60s default client timeout; the daemon finished the removal in the background, which is why an immediate rerun succeeded.

### Added
- `github_runner_docker_timeout` (default `180`): Docker API client timeout for the deploy task.
- `github_runner_stop_timeout` (default `10`): seconds docker waits after SIGTERM before SIGKILL when stopping the runner container.

## [0.1.3] - 2026-05-27
### Added
- Added `github_runner_network_mode` variable (defaults to `default`) to control the runner container's Docker network mode. Set to `host` so the in-container `adb` client can reach an adb server running on the host at `127.0.0.1:5037`.
Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,8 @@ github_runner_env_file | whether to use an env file for pas
github_runner_env_filename | the filename of the env file for passing extra environment variables into the container (defaults to ".env")
github_runner_github_host | The GITHUB_HOST used for registering the runner (defaults to "github.com")
github_runner_persist_config | whether to persist runner configuration across container restarts using a named volume (defaults to true)
github_runner_stop_timeout | seconds docker waits after SIGTERM before SIGKILL when stopping the runner container, e.g. while replacing it on an image bump (defaults to 10)
github_runner_docker_timeout | Docker API client timeout in seconds for the deploy task; stopping and removing a crash-looping runner can exceed the SDK's 60s default (defaults to 180)

Notes: the env file lets you do things like set site-specific credentials into the runner that can be built into the code
at build time, for instance, Wi-Fi credentials that can be built into tests that are specific to the location of
Expand Down
2 changes: 1 addition & 1 deletion galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ description: "Installs github self hosted repo or org runners within a docker co
can be a vanilla runner, or one with java / android installed."
license_file: LICENSE
readme: README.md
version: 0.1.3
version: 0.1.4
repository: https://github.com/compscidr/ansible-github-runner
tags:
- github
Expand Down
9 changes: 9 additions & 0 deletions roles/github_runner/defaults/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,12 @@ github_runner_network_mode: default
github_runner_github_host: "github.com"

github_runner_persist_config: true

# Seconds docker waits after SIGTERM before SIGKILL when stopping the runner
# container (e.g. while replacing it on an image bump).
github_runner_stop_timeout: 10

# Docker API client timeout for the deploy task. Stopping and removing a
# crash-looping or wedged runner container can exceed the SDK's 60s default,
# which fails the first playbook run and succeeds on the rerun.
github_runner_docker_timeout: 180
8 changes: 8 additions & 0 deletions roles/github_runner/tasks/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@
device_cgroup_rules: "{{ ['c 189:* rmw'] if (github_runner_java and github_runner_java_mount_usb) else omit }}"
volumes: "{{ runner_volumes }}"
restart_policy: unless-stopped
# Replacing an existing container (image bump) stops and removes it first.
# A crash-looping or wedged runner can take well over the Docker SDK's
# 60s default read timeout to stop+remove, which fails the first run and
# then succeeds on the rerun (the daemon finishes the removal in the
# background). Bound the graceful stop and give the API client enough
# room to wait out a slow removal.
stop_timeout: "{{ github_runner_stop_timeout }}"
timeout: "{{ github_runner_docker_timeout }}"
Comment thread
compscidr marked this conversation as resolved.
network_mode: "{{ github_runner_network_mode }}"
ports: "{{ runner_ports }}"
env: "{{ runner_env }}"
Expand Down