Releases, promotion and CI/CD
A pipeline run is not a release. pipewright release builds your component image and every pipeline template, pins both by digest, writes a write-once release contract, verifies it, and only then moves a live pointer. Every run uses the live release; rollback moves the pointer back. Production gets the tested release by promotion, never by rebuilding.
Releasing
git commit -am "churn: tighter gates" # releases are named after the commit
pipewright release --env dev # every use case, or --usecase churn (repeatable)
pipewright status --env dev # what is live
- Tables first:
tables syncruns (additive changes only), unless--skip-tables. - Images: the component image (and Ray and synthetic images when used) is built from your components and requirements and pushed; the contract records the digest.
--component-image <repo>@sha256:...reuses one for a configuration-only change. - Templates: each pipeline (training, inference, synthetic) is compiled with the resolved configuration and step sizes, uploaded, and pinned by digest.
- The contract is written once: commit, images, templates, the resolved configuration and its digest, the feature contract. It is never overwritten; releasing the same commit and configuration again reuses it.
- Verify, then go live: every digest is read back; only then does the pointer move (
release.live).
Uncommitted work is released as <commit>-dirty-<time>, so it is never mistaken for a commit. tests.on_release runs your tests first.
pipewright rollback --env dev --usecase churn # the previous release
pipewright rollback --env dev --usecase churn --to <release-id>
Approved images
A platform can limit what images are built from, in the manifest:
"policies": {"images": {
"base_images": ["europe-west2-docker.pkg.dev/acme-ml/mirror/*"],
"package_indexes": ["https://europe-west2-python.pkg.dev/acme-ml/pypi-mirror/simple/"],
"default_base_image": "europe-west2-docker.pkg.dev/acme-ml/mirror/python:3.11-slim"
}}
Every base image must match a pattern; requirement files may name only approved indexes; direct references (pkg @ https://..., git+, local paths) are refused. validate reports what breaks the policy, release refuses it before building, and the contract records base images by digest. A use case can choose its own base image (components.base_image, for example a CUDA image) within the list.
Promotion between environments
pipewright promote --from test --to prod --usecase churn [--approve]
- Allowed source: only from the environment the destination names (
promotion: { from: test }in its environment file), from a clean checkout of the source release’s commit (--print-source-commitprints it). - Destination policies first: the use case is resolved under production’s manifest; a refusal stops before anything is copied.
- The same code: images are copied by digest and checked. Templates are compiled for production and must equal the tested ones with only the registry address changed; an override that changes a pipeline’s shape is refused unless accepted with
--accept-template-change(recorded). - The same model (
model.promotion: model): the approved version’s files, verified and checked against the approval, registered in production as a candidate;pipewright model approvethere makes it the default. A first version needs--approvewith the promotion. The version must have been trained by the release being promoted. Withmodel.promotion: retrain, production trains its own. - Safe to repeat, recorded, reversible: repeating is a no-op;
release.promotedrecords what came from where and by whom;rollbackgoes back without rebuilding.
CI/CD with GitHub Actions
pipewright ci init --environments dev,prod
pipewright ci init --environments dev,prod --runs-on self-hosted,linux,mlops # self-hosted runners
| Workflow | When | What it does |
|---|---|---|
pipewright-pr | Every pull request | validate, test, doctor, dry runs, and the review bundle for agent-written changes |
pipewright-release | On merge | tables, release, schedules and alerts for each changed use case, environment by environment |
pipewright-operate | By hand | run, status, rollback, model approve, deploy, canary |
pipewright-decisions, pipewright-gate | Hourly; per decision | Decisions approved by a GitHub environment’s reviewers (more) |
Create a GitHub environment per Pipewright environment with the variables GCP_WIF_PROVIDER, PIPEWRIGHT_SERVICE_ACCOUNT and PIPEWRIGHT_PIP_SPEC (for example pipewright-mlops[gcp]==1.4.5); set PIPEWRIGHT_SCHEDULES=off where Cloud Scheduler is not enabled, and add required reviewers to production. Authentication is Workload Identity Federation, with no keys. On a self-hosted runner with a service account attached, leave GCP_WIF_PROVIDER empty; set PIPEWRIGHT_SETUP_TOOLS=off when the image already has Python 3.11 and uv. Tutorial 5 walks through it.
Scoring that waits for a person
Training, evaluation and registration check themselves, and a person approves the version that becomes the default. Some teams also need a person to say yes to each scoring run, for example when the scores drive letters, credit limits or prices. Pipewright 1.4.3 can hold every scoring run until someone does; it is off by default.
# usecase.yaml (or one environment's overrides)
approvals:
batch_scoring: manual # auto (default): scoring starts when it is triggered
batch_scoring_hold_hours: 24 # a held run expires after this
pipewright scoring list --env prod --usecase churn
pipewright scoring approve --env prod --usecase churn --hold <hold_id> --reason "March file checked"
pipewright scoring reject --env prod --usecase churn --hold <hold_id> --reason "last month's file"
The launcher holds the run whatever started it (a schedule, a landing file, the API, the CLI or a workflow) and sends run.held. pipewright decisions pending lists it as score-approve, so the gate workflow asks the environment’s reviewers; an approval submits the run exactly as it was asked for, and run.hold_decided records who approved it, their comment and the run. A platform can require it for every use case with policies.batch_scoring: manual. Retrain loops are not held: a person approved their case already.
| Governance | every scoring run has a named decider and, from the gate, the reviewer’s comment and run link |
|---|---|
| Security | runner identities and the launcher may not decide; an approval cannot change what runs |
| Cost | one small object and two events per held run: under $0.02 a month for 1,000 runs at list prices (europe-west2). The real cost is a person deciding every run, so use it where each run carries consequences |
Schedules and alerts after a release
pipewright schedules sync --env dev # Cloud Scheduler jobs (or CronJobs on private GKE)
pipewright alerts sync --env dev # email alert policies from monitoring.alerts
A whole-repo alerts sync also removes the policies of use cases that are gone: neither in the repository nor released in the environment. --dry-run shows what would be deleted.
Cleaning up images
pipewright images prune --env dev # lists what would go
pipewright images prune --env dev --apply # deletes
Every release pushes images and nothing else removes them, while a blanket cleanup policy would break rollback and replay. images prune keeps every image a contract in any use case’s history pins by digest, and the newest --keep (3) of each package; it never touches a package no contract names. Each environment is pruned on its own.