Upgrade a Server
Use this playbook when a stage or prod deploy stops with
This commit changes the Server config: <files>. That happens after you merge the pull request
that adops upgrade made, or any commit that changes Dockerfile, docker-compose.yml or a
server/*.yaml file.
Those files sit at the root of <your-server-folder>. Every release folder shares them, and Docker
reads them only when it builds and starts the containers. A deploy never changes them, because that
would restart the Server under a run in progress. So adops server-release stops, changes no file,
and you rebuild the Server once by hand. The Dockerfile holds the adops version the Server runs
(ARG ADOPS_PACKAGE=adops==<version>), so a new version reaches the Server only through this
rebuild.
Before you start
- The Server folder must already use release folders: it has a
releases/folder and acurrentlink. If the deploy stopped with... has the old layout ...or... is half moved ..., first do One-time move to release folders, then come back. - Find
<commit>: the commit the stopped deploy was deploying. It is the merge commit of the pull request, shown at the top of the deploy's run page under Actions.
Rebuild the Server at the merged commit
Run these on the Server machine, not on your own checkout.
-
Make sure no run is in progress: on the Dagster page, open Runs; nothing may be Queued, Starting or Started. A rebuild restarts the Server, and a restart kills runs in progress.
-
Bring the Server config files to that commit.
git restorealso deletes aserver/*.yamlfile the commit removed:cd <your-server-folder> sudo -u <runner-user> git fetch origin sudo -u <runner-user> git restore --source=<commit> --worktree -- Dockerfile docker-compose.yml server -
Build the new image and restart the Server.
--buildis what installs the new adops version; without it the old image keeps running and the next deploy stops again.--waitreturns once every container is running and healthy, and fails if one is not:sudo -u <runner-user> COMPOSE_PROFILES=server docker compose up -d --build --waitIf you also run Grafana on this Server, use
COMPOSE_PROFILES=server,grafana. -
Check it worked. Every service shows
running(andhealthyfordagster_meta), and the version printed is the one on theARG ADOPS_PACKAGEline of theDockerfile:sudo -u <runner-user> docker compose --profile server ps sudo -u <runner-user> docker compose --profile server exec dagster_daemon adops --version grep ADOPS_PACKAGE= Dockerfile
Re-run the deploy
Open the deploy that stopped (under Actions in the Project repository) and click
Re-run jobs. The files now match, so adops server-release goes on; its log ends with
current: releases/<commit>.