Shuttle runs GitLab CI pipelines for Tangled repositories on an ordinary GitLab runner, and publishes the job logs to the repository owner's tangled.org/dracoblue.de/shuttle
README.md

Shuttle #

Shuttle runs GitLab CI pipelines for Tangled repositories on an ordinary GitLab runner, and publishes the job logs to the repository owner's own atproto PDS.

Status: experimental. Pipelines run end to end against a local Knot 2, a real gitlab-runner, and a real PDS, but Shuttle is not deployed yet and not ready to run for anyone but its owner. See Status.

How it works #

 git push ──► Knot 2 ──/events──► Shuttle ──jobs──► gitlab-runner
                 ▲                   │                    │
                 └──── clone (anonymous HTTPS) ───────────┘
                                     │
                       trace blob + record (OAuth)
                                     ▼
                              owner's PDS ──► anyone (getBlob, no auth)
  1. Shuttle reads the owner's sh.tangled.repo records to learn which repositories exist and on which knot.
  2. It listens to each knot's /events stream. A sh.tangled.git.refUpdate for one of those repositories starts a run. On start, and when it detects a gap in the stream, it reconciles with git ls-remote.
  3. It reads .gitlab-ci.yml at the pushed commit and turns each job into a GitLab runner job.
  4. A stock gitlab-runner polls Shuttle through the GitLab runner API, clones the repository anonymously from the knot, and runs the job.
  5. When the job ends, Shuttle uploads the log as a blob and writes a net.dracoblue.shuttle.trace record to the owner's PDS. Anyone can read it there without Shuttle and without logging in.

Shuttle stores no logs itself. Its SQLite file holds the OAuth session, the event cursors, and the run state needed for deduplication.

Downloading an artifact by hand #

Read the net.dracoblue.shuttle.artifact record and follow its ordered parts array. For every entry, call com.atproto.sync.getBlob with the record owner's DID and the CID in part.blob, saving the result under the recorded part.name. Verify each part's size and sha256, then concatenate in array order and verify the record's whole-file sha256:

cat package.zip.* > package.zip

Do not discover parts with a PDS glob: blob names exist only in the record, and parts[] is authoritative. A one-part artifact is named package.zip; split artifacts use .001, .002, and so on.

The design, the decisions behind it, and the open questions are in BRIEFING.md.

Production #

Production runs on one host: Caddy and Shuttle from deploy/, a gitlab-runner installed on the host, and a confidential OAuth client. Only the OAuth paths are public; the runner API stays on 127.0.0.1:8080. Setup, key, grants, and operations are in docs/DEPLOYMENT.md.

GitLab CI compatibility #

Shuttle reads .gitlab-ci.yml. Of the keywords in the GitLab CI/CD YAML reference, counted as rows of docs/FEATURES.md:

Group ✅ supported 🟡 partial ⬜ not implemented
Global keywords 17 4 13
Header keywords 0 0 5
Job keywords 56 18 51
Total 73 22 69

A pipeline that uses a keyword that is not implemented does not start; the run fails and names the keyword. Every keyword, with notes and its e2e test, is listed in docs/FEATURES.md.

Predefined CI variables #

Shuttle sends the following public, unmasked variables to every job. It sends no secret variables. Like GitLab, variables in .gitlab-ci.yml have higher precedence than these predefined values. Predefined, top-level, workflow-rule, job, and matching job-rule variables are available while evaluating job rules; job-only CI_JOB_ID is added after expansion and is not available to rules.

Variable Shuttle source
CI Always true
CI_PIPELINE_SOURCE Always push
CI_COMMIT_SHA / CI_COMMIT_SHORT_SHA Pushed SHA / its first eight characters
CI_COMMIT_BEFORE_SHA Knot ref-update old SHA, or 40 zeroes
CI_COMMIT_REF_NAME / CI_COMMIT_REF_SLUG Pushed branch or tag name / GitLab-compatible lowercase 63-byte slug
CI_COMMIT_BRANCH Branch name; absent for tags
CI_COMMIT_TAG Tag name; absent for branches
CI_DEFAULT_BRANCH Symbolic HEAD from anonymous git ls-remote --symref against the knot
CI_JOB_NAME / CI_JOB_STAGE Expanded job name / stage
CI_JOB_ID Durable Shuttle run row ID
SHUTTLE_JOB_ATTEMPT One-based durable attempt number; a Shuttle-specific variable
CI_PIPELINE_ID Durable Shuttle pipeline row ID
CI_PROJECT_NAME name in the owner's sh.tangled.repo record; the repo DID is the fallback
CI_PROJECT_PATH <owner DID>/<project name>; Shuttle uses the stable owner DID rather than a mutable handle

Trace records #

Each finished job becomes one record on the owner's PDS:

