Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 0 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -136,36 +136,6 @@ jobs:
- name: evaluate every check
run: nix flake check --no-build .

# The guard around the deploy script (`deploy/deploy.py`) and the public
# demo's front under a real nginx (`deploy/test_front_limits.py`): the
# checks here that are not Cargo targets. Stdlib Python and nginx, so the runner
# needs nothing but nix.
- name: the public demo's deploy guard
run: nix build .#checks.x86_64-linux.prod-deploy --no-link --print-build-logs

# The other root command the CI user on that box may run
# (`deploy/install_shape.py`): the shape arrives on stdin, only `compose.yaml`
# and `proxy/` are accepted, and every other name, link, device and
# traversing path is refused with the box untouched.
- name: the public demo's shape installer
run: nix build .#checks.x86_64-linux.prod-shape --no-link --print-build-logs

# The public demo's front, under its real configuration and a real nginx, in
# both halves: `test_front_limits.py` measures whether a source is refused and
# whether one metered endpoint can spend another's budget, and `check-front.sh`
# reads the front's own answers back out of the bytes it serves — a missing
# path answered with this instance's not-found page where the page container's
# 404 would otherwise arrive, and a request naming a host this front is not the
# server for closed rather than served. Every one is about a running proxy, and
# none is readable from the configuration.
- name: the public demo's front
run: nix build .#checks.x86_64-linux.prod-front --no-link --print-build-logs

# The command lines the tracked compose shapes give the server, run against
# the binary: a value it refuses is a container that exits 2 and
# restart-loops.
- name: the deployed command line
run: nix build .#checks.x86_64-linux.deploy-args --no-link --print-build-logs

# The command this repository's release workflow runs before it commits a
# version (`scripts/bump-version.sh`): a bump word in, the next version on the
Expand All @@ -174,25 +144,6 @@ jobs:
- name: the version bump
run: nix build .#checks.x86_64-linux.bump-version --no-link --print-build-logs

# The deploy workflow's verification (`scripts/verify_deploy.py`): the origin,
# read on the box through the front over the SSH path the deploy itself used,
# is the assertion — a version other than the one asked for, or a page that
# stops answering, fails the run — while the public read is only reported,
# because an edge answers a programmatic client on a datacenter address with a
# managed challenge. The suite drives the poll loops with injected reads and
# the `ssh`/`curl`-facing edges against stand-ins on `PATH`, so it needs no
# network, no token and no live deploy.
- name: the deploy workflow's verification
run: nix build .#checks.x86_64-linux.deploy-verify --no-link --print-build-logs

# The watcher the release's last step runs (`scripts/wait_for_deploy.py`):
# `gh workflow run` prints no run id, so the run to wait on is the newest
# one of the workflow that is not the newest seen before the dispatch, and
# the release fails unless it concludes `success`. The suite drives the poll
# loops with injected reads and the `gh`-facing edges against a stand-in on
# `PATH`, so it needs no network, no token and no real run.
- name: the release's wait for its deploy
run: nix build .#checks.x86_64-linux.deploy-wait --no-link --print-build-logs

# The guard around a workflow's `dry_run` input (`scripts/check_dry_run_gating.py`):
# a plan step prints what a real run would do, and every step after it has to be
Expand Down
304 changes: 0 additions & 304 deletions .github/workflows/deploy-prod.yml

This file was deleted.

3 changes: 1 addition & 2 deletions .github/workflows/image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,7 @@ jobs:
context: .
platforms: linux/amd64,linux/arm64
push: true
# A prerelease never moves `latest`: the public demo follows it
# unapproved (`deploy-prod.yml`), and a blank line here is no tag.
# A prerelease never moves `latest`: a blank line here is no tag.
tags: |
ghcr.io/selvage-protocol/selvaged:${{ steps.tags.outputs.name }}
ghcr.io/selvage-protocol/selvaged:${{ steps.tags.outputs.version }}
Expand Down
49 changes: 8 additions & 41 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: release

