fix(gitea): migrate to gitea/runner image, fix daemon config not loading
The renamed gitea/runner project (v1.0.0+) is a straight rename of act_runner with the binary renamed to gitea-runner. While inspecting its run.sh, found the actual root cause of the cache config being ignored all along: run.sh builds --config from the CONFIG_FILE env var, not from any command: override - it always execs the binary itself regardless of passed args. The runner service never set CONFIG_FILE, so runner-config.yaml was never actually loaded by the daemon despite being correctly mounted.
This commit is contained in:
+12
-6
@@ -63,10 +63,9 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- compose_network
|
- compose_network
|
||||||
runner:
|
runner:
|
||||||
image: gitea/act_runner:latest
|
image: gitea/runner:latest
|
||||||
container_name: gitea_runner
|
container_name: gitea_runner
|
||||||
privileged: true
|
privileged: true
|
||||||
command: ["act_runner", "daemon", "--config", "/data/config.yaml"]
|
|
||||||
environment:
|
environment:
|
||||||
TZ: ${TIMEZONE:-Europe/Amsterdam}
|
TZ: ${TIMEZONE:-Europe/Amsterdam}
|
||||||
GITEA_INSTANCE_URL: https://${TRAEFIK_HOST}
|
GITEA_INSTANCE_URL: https://${TRAEFIK_HOST}
|
||||||
@@ -74,6 +73,13 @@ services:
|
|||||||
GITEA_RUNNER_NAME: docker-runner
|
GITEA_RUNNER_NAME: docker-runner
|
||||||
GITEA_RUNNER_LABELS: ubuntu-latest:docker://catthehacker/ubuntu:act-latest,ubuntu-22.04:docker://catthehacker/ubuntu:act-22.04,ubuntu-20.04:docker://catthehacker/ubuntu:act-20.04
|
GITEA_RUNNER_LABELS: ubuntu-latest:docker://catthehacker/ubuntu:act-latest,ubuntu-22.04:docker://catthehacker/ubuntu:act-22.04,ubuntu-20.04:docker://catthehacker/ubuntu:act-20.04
|
||||||
DOCKER_HOST: unix:///var/run/docker.sock
|
DOCKER_HOST: unix:///var/run/docker.sock
|
||||||
|
# run.sh (the image's entrypoint script) builds its --config arg from
|
||||||
|
# this env var, not from any `command:` override - it always execs the
|
||||||
|
# binary itself and ignores compose's command/args entirely. This was
|
||||||
|
# almost certainly why runner-config.yaml's cache settings never took
|
||||||
|
# effect despite being correctly mounted: without CONFIG_FILE set, the
|
||||||
|
# daemon never even loaded that file.
|
||||||
|
CONFIG_FILE: /data/config.yaml
|
||||||
# Lets this container itself resolve host.docker.internal too (used by
|
# Lets this container itself resolve host.docker.internal too (used by
|
||||||
# cache.external_server in runner-config.yaml) - the daemon needs this
|
# cache.external_server in runner-config.yaml) - the daemon needs this
|
||||||
# for its own pre-registration calls to runner-cache-server, separately
|
# for its own pre-registration calls to runner-cache-server, separately
|
||||||
@@ -89,13 +95,13 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- compose_network
|
- compose_network
|
||||||
runner-cache-server:
|
runner-cache-server:
|
||||||
image: gitea/act_runner:latest
|
image: gitea/runner:latest
|
||||||
container_name: gitea_runner_cache
|
container_name: gitea_runner_cache
|
||||||
# The image's default entrypoint (run.sh) ignores any command args and
|
# The image's default entrypoint (run.sh) ignores any command args and
|
||||||
# always registers-then-execs `act_runner daemon` regardless - it has no
|
# always registers-then-execs `gitea-runner daemon` regardless - it has no
|
||||||
# cache-server mode. Bypass it entirely and invoke act_runner directly.
|
# cache-server mode. Bypass it entirely and invoke the binary directly.
|
||||||
entrypoint: ["/sbin/tini", "--"]
|
entrypoint: ["/sbin/tini", "--"]
|
||||||
command: ["act_runner", "cache-server", "--config", "/data/config.yaml", "--host", "0.0.0.0", "--port", "8088", "--dir", "/data/cache"]
|
command: ["gitea-runner", "cache-server", "--config", "/data/config.yaml", "--host", "0.0.0.0", "--port", "8088", "--dir", "/data/cache"]
|
||||||
environment:
|
environment:
|
||||||
TZ: ${TIMEZONE:-Europe/Amsterdam}
|
TZ: ${TIMEZONE:-Europe/Amsterdam}
|
||||||
ports:
|
ports:
|
||||||
|
|||||||
Reference in New Issue
Block a user