mirror of
https://github.com/radixark/miles.git
synced 2026-11-03 08:16:53 +08:00
44 lines
2.1 KiB
YAML
44 lines
2.1 KiB
YAML
# Please refer to `README.md` for how to setup this GitHub action runner.
|
|
#
|
|
# Both sides of the /data/miles_ci bind mount must be the SAME path. This is
|
|
# a docker-out-of-docker requirement: when this runner spawns sibling job
|
|
# containers via the mounted /var/run/docker.sock, it passes its in-container
|
|
# --work path through to the host daemon, which resolves the path against
|
|
# the HOST filesystem. If host source and container target differ, the
|
|
# daemon looks at a host directory the runner never wrote to and the job
|
|
# container mounts the wrong (or empty) tree.
|
|
#
|
|
# Every CI host is expected to provide /data/miles_ci as a real directory or
|
|
# as a symlink to the host's big disk; tests/ci/skills/setup-ci-host/setup-host.sh
|
|
# automates this (df probe + symlink). Concrete per-runner services live in
|
|
# a host-local docker-compose.override.yml (gitignored): each host defines
|
|
# its own runners there with stable names, labels, and CUDA_VISIBLE_DEVICES
|
|
# partitioning. The base service below is a template only — kept at
|
|
# replicas: 1 so a stray `docker compose up` without a host override never
|
|
# silently spins up many runners.
|
|
services:
|
|
runner:
|
|
# NOTE need to use the latest, o/w the runner will want to upgrade itself
|
|
image: ghcr.io/actions/actions-runner:2.334.0
|
|
volumes:
|
|
- /var/run/docker.sock:/var/run/docker.sock
|
|
- /data/miles_ci:/data/miles_ci
|
|
# it requires this folder
|
|
- /home/runner/externals:/home/runner/externals
|
|
deploy:
|
|
replicas: 1
|
|
restart: always
|
|
environment:
|
|
RUNNER_ALLOW_RUNASROOT: "1"
|
|
privileged: true
|
|
user: root
|
|
# ref: https://github.com/actions/runner/issues/367#issuecomment-2007558723
|
|
# ref: https://github.com/actions/runner
|
|
# args ref: https://github.com/actions/runner/blob/68ff57dbc4c836d50f46602a8a53301fb9513eb4/src/Runner.Listener/CommandSettings.cs#L53
|
|
entrypoint: >
|
|
sh -c "
|
|
cd /data/miles_ci &&
|
|
/home/runner/config.sh --url ${GITHUB_RUNNER_URL} --token ${GITHUB_RUNNER_TOKEN} --unattended --work /data/miles_ci/runner_$(hostname) --disableupdate &&
|
|
/home/runner/run.sh
|
|
"
|