From c5b0c11c0c6611d23929bdf7d6c6bd18dfa32c7f Mon Sep 17 00:00:00 2001 From: Spencer McGuire Date: Fri, 16 Oct 2026 10:29:47 -0600 Subject: [PATCH] Runner: host-directory job workspace (bind_workdir) so the e2e compose stack can bind-mount the checkout Co-Authored-By: Claude Fable 5.1 --- deploy/runner/README.md | 11 +++++++---- deploy/runner/compose.yaml | 9 ++++++--- deploy/runner/config.yaml | 7 +++++-- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/deploy/runner/README.md b/deploy/runner/README.md index 40403a4..8ed05df 100644 --- a/deploy/runner/README.md +++ b/deploy/runner/README.md @@ -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). - 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 - started through the runner's Docker proxy on docker-1's daemon. The proxy maps the job workspace so the - compose bind mounts (`deploy/postgres/initdb`, `tests/e2e`, the CI secrets) resolve, and it removes what - the job started when the job ends. + started on docker-1's daemon through the socket. The job workspace is a host directory + (`~/gitea/runner/work//spencerm/PacketStation`, `container.bind_workdir`) mounted into the job + 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. ## Install (once) ```bash -mkdir -p ~/gitea/runner/data +mkdir -p ~/gitea/runner/data ~/gitea/runner/work cp deploy/runner/compose.yaml ~/gitea/runner/ cp deploy/runner/config.yaml ~/gitea/runner/data/ cd ~/gitea/runner diff --git a/deploy/runner/compose.yaml b/deploy/runner/compose.yaml index 3543c3d..b0352ca 100644 --- a/deploy/runner/compose.yaml +++ b/deploy/runner/compose.yaml @@ -1,7 +1,8 @@ # 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; -# the runner's Docker proxy lets a job's `docker compose` bind-mount the workspace by its own path, -# which is what the e2e job needs for deploy/compose.ci.yaml. +# Jobs run in docker.gitea.com/runner-images:ubuntu-latest containers started through the socket. +# The job workspace is a host directory (container.bind_workdir) mounted into the runner and into +# 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. # cd ~/gitea/runner @@ -27,6 +28,8 @@ services: GITEA_RUNNER_NAME: docker-1 volumes: - ./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 restart: unless-stopped logging: diff --git a/deploy/runner/config.yaml b/deploy/runner/config.yaml index f045a86..9ff8cad 100644 --- a/deploy/runner/config.yaml +++ b/deploy/runner/config.yaml @@ -19,8 +19,11 @@ cache: dir: /data/cache container: - # The job workspace is a Docker volume; the Docker proxy maps workspace paths for sibling - # containers, so `docker compose` in the e2e job can bind-mount tests/e2e and deploy/postgres/initdb. + # The job workspace is a host directory under workdir_parent, mounted into the job container at that + # 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 valid_volumes: [] # The proxy removes what a job started (the CI compose stack included) when the job ends.