chadtmiller.com/monolith
An atproto PDS
0
0
Releases publish the image and the binary, from change files
.changeset/releases-are-published.mdnew+7−0
| @@ -0,0 +1,7 @@ | ||
--- | ||
default: minor | ||
--- | ||
| ||
# Each version is published as an image and a binary | ||
| ||
Each release is published as the image `knotless.dev/chadtmiller.com/monolith`, tagged with its version and `latest`, and as the `pds` binary for Linux x86-64 on the repository's releases page, with its SHA-256. The image's labels name its version and the commit it was built from, and `/xrpc/_health` answers its version. | ||
.knotless/workflows/release-pull.ymlnew+122−0
| @@ -0,0 +1,122 @@ | ||
# Keeps one pull open that releases the server, as knotless's own does: | ||
# each day, when main has change files, it runs `knope release` on main's | ||
# tip and force-pushes the commit to `release/next`, opening a pull titled | ||
# `Release <version>`, or bringing the open one up to date. Queueing that | ||
# pull is the release: once it lands, release.yml publishes the version and | ||
# tags it. Nothing is queued here, so when to release stays the owner's | ||
# call. | ||
# | ||
# The version is worked out here and given to knope with | ||
# --override-version: a change file's `minor` or `major` raises 0.x's | ||
# minor, where knope would raise the patch, and a `patch` the patch; from | ||
# 1.0 on, each raises its own part. A pull already holding main's change | ||
# files, and still merging with main, is left alone, so its checks run | ||
# again only when what it releases changes. The open pull is found by its | ||
# title, `Release x.y.z` by the owner, so one cut by hand is taken over, its | ||
# head pointed at release/next. | ||
# | ||
# Ask for it at once with `knotless run rerun | ||
# knotless://chadtmiller.com/monolith --ref refs/heads/main --workflow | ||
# release-pull`. Asked for on any other branch, it makes the release commit | ||
# there and prints the pull's body, pushing nothing. | ||
# | ||
# RELEASE_PASSWORD is release.yml's app password of the owner's, sealed to | ||
# this runner for pushes to main alone. | ||
image: node:24.22.1 | ||
runners: [runner.knotless.dev] | ||
on: | ||
schedule: | ||
- cron: '0 6 * * *' | ||
asked: {refs: [refs/heads/*]} | ||
secrets: [RELEASE_PASSWORD] | ||
env: | ||
REPO: knotless://chadtmiller.com/monolith | ||
OWNER: chadtmiller.com | ||
BRANCH: release/next | ||
KNOTLESS_APPVIEW: https://knotless.dev | ||
KNOPE_VERSION: 0.23.2 | ||
KNOPE_SHA256: c64f6281e012fc8e046ebd6f30be76c583e88b9ad55b00c7b1809b030db92eee | ||
steps: | ||
- name: changes | ||
run: | | ||
set -- .changeset/*.md | ||
if [ ! -e "$1" ]; then | ||
echo "no change files at $KNOTLESS_RUN_REF: nothing to release" | ||
touch ~/.done | ||
fi | ||
- name: tools | ||
run: | | ||
[ ! -e ~/.done ] || exit 0 | ||
cd /tmp | ||
curl -fsSLO "https://github.com/knope-dev/knope/releases/download/knope/v$KNOPE_VERSION/knope-x86_64-unknown-linux-musl.tgz" | ||
echo "$KNOPE_SHA256 knope-x86_64-unknown-linux-musl.tgz" | sha256sum -c - | ||
tar -xzf knope-x86_64-unknown-linux-musl.tgz | ||
install knope-x86_64-unknown-linux-musl/knope /usr/local/bin/ | ||
curl -fsSL https://knotless.dev/install.sh | KNOTLESS_INSTALL_DIR=/usr/local/bin sh | ||
- name: release commit | ||
run: | | ||
[ ! -e ~/.done ] || exit 0 | ||
set -- .changeset/*.md | ||
count=$# | ||
bumps=$(sed -n 's/^default: *//p' "$@") | ||
current=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1) | ||
IFS=. read -r major minor patch <<EOF | ||
$current | ||
EOF | ||
if echo "$bumps" | grep -qx major && [ "$major" != 0 ]; then | ||
version=$((major + 1)).0.0 | ||
elif echo "$bumps" | grep -qxE 'major|minor'; then | ||
version=$major.$((minor + 1)).0 | ||
else | ||
version=$major.$minor.$((patch + 1)) | ||
fi | ||
echo "$version" > ~/.version | ||
knope release --override-version "$version" | ||
git -c user.name=monolith -c user.email=monolith@knotless.invalid commit -aqm "Release $version" | ||
at=$(echo "$KNOTLESS_RUN_SHA" | cut -c1-12) | ||
notes=$(awk -v v="$version" '/^## / { on = ($2 == v); next } on' CHANGELOG.md) | ||
cat > ~/.body <<EOF | ||
Releases Monolith $version, from the $count change files on main: its changelog is below. Queue this pull to release it; once it lands, release.yml publishes the image and the binary and tags the commit. release-pull.yml keeps it up to date as change files land. | ||
| ||
<details> | ||
<summary>release-pull.yml</summary> | ||
| ||
## What changes | ||
| ||
Monolith $version, as \`knope release --override-version $version\` makes it from main at $at: the workspace version from $current to $version in Cargo.toml and the crates' Cargo.lock entries, the version's CHANGELOG.md section, and the change files removed. | ||
| ||
$notes | ||
| ||
## Why | ||
| ||
Those who run Monolith get main's changes only from a release. A 0.x minor change raises the minor here, where knope alone would raise the patch. | ||
| ||
## How it was checked | ||
| ||
The gates run on this pull, as on any. \`harness/upgrade/\` is written again from the tagged release afterwards, as docs/guide/contributing.md, "Releases", says. | ||
| ||
</details> | ||
EOF | ||
cat ~/.body | ||
- name: pull | ||
on: {refs: [refs/heads/main]} | ||
run: | | ||
[ ! -e ~/.done ] || exit 0 | ||
version=$(cat ~/.version) | ||
export KNOTLESS_IDENTIFIER="$OWNER" KNOTLESS_PASSWORD="$RELEASE_PASSWORD" | ||
pull=$(knotless pull list "$REPO" -q "is:pull state:open author:$OWNER Release" | | ||
awk -F '\t' '$4 ~ /^Release [0-9]+\.[0-9]+\.[0-9]+$/ { print $3; exit }') | ||
if [ -n "$pull" ] && git fetch -q "$REPO" "refs/heads/$BRANCH" && | ||
[ "$(git rev-parse "FETCH_HEAD^:.changeset")" = "$(git rev-parse "$KNOTLESS_RUN_SHA:.changeset")" ] && | ||
git merge-tree --write-tree "$KNOTLESS_RUN_SHA" FETCH_HEAD > /dev/null; then | ||
echo "$pull releases main's change files already and merges with main: nothing to push" | ||
exit 0 | ||
fi | ||
git push -q --force "$REPO" "HEAD:refs/heads/$BRANCH" | ||
if [ -z "$pull" ]; then | ||
knotless pull create "$REPO" main "$REPO" "$BRANCH" "Release $version" -m - < ~/.body | ||
else | ||
knotless pull retarget "$REPO" "$pull" --head "$BRANCH" | ||
knotless pull edit "$REPO" "$pull" --title "Release $version" -m - < ~/.body | ||
echo "updated $pull" | ||
fi | ||
.knotless/workflows/release.ymlnew+110−0
| @@ -0,0 +1,110 @@ | ||
# Publishes a version of the server once main's version, in Cargo.toml, has | ||
# no release yet and the gates have passed at its commit, as the releases | ||
# docs/guide/getting-started.md names: | ||
# | ||
# - the image, the release of the package `monolith`, named as the | ||
# repository: `docker pull knotless.dev/chadtmiller.com/monolith:<version>`; | ||
# - the binary for Linux x86-64, the release of the package `pds`: | ||
# pds-<version>-x86_64-linux.tar.gz and its .sha256. | ||
# | ||
# Each with the version's CHANGELOG.md section as its notes and the commit | ||
# it was built from; then the commit is tagged `v<version>`. The pages and | ||
# `pds` are built as the Dockerfile builds them, and the image made from the | ||
# binary with no container engine, which this runner's jobs have none of | ||
# (.knotless/image.sh). release-pull.yml keeps a pull open that raises the | ||
# version; once it lands, this publishes it. A package with that version | ||
# published already is left alone, so a run that published one of them | ||
# and failed publishes the other when it runs again. | ||
# | ||
# RELEASE_PASSWORD is an app password of the owner's, sealed to this runner | ||
# for pushes to main alone. Asked for on another branch, `knotless run | ||
# rerun knotless://chadtmiller.com/monolith --ref refs/heads/<branch> | ||
# --workflow release`, it builds both and publishes nothing. | ||
image: rust:1.98 | ||
runners: [runner.knotless.dev] | ||
on: | ||
push: {refs: [refs/heads/main], paths: [Cargo.toml]} | ||
asked: {refs: [refs/heads/*]} | ||
after: [gates] | ||
superseded: finish | ||
cache: [target, /usr/local/cargo/registry, /usr/local/rustup, /opt/node, /opt/tools, web/node_modules] | ||
secrets: [RELEASE_PASSWORD] | ||
env: | ||
REPO: knotless://chadtmiller.com/monolith | ||
KNOTLESS_APPVIEW: https://knotless.dev | ||
CRANE_VERSION: 0.22.1 | ||
CRANE_SHA256: 0ab7a1d6932a213aed964ce97666c3077fe691c8606413674a8b3e0b9ec4cda0 | ||
steps: | ||
- name: version | ||
run: | | ||
curl -fsSL https://knotless.dev/install.sh | KNOTLESS_INSTALL_DIR=/usr/local/bin sh | ||
version=$(sed -n 's/^version = "\(.*\)"/\1/p' Cargo.toml | head -1) | ||
echo "$version" > ~/.version | ||
published="" | ||
for package in monolith pds; do | ||
if knotless release list "$REPO" "$package" | cut -f2 | grep -qxF "$version"; then | ||
echo "$package $version is published already" | ||
published="$published $package" | ||
fi | ||
done | ||
echo "$published" > ~/.published | ||
if [ "$published" = " monolith pds" ]; then | ||
touch ~/.done | ||
elif [ "$KNOTLESS_RUN_REF" != refs/heads/main ]; then | ||
echo "on $KNOTLESS_RUN_REF: building $version, publishing nothing" | ||
fi | ||
- uses: chadtmiller.com/steps/node@1 | ||
with: {version: 24.22.1} | ||
- uses: chadtmiller.com/steps/npm-ci@1 | ||
with: {dir: web} | ||
# The pages, which pds-server embeds, then the server: as the Dockerfile's | ||
# stages build them. | ||
- name: build | ||
run: | | ||
[ ! -e ~/.done ] || exit 0 | ||
(cd web && PATH=/opt/node/bin:$PATH npm run build) | ||
cargo build --release --locked -p pds | ||
- name: files | ||
run: | | ||
[ ! -e ~/.done ] || exit 0 | ||
version=$(cat ~/.version) | ||
if [ "$(cat /opt/tools/.crane 2>/dev/null)" != "$CRANE_VERSION" ]; then | ||
mkdir -p /opt/tools/bin && cd /tmp | ||
curl -fsSLO "https://github.com/google/go-containerregistry/releases/download/v$CRANE_VERSION/go-containerregistry_Linux_x86_64.tar.gz" | ||
echo "$CRANE_SHA256 go-containerregistry_Linux_x86_64.tar.gz" | sha256sum -c - | ||
tar -xzf go-containerregistry_Linux_x86_64.tar.gz -C /opt/tools/bin crane | ||
echo "$CRANE_VERSION" > /opt/tools/.crane | ||
cd - > /dev/null | ||
fi | ||
command -v jq > /dev/null || { apt-get update -qq && apt-get install -y -qq --no-install-recommends jq > /dev/null; } | ||
rm -rf target/release-files && mkdir -p target/release-files | ||
# The binary, as getting-started.md downloads and checks it. | ||
name=pds-$version-x86_64-linux.tar.gz | ||
epoch=$(git log -1 --format=%ct HEAD) | ||
tar -C target/release -cf - --sort=name --mtime="@$epoch" --owner=0 --group=0 --numeric-owner pds | | ||
gzip -9n > "target/release-files/$name" | ||
(cd target/release-files && sha256sum "$name" > "$name.sha256" && cat "$name.sha256") | ||
# The image. | ||
PATH=/opt/tools/bin:$PATH SOURCE_DATE_EPOCH=$epoch \ | ||
.knotless/image.sh target/release/pds "$version" "$KNOTLESS_RUN_SHA" target/image | ||
- name: publish | ||
on: {refs: [refs/heads/main]} | ||
run: | | ||
[ ! -e ~/.done ] || exit 0 | ||
version=$(cat ~/.version) | ||
owner=${REPO#knotless://} | ||
export KNOTLESS_IDENTIFIER=${owner%%/*} KNOTLESS_PASSWORD="$RELEASE_PASSWORD" | ||
# The version's section of the changelog, less its heading. | ||
awk -v v="$version" '/^## / { on = ($2 == v); next } on' CHANGELOG.md > ~/.notes | ||
case "$(cat ~/.published)" in *pds*) ;; *) | ||
knotless release publish "$REPO" pds "$version" target/release-files/* --commit "$KNOTLESS_RUN_SHA" --notes - < ~/.notes ;; | ||
esac | ||
case "$(cat ~/.published)" in *monolith*) ;; *) | ||
knotless release publish "$REPO" monolith "$version" --oci target/image --commit "$KNOTLESS_RUN_SHA" --notes - < ~/.notes ;; | ||
esac | ||
# Tagged once published, at the commit it was built from. | ||
if knotless repo refs "$REPO" | cut -f2 | grep -qxF "refs/tags/v$version"; then | ||
echo "v$version is tagged already" | ||
else | ||
knotless tag create "$REPO" "v$version" "$KNOTLESS_RUN_SHA" | ||
fi | ||
.knotless/image.shnew+110−0
| @@ -0,0 +1,110 @@ | ||
#!/bin/sh | ||
# The server's image as an OCI image layout, made with no container engine, | ||
# as release.yml's runner gives its jobs none. It is the Dockerfile's last | ||
# stage: debian:trixie-slim for linux/amd64, as the registry has it when | ||
# this runs, and one layer more holding `pds` and its user, with the | ||
# Dockerfile's user, environment, volume, port, entry point and command. | ||
# The image's labels, and its manifest's annotations, name its version, the | ||
# commit it was built from and the base, by digest. | ||
# | ||
# SOURCE_DATE_EPOCH=<commit time> .knotless/image.sh <pds> <version> <commit> <dir> | ||
# | ||
# The layer's files and the image's dates are SOURCE_DATE_EPOCH's, so the | ||
# same binary on the same base makes the same image. Needs crane, jq, GNU | ||
# tar, gzip and sha256sum. | ||
set -eu | ||
| ||
bin=$1 version=$2 commit=$3 out=$4 | ||
: "${SOURCE_DATE_EPOCH:?the commit's time, in seconds}" | ||
base=debian:trixie-slim | ||
work=$(mktemp -d) | ||
trap 'rm -rf "$work"' EXIT | ||
| ||
blob() { echo "$work/base/blobs/sha256/${1#sha256:}"; } | ||
digest=$(crane digest --platform linux/amd64 "$base") | ||
crane pull --format=oci "$base@$digest" "$work/base" | ||
manifest=$(blob "$(jq -r '.manifests[0].digest' "$work/base/index.json")") | ||
jq -e '.mediaType == "application/vnd.oci.image.manifest.v1+json" | ||
and all(.layers[]; .mediaType == "application/vnd.oci.image.layer.v1.tar+gzip")' \ | ||
"$manifest" >/dev/null || { echo "$base@$digest: not an OCI image of gzipped layers" >&2; exit 1; } | ||
| ||
# The layer: what the Dockerfile's last stage adds to the base. Its | ||
# /etc/passwd and /etc/group are the base's with the user pds, 10001, and | ||
# its group, as the Dockerfile's groupadd and useradd make them. | ||
root="$work/root" | ||
mkdir -p "$root/usr/local/bin" "$root/data" | ||
install -m 755 "$bin" "$root/usr/local/bin/pds" | ||
for layer in $(jq -r '.layers[].digest' "$manifest"); do | ||
tar -xzf "$(blob "$layer")" -C "$root" --wildcards 'etc/passwd' 'etc/group' 2>/dev/null || true | ||
done | ||
[ -s "$root/etc/passwd" ] && [ -s "$root/etc/group" ] || { echo "no /etc/passwd or /etc/group in $base" >&2; exit 1; } | ||
echo 'pds:x:10001:10001::/data:/usr/sbin/nologin' >> "$root/etc/passwd" | ||
echo 'pds:x:10001:' >> "$root/etc/group" | ||
chown -R 0:0 "$root" | ||
chown 10001:10001 "$root/data" | ||
tar -C "$root" -cf "$work/layer.tar" --sort=name --mtime="@$SOURCE_DATE_EPOCH" \ | ||
--numeric-owner --format=posix --pax-option=delete=atime,delete=ctime etc usr data | ||
diff_id=$(sha256sum "$work/layer.tar" | cut -d' ' -f1) | ||
gzip -9n < "$work/layer.tar" > "$work/layer.tar.gz" | ||
| ||
created=$(date -u -d "@$SOURCE_DATE_EPOCH" +%Y-%m-%dT%H:%M:%SZ) | ||
jq --arg diff "sha256:$diff_id" --arg created "$created" \ | ||
--arg version "$version" --arg commit "$commit" --arg base "docker.io/library/$base" --arg digest "$digest" ' | ||
.created = $created | ||
| .rootfs.diff_ids += [$diff] | ||
| .history = (.history // []) + [{created: $created, created_by: "pds, and its user (.knotless/image.sh)"}] | ||
| .config.User = "pds" | ||
| .config.Env = (.config.Env // []) + ["PDS_PORT=2583", "PDS_BIND_ADDRESS=::", "PDS_DATA_DIR=/data"] | ||
| .config.Volumes = {"/data": {}} | ||
| .config.ExposedPorts = {"2583/tcp": {}} | ||
| .config.Entrypoint = ["pds"] | ||
| .config.Cmd = ["serve"] | ||
| .config.Labels = (.config.Labels // {}) + { | ||
"org.opencontainers.image.title": "monolith", | ||
"org.opencontainers.image.version": $version, | ||
"org.opencontainers.image.revision": $commit, | ||
"org.opencontainers.image.source": "https://knotless.dev/chadtmiller.com/monolith", | ||
"org.opencontainers.image.base.name": $base, | ||
"org.opencontainers.image.base.digest": $digest | ||
}' "$(blob "$(jq -r '.config.digest' "$manifest")")" > "$work/config.json" | ||
| ||
# The layout: the base's layers, the new one, the config, the manifest and | ||
# an index naming it alone. | ||
rm -rf "$out" | ||
mkdir -p "$out/blobs/sha256" | ||
put() { | ||
d=$(sha256sum "$1" | cut -d' ' -f1) | ||
cp "$1" "$out/blobs/sha256/$d" | ||
echo "$d $(wc -c < "$1" | tr -d ' ')" | ||
} | ||
for layer in $(jq -r '.layers[].digest' "$manifest"); do cp "$(blob "$layer")" "$out/blobs/sha256/"; done | ||
read -r layer_d layer_n <<EOF | ||
$(put "$work/layer.tar.gz") | ||
EOF | ||
read -r config_d config_n <<EOF | ||
$(put "$work/config.json") | ||
EOF | ||
jq --arg ld "sha256:$layer_d" --argjson ln "$layer_n" --arg cd "sha256:$config_d" --argjson cn "$config_n" \ | ||
--arg version "$version" --arg commit "$commit" --arg base "docker.io/library/$base" --arg digest "$digest" ' | ||
.config = {mediaType: "application/vnd.oci.image.config.v1+json", digest: $cd, size: $cn} | ||
| .layers += [{mediaType: "application/vnd.oci.image.layer.v1.tar+gzip", digest: $ld, size: $ln}] | ||
| .annotations = { | ||
"org.opencontainers.image.version": $version, | ||
"org.opencontainers.image.revision": $commit, | ||
"org.opencontainers.image.base.name": $base, | ||
"org.opencontainers.image.base.digest": $digest | ||
}' "$manifest" > "$work/manifest.json" | ||
read -r manifest_d manifest_n <<EOF | ||
$(put "$work/manifest.json") | ||
EOF | ||
jq -n --arg d "sha256:$manifest_d" --argjson n "$manifest_n" --arg version "$version" '{ | ||
schemaVersion: 2, | ||
mediaType: "application/vnd.oci.image.index.v1+json", | ||
manifests: [{ | ||
mediaType: "application/vnd.oci.image.manifest.v1+json", digest: $d, size: $n, | ||
platform: {architecture: "amd64", os: "linux"}, | ||
annotations: {"org.opencontainers.image.ref.name": $version} | ||
}] | ||
}' > "$out/index.json" | ||
echo '{"imageLayoutVersion":"1.0.0"}' > "$out/oci-layout" | ||
echo "$out: monolith $version at $commit on $base@$digest, manifest sha256:$manifest_d" | ||
.knotless/review.md+1−0
| @@ -1,6 +1,7 @@ | ||
This repository builds a PDS from specifications: agents build `crates/` from `spec/`, and `harness/` checks it against the reference PDS. Check that: | ||
| ||
- Every change in behaviour is in `spec/` (`PDS.md` or the page of its area beside it, `COMMANDS.md` or a lexicon) as well as in the code, and the README and `docs/` say what is built, not how it came to be built; a change to how the server is run, deployed, called or checked updates its guide in `docs/guide/`. | ||
- A change that those who run the server or call it see adds a change file to `.changeset/`, its text written for them; a pull titled `Release <version>` is release-pull.yml's, made by `knope release`. | ||
- A harness change makes a check stricter or fixes it, and never loosens one so that a server passes. A new check says what it compares, and with what. | ||
- Server code takes nothing from the reference PDS's or an SDK's source, and adds no atproto or MCP crates. | ||
- Each conformance check excused in `harness/conformance.yaml` gives a reason that the suite's source supports. | ||
docs/guide/contributing.md+32−6
| @@ -208,11 +208,8 @@ of them; the `docs` workflow builds it on each pull that changes what it is | ||
made from. `just docs-site` serves it at http://localhost:4321/ while you | ||
write. | ||
| ||
The repository is private, so its site is too: only its members read it, | ||
at https://3mztgvkwexivt-bcgltzqazw5tb6k2g3ttenbj.private.knotless.page/. | ||
An app password, all a workflow could sign in with, cannot write the space | ||
its site is kept in, so the owner deploys it, signed in with `knotless | ||
login`: | ||
The site is at https://chadtmiller-com.knotless.page/monolith/. Its owner | ||
deploys it: | ||
| ||
```sh | ||
just docs-deploy | ||
| @@ -220,8 +217,37 @@ just docs-deploy | ||
| ||
## Releases | ||
| ||
A pull that changes what those who run the server or call it see, its | ||
behaviour, its settings, its CLI, its image, adds a change file to | ||
`.changeset/`: `knope document-change` asks for the bump (`patch`, `minor` | ||
or `major`) and a summary, or write it by hand, as the ones there are. Its | ||
heading and text are that change's entry in `CHANGELOG.md`, for those | ||
readers, not for us. A change they do not see, as a test or the harness, | ||
adds none. | ||
| ||
A release is `main` with the workspace's `version` raised, tagged | ||
`v<version>`. As it is tagged, `harness/upgrade/` is written again with its | ||
`v<version>`, made by two workflows: | ||
| ||
- `release-pull.yml`, each day when `main` has change files: `knope | ||
release` on `main`'s tip, which raises the version, writes the version's | ||
section of `CHANGELOG.md` and removes the change files, as the one open | ||
pull `Release <version>`, kept up to date as change files land. Queueing | ||
that pull is the release. 0.x's `minor` raises the minor, where knope | ||
alone would raise the patch. `knotless run rerun | ||
knotless://chadtmiller.com/monolith --ref refs/heads/main --workflow | ||
release-pull` makes the pull at once. | ||
- `release.yml`, once that lands and the gates pass at it: it builds the | ||
pages and `pds` as the Dockerfile does, makes the image from the binary | ||
with no container engine (`.knotless/image.sh`, as the runner's jobs have | ||
none), and publishes both, the image as the package `monolith` and | ||
`pds-<version>-x86_64-linux.tar.gz` with its `.sha256` as the package | ||
`pds`, each with the version's changelog as its notes, then tags the | ||
commit. Asked for on a branch, it builds both and publishes nothing. | ||
| ||
Both run on `runner.knotless.dev`, with `RELEASE_PASSWORD`, an app password | ||
of the owner's, sealed to it for pushes to `main` alone. | ||
| ||
Once tagged, `harness/upgrade/` is written again with the release's | ||
binary, which is then the previous version every later build must start on | ||
(`compare.mjs --upgrade`, in [Comparing](comparing.md#the-store-scale-and-upgrades)), | ||
and committed: | ||
docs/guide/deploying.md+6−3
| @@ -7,9 +7,12 @@ the whole environment, blobs in a bucket, and backups. | ||
## The image | ||
| ||
`knotless.dev/chadtmiller.com/monolith` is the server as an image, `latest` | ||
or a version as its tag: `pds` alone, on Debian slim, run as a user of its | ||
own. It sets `PDS_PORT=2583`, `PDS_BIND_ADDRESS=::` and | ||
`PDS_DATA_DIR=/data`, a volume. | ||
or a version as its tag, published with each release for linux/amd64: | ||
`pds` alone, on Debian slim, run as the user `pds`, uid and gid 10001. It | ||
sets `PDS_PORT=2583`, `PDS_BIND_ADDRESS=::` and `PDS_DATA_DIR=/data`, a | ||
volume, which that user must own. Its labels, `org.opencontainers.image.version` | ||
and `org.opencontainers.image.revision`, name the version and the commit it | ||
was built from, and `/xrpc/_health` answers the version. | ||
| ||
```sh | ||
docker run -d -p 127.0.0.1:2583:2583 -v pds-data:/data --env-file pds.env knotless.dev/chadtmiller.com/monolith | ||
docs/guide/getting-started.md+8−6
| @@ -26,16 +26,18 @@ docker pull knotless.dev/chadtmiller.com/monolith | ||
``` | ||
| ||
That is the latest version; a tag pins one, as | ||
`knotless.dev/chadtmiller.com/monolith:0.1.0`. The image is the `pds` | ||
`knotless.dev/chadtmiller.com/monolith:0.2.0`. The image is the `pds` | ||
binary alone, on Debian slim, run as a user of its own, with its data on | ||
the volume `/data`. | ||
the volume `/data`. Its labels name its version and the commit it was | ||
built from (`org.opencontainers.image.version` and `.revision`). | ||
| ||
Or the binary, for Linux x86-64: | ||
Or the binary, for Linux x86-64, of a version from the releases page: | ||
| ||
```sh | ||
curl -fLO https://knotless.dev/chadtmiller.com/monolith/releases/download/pds/0.1.0/pds-0.1.0-x86_64-linux.tar.gz | ||
curl -fL https://knotless.dev/chadtmiller.com/monolith/releases/download/pds/0.1.0/pds-0.1.0-x86_64-linux.tar.gz.sha256 | sha256sum -c | ||
tar xzf pds-0.1.0-x86_64-linux.tar.gz && sudo install pds /usr/local/bin/ | ||
v=0.2.0 | ||
curl -fLO https://knotless.dev/chadtmiller.com/monolith/releases/download/pds/$v/pds-$v-x86_64-linux.tar.gz | ||
curl -fL https://knotless.dev/chadtmiller.com/monolith/releases/download/pds/$v/pds-$v-x86_64-linux.tar.gz.sha256 | sha256sum -c | ||
tar xzf pds-$v-x86_64-linux.tar.gz && sudo install pds /usr/local/bin/ | ||
``` | ||
| ||
The [releases page](https://knotless.dev/chadtmiller.com/monolith/releases) | ||
AGENTS.md+4−0
| @@ -75,6 +75,10 @@ A change to how the server is run, deployed, called or checked updates its | ||
guide in `docs/guide/` in the same pull, as a change in behaviour updates | ||
the spec. | ||
| ||
A change that those who run the server or call it see adds a change file | ||
to `.changeset/` in the same pull, from which the next release's | ||
`CHANGELOG.md` is written (`docs/guide/contributing.md`, "Releases"). | ||
| ||
The README says what is built, not how it came to be: no history, plans or | ||
sessions in it, in `docs/`, or in the spec. | ||
| ||
CHANGELOG.mdnew+4−0
| @@ -0,0 +1,4 @@ | ||
# Changelog | ||
| ||
What changed in each version of Monolith for those who run it or call it, | ||
from the change files in `.changeset/` (see `knope.toml`). | ||