Files
agentbox 14106ed5e7
gvisor-keyring-regression / keyring-regression (push) Successful in 13m2s
Add gVisor keyring exhaustion regression test
Run on every push. The workflow verifies that a gVisor dind has a raised keyring limit and starts 301 containers, exceeding gVisor's default 200-key limit. It passes with the dind startup workaround and fails against an unconfigured gVisor dind.
2026-11-09 14:44:56 +00:00

49 lines
1.7 KiB
YAML

name: gvisor-keyring-regression
on:
push:
workflow_dispatch:
jobs:
keyring-regression:
runs-on: docker
timeout-minutes: 30
steps:
- name: Check the configured gVisor keyring limit
shell: sh
run: |
set -eu
if grep -qi gvisor /proc/version; then
maxkeys=$(cat /proc/sys/kernel/keys/maxkeys)
echo "gVisor session keyring limit: ${maxkeys}"
# A default gVisor sandbox has a limit of 200, which is exhausted
# after roughly 200 container starts because runc never releases
# the session keyring it creates for each container.
if [ "${maxkeys}" -lt 1000 ]; then
echo "ERROR: gVisor keyring limit is too low for CI." >&2
echo "The dind container must use this repository's" >&2
echo "gvisor/images/basic/docker/start-dockerd.sh," >&2
echo "or GVISOR_KEY_MAXKEYS must be raised." >&2
exit 1
fi
else
echo "Not running under gVisor; skipping keyring limit check."
fi
- name: Start more containers than gVisor's default keyring limit
shell: sh
run: |
set -eu
docker pull alpine:3.20 >/dev/null
i=0
while [ "${i}" -lt 300 ]; do
i=$((i + 1))
docker run --rm --network none alpine:3.20 true >/dev/null
if [ $((i % 50)) -eq 0 ]; then
echo "started ${i} containers"
fi
done
# One more after the loop to make failures obvious at the boundary.
docker run --rm --network none alpine:3.20 true >/dev/null
echo "OK: started 301 containers without session keyring exhaustion"