8.6 KiB
Woodpecker CI (server + agent)
Self-hosted CI for the co-op's repos. As of 2026-11-11 the CI is WORKING
end to end for push-gated test runs — co-op/docs (manual, build+deploy),
code/member-portal and code/admin-panel (push-triggered test gating). Read
the Current state section for what is proven and the traps that remain.
Two Cloudron apps, added 2026-11-03:
| App | FQDN | Cloudron id | Image |
|---|---|---|---|
| Woodpecker server | ci.inference.coop |
4984f95e-0c0a-4af3-9ce1-4ca4f3e8483d |
cloudron/org.woodpecker_ci.cloudronapp:202610300219490000 (store, v2.22.1 / upstream 3.20.1) |
| Woodpecker agent | ci-agent.inference.coop |
5ac63873-cf2c-4ad9-acd6-81dc0e016c83 |
registry.inference.coop/co-op/woodpecker-agent:20261104-e070275 (custom) |
- The server is the stock Cloudron app. It uses the
mysqladdon for storage and exposesGRPC_PORT9000 to the agent. Its config lives in/app/data/env.sh(WOODPECKER_GITEA,WOODPECKER_ADMIN,WOODPECKER_AGENT_SECRET,WOODPECKER_OPEN, …). No env vars are set through the app's Cloudron env (env-keysis empty) — everything is in that file. - The agent is a custom app. Its config is set as Cloudron env (names only):
WOODPECKER_SERVER=ci.inference.coop:9000,WOODPECKER_GRPC_SECURE=true,WOODPECKER_BACKEND=local,WOODPECKER_MAX_WORKFLOWS=2,WOODPECKER_AGENT_CONFIG_FILE=/app/data/agent.conf, plus the sharedWOODPECKER_AGENT_SECRET.
Why the agent image is custom (and why the backend is local)
Cloudron apps have no Docker socket, so the default docker backend cannot
run and the agent uses the local backend: each pipeline step executes as a
shell command inside the agent container, and a step's image: field selects
the shell, not a container image. Consequence: every tool a pipeline step
needs must be baked into the agent image, and the Cloudron rootfs is read-only
at run time, so nothing can install at run time.
The image is FROM woodpeckerci/woodpecker-agent:v3.20.1-alpine (the alpine
variant — the default scratch image has no shell). It adds bash, git,
git-lfs, tar, ca-certificates, python3, node/npm, the cloudron
CLI, and a pinned MkDocs toolchain at /opt/docs-venv. It runs as root
(/app/data on this Cloudron is root-owned, as for the other custom apps here).
Building and pinning the agent image
- Source repo:
/home/ubuntu/repos/woodpecker-agenton the agent host. ⚠️ This repo has no git remote and has never been pushed to Gitea — the CI agent's build source exists only on the agent host. Treat that as a gap to close. - Tag convention:
<yyyymmdd>-<gitsha>(e.g.20261104-e070275). Never a floating tag. - Build:
~/.hermes/scripts/cloudron_builder_build.sh registry.inference.coop/co-op/woodpecker-agent <tag> <dir>(the script carries the registry auth triple, which is not optional). - Deploy: write the new tag into
CloudronManifest.json'sdockerImage, commit, build--no-cache, thencloudron update --app 5ac63873-…without--image(the manifest's pin wins). Verify by the running image tag and something only the new build produces — never by exit code alone. publishing-requirements.txtmirrors the docs repo'spublishing/requirements.txt; keep the two in step when the docs toolchain changes.
Current state (2026-11-11): push-gated test CI is live
- The server-side gRPC 500 was never the blocker. The agent's
Nextlong-poll is cut short by the platform proxy every ~10 minutes (nginxupstream timed out,could not find named location "@grpc_unavailable") and the agent retries — pipelines are collected and executed regardless. Re-confirmed 2026-11-11: the 500s continue in the log while push-triggered pipelines run green. Do not chase it. - API access: a personal token for
inference-adminlives at/home/ubuntu/.hermes/woodpecker.key(mode 600). Repo enablement isPOST /api/repos?forge_remote_id=<gitea repo id>(query param, not body); a manual run isPOST /api/repos/<id>/pipelineswith{"branch": "..."}. - Enabled repos:
co-op/docs(id 1),code/member-portal(id 2),code/admin-panel(id 3),code/member-dashboard(id 4, enabled 2026-11-13 with the same push gate +ci/woodpecker/push/woodpeckerstatus check as the panel). Noteco-op/member-portalis a Gitea REDIRECT tocode/member-portal— the canonical repo lives in thecodeorg (Gitea id 6). - Test gating (added 2026-11-11):
.woodpecker.ymlon the apps' default branches runs their EXISTING suites on every push (portal test files; admin-panel guest-guard + oidc/chart sync pins + 4 page-JS harnesses via the vendoredtests/check-page-js.sh; member-dashboard oidc/chart sync pins + 2 page-JS harnesses). Gitea branch protection onmainof each app repo requires the status contextci/woodpecker/push/woodpeckerto merge. - Shared chart module (added 2026-11-13):
ops-docs/scripts/shared/ coop_chart.jsis the canonical chart rendering + hover-tooltip module; byte-identical copies live atapp/coop_chart.jsin both UI apps, spliced into each PAGE_HTML at import time.tests/test_chart_sync.pyin each app pins the copy (same pattern as the oidc client);scripts/check-chart-sync.pyis the pre-deploy gate andscripts/sync-chart-module.shre-copies + re-pins both apps in one step. Since 2026-11-13 the module ALSO owns the chart DEFINITIONS (CHART_METRICS+renderChart()): one description per chart, read by both UIs, so the metric list, the titles, the axis rules and the formatters cannot drift apart again. Each app keeps onlyMETRIC_SOURCE(which fetch feeds a metric) and its own DOM; Money is a metric of Trends in both, not a tab. The vendoredtests/check-page-js.shin BOTH apps splices the module into the extracted page JS exactly as the app does — keep the two vendored copies byte-identical to the skill's script (md5 445cdcf59f193ff875bb634f6f790e73). - Proven with real output: first push runs green (portal tests step: 439
log lines ending "all portal test suites green"; all four harnesses OK on
the panel), and a deliberately broken assertion on a branch (
ci-red-test) produced pipeline #2 failure with the failing status context on Gitea — the gate signal works. The branch was deleted after the proof. - The agent's python is 3.14 (agent image base) — the portal's PINNED
requirements (pydantic 2.9.2, psycopg2-binary 2.9.9) have no cp314 wheels,
so the portal pipeline installs a bounded-range subset (fastapi/httpx/PyJWT/
slowapi/cryptography) instead of
-r requirements.txt. Seecode/member-portal/.woodpecker.ymlfor the rationale.
When a pipeline runs (and when it does not)
co-op/docs: manual-trigger only by deliberate decision (the poll watcher remains the live auto-deploy path until the operator says otherwise).code/member-portal,code/admin-panel: fire on every push (any branch) and can also be triggered manually.git-lfsis required by the clone step. Woodpecker runsgit lfs fetchafter cloning, so a clone step fails withgit: 'lfs' is not a git commandon any image without it — this was added to the agent image on 2026-11-04. If a rebuild ever drops it, clones break again.
Historical state (2026-11-04): installed, agent connected, could not run jobs
Superseded by the section above. Kept because each entry was a lesson:
the health endpoint lied by omission (liveness, not capability), the missing
git-lfs broke every clone, the missing repo secret (cloudron_token) made the
config fail to PARSE with the reason visible ONLY in the web UI, and the gRPC
500s were misread twice as the blocker before pipeline #2 proved otherwise.
The repo-enablement login gate (operator completes Gitea OAuth once) was
cleared the same day: the inference-admin user exists with admin rights.
Enabling a repo (known gate — cleared 2026-11-04)
- Repos are connected through the Gitea source (
WOODPECKER_GITEA). The OAuth login source was stood up by the operator and theinference-adminuser exists (admin). Enabling further repos is now a pure API call (see Current state), not an operator step. - Reading run/pipeline state is done from the server's MySQL database, not
from a public API, when the API view is thin (the pipeline endpoint does not
expose step logs;
log_entriesin the database does). - Note: the whole point of this CI is to take the docs build and custom-app builds
off the agent host — see
co-op/support#30(movingREGISTRY_BUILD_TOKENto CI).