fix(deploy): prune unused staging images before digest pull
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:
@@ -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
|
||||
|
||||
|
||||
@@ -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 \
|
||||
|
||||
Reference in New Issue
Block a user