fix(ci): cap postgres fixtures and reclaim leftover compose networks
xiaoxin's 20-core npm test opened one Docker network per database file and exhausted default address pools. Limit concurrent fixtures and remove unused jyotisha-postgres networks before the gate. Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
@@ -29,6 +29,30 @@ docker container prune --force --filter until=6h
|
||||
docker volume ls --quiet --filter 'name=^jyotisha-postgres-' --filter dangling=true |
|
||||
xargs -r docker volume rm
|
||||
docker network prune --force --filter until=6h
|
||||
|
||||
# Compose networks from crashed or finished fixtures keep occupying Docker's
|
||||
# default address pools until they are removed. `network prune --filter until=6h`
|
||||
# leaves same-day leftovers, and the next `docker compose up` then fails with
|
||||
# "all predefined address pools have been fully subnetted".
|
||||
# `docker network rm` refuses networks that still have endpoints, so a
|
||||
# concurrent job's live fixture is left alone.
|
||||
echo "removing unused jyotisha-postgres compose networks"
|
||||
removed_networks=0
|
||||
kept_networks=0
|
||||
while IFS= read -r network; do
|
||||
if [ -z "$network" ]; then
|
||||
continue
|
||||
fi
|
||||
if docker network rm "$network" >/dev/null 2>&1; then
|
||||
echo "removed unused network $network"
|
||||
removed_networks=$((removed_networks + 1))
|
||||
else
|
||||
echo "kept in-use network $network"
|
||||
kept_networks=$((kept_networks + 1))
|
||||
fi
|
||||
done < <(docker network ls --format '{{.Name}}' --filter 'name=jyotisha-postgres-')
|
||||
echo "jyotisha-postgres networks: removed=${removed_networks} kept=${kept_networks}"
|
||||
|
||||
docker image prune --force
|
||||
|
||||
# Exact-SHA release images are immutable in the registry once published, so the
|
||||
|
||||
Reference in New Issue
Block a user