ci: database containers keep their data in tmpfs, not a leaked volume (#5746)
postgres declares VOLUME /var/lib/postgresql/data, so each integration service container and each publish smoke Postgres left an anonymous volume behind: act_runner removes service containers without their volumes, and the smoke clean-up ran docker rm -f without -v. 2,488 of them, each a Postgres data directory of up to 130k files, used every inode on the runner host and stopped CI. A tmpfs at the data path creates no volume at all, and the clean-up now removes volumes too. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -69,7 +69,12 @@ jobs:
|
||||
POSTGRES_USER: steward
|
||||
POSTGRES_PASSWORD: steward
|
||||
POSTGRES_DB: steward
|
||||
# The data directory lives in RAM (#5746): postgres images declare
|
||||
# VOLUME for it, so without a tmpfs each run left an anonymous volume
|
||||
# that act_runner never removes, and 2,488 of them used up the runner
|
||||
# host's inodes.
|
||||
options: >-
|
||||
--tmpfs /var/lib/postgresql/data
|
||||
--health-cmd "pg_isready -U steward"
|
||||
--health-interval 10s
|
||||
--health-timeout 5s
|
||||
@@ -168,6 +173,7 @@ jobs:
|
||||
IMAGE=git.fabledsword.com/bvandeusen/steward:${{ github.sha }}
|
||||
docker network create --internal "$SMOKE-net"
|
||||
docker run -d --name "$SMOKE-pg" --network "$SMOKE-net" \
|
||||
--tmpfs /var/lib/postgresql/data \
|
||||
-e POSTGRES_USER=steward -e POSTGRES_PASSWORD=steward -e POSTGRES_DB=steward \
|
||||
postgres:16-alpine
|
||||
# Waits with deadlines (rule 156); pg_isready, not /dev/tcp, which is
|
||||
@@ -276,7 +282,7 @@ jobs:
|
||||
- name: Smoke clean-up
|
||||
if: always()
|
||||
run: |
|
||||
docker rm -f "steward-smoke-${{ github.run_id }}-app" "steward-smoke-${{ github.run_id }}-restored" \
|
||||
docker rm -fv "steward-smoke-${{ github.run_id }}-app" "steward-smoke-${{ github.run_id }}-restored" \
|
||||
"steward-smoke-${{ github.run_id }}-pg" >/dev/null 2>&1 || true
|
||||
docker network rm "steward-smoke-${{ github.run_id }}-net" >/dev/null 2>&1 || true
|
||||
- name: Prune dangling layers
|
||||
|
||||
Reference in New Issue
Block a user