Commit Graph

11 Commits

Author SHA1 Message Date
bvandeusen 8d07b6c79e ci: new ci-runner base image + uv/ruff/node_modules cache
Runner base image (infra/Dockerfile.runner-base):
- Added uv (fast Python package installer, ~10x faster than pip)
- Added ruff (baked in, lint job drops from ~13s to ~2s)
- Added jq + tzdata
- Renamed tag from py3.12-node22 to ci-runner (purpose over contents)

Workflow (ci.yml):
- typecheck: cache node_modules directly instead of npm download cache;
  skip npm ci entirely on cache hits (9m41s → ~30s expected)
- lint: just `ruff check src/` — no venv, no install
- test: uv venv + uv pip install replaces pip (~10x faster resolves)
- all jobs: runs-on ci-runner label

Baseline: typecheck 9m41s, lint 13s, test 1m42s
2026-04-11 23:59:57 -04:00
Bryan Van Deusen 1a6b4b0a97 CI: simplify docker CLI install — use docker.io from Ubuntu repos
Replaces docker-ce-cli (requiring external Docker apt repo) with
docker.io from Ubuntu 24.04 main, which is sufficient for docker login
and working alongside buildx.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 14:21:39 -04:00
Bryan Van Deusen ca151c1a98 CI: split runner-base RUN steps to avoid nginx upload timeout
Single combined layer was ~280MB and consistently failed to push with
499 (nginx closing connection). Split into three layers (~70-100MB each)
so each is pushed independently and stays within the timeout.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 13:24:26 -04:00
Bryan Van Deusen 418f9e3a77 CI: add docker-ce-cli to runner-base image
docker/login-action requires the docker CLI binary in the job container.
The daemon is provided by the host socket mount; only the CLI is needed.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 11:47:11 -04:00
Bryan Van Deusen 6c051fa59d CI: remove redundant GITEA_RUNNER_LABELS from runner-compose.yml
Labels are defined in act-runner-config.yml which is the authoritative
source. The env var is only used on first registration and was being
ignored after .runner was created.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 11:12:52 -04:00
Bryan Van Deusen 94d818e519 CI: rename runner label ubuntu-latest → py3.12-node22
The label now explicitly declares the dependency versions it provides
rather than using the opaque ubuntu-latest alias. All runs-on fields
in ci.yml updated to match.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 11:04:35 -04:00
Bryan Van Deusen eb7d00e114 CI: set runner label-to-image mapping in config.yml
Move ubuntu-latest → runner-base:py3.12-node22 mapping into
act-runner-config.yml so it is respected at runtime. The
GITEA_RUNNER_LABELS env var is only honoured on first registration
and was being ignored after the runner's .runner file was created.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 11:02:20 -04:00
Bryan Van Deusen dc03d71898 CI: custom runner-base image, Node 22, pip caching
- infra/Dockerfile.runner-base: new Ubuntu 24.04 image with Python 3.12
  and Node 22 LTS pre-installed, tagged py3.12-node22. Eliminates the
  ~3-4 min deadsnakes PPA install that ran on every test job.
- infra/runner-compose.yml: update ubuntu-latest label to use
  runner-base:py3.12-node22 instead of node:20-bullseye.
- .forgejo/workflows/ci.yml: remove Python 3.12 install steps (now in
  base image), add actions/cache for pip keyed on pyproject.toml hash,
  bump node-version 20 → 22.
- Dockerfile: bump frontend build stage node:20-alpine → node:22-alpine.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 10:45:59 -04:00
bvandeusen feac66dcd0 Scope CI/CD to build+test only; clean up runner infra
Remove automated deploy — Portainer handles deployments for now.
build.yml: deploy job removed, only builds and pushes image to registry.
infra/runner-compose.yml: clean standalone Portainer stack for act_runner,
  no swarm network dependency, uses external Forgejo URL.
infra/runner-swarm.yml: removed (replaced by runner-compose.yml).

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08 19:46:46 -04:00
bvandeusen 93fcd753a6 Simplify CI/CD for same-swarm topology: no SSH, direct service update
Since Forgejo and the app share a swarm, the runner can:
- Connect to Forgejo at http://forgejo:3000 (internal, no Traefik)
- Call docker service update directly via mounted socket
- Avoid SSH entirely — secrets drop from 6 to 3

infra/runner-swarm.yml: runner added to Forgejo stack, pinned to manager
  node (required for service API access), uses Docker Swarm Config object
  for act_runner config injection
infra/act-runner-config.yml: runner config (bridge network for jobs,
  docker socket whitelisted)
build.yml: deploy step replaced with docker service update --with-registry-auth
  --detach=false (waits for rollout, shows progress in Actions log)

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08 19:06:11 -04:00
bvandeusen 1dc771cec2 Fix CI/CD for Forgejo-on-swarm topology; add runner swarm compose
- build.yml: clarify that runner needs Docker socket; SSH deploy uses
  DEPLOY_PATH secret so app host path is configurable; --no-deps so
  db/ollama containers are left untouched during deploy
- infra/runner-swarm.yml: act_runner as a Docker service on the Forgejo
  host — mounts host socket for buildx, writes act_runner config via
  one-shot init container, connects to fabled_backend network

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-08 18:55:40 -04:00