Field Meaning
repo, repoUri repository DID and its sh.tangled.repo record
ref, sha the pushed ref and commit
job, jobName runner job id and YAML job name
status, exitCode success, failed, canceled, lost, or skipped; skipped records omit exitCode
allowFailure true when this failed job was allowed by allow_failure; false otherwise
attempt one-based attempt number; each retry has a new job ID and trace record
failureReason runner-reported failure_reason, when present (for example script_failure or job_execution_timeout)
stage the job's pipeline stage
parts, sha256 the log as text/plain blobs in order, cut at line ends so each part is readable on its own (<job>.log, or <job>.log.001, .002, ... when split), with per-part and whole sha256; records before 2026-10-08 have chunks instead
createdAt, startedAt, finishedAt creation, runner claim, and completion timestamps; skipped jobs have no startedAt

They can be browsed on any atproto explorer, for example https://pdsls.dev/at://<owner-did>/net.dracoblue.shuttle.trace.

The pipeline debug page (source on the site branch) reads the same records without credentials: enter a DID or handle, pick a repository and a job, read its log, and download artifacts or browse the files inside a zip. The URL fragment keeps the view, for example https://dracoblue.tngl.io/shuttle/#did=<owner-did>&repo=<repo-rkey>&trace=<trace-rkey>.

Commands #

Command Purpose
shuttle lint [path] check a repository's .gitlab-ci.yml without pushing and without a runner
shuttle run-local [path] run a repository pipeline locally on a real GitLab Runner
shuttle serve [--addr 127.0.0.1:8080] run the coordinator and the runner API
shuttle grant login [--port 8080] <handle> authorize Shuttle for an owner via atproto OAuth
shuttle grant enable|disable <did> enable or disable an OAuth grant
shuttle grant status [--check] show enabled/disabled and login health
shuttle repos refresh immediately re-read enabled owners' repository records
shuttle runner create [--tags a,b] [--run-untagged] create a runner token; printed once, stored hashed with its tags
shuttle run show --sha <sha> show how a run was triggered
shuttle trace put <owner-did> <file> upload a trace by hand (development)
shuttle trace get <at-uri> read a trace without any auth
shuttle job enqueue … enqueue a fixed job (development only)

Checking a pipeline before you push #

shuttle lint checks a repository's .gitlab-ci.yml without a runner; shuttle run-local runs it on a real GitLab Runner without a knot or PDS:

shuttle lint .
shuttle run-local --runner docker --worktree .

Flags, exit codes, and output are in docs/LOCAL.md.

Runners #

shuttle runner create prints a token once and stores only its hash, plus the runner's tags and run_untagged flag. --tags is a comma-separated list. When --run-untagged is omitted, the flag is true if no tags were given and false if tags were given, which matches GitLab registration. Pass --run-untagged or --run-untagged=false to set it explicitly. gitlab-runner's verify request sends only the token and a system id, not the tags, so the values stored here are the ones Shuttle uses.

Register a runner against Shuttle the usual way:

gitlab-runner register --non-interactive \
  --url http://<shuttle-host>:8080/ --token <token from shuttle runner create> \
  --executor docker --docker-image alpine:3

Configuration #

Variable Purpose
SHUTTLE_DB path of the SQLite file (default shuttle.db); never commit it
SHUTTLE_KNOT_URL_<HOST> override how a knot hostname is reached, for example SHUTTLE_KNOT_URL_KNOT_EXAMPLE_ORG=http://knot:5555

OAuth asks only for atproto repo:net.dracoblue.shuttle.trace?action=create repo:net.dracoblue.shuttle.artifact?action=create&action=delete blob:text/plain blob:application/zip blob:application/octet-stream. Shuttle cannot touch any other record of the owner; it deletes only its own expired artifact records.

Development #

See docs/DEVELOPMENT.md for building, testing, and the end-to-end harness.

Status #

Works, verified end to end against a local Knot 2, a real gitlab-runner, and a real PDS:

  • push → /events → run → gitlab-runner → trace record, deduplicated per repository, ref, commit, and job, with a restart-safe cursor
  • traces and artifacts as separate records; blobs over the PDS upload limit are split into parts; rate-limited writes back off
  • the keywords marked supported or partial in docs/FEATURES.md, each with its own e2e test
  • shuttle lint and shuttle run-local before a push
  • OAuth with a narrow, granular scope; grants closed by default; repository records refreshed while running
  • the production stack in deploy/, smoke-tested without DNS

Not yet:

  • no public deployment; Shuttle has only run for its owner
  • the keywords counted as not implemented in GitLab CI compatibility
  • local development uses a public OAuth client, whose sessions expire after two weeks; production uses a confidential client

Security #

  • Push access is execution access. Adding a collaborator to a repository lets them run code on your runner.
  • A runner with the host's Docker socket gives every job root on the host. Isolate the runner before anyone but you can push.
  • Traces are public and permanent. Never print secrets in a job.

License #

MIT, see LICENSE.