Fix #24: Integrate python-on-whales for Docker operations#88
Open
ClaydeCode wants to merge 1 commit into
Open
Conversation
Replaces the `docker` SDK and raw subprocess calls for Docker/Compose operations with `python-on-whales`, which provides a typed Python API for both Docker and Docker Compose. Key changes: - docker-compose up/stop/down → DockerClient(compose_project_directory=…).compose.* - docker image prune → DockerClient().image.prune() - docker login → DockerClient().login() - docker.from_env() container/network queries → DockerClient().container/network.* - Synchronous python-on-whales calls wrapped in asyncio.to_thread() in async contexts - docker.errors.NotFound → python_on_whales.exceptions.NoSuchContainer - SubprocessError → python_on_whales.exceptions.DockerException Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
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.
Summary
dockerSDK and rawsubprocesscalls for Docker/Compose operations withpython-on-whales, which provides a typed Python API for both the Docker daemon and Docker Composeasyncio.to_thread()wherever they appear in async functionsdocker.errors.NotFound/SubprocessErrortopython_on_whales.exceptions.NoSuchContainer/DockerExceptionCloses #24
Recommended reading order
pyproject.toml/uv.lock— dependency swap:docker→python-on-whalesshard_core/service/app_tools.py— docker-compose up/stop/down and image pruneshard_core/service/app_installation/__init__.py— docker registry loginshard_core/web/internal/app_error.py— container status lookupshard_core/web/internal/call_peer.py— container/network lookup by IPtests/util.py— docker network create/disconnect/remove helperstests/test_app_installation.py/tests/test_app_lifecycle.py— test assertions using container inspect🤖 Generated with Claude Code