fix(deploy): prune unused staging images before digest pull
Independent Staging Quality Gate / validate (push) Successful in 16m51s
Independent Staging Quality Gate / publish (push) Successful in 6m45s

BUG-994: migrate run 2841 failed writing containerd ingest because the staging host had no space left after accumulated exact-SHA images.
This commit is contained in:
jesse-ux
2026-09-21 22:59:07 +08:00
parent f9685f2837
commit a06829b33e
4 changed files with 52 additions and 1 deletions
+10
View File
@@ -143,6 +143,16 @@ export SITE_ADDRESS='https://staging.jyotisha.chat'
export GITHUB_SHA="$DEPLOY_SHA"
"${compose[@]}" config --quiet
# Exact-SHA images accumulate after each deploy. Pulling a new digest then
# fails with containerd "no space left on device" (run 2841 / f9685f28).
# Running jyotisha-staging containers keep their layers; unused tags go.
# Do not prune named volumes: that would risk the Postgres data volume.
echo "staging host docker disk before image reclaim"
"${docker_command[@]}" system df || true
"${docker_command[@]}" image prune --force
"${docker_command[@]}" image prune --all --force
echo "staging host docker disk after image reclaim"
"${docker_command[@]}" system df || true
"${compose[@]}" pull api web
"${compose[@]}" up -d --no-build --pull never --wait postgres
+10
View File
@@ -85,6 +85,16 @@ bash deploy/validate-staging-database-env.sh .env.staging.database
export DATABASE_ENV_FILE='../.env.staging.database'
compose=("${docker_command[@]}" compose -p jyotisha-staging -f deploy/docker-compose.postgres.yml)
# Exact-SHA images accumulate after each deploy. Pulling a new digest then
# fails with containerd "no space left on device" (run 2841 / f9685f28).
# Running jyotisha-staging containers keep their layers; unused tags go.
# Do not prune named volumes: that would risk the Postgres data volume.
echo "staging host docker disk before image reclaim"
"${docker_command[@]}" system df || true
"${docker_command[@]}" image prune --force
"${docker_command[@]}" image prune --all --force
echo "staging host docker disk after image reclaim"
"${docker_command[@]}" system df || true
"${docker_command[@]}" pull "$WEB_IMAGE"
"${compose[@]}" up -d --no-build --pull never --wait postgres
"${compose[@]}" exec -T postgres psql -v ON_ERROR_STOP=1 -U postgres -d jyotisha \