Runner: host-directory job workspace (bind_workdir) so the e2e compose stack can bind-mount the checkout
Co-Authored-By: Claude Fable 5.1 <[email protected]>
This commit is contained in:
@@ -11,15 +11,18 @@ the `spencerm` user through the Docker socket. No sudo is needed.
|
|||||||
(Ubuntu 24.04 with git, node, python 3.12, docker and compose).
|
(Ubuntu 24.04 with git, node, python 3.12, docker and compose).
|
||||||
- Every job of ci.yml runs in a fresh job container from that image. The server job's PostgreSQL service
|
- Every job of ci.yml runs in a fresh job container from that image. The server job's PostgreSQL service
|
||||||
container and the e2e job's compose stack (postgres, migrate, app, worker, the Samba DC, Playwright) are
|
container and the e2e job's compose stack (postgres, migrate, app, worker, the Samba DC, Playwright) are
|
||||||
started through the runner's Docker proxy on docker-1's daemon. The proxy maps the job workspace so the
|
started on docker-1's daemon through the socket. The job workspace is a host directory
|
||||||
compose bind mounts (`deploy/postgres/initdb`, `tests/e2e`, the CI secrets) resolve, and it removes what
|
(`~/gitea/runner/work/<task>/spencerm/PacketStation`, `container.bind_workdir`) mounted into the job
|
||||||
the job started when the job ends.
|
container at that same path, so the compose bind mounts (`deploy/postgres/initdb`, `tests/e2e`, the CI
|
||||||
|
secrets) resolve on the host. A Docker-volume workspace does not work here: the first run failed with
|
||||||
|
"bind source path does not exist". The runner removes what the job started when the job ends; the
|
||||||
|
workflow also runs `down -v` itself.
|
||||||
- Capacity 2: server and frontend run at the same time; e2e waits for both.
|
- Capacity 2: server and frontend run at the same time; e2e waits for both.
|
||||||
|
|
||||||
## Install (once)
|
## Install (once)
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
mkdir -p ~/gitea/runner/data
|
mkdir -p ~/gitea/runner/data ~/gitea/runner/work
|
||||||
cp deploy/runner/compose.yaml ~/gitea/runner/
|
cp deploy/runner/compose.yaml ~/gitea/runner/
|
||||||
cp deploy/runner/config.yaml ~/gitea/runner/data/
|
cp deploy/runner/config.yaml ~/gitea/runner/data/
|
||||||
cd ~/gitea/runner
|
cd ~/gitea/runner
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
# Gitea Actions runner for docker-1. One act_runner container with the host Docker socket.
|
# Gitea Actions runner for docker-1. One act_runner container with the host Docker socket.
|
||||||
# Jobs run in docker.gitea.com/runner-images:ubuntu-latest containers started through the socket;
|
# Jobs run in docker.gitea.com/runner-images:ubuntu-latest containers started through the socket.
|
||||||
# the runner's Docker proxy lets a job's `docker compose` bind-mount the workspace by its own path,
|
# The job workspace is a host directory (container.bind_workdir) mounted into the runner and into
|
||||||
# which is what the e2e job needs for deploy/compose.ci.yaml.
|
# the job container at the same absolute path, so a job's `docker compose` can bind-mount files of
|
||||||
|
# the checkout (the CI secrets, deploy/postgres/initdb, tests/e2e) and the host daemon finds them.
|
||||||
#
|
#
|
||||||
# Install on docker-1 (see README.md): copy this folder to ~/gitea/runner, register once, then up -d.
|
# Install on docker-1 (see README.md): copy this folder to ~/gitea/runner, register once, then up -d.
|
||||||
# cd ~/gitea/runner
|
# cd ~/gitea/runner
|
||||||
@@ -27,6 +28,8 @@ services:
|
|||||||
GITEA_RUNNER_NAME: docker-1
|
GITEA_RUNNER_NAME: docker-1
|
||||||
volumes:
|
volumes:
|
||||||
- ./data:/data # .runner (the registration), config.yaml, cache, job logs
|
- ./data:/data # .runner (the registration), config.yaml, cache, job logs
|
||||||
|
# Job workspaces. The host path and the container path must be the same (see data/config.yaml).
|
||||||
|
- /home/spencerm/gitea/runner/work:/home/spencerm/gitea/runner/work
|
||||||
- /var/run/docker.sock:/var/run/docker.sock # job containers and the Docker proxy
|
- /var/run/docker.sock:/var/run/docker.sock # job containers and the Docker proxy
|
||||||
restart: unless-stopped
|
restart: unless-stopped
|
||||||
logging:
|
logging:
|
||||||
|
|||||||
@@ -19,8 +19,11 @@ cache:
|
|||||||
dir: /data/cache
|
dir: /data/cache
|
||||||
|
|
||||||
container:
|
container:
|
||||||
# The job workspace is a Docker volume; the Docker proxy maps workspace paths for sibling
|
# The job workspace is a host directory under workdir_parent, mounted into the job container at that
|
||||||
# containers, so `docker compose` in the e2e job can bind-mount tests/e2e and deploy/postgres/initdb.
|
# same absolute path. compose.yaml mounts the same host folder into the runner at the same path, so a
|
||||||
|
# bind source a job names (deploy/ci/ci-secrets/..., tests/e2e) is a real path for docker-1's daemon.
|
||||||
|
bind_workdir: true
|
||||||
|
workdir_parent: home/spencerm/gitea/runner/work # no leading slash; the runner adds it
|
||||||
privileged: false
|
privileged: false
|
||||||
valid_volumes: []
|
valid_volumes: []
|
||||||
# The proxy removes what a job started (the CI compose stack included) when the job ends.
|
# The proxy removes what a job started (the CI compose stack included) when the job ends.
|
||||||
|
|||||||
Reference in New Issue
Block a user