Skip to content

Commit b71bd42

Browse files
committed
fix(#341): refresh the dev pin to current :main; document a docker-less digest lookup
The pin in this PR was read 18 days ago. :main has moved five builds since, and dev has been hand-pinned twice in the meantime to keep up — most recently to sha256:f9be5dae (git_sha 19b3c70, current main tip), which is what the live deployment and both serving pods run right now. Merging the stale sha256:1b0f133f would have made git disagree with the cluster and silently rolled dev back 18 days on the next `kubectl apply` — the same class of drift this PR exists to prevent, just slower. Re-read the digest from the registry and pin what dev actually runs, so the merge is a no-op against the live deployment. Also document the registry-v2 fallback for reading a digest. The `imagetools inspect` line assumes a docker CLI, which a JupyterLab session doesn't have, and the GHCR packages API needs a read:packages scope our gh logins generally lack — so the documented step was not executable from the environment the rollout often gets driven from. The curl form works anywhere, with a note to validate it against prod's existing pin before trusting it.
1 parent ddf9950 commit b71bd42

2 files changed

Lines changed: 17 additions & 1 deletion

File tree

AGENTS.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,22 @@ disagree, the digest wins). **Never apply prod while the manifest points at an i
107107
hasn't built yet** — the rollout stalls on `ImagePullBackOff`. `kubectl apply` must precede
108108
`rollout restart`; a git push alone does not update the cluster.
109109

110+
**No `docker` CLI (e.g. a JupyterLab session)?** `imagetools inspect` needs it, and the
111+
GHCR packages API needs a `read:packages` token most of our `gh` logins don't carry. An
112+
anonymous pull token against the registry v2 API works anywhere `curl` does — substitute
113+
`main` or `vX.Y.Z` for `<tag>`:
114+
```
115+
repo=boettiger-lab/mcp-data-server
116+
tok=$(curl -s "https://ghcr.io/token?scope=repository:$repo:pull" \
117+
| python3 -c "import sys,json;print(json.load(sys.stdin)['token'])")
118+
curl -sI -H "Authorization: Bearer $tok" \
119+
-H "Accept: application/vnd.oci.image.index.v1+json" \
120+
-H "Accept: application/vnd.docker.distribution.manifest.v2+json" \
121+
"https://ghcr.io/v2/$repo/manifests/<tag>" | grep -i '^docker-content-digest:'
122+
```
123+
Sanity-check the method before trusting it: run it on the tag prod already pins and
124+
confirm the digest matches `k8s/deployment.yaml`.
125+
110126
**Verify all replicas converge on a single digest after rollout** (both dev and prod —
111127
dev is the multi-replica canary, so its convergence matters as much as prod's). Swap the
112128
label for the deployment you rolled (`duckdb-mcp` for prod, `dev-duckdb-mcp` for dev):

k8s/dev-deployment.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ spec:
3232
# dev's ≥2 replicas exist to catch. Bump this digest on redeploy (see
3333
# AGENTS.md → Rollout workflow). The tag prefix is for humans; the digest
3434
# is enforced. See issue #341.
35-
image: ghcr.io/boettiger-lab/mcp-data-server:main@sha256:1b0f133f4c7684b4a3271f627bb0fd4a494da3e056f1b6adf0cff68f85371f4f
35+
image: ghcr.io/boettiger-lab/mcp-data-server:main@sha256:f9be5daeb9af3d96dc77a10d78c557e911c687d5091b1e513eb8b6068b048144
3636
imagePullPolicy: IfNotPresent
3737
env:
3838
- name: STAC_CATALOG_URL

0 commit comments

Comments
 (0)