Allow overriding --tmpfs for docker container via env var - #38
Merged
Merged
Conversation
Ref #37 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HhMAd9QaUnmduHbXQsARQG
… mem_limit, cpus) Both the Postgres and MSSQL testdb containers now accept env-var overrides for common docker-run resource knobs that were previously hardcoded/unset: - PGDEVKIT_TESTDB_TMPFS / PGDEVKIT_TESTDB_MSSQL_TMPFS (docker-CLI --tmpfs syntax, semicolon-separated for multiple mounts) - PGDEVKIT_TESTDB_SHM_SIZE / PGDEVKIT_TESTDB_MSSQL_SHM_SIZE - PGDEVKIT_TESTDB_MEM_LIMIT / PGDEVKIT_TESTDB_MSSQL_MEM_LIMIT - PGDEVKIT_TESTDB_CPUS / PGDEVKIT_TESTDB_MSSQL_CPUS - PGDEVKIT_TESTDB_IMAGE, bringing Postgres in line with the MSSQL container's existing image override All default to Docker/Podman's own defaults when unset. Parsing/kwarg building lives in _docker.resource_kwargs(), shared by both container modules. Closes #37 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HhMAd9QaUnmduHbXQsARQG
Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HhMAd9QaUnmduHbXQsARQG
Code review flagged that ensure_container()/ensure_mssql_container() just restart an existing stopped container as-is, so TMPFS/SHM_SIZE/ MEM_LIMIT/CPUS/IMAGE/etc. changes have no effect until it's removed (docker rm) -- same pre-existing limitation as HOST/PORT/USER/PASSWORD. Documented in the README and with a short comment at both call sites. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01HhMAd9QaUnmduHbXQsARQG
aersam
marked this pull request as ready for review
September 22, 2026 10:44
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #37
Adds Docker-level resource overrides for the shared testdb containers (both Postgres and MSSQL), all optional and defaulting to Docker/Podman's own behavior when unset:
PGDEVKIT_TESTDB_TMPFS/PGDEVKIT_TESTDB_MSSQL_TMPFS— docker-CLI--tmpfssyntax, semicolon-separated for multiple mountsPGDEVKIT_TESTDB_SHM_SIZE/PGDEVKIT_TESTDB_MSSQL_SHM_SIZEPGDEVKIT_TESTDB_MEM_LIMIT/PGDEVKIT_TESTDB_MSSQL_MEM_LIMITPGDEVKIT_TESTDB_CPUS/PGDEVKIT_TESTDB_MSSQL_CPUSPGDEVKIT_TESTDB_IMAGE— brings the Postgres container in line with the MSSQL container's existing image overrideParsing/kwarg building is shared between both container modules via a new
_docker.resource_kwargs()helper. Version bumped to 0.8.0.Known limitation (documented in the README and in-code): like the existing
HOST/PORT/USER/PASSWORDoverrides, these only take effect when pgdevkit actually creates the container — restarting an existing stopped container reuses its original config, so adocker rmis needed after changing any of these on a machine that already has one.Test plan
tests/testdb/test_docker.py(tmpfs spec parsing, resource-kwargs building), extendedtest_constants.py/test_mssql_constants.py(env var defaults + overrides), extendedtest_container.pyand newtest_container_mssql.py(fake-client assertions that the new kwargs are omitted by default and passed through when set)uv run pytest tests/testdb -m "not mssql"— 82 passed, 34 skipped (podman-gated live tests), 3 deselecteduv run ty check pgdevkit/testdb— all checks passedSession: https://claude.ai/code/session_01HhMAd9QaUnmduHbXQsARQG
🤖 Generated with Claude Code