# The button that cuts a release: the bump word in, and the version, the tag, the
# image and the public demo's pin out.
# The button that cuts a release: the bump word in, and the version, the tag and the
# image out.
#
# A manual dispatch takes `patch`, `minor` or `major`, computes the next version
# from the one `Cargo.toml` already carries, and **refuses unless that version is
Expand All @@ -27,15 +27,10 @@ name: release
# commit that is about to land, before anything is pushed.
#
# Every event a workflow creates with that token is invisible to Actions, so the
# tag push starts nothing either and the two dispatches below are explicit:
# tag push starts nothing either, so the dispatch below is explicit:
# `gh workflow run image.yml --ref "v<version>"` is the event the loop-prevention
# rule exempts, and `deploy-prod.yml` is asked for by name once the image it names
# actually exists on GHCR. That last dispatch is watched: `gh workflow run` prints
# no run id, so `scripts/wait_for_deploy.py` reads the workflow's runs, dispatches,
# and waits for the run the dispatch created — a release that says the demo moved
# fails unless that run concludes `success`, rather than standing green beside a
# red deploy. `deploy-prod.yml` does its own verification of what the box serves;
# this workflow reads the run's conclusion and does not repeat it.
# rule exempts. The release waits for that image to exist on GHCR before it
# reports success.
#
# `dry_run` stops before the first write — before the tree is touched, the gate
# runs, anything is pushed or anything is dispatched — and prints the whole plan. A
Expand Down Expand Up @@ -178,8 +173,6 @@ jobs:
publish: image.yml dispatched at v$NEXT, then
ghcr.io/selvage-protocol/selvaged:$NEXT waited for (an anonymous read,
polled with a 45-minute deadline)
deploy: deploy-prod.yml at main with server_version=$NEXT, and install_shape=true
if deploy/ changed since v$CURRENT
EOF

release:
Expand All @@ -192,7 +185,7 @@ jobs:
# seen this flake, and the image it publishes is waited for afterwards.
timeout-minutes: 90
# `contents: write` pushes the bump and the tag; `actions: write` is what lets
# this run dispatch `image.yml` and `deploy-prod.yml` at all.
# this run dispatch `image.yml` at all.
permissions:
contents: write
actions: write
Expand All @@ -201,8 +194,7 @@ jobs:
with:
# The token in `.git/config` is what pushes the bump and the tag below.
persist-credentials: true
# Every tag, and the whole history: the last step compares `deploy/`
# against the previous release's tag, which has to be a local ref for it.
# Tags and full history are read by the release guards below.
fetch-depth: 0

# A release-only retry can reuse a successful plan after remote tags changed.
Expand Down Expand Up @@ -287,8 +279,7 @@ jobs:
gh workflow run image.yml --ref "$tag"

# A green `publish` job is not the image existing: the run is queued before
# the build starts, and the deploy below names a tag that has to be in the
# registry by then. So this waits on the registry itself, anonymously, and a
# the build starts, so this waits on the registry itself, anonymously, and a
# deadline that cannot pass says what it last saw rather than looking hung.
- name: wait for the image this release published
env:
Expand Down Expand Up @@ -328,27 +319,3 @@ jobs:
sleep 20
done

# The bump is pushed and the image exists; what is left is the public demo.
# `deploy-prod.yml` changes the tag `/srv/selvage/.env` names for `selvaged`,
# and installs the box's shape when this release moved one. `gh workflow run`
# prints no run id, so `scripts/wait_for_deploy.py` reads the workflow's runs,
# dispatches, and waits for the run this dispatch created: this step fails
# unless that run concludes `success`, which is what keeps a green release from
# standing beside a red deploy. The deploy verifies the origin itself, so
# nothing here re-reads `/meta`.
- name: hand the release to the public demo, and fail when the deploy fails
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
VERSION: ${{ needs.plan.outputs.version }}
PREVIOUS: ${{ needs.plan.outputs.current }}
run: |
set -euo pipefail
args=(-f "server_version=$VERSION")
# What changed since the *last release*, not since the bump: the bump
# touches no file of the shape, and `$GITHUB_SHA` is the commit this run
# was dispatched at, which is the one before it.
if [ -n "$(git diff --name-only "v$PREVIOUS" "$GITHUB_SHA" -- deploy/)" ]; then
args+=(-f install_shape=true)
echo "deploy/ changed since v$PREVIOUS; the box's shape is installed as part of the deploy"
fi
scripts/wait_for_deploy.py --dispatch --workflow deploy-prod.yml --ref main "${args[@]}"
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ with its default. `--version` prints `selvaged/<version>`.
- [The server's shape](docs/the-server.md): rooms in memory, the grace period and `/meta`.
- [The first room](docs/rooms.md): who mints a room, and which clients host or join.
- [Deploying](docs/deploying.md): the addresses a client dials, the bind and TLS.
- [Operating the demo](docs/operating-the-demo.md): provisioning, the CI privilege boundary, verification, and recovery.
- [Publishing](docs/publishing.md): version tags, release gates, and partial-release recovery.
- [Serving the page](docs/serving-the-page.md): `--serve-page` and the served headers.
- [Licence](docs/licence.md): what each path is under, and what the image carries.
Expand Down
3 changes: 1 addition & 2 deletions compose.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
# Self-host for someone evaluating selvage on their own machine: two containers
# on loopback — the server, and the page image relaying to it. The public demo's
# shape is in `deploy/`.
# on loopback — the server, and the page image relaying to it.
#
# No volumes: the server is memory-only and the page is served from the page
# image, so there is nothing to persist and nothing to mount.
Expand Down
13 changes: 0 additions & 13 deletions deploy/.env.example

This file was deleted.

Loading