Promotion setup: from a pull request to stage and prod
Promotion moves a reviewed change from a Branch Environment to stage and then to prod, through Git.
adops init writes three GitHub Actions workflows into your Project that do this for you. They only
work after the one-time setup below, which adops cannot do for you because it needs admin rights on
your GitHub repository and on your Server machines.
You do not need to know Git or Docker to follow this guide: every step is a command to copy and paste, or a setting to click. Your Assistant can run the commands for you.
Running prod on one machine? Run production on one VM adds what operating it needs: a Heartbeat to an outside monitor, the Disk Alert and Rollback.
What the workflows do
adops init writes these files into .github/workflows/ of your Project:
| File | Runs when | What it does | Where it runs |
|---|---|---|---|
adops-pull-request.yml |
a pull request is opened or updated (opened, synchronize, reopened) |
adops validate, then adops run --all --branch <branch>: every Pipeline in that pull request's Branch Environment |
the stage Server (runner label adops-stage) |
adops-pull-request.yml |
a pull request is closed or merged (closed) |
adops drop-branch <branch>: removes that Branch Environment |
the stage Server (runner label adops-stage) |
adops-stage.yml |
a change is merged to main |
validates the new version, copies it into the stage Server's releases/<commit> and points current at it (adops server-release, which also deletes old release folders), reloads the Server's Pipelines and Schedules, then adops run --all --changed --env stage from current, which reruns only the Changed Steps |
the stage Server (runner label adops-stage) |
adops-prod.yml |
a release is published | the same as stage, for the release's tag, then adops run --all --changed --env prod from current, after a required reviewer approves |
the prod Server (runner label adops-prod, environment prod) |
A pull request from a fork (a copy of your repository under someone else's account) is a
Fork PR. It only gets adops validate, on a machine GitHub provides, with no access to your
Servers or secrets. Its Branch run is skipped; to run it, a maintainer pushes the same change to a
branch in your own repository.
A deploy reruns only what changed. For each Pipeline, --changed reruns from the first Step
whose definition changed since that Environment's last successful run, plus every Step after it. A
Pipeline with no changed Step is not run, and its Steps show unchanged in stage (or prod) in the
log; if it has a Schedule, its next scheduled run refreshes its data. A Pipeline runs in full when it
has no Schedule, when that Environment has no saved Step Fingerprints for it yet (its first run
there, or on prod its first deploy after upgrading adops), when that Environment's block in adops.yaml (or
the time zone or alert webhook) changed, or when it has a new accepted-change record. To rerun
everything by hand, run this in the Server folder on that machine (use --env prod on the prod
Server):
docker compose --profile server run --rm --no-deps dagster_daemon adops run --all --env stage --project /project/current
The first deploy to prod after upgrading adops creates two new tables in prod's adops schema:
_adops_step_fingerprints and _adops_deploy_state. That deploy runs every Pipeline in full, because
prod has no saved fingerprints yet; later deploys rerun only the Changed Steps. The prod Warehouse
user already writes to that schema, so no new rights are needed.
If a validate fails, no file in the Server folder changes and the Server keeps running the last good
version. A deploy never runs git in the Server folder and never restarts the Server's containers.
Before you start
You need:
- One machine per Server: one for stage and, when you add prod, a separate one for prod. A Server whose Warehouse is a DuckDB file must run Linux. Its Warehouse lock (see below) uses file locks, and these are not reliably shared between macOS and a Docker container through a Docker Desktop for macOS folder mount, so two runs could write to a DuckDB Warehouse at once. A Server with a Postgres Warehouse may run on a Mac: this was tried on OrbStack, not on Docker Desktop. See Run stage and prod on a Mac.
- Minimum DuckDB Server size: 2 vCPUs, 8 GB memory, 20 GB disk. This is for a Server whose
Warehouse is a DuckDB file, with the demo's three Postgres containers on the same machine. In the
2026-11-28 trial (see Recorded trials) the highest peaks were 3.5 GB memory,
during a 2-million-row full refresh with a Branch run waiting for the Warehouse lock, and 8.8 GB
disk used, counting the system, the containers, the Server image, the release folders and a
second Server image during a rebuild. That leaves 4.5 GB of memory and 11 GB of disk spare for a
larger Warehouse file, more release folders and logs. CPU reached 100% of both cores during the
large runs: they ran slower but finished. A machine with less than 8 GB was not tried. Add disk
as your Warehouse grows: the trial's
.adops/folder, which holds the DuckDB files and the Sync state, reached 530 MB at 2 million rows. - Or one Linux machine for both stage and prod, for a trial or a small team. Run one Server and
switch it between stage and prod with
ADOPS_ENVIRONMENTin.env, and register one runner with both labels,adops-stage,adops-prod. Stage and prod then never run at the same time, and a switch stops the Server. See Run stage and prod on a Mac: Step 4 for the switch and what the two Environments share. The 2026-11-28 trial ran this way. - Stage and prod DuckDB paths must stay under
.adops/, for examplepath: .adops/warehouse_stage.duckdbandpath: .adops/warehouse_prod.duckdb. Every deploy puts the Project in a newreleases/<commit>folder, and.adops/is the only Project folder all releases share. A DuckDB file anywhere else in the Project would be left behind in the old release folder at the next deploy, and the Server would start an empty Warehouse. - Docker with the
docker composecommand on each machine. - Admin rights on the GitHub repository that holds your Project.
- A private GitHub repository. GitHub's own advice is that self-hosted runners "should almost never be used for public repositories": anyone can open a pull request against a public repository, and a workflow change in that pull request could run their code on your Server, next to your Warehouse and its passwords (GitHub: Hardening for self-hosted runners). If your repository must be public, the fork approval setting in step 4 is the only thing standing between a stranger's pull request and your Server.
In the commands below, replace these placeholders once, everywhere they appear:
<your-server-folder>: the folder on the Server machine that holds the Project, for example/srv/adops. It is the same value you giveADOPS_SERVER_DIRin step 3.<runner-user>: the Linux user the runner runs as, for examplegithub-runner.<owner>/<repo>: your GitHub repository, for exampleacme/analytics.
Step 1 — Put the Project on the Server machine as a Git clone
Clone your repository once to get its files onto the machine. The workflows never run git in this
folder: each deploy copies the new version into its own folder under releases/.
sudo mkdir -p <your-server-folder>
sudo chown <runner-user> <your-server-folder>
sudo -u <runner-user> git clone https://github.com/<owner>/<repo>.git <your-server-folder>
For a private repository, git clone asks you to sign in once. The workflows never fetch from GitHub
on the Server: they hand the new version over from the runner's own checkout.
Then create the Server's .env from the example and fill in the real passwords for this machine's
Warehouse, Sources and Targets:
cd <your-server-folder>
sudo -u <runner-user> cp .env.example .env
sudo -u <runner-user> nano .env
.env and the .adops/ folder stay in <your-server-folder> and are never committed: the Project's
.gitignore already lists both. Warehouse secrets live only in each Server machine's .env. Never
add them as GitHub secrets. Make sure .env sets DAGSTER_WEBSERVER_PORT (the example sets
3000): the stage and prod workflows read it to reload the Server. Set ADOPS_ENVIRONMENT to the
Environment this machine runs: stage on the stage machine (the example's value) and prod on the
prod machine. A prod machine left at stage runs stage's Schedules while its workflow deploys prod.
Plain Projects only: a Project made with adops init without --demo defines only the dev
Environment. Add a stage Environment to adops.yaml (same shape as dev, pointing at the stage
Warehouse) and merge it before you start the Server, or the Server and adops-stage.yml both fail.
For prod, step 6 below comes first.
Before you start the Server, lay the folder out as release folders: do steps 2 and 3 of
One-time move to release folders. The Server reads the Project
from the current link, so it does not start without it.
Start the Server once:
cd <your-server-folder>
sudo -u <runner-user> docker compose --profile server up -d --build
Step 2 — Install a self-hosted runner on the Server machine
A self-hosted runner is GitHub's small agent program that runs workflow jobs on your own machine. Each Server machine gets one, with a label that says which Server it is:
| Server | Runner label |
|---|---|
| stage | adops-stage |
| prod | adops-prod |
-
On GitHub, open your repository, then Settings > Actions > Runners > New self-hosted runner. Choose Linux and your machine's architecture.
-
On the Server machine, as
<runner-user>, run the download andconfig.shcommands GitHub shows. Whenconfig.shasks for additional labels, enteradops-stageon the stage machine oradops-prodon the prod machine. You can also pass the label directly:./config.sh --url https://github.com/<owner>/<repo> --token <token-from-the-github-page> --labels adops-stage<token-from-the-github-page>is the one-time token shown on that GitHub page; it expires after one hour. -
Install and start the runner as a service, so it keeps running after you log out and after a reboot (from the runner's folder):
sudo ./svc.sh install <runner-user> sudo ./svc.sh start sudo ./svc.sh status(GitHub: Configuring the self-hosted runner application as a service)
-
Check that the runner user can use Docker. Every job runs adops inside the Server's image with
docker compose run, so a runner user without Docker access fails every job:sudo -u <runner-user> docker compose version sudo -u <runner-user> docker psIf
docker pssays "permission denied", add the user to thedockergroup, then restart the runner service:sudo usermod -aG docker <runner-user> sudo ./svc.sh stop sudo ./svc.sh start
A Mac stage Server (Postgres Warehouse only, see "Before you start"): choose macOS on the
GitHub page, run config.sh as yourself, and skip the sudo and usermod parts above: the runner
runs as your user, who can already use Docker. ./svc.sh install sets it up as a launch agent that
starts when you log in, or run ./run.sh in a terminal for a trial.
The runner shows as Idle under Settings > Actions > Runners when it is ready. Use the label
exactly as written (adops-stage, not stage): a job whose label matches no runner waits forever.
Step 3 — Set the Server folder variables on GitHub
The workflows read the Server's folder from a GitHub variable (not a secret) named
ADOPS_SERVER_DIR. It is set twice, because stage and prod are different machines:
- For stage — a repository variable. Settings > Secrets and variables > Actions > Variables >
New repository variable. Name:
ADOPS_SERVER_DIR. Value: the stage machine's<your-server-folder>. - For prod — an environment variable on the
prodenvironment (created in step 5). On theprodenvironment page, under Environment variables, addADOPS_SERVER_DIRwith the prod machine's<your-server-folder>. A job that uses theprodenvironment reads this value instead of the repository variable with the same name.
Optional — ADOPS_PACKAGE. Only the Fork PR validate job installs adops itself, by default the
exact version your Project was made with (adops==<version>). To make it install something else, such
as a wheel file URL or a Git URL, add a repository variable ADOPS_PACKAGE with that pip install
target. Leave it unset otherwise.
Step 4 — Keep fork pull requests from running on your Server
The workflow's fork check (head.repo.full_name != github.repository) sends Fork PRs to a GitHub
machine. That check is not a security boundary on its own. A Fork PR can change the workflow file
itself, and its changed version is what runs. What stops fork code from reaching your Server is
GitHub's approval setting, which makes a maintainer look at a Fork PR before any workflow runs for it.
Keep it on at its strictest:
Open Settings > Actions > General, then:
- Private repository: under Fork pull request workflows, GitHub leaves Run workflows from fork pull requests off for a new private repository, so no Fork PR runs anything. That is the safest setting; keep it unless you need Fork PRs. If you turn it on, also turn on Require approval for fork pull request workflows, and leave Send secrets to workflows from pull requests off.
- Public repository: under Approval for running fork pull request workflows from contributors, choose Require approval for all external contributors (older GitHub pages call it "Require approval for all outside collaborators"). Do not choose the "first-time contributors" options: they let anyone who once had a pull request accepted run code on your Server without approval.
Before you approve a Fork PR's workflow run, check that it does not change anything under
.github/workflows/.
(GitHub: Managing GitHub Actions settings for a repository)
Step 5 — Create the prod environment with required reviewers
A release deploys to prod only after a person approves it.
- Settings > Environments > New environment. Name it exactly
prod, then Configure environment. - Tick Required reviewers and add the people or teams who may approve a prod deploy (up to 6). Save.
- On the same page, add the
ADOPS_SERVER_DIRenvironment variable from step 3.
When a release is published, the adops-prod.yml job waits until one of those reviewers clicks
Review deployments > Approve and deploy on the workflow run. Without required reviewers, every
published release deploys to prod at once.
On GitHub Free, Pro and Team, required reviewers work only on public repositories; a private repository needs GitHub Enterprise for them. (Tried 2026-11-27: on a private repository GitHub refuses with "Please ensure the billing plan supports the required reviewers protection rule", so create the environment without reviewers.) Without them, limit who can publish releases instead: only people with write access to the repository can.
(GitHub: Managing environments for deployment)
Step 6 — Turn on prod in adops.yaml
A plain Project's adops.yaml ships with the prod Environment commented out. Before the first
release, uncomment the # prod: block (remove the # at the start of each of its lines), point it
at the prod machine's Warehouse, Sources and Targets, and merge that change. A demo Project ships a
prod that runs against the local Docker databases instead: point its host, port and database
lines at the prod machine before the first release, and merge that change. The prod machine's
.env holds the matching passwords.
Step 7 — Try it
The first push of a new repository to main starts no adops stage deploy, so it needs no runner
yet. Until stage has run once, a pull request's Branch run has nothing in stage to compare with and
rebuilds every Step of each Pipeline. Stage first runs when that first pull request is merged; from
then on a Branch run rebuilds only the Steps that changed. A repository created on GitHub with a
README and then pushed to is not a first push: that push may still start adops stage, so if no
runner exists yet, cancel that run under Actions.
- Open a pull request from a branch in your repository.
adops pull requestruns on the stage Server; its log shows each Pipeline's Branch run. - Merge it. A second
adops pull requestrun drops the Branch Environment, andadops stagedeploys to stage. - Publish a release.
adops prodwaits for approval, then deploys to prod.
One-time move to release folders
From this version on, a deploy never changes the files a run in progress is reading. It copies the
new version into its own folder, <your-server-folder>/releases/<commit>, then points a link named
current at it in one step. A run reads the folder current named when it started, to the end,
retries included. adops server-release does this, and it stops with
... has the old layout ... or ... is half moved ... until the Server folder has been moved once,
by hand, as below. It changes no file when it stops.
-
Make sure no run is in progress. On the Dagster page, open Runs: nothing may be Queued, Starting or Started. Wait for it to finish if it is.
-
Copy the version the Server runs now into its release folder, and link the shared
.envand.adops/into it:cd <your-server-folder> commit=$(sudo -u <runner-user> git rev-parse HEAD) sudo -u <runner-user> mkdir -p .adops "releases/$commit" sudo -u <runner-user> sh -c "git archive HEAD | tar -x -C releases/$commit" sudo -u <runner-user> ln -s ../../.env "releases/$commit/.env" sudo -u <runner-user> ln -s ../../.adops "releases/$commit/.adops" -
Create the
currentlink. It must be relative (releases/<commit>, not a path starting with/): the containers see the Server folder at/project, so an absolute link would point at nothing inside them, andadops server-releaserefuses it.sudo -u <runner-user> ln -s "releases/$commit" current -
Keep
.env,.adops/,server/,docker-compose.ymlandDockerfilewhere they are, at the root of<your-server-folder>. Every version shares them. The other Project files at the root are no longer read; you may leave them. -
Point the Server at
current. A Project made with this version ofadops initalready hasADOPS_PROJECT: /project/currentindocker-compose.yml; skip to the command below. In an older one, underdagster_daemon:→environment:, changeADOPS_PROJECT: /projecttoADOPS_PROJECT: /project/currenthere on the Server. In the Project repository, runadops upgradeand merge its pull request: it bringsdocker-compose.ymlto the sameADOPS_PROJECT, so the next deploy does not stop with "This commit changes the Server config". Then recreate the containers once (no run is in progress, step 1):sudo -u <runner-user> docker compose --profile server up -d -
Check it with the next deploy: its log shows
current: releases/<commit>for the new commit.
When a deploy changes the Server config
Dockerfile, docker-compose.yml and the server/*.yaml files at the root of
<your-server-folder> are shared by every release and read when the containers are built and
started, so a deploy never changes them. When a commit adds, removes or changes one of them, for
example the pull request adops upgrade made for a new adops version, adops server-release stops
with This commit changes the Server config: <files> and changes no file.
Do not edit these files by hand in the Project. Run adops upgrade in the Project repository and
merge its pull request; then rebuild the Server with
Upgrade a Server and re-run the
deploy that stopped.
Which release folders a deploy deletes
After switching current, adops server-release deletes old release folders, keeping the newest 3,
the one current names, and every folder a run in progress is reading. Each run records its folder
when it starts. Two cases:
- A run that has not recorded a folder yet (it is queued, or it started before this version of
adops) may be reading any folder, so nothing is deleted while it is in progress, and the log
says
Old release folders were kept. The next deploy after it finishes deletes them. - Branch runs read the pull request's checkout, not a release folder, so they keep no release folder.
Each release folder is a full copy of the Project without .git, .env and .adops/, so the Server
folder needs room for about 4 of them (the newest 3 plus the one being copied), more while long runs
hold older ones. Check with du -sh <your-server-folder>/releases.
After a deploy: Schedules pick up the change by themselves
The stage and prod workflows reload the Server's Pipelines and Schedules after current points at
the new release. A run already in progress keeps reading the release folder it started with, to the
end, retries included; runs that start after the switch read the new one. The Dagster page shows the new version at once. The Dagster daemon, which starts
scheduled runs, picks up new, removed or changed Schedules within about 60 seconds, because it
refreshes its own copy every 60 seconds. Do not restart the Server to pick up a change: a restart
kills runs that are in progress, which the reload exists to avoid.
When two runs want the same Warehouse: the Warehouse lock
Every run that writes to a Warehouse (a Branch run, a stage or prod deploy, a Schedule,
adops accept-schema --branch, and adops drop-branch) first takes that Warehouse's Warehouse
lock. Branch runs, accept-schema --branch and drop-branch use stage's Warehouse, so they share
stage's lock. What the lock keeps apart depends on the Warehouse:
-
Postgres: the lock is per Pipeline. Two runs of different Pipelines may hold it at once; two runs of the same Pipeline never do. A Pipeline is known by the
name:in its YAML file, not by its file name, and a Branch run of a Pipeline shares stage's lock for that Pipeline. Two jobs cover the whole Warehouse and so wait for every running Pipeline:adops drop-branchand saving the Settings Marker at the end ofadops run --all --changed. While one of them waits, new runs queue behind it, so a steady stream of runs cannot hold it off.Every dbt Transform builds the whole dbt project, so on Postgres a Transform Step also takes the Warehouse's one dbt Lock while dbt runs, after its run already holds the Pipeline's lock. Only one Transform builds at a time, including a Branch run's Transform in stage's Warehouse; the Sync Steps of other Pipelines keep running. A Transform that cannot get the dbt Lock within the same 30 minutes fails with
another Transform is building the dbt project on this Warehouse; try again when it finishes, and it is not retried. The Assistant does not wait: it answers that the Warehouse is busy before it loads anything.A Sync may load raw tables while another Pipeline's Transform reads them. On Postgres a full refresh is loaded into the
raw_<source>_stagingschema first and then replaces the table in one transaction, and an incremental load is merged in one transaction, so the Transform reads either the whole old table or the whole new one. When two Pipelines first load into the same newraw_<source>at once, the one that loses the race to create the schema or dlt's_dlt_tables loads again, up to 5 times in all. -
DuckDB: one lock per Warehouse file, so only one run at a time, whatever the Pipeline.
If the lock is held:
- The new run waits up to 30 minutes, then fails with
Another run is using the stage Warehouse; gave up after 30 minutes.(orprod). It is not retried. - A scheduled run on the Server holds its Run Slot while it waits. On Postgres each Pipeline has its own Run Slot, so only that Pipeline's next run queues behind it, and at most 4 runs go at once. On DuckDB the Server has one Run Slot, so every other Schedule on that Server queues behind it, and a long Branch run can delay all of stage's Schedules.
- On the Server, a timed-out run fails and sends an alert like any other failure (when
ALERT_WEBHOOK_URLis set in.env). In GitHub, the job turns red with the message above; rerun it with Re-run jobs once the other run has finished. adops run --alltakes the lock once per Pipeline, so another run may slip in between two Pipelines of the same deploy.
Turn on one Run Slot per Pipeline on an existing Server
adops init writes server/dagster.yaml once, so a Server made with an older adops still runs one
run at a time on Postgres. To let different Pipelines run at once, run adops upgrade in the
Project repository: it brings server/dagster.yaml to the version you installed. Merge its pull
request, then rebuild the Server with Upgrade a Server.
The same file keeps a DuckDB Server at one run at a time, because adops tags every DuckDB run
adops/serial. Before you restart, run adops validate: it refuses two Pipeline files with the same
name: and two Pipelines that sync the same table from the same Source, because runs of different
Pipelines would then share a lock identity or race on one raw table.
Backfill one table
When rows in a Source table changed without moving their cursor forward (a fix-up script, a late
import), the next run does not see them. adops backfill reloads them without a Full Refresh:
adops backfill shop_sync orders --from 2026-02-01 --env stage
- It runs the whole Pipeline from its first Step, as
adops rundoes. Only the named table goes back: it reloads every Source row whose cursor is at or after--fromand merges them by primary key, so changed rows get their new values and no row is doubled. Every other table syncs as usual. After the run the table's cursor is back at the newest value, so the next run loads only new rows. --fromtakes a date (2026-02-01, from midnight) or a timestamp (2026-02-01T12:00). Without an offset such as+02:00, it is read in the Project'stimezonefromadops.yaml.- Only an incremental table can be backfilled, and its cursor column must be a date or a timestamp.
- It needs no Server pause. If the same Pipeline is running, the backfill waits for it (up to 30 minutes), like any run.
- In stage and prod it is a real run: the Transform rebuilds and the Reverse Sync writes its Target.
Use
--env devto see the reload with only a Preview of the Reverse Sync. - It is a command for people only; the Assistant cannot start a backfill.
- Only the named table skips the
volume_anomalyCheck (its result readsvolume_anomaly skipped — a backfill run reloads this table), and its Load Record is marked as a backfill, so the big reload never counts toward its normal volume. Every other table in the run is still checked.
When the volume Check halts a run
In stage and prod, every Sync table has the built-in volume_anomaly Check
(ADR-0021). Once a table has 5 or more
past loads, it halts the run when a load writes at least 1,000 rows and more than 10 times the
median of the table's last 10 loads, or, for a Full Refresh table whose median is at least 1,000,
fewer than a tenth of it. An Incremental table never halts for loading few rows.
A halt does not undo the load. The rows are already in the Warehouse table; the halt only stops the Transform and the Reverse Sync from passing them on. Look at the table before deciding:
-
The volume is wrong (a duplicated export, a broken Source filter): fix the Source and do not skip the Check. A Full Refresh table is replaced by its next good load; an Incremental table keeps the rows it merged until you delete them.
-
The volume really changed (a new region, a bulk import that will keep coming): skip the Check for that table, with a reason, in the Pipeline file and promote it like any change:
- name: invoices mode: full_refresh primary_key: invoice_id skip_checks: checks: [volume_anomaly] reason: new region doubles invoices from March; remove after 6 loads at the new volumeKeep the skip until at least 6 of the table's last 10 passed loads are at the new volume. The halted loads were recorded as failed and do not count, so when you add the skip the table's history still holds only the old volume. If you remove the skip after one or two good loads, the next run compares against the old volume and halts again.
adops validatelists the skip until you remove it.
When two branches get the same Branch Environment
A Branch Environment's name is the branch name lower-cased, with every run of characters other than
letters and digits turned into _. So feature/new-orders and feature-new/orders both become
feature_new_orders, and two open pull requests on those branches share one Branch Environment:
each Branch run overwrites the other's tables, and closing either pull request drops the Branch
Environment of both.
To recover:
- Rename one of the branches so the names differ after that rule (for example
feature/new-orders-2) and open a new pull request from it; close the old one. Closing it drops the shared Branch Environment. - On the other pull request, open its latest
adops pull requestrun and click Re-run jobs, so its Branch Environment is built again.
To clean up by hand instead, run this on the stage Server machine, with <branch> being either branch
name, then rerun the remaining pull request's workflow as in step 2:
cd <your-server-folder>
sudo -u <runner-user> docker compose --profile server run --rm --no-deps dagster_daemon adops drop-branch <branch>
After a reboot: the Server starts by itself
The Server's containers have restart: unless-stopped, so Docker starts them again after the
machine reboots or a container crashes. The daemon then marks any run the reboot cut off as failed
and sends one alert for it. docker compose stop still keeps a container stopped.
adops init writes docker-compose.yml once, so a Server made with an older adops does not come
back after a reboot and never rotates its container logs. Run adops upgrade in the Project
repository: it replaces the x-logging block and the dagster_meta, dagster_daemon and
dagster_webserver services with the current ones. Merge its pull request, then rebuild the Server
with Upgrade a Server.
Back up the Server
A Server's state lives in .env, .adops/, server/, releases/, each Warehouse and the Dagster
metadata database. To back it up, or to rebuild a Server on a new machine, see
Back up and restore a Server.
Recorded trials
| Date | Where | Result |
|---|---|---|
| 2026-11-26 | Stage Server on a Mac (OrbStack, Postgres Warehouse), runner run with ./run.sh, a fresh private demo repository, Server image built from a wheel |
PR → Branch run, merge → stage and drop on close all passed. The first deploy failed at the reload step: the workflows asked Dagster for the location adops.interface.server, but Dagster names it adops.interface.server:defs. Fixed the same day. After that, merge → stage passed (22 s), a pull request adding a dbt model got a Branch run that deferred the unchanged Sync to stage and built only the Transform (17 s), and closing it dropped its schemas. Not yet tried: release → prod, a Linux runner as a service, root-owned .adops/ files, a reload during a run in progress. |
| 2026-11-27 | Prod Server on an AWS m7i-flex.large VM (Ubuntu 24.04, 2 cores, 8 GB), runner installed as a systemd service, a fresh private demo repository, Server image built from a wheel |
Release → prod passed. v0.1.0 made the first prod deploy (26 s; prod Warehouse built, 20 rows written to shop_prod). v0.2.0 added a dbt model and a schedule: line: the deploy updated the folder although Dagster had left root-owned files in .adops/ and server/logs (Git ignores them), the reload picked up the new Schedule as RUNNING without a container restart, and prod built the model (25 s). Required reviewers were refused on the private repository (GitHub Free). Not tried: a deploy while a run is in progress. |
| 2026-11-28 | Stage and prod Server on one Mac (OrbStack, Postgres Warehouse, Server on port 3300), one runner run with ./run.sh carrying both labels adops-stage and adops-prod, a fresh private demo repository created empty on GitHub, release-folder layout, Project made with adops init --demo and Server image built from the local wheel adops-0.3.1-py3-none-any.whl of commit dbfb6b8 (--build-arg ADOPS_PACKAGE=/build/adops-0.3.1-py3-none-any.whl), with schedule: "0 3 * * *" added |
First push, first pull request, changed-only stage and prod deploys and a failed-then-fixed deploy all passed. The Project's adops-stage.yml held the first-push if: before the first push. First push of main: an adops stage run appeared with its deploy job skipped (7 s); the runner, online, took no job. First pull request: its Branch run rebuilt every Step (sync_shop, transform_shop, reverse_sync_customer_stats all passed, none deferred) and went green (23 s). Merge → stage's first deploy ran in full (25 s). A merge changing only dbt/models/customer_orders.sql: step sync_shop: unchanged in stage, Transform and reverse sync reran (26 s). A merge adding a failing dbt test: sync_shop: unchanged in stage, transform_shop: check_failed, reverse_sync_customer_stats: skipped, job failed (25 s); the fix, an exact revert to the last good tree, reran from transform_shop with sync_shop: unchanged in stage, job green (25 s). Server switched to ADOPS_ENVIRONMENT=prod: release v0.1.0 ran prod in full (27 s, no prod fingerprints yet); release v0.2.0, changing only customer_orders.sql, printed step sync_shop: unchanged in prod and reran Transform and reverse sync (33 s). Not tried: a deploy while a run is in progress, a Linux runner, separate stage and prod machines. |
| 2026-11-28 | Stage and prod DuckDB Server on one AWS m7i-flex.large machine (Ubuntu 24.04, 2 cores, 8 GB, 20 GB disk, made by scripts/trial-ec2.sh), switched by ADOPS_ENVIRONMENT; one runner installed as a systemd service with labels adops-stage and adops-prod; a fresh private demo repository created empty; release-folder layout; stage and prod Warehouses switched to DuckDB files under .adops/ (dev kept its Postgres Warehouse); Server image built from the local wheel adops-0.3.2-py3-none-any.whl of commit 0942a4b plus fixes 1 and 2 below |
All 7 checks passed, after two bugs found by the trial were fixed. Building the Server image took 67 s and raised disk used from 3.3 GB to 5.6 GB (df -h; docker system df failed on Docker 29); the idle Server used 1.4 GB memory. Peaks below are memory used / CPU (100% = both cores) / root disk used, from scripts/trial-sample.sh (the trial ran a version that read CPU with vmstat; the committed one reads /proc/stat). 1. PR → Branch run: pass. All three Steps built, none deferred (22 s); 2.0 GB / 71% / 5.7 GB. 2. Merge → stage: pass. The first deploy ran in full (33 s); 2.2 GB / 72% / 5.7 GB. 4. Two Scheduled stage runs: pass. A pull request adding schedule: "* * * * *" deferred every Step, its merge deploy printed every Step unchanged in stage, and Scheduled runs 14:36:09–14:36:15 and 14:37:04–14:37:08 UTC succeeded; the first one came about 3 minutes after the deploy; 2.3 GB / 100% / 5.7 GB. 5. Schedule and Branch run on one DuckDB file: pass after fix 1. With 2,000,020 rows in shop.customers, a Scheduled run took about 2.5 minutes. Scheduled run 14:52:07–14:54:47 held the lock: /proc/locks showed one FLOCK ADVISORY WRITE on warehouse_stage.duckdb.lock, held by its worker, while the Branch run's adops run --all --branch rounded-total had been waiting for 21 s. The Branch job started 14:52:30, waited about 2 min 17 s, and went green at 14:55:00 with 2,000,020 customers, 100 orders and 20 customer_stats rows in its Branch schemas; 3.5 GB / 100% / 7.5 GB. The first attempt failed with WarehouseUnreachable. Fix 1: the waiting run got the flock about 0.2 s before the previous holder's DuckDB connection had closed. After getting the lock, a run now also waits up to 10 seconds for DuckDB to be able to open the file (the trial's image waited up to the whole lock timeout; the limit was added afterwards, so that a file kept open by a program outside adops still fails fast). 6. kill -9 during a run: pass after fix 2. kill -9 of the run worker, the process holding the flock (found in /proc/locks and docker top), 60 s into a Scheduled run, during the Sync of the 2-million-row table. Afterwards no flock remained and a flock -n probe got the lock. The DuckDB file opened with every table readable. The killed run was FAILURE, none was left STARTED, and the daemon restart's server-recover marked nothing. The next run failed load failed. Fix 2: dlt had kept the killed run's unfinished load package, and the next pipeline.run loaded only that package and then crashed. The Sync now finishes a leftover package before loading new data. Retest: killed at 15:12:37 mid-Sync with the package left behind; the next Scheduled run, 15:13:04–15:17:49, went green with 2,000,020 rows; 3.2 GB / 100% / 8.8 GB (the 8.8 GB includes a second Server image during a rebuild). 7. Breaking Change accepted: pass. A dev run (from a Mac through an SSH tunnel) and a stage run recorded an added customers.nickname that no model uses. After it was dropped, stage's Scheduled runs failed with Breaking Change in customers: nickname dropped. adops accept-schema shop_sync customers in dev wrote the accepted-change record, its pull request's Branch run was green (27 s), and the merge deploy (33 s) and the following Scheduled runs were green; 2.6 GB / 100% / 8.8 GB, read from the log of check 5's sampler, which was still running, cut to this check's window, 15:18–15:29 UTC, after the 2-million-row test data was deleted (the dev runs were on the Mac and are not counted). Merging the check-5 pull request next printed step sync_shop: unchanged in stage and reran only the Transform and reverse sync. 3. Release → prod: pass. Clean stop, ADOPS_ENVIRONMENT=prod, up -d --no-build. Release v0.1.0, made in the trial repository only, deployed prod green (15:31:59–15:32:39 UTC). The deploy printed orders 0 rows because prod's first Scheduled run, a minute earlier, had already loaded the 100 orders. The prod DuckDB file held 20 customers, 100 orders and 20 customer_stats rows. Prod had never seen nickname, so the record had nothing to accept there; 2.4 GB / 100% / 8.6 GB. No big bug was found: no run stuck in STARTED, no corrupt DuckDB file, no dlt type-mapping failure. Not tried: separate stage and prod machines, a machine with less than 8 GB, a Warehouse much larger than 2 million rows, a kill during dbt (both kills landed in the Sync). |
| 2026-12-01 to 2026-12-02 | Soak Trial on an AWS m7i-flex.large machine (Ubuntu 24.04, 2 cores, 8 GB, 19 GB root disk, made by scripts/trial-ec2.sh, 72 h shutdown armed). A stage Server ran on a Postgres Warehouse for about 24 h, 2026-12-01 05:00 to 2026-12-02 05:00 UTC, cut from a planned 48 h by the user. It had two Pipelines on one shop Source: events_sync every 7 minutes and shop_sync every 10 minutes, sharing one dbt project. A writer added Source rows every minute, alerts went to a local receiver, and the sampler took readings every few seconds. Image built from the wheel adops-0.4.1.dev1 of commit c0f2b8c, upgraded in place to dev2 (bd8e290), dev3 (b88c6ef) and dev4 (59464e5). Then a short DuckDB session on the same machine. Faults injected with scripts/soak/faults.sh and checked with scripts/soak/check_invariants.py (five Invariants) |
9 of 10 Faults passed; backfill-kill failed with a big bug; 3 small bugs fixed. Switching the Server to DuckDB found a second big bug. Run counts: events_sync 209 of 216 expected ticks succeeded (96.8%), shop_sync 137 of 144 (95.1%), no run left STARTED. 1. source-stop: pass. The Source was stopped under a scheduled run, which waited out its 300 s retry and ended SUCCESS with no alert. 2. reboot-in-retry: pass after fix 1. First try: no container came back after the reboot. Fix 1 (bd8e290): restart: unless-stopped in both compose templates. Rerun: the Server came back by itself, the cut-off run was marked failed with one alert, and the next ticks succeeded. 3. kill-worker: pass after fix 2. kill -9 of a run worker with 300,000 orders rows pending: the run went FAILURE with 0 alerts. Fix 2 (b88c6ef): a sensor alerts once for a run whose process stopped before it finished. Rerun: the checker first read the alerts before the sensor's alert arrived (fixed in the harness, a9f13e8); the recheck passed with 1 alert and a green next tick. 4. backfill-overlap: pass. A backfill waited for a scheduled run, and a tick waited for a backfill; both passed. 5. backfill-kill: fail, big bug. docker kill of an adops backfill left its Dagster run STARTED, so the Schedule skips the Pipeline with no alert until dagster_daemon restarts. All five Invariants passed. 6. overlap-old-release: pass. A run of the old release was held at its Transform through 3 newer releases: releases/local was kept, the run and the deploy passed, and the saved fingerprints equal the newest release. 7. overlap-queued-run: pass. A scheduled run of the old code, queued behind a deploy, ended SUCCESS, and the next tick ran the new release. 8. backup-under-load: pass. See the 2026-12-01 Recorded trial in Back up and restore a Server. 9. disk-full: pass. The root disk was filled for 11 minutes: 2 runs failed with 1 alert each, and the next ticks were green once the file was removed. 10. DuckDB deploy-while-running: pass, after a big bug in the switch to DuckDB. The Postgres Server was stopped with no run in progress, and the stage block was switched to DuckDB and released (3465903; release shas here are commits of the soak Project's deploy checkout, not of adops). That release's own deploy run failed, because adops run --all ran events_sync first and its Transform needs shop_sync's tables. The first shop_sync load then failed: Table with name orders does not exist. The old dlt state in .adops/dlt/stage had made dlt skip creating raw_shop.orders. After that state and the DuckDB file were moved aside, both Pipelines loaded in full. With 2,000,000 extra customers rows, scheduled run 25d9b7b4 held the DuckDB lock. The deploy of release ce398a9 waited 143 s for it and then passed, the held run ended SUCCESS, and the next tick ran ce398a9. The Invariant Checker had to be rerun between ticks to get five PASS lines. Resources (scripts/trial-sample.sh trend): peak memory 2,650 MB; memory +4.7 and +3.9 MB/h in the two no-Fault windows (19:00–00:00 and 00:00–05:00 UTC); disk peak 18,752 MB, during disk-full. Stores still growing in those windows: dlt loaded packages +1.6 MB/h, fixed by fix 3 (59464e5, dlt's loaded packages removed after each Sync); container logs +0.2 and +0.3 MB/h, fixed in c63b367 (log rotation, 3 × 10 MB); Dagster metadata volume +0.7 and +0.6 MB/h and run logs +0.3 and +0.2 MB/h, a big bug. TransformBusyError 0 and dlt _dlt_* first-creation race 0 in the run logs. Harness fixes, not adops bugs: 3cdeba2, a9f13e8, 0015cc2, 8c9d22b, f68cad0, 80fca30, 1019327; playbook fix edbe07e. Big bugs deferred: a killed CLI run left STARTED, no retention for Dagster history, and switching a Server's Warehouse in place (briefs below). Teardown: scripts/trial-ec2.sh down deleted the machine, its security group, key pair and Budget, and its leftovers report printed No adops-trial resources are left.; a second run printed the same. Not tried on the soak machine: 48 h of growth, a truly simultaneous first load of two new Pipelines, a pending dlt package across a release switch, a dbt build near the 30-minute dbt Lock wait, and a DuckDB Server backup under load. The simultaneous first load and the dbt Lock wait were later tested on a local Postgres (answers 1 and 7 below). |
The 2026-11-26 and 2026-11-27 trials used the earlier deploy, which moved the Server folder with
git checkout and so could change files under a run in progress. The 2026-11-28 trial used the
release-folder deploy (copy into releases/<commit>, switch current), built for that case. The 2026-12-01 Soak Trial tried a
deploy during a run in progress on both a Postgres and a DuckDB Server.
What the 2026-12-01 soak answered
Twelve questions were left open by the parallel-Pipelines work (horizon 24). Each answer below
names the Fault, figure or file in soak-evidence/horizon-25/ it rests on. That folder is
git-ignored, because raw outputs can hold hostnames, IPs or .env values.
- Can two brand-new Pipelines race on dlt's own first creation of
_dlt_loads,_dlt_versionand_dlt_pipeline_statein a freshraw_<source>? Not seen: 0 run-log lines and 0 runs with a duplicate-key or already-exists error on a_dlt_table in the 24 h (13-run-log-counts.txt). The soak itself loaded the two Pipelines one after the other. Horizon 32 forced the truly simultaneous first load on a local Postgres, with both loads held at the same point before creating the schema and again before creating the tables (tests/unit/infrastructure/test_parallel_runs_postgres.py). It failed: the second load stopped withduplicate key value violates unique constraint "pg_namespace_nspname_index"onraw_shop. The losing load is now loaded again (dlt documents this retry as safe). With that fix both loads pass, and the schema holds each data table and_dlt_loads,_dlt_versionand_dlt_pipeline_stateexactly once. On DuckDB every run takes the file lock, so the race cannot happen there. - After a Source stop, a full disk or a reboot, can the dlt state restored from the Warehouse
hold a cursor that is older than the loaded data (duplicates) or newer (skipped rows)? Not
seen.
no-duplicate-primary-keysandcursor-never-moves-backpassed after source-stop (02-source-stop.txt), reboot-in-retry (03-reboot-in-retry.rerun-1300.txt), kill-worker (04-kill-worker.recheck.txt) and disk-full (10-disk-full.txt). - After a load is killed with a dlt package pending, does the next run replay it, drop it or
fail, and does the cursor agree? The next run finishes the leftover package (the 2026-11-28
fix 2) and passes. In kill-worker the run worker was killed with 300,000 new
ordersrows pending; the nextshop_synctick succeeded, and both data Invariants passed (04-kill-worker.recheck.txt). The killed run itself ended FAILURE with no alert, which was a small bug, fixed inb88c6ef. Since horizon 32 the next run replays such a Pending Load Package only when the Warehouse has its tables, and otherwise drops it, prints oneDropped an unfinished load for <table>line and reads those rows again. Unit tests cover a package pending across a release switch (replayed, no row lost or doubled) and one pending for a new DuckDB or Postgres Warehouse (dropped, every Source row loaded), intests/unit/infrastructure/test_dlt_sync.py. A live release switch with a package pending was not tried. - h17 overlap: a scheduled run on the old release finishes after a changed-only deploy. Does it
save Step Fingerprints that no longer match? No. overlap-old-release held an old-release run
at its Transform through 3 newer releases.
releases/localwas kept while the run used it, the run ended SUCCESS, the deploy run passed, and the saved fingerprints of both Pipelines equal the newest releasec41ffdc(07-overlap-old-release.rerun-1651.txt). - h17 overlap: plan_deploy reads fingerprints before it takes the lock. Closed in code since
horizon 18 (
34cf2ab): the deploy run now builds its Deploy Plan inside the Pipeline Lock. The case still open was tested in its place, a scheduled run of the old code queued behind the deploy's lock. It ended SUCCESS, the fingerprints equal the new release, and the next tick ran the new release (08-overlap-queued-run.txt). - Deploy while a run is in progress on a DuckDB Server. Tried on 2026-12-02 and passed. After the switch to a DuckDB
stage Warehouse, 2,000,000 rows were added to
shop.customers, and scheduledshop_syncrun25d9b7b4held the DuckDB file lock from 06:50:06 UTC. Releasece398a9was made, the Server reloaded, and the deploy run waited for the lock. It exited 0 after 143 s, the held run ended SUCCESS, and the next tick (07:00:08) carriedadops/releasece398a9(18-duckdb-deploy-while-running.txt). The checker run right after the Fault left 3 Invariants NOT CHECKED, because runs kept the file locked. Rerun between ticks, all five passed (18-duckdb-deploy-while-running.recheck.txt). No file-lock release race was seen. - Does a long dbt build push other Pipelines' Transforms past the 30-minute dbt Lock wait into
TransformBusyError? Not in 24 h: 0 TransformBusyError lines in the run logs
(
13-run-log-counts.txt). The dbt builds there took seconds. Horizon 32 tested the wait itself on a local Postgres, with the wait shortened to a few seconds: while another process holds the dbt Lock, a Transform fails with TransformBusyError when its wait runs out and never starts dbt, and it builds once the holder lets go within the wait (tests/unit/infrastructure/test_parallel_runs_postgres.py). The wait stays 30 minutes and is still not retried. How often real builds come near it depends on how long the Project's dbt builds take. - Can a Sync from Pipeline B that loads raw tables while Pipeline A's Transform reads them give
half-loaded inputs? Not seen in the Server runs. The only 2 STEP_FAILURE events in 24 h were
both during disk-full (
13-run-log-counts.txt), andload-records-matchpassed after every Fault. A related effect was seen outside adops: a Postgres query that started while dbt swapped in a rebuilt table read it as empty. The soak's backup check now counts rows only between runs (80fca30). Horizon 32 forced the overlap on a local Postgres: a Sync was held just before it committed its load while another Pipeline's Transform built from the same raw table (tests/unit/infrastructure/test_parallel_runs_postgres.py). An incremental load passed: it is merged in one transaction, so dbt read the whole old table. A full refresh failed: dlt empties the table and commits that before it inserts the new rows, so dbt read 0 rows. Since then a full refresh on Postgres is loaded into the staging schema and replaces the table in one transaction; dbt now waits for that transaction and then reads the whole new table. The cost is a second copy of each full-refresh table inraw_<source>_staging. - If a reboot hits during the 300 s retry wait, is the result FAILURE, one alert and a green
next tick? Yes, once the Server comes back. On the first try it did not come back: no
container had a
restart:policy, so a reboot needed a manual Server start (03-reboot-in-retry.txt). That small bug was fixed inbd8e290(restart: unless-stopped). Existing Servers need the compose edit in "After a reboot" above (edbe07e). On the rerun the Server came back by itself, the cut-off run was marked failed,one-alert-per-failed-runpassed, and the next ticks succeeded (03-reboot-in-retry.rerun-1300.txt). A crash-surviving resume tag is not warranted: the loss is one failed run and its alert. - Does a backfill that overlaps a scheduled run, or a crash mid-backfill, leave the cursor
rewound? No. In backfill-overlap the backfill waited for the scheduled run, a tick waited
for the backfill, and both passed (
05-backfill-overlap.rerun-1545.txt). In backfill-kill the cursor did not stay below its pre-backfill value. Big bug, not fixed: a killedadops backfill(oradops run) leaves its Dagster run STARTED, so the Schedule skips that Pipeline with no alert untildagster_daemonrestarts (06-backfill-kill.finding.md). - Does the backup playbook still restore a consistent Server when the backup is taken during
parallel runs? Yes at the database level: see the 2026-12-01 Recorded trial in
Back up and restore a Server
(
09-backup-under-load.rerun-1821.txt). Automated backups are not warranted as an adops feature by this soak. The playbook's dump commands worked during runs, so a cron job running them is enough. A DuckDB Server still has to stop for its copy. - Do the Postgres Server's memory and disk stay bounded over days? Only 24 h were run
(
12-sampler-trend.txt). Peak memory was 2,650 MB, and it grew +4.7 and +3.9 MB/h in the two no-Fault windows (12b-sampler-trend-quiet.txt). dlt's loaded packages grew 1.6 MB/h and were fixed in59464e5, container logs grew +0.2–0.3 MB/h and were fixed inc63b367, and Dagster run history (+0.6–0.7 MB/h) and run logs (+0.2–0.3 MB/h) are a big bug, below. The 18,752 MB disk peak is the disk-full Fault's fill file.
A retry e2e test is not warranted now. source-stop drove a real retry on the Server: the run
waited out the 300 s retry wait with the Source back and ended SUCCESS (02-source-stop.txt), and
the retry logic has unit tests. The CI e2e jobs run up to 20 minutes, and a 300 s wait would take
a large share of that.
Big bugs for the next horizon:
- Killed CLI run left STARTED. What fails: a
docker killedadops backfilloradops runin the Server image leaves its Dagster run STARTED, and the Schedule then skips the Pipeline with no alert. Evidence:06-backfill-kill.txt,06-backfill-kill.finding.md. Suggested scope: a run liveness signal, such as a session advisory lock held from the run's first moment that the Schedule or a sensor can probe, plus an alert for a STARTED run that has lost it. - No retention for Dagster history. What fails:
event_logs, schedule ticks and compute logs are never expired, which comes to about 5–6 GB a year of metadata and 2–3 GB of run logs at the soak's rates, on a 19 GB disk. Evidence:12b-sampler-trend-quiet.txt,15-growth-without-retention.finding.md. Suggested scope: a retention setting with a default and a daily purge job (instance.delete_runplus the compute-log folders), with tests and docs. - Switching a Server's Warehouse in place. What fails: changing
type: postgrestotype: duckdbfor an Environment that has already run keeps.adops/dlt/<env>. On the firstshop_syncload into the new DuckDB file, dlt createdraw_shop.customersbut notraw_shop.orders(the failed load package'sapplied_schema_updates.jsonwas{}), and the merge failed withTable with name orders does not exist. dlt then stored that schema's hash in the new_dlt_version, so later runs would keep failing. Moving.adops/dlt/<env>and the new DuckDB file aside and loading again fixed it. Evidence:17-duckdb-switch.txt. Suggested scope: when the Warehouse block of an Environment changes, have adops start the dlt pipelines of that Environment afresh (or refuse, naming the folder to clear), and document how to move a Server to another Warehouse; with an e2e test. Status: horizon 26 moves a stamped folder aside on a Warehouse Switch. Since horizon 32 an unstamped folder, made before those stamps, is moved aside too when none of the running Pipeline's raw tables are in the new Warehouse. The unit testtest_an_upgraded_project_switched_to_a_new_duckdb_file_loads_every_source_rowreplays this case with a pendingordersload and two Pipelines on one Source; it fails without the change.