Skip to content

feat(docker_lib): add image-presence preflight and a prune opt-out - #319

Open
speriaswamy-amd wants to merge 3 commits into
speriaswamy/xdit-05-pssh-inactivity-timeoutfrom
speriaswamy/xdit-06-docker-image-preflight
Open

feat(docker_lib): add image-presence preflight and a prune opt-out#319
speriaswamy-amd wants to merge 3 commits into
speriaswamy/xdit-05-pssh-inactivity-timeoutfrom
speriaswamy/xdit-06-docker-image-preflight

Conversation

@speriaswamy-amd

Copy link
Copy Markdown
Contributor

Part 6 of 12 in a stack that replaces #184. Base: #318.

Why

Two small library gaps the pytorch_xdit benchmarks hit, both usable by any suite.

What changed

nodes_missing_docker_image(phdl, image_ref) — runs docker image inspect on every target and returns the hosts where the image is absent. Without it, a missing image surfaces as a docker run failure minutes into a test, buried in container output. The image ref is shlex-quoted.

delete_all_containers_and_volumes() now honours CVS_PYTORCH_XDIT_SKIP_DOCKER_SYSTEM_PRUNE (1/true/yes/on). The function runs docker system prune --force, which removes stopped containers and unused networks belonging to other users on shared cluster nodes. The opt-out lets a run stop its own named container and skip the cluster-wide prune. Default behaviour is unchanged.

Unit tests cover both, including the missing/present cases and the skip path.

Two small additions needed by the pytorch_xdit benchmarks, both usable by any
suite:

nodes_missing_docker_image(phdl, image_ref) runs `docker image inspect` on
every target and returns the hosts where the image is absent. Without it, a
missing image surfaces as a `docker run` failure minutes into a test, mixed in
with container output; callers can now fail fast with an actionable message.
The image ref is shlex-quoted.

delete_all_containers_and_volumes() now honours
CVS_PYTORCH_XDIT_SKIP_DOCKER_SYSTEM_PRUNE (1/true/yes/on). The function runs
`docker system prune --force`, which removes stopped containers and unused
networks belonging to other users on shared cluster nodes. The opt-out lets a
run stop its own named container and skip the cluster-wide prune. Default
behaviour is unchanged.

Adds unit tests for both, covering the missing/present cases and the skip path.

Co-Authored-By: Claude <noreply@anthropic.com>
Comment thread cvs/lib/docker_lib.py

This runs ``docker system prune --force`` (not ``-a``), but it can still remove
stopped containers and unused networks on shared nodes. Set environment variable
``CVS_PYTORCH_XDIT_SKIP_DOCKER_SYSTEM_PRUNE`` to ``1``/``true``/``yes`` to skip this

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

isn't this function used by most of the frameworks, can this 'CVS_PYTORCH_XDIT_SKIP_DOCKER_SYSTEM_PRUNE' be generalized to 'CVS_SKIP_DOCKER_SYSTEM_PRUNE'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants