Repository navigation
Mount MPS control binary and pipe dir into the agent container - #5086
Merged
Merged
Conversation
harishxr
force-pushed
the
mps-ec2-init-mps-mounts
branch
from
August 5, 2026 18:34
f44e499 to
12f0505
Compare
harishxr
marked this pull request as ready for review
August 5, 2026 18:45
harishxr
enabled auto-merge (rebase)
August 5, 2026 18:50
tessaSlice
reviewed
Aug 5, 2026
harishxr
force-pushed
the
mps-ec2-init-mps-mounts
branch
from
August 5, 2026 20:13
12f0505 to
95ae0ee
Compare
harishxr
disabled auto-merge
August 5, 2026 20:23
prateekchaudhry
approved these changes
Aug 5, 2026
tessaSlice
approved these changes
Aug 6, 2026
harishxr
enabled auto-merge (rebase)
August 6, 2026 19:00
TheanLim
reviewed
Aug 6, 2026
Contributor
curious: how to ensure the creation before agent starts? |
TheanLim
reviewed
Aug 6, 2026
TheanLim
reviewed
Aug 6, 2026
TheanLim
reviewed
Aug 6, 2026
TheanLim
reviewed
Aug 6, 2026
TheanLim
requested changes
Aug 6, 2026
TheanLim
approved these changes
Aug 7, 2026
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
The ECS agent runs inside a container, so it cannot see host paths that aren't explicitly mounted in. An upcoming change adds an MPS control-daemon health gate that runs inside the agent and needs to reach the daemon on the host. This change makes the two host paths that gate depends on visible inside the agent container.
Implementation details
In ecs-init,
getHostConfigalready adds GPU-only bind mounts inside the block gated onECS_ENABLE_GPU_SUPPORT=trueandnvidiaGPUDevicesPresent(). Adding 2 more mounts there:/usr/bin/nvidia-cuda-mps-control- the MPS control front-end which the agent execs./tmp/nvidia-mps- the MPS control daemon's socket directoryBoth mounts are guarded with
isPathValidso they are only added when the source exists on the host, avoiding docker creating an empty host directory when the daemon is not present. The MPS binary ships in the GPU AMI. The pipe directory is created by the MPS control daemon at boot, before the agent starts.Only GPU instances with GPU support enabled are affected, non-GPU instances are unchanged.
Testing
Built a custom agent and loaded it on a GPU instance running the latest AL2023 ECS GPU AMI. Ran a
docker inspect ecs-agentand observed the following in the mounts section:New tests cover the changes: yes
Description for the changelog
Enhancement - Mount MPS control binary and pipe dir into the agent container
Additional Information
Does this PR include breaking model changes? If so, Have you added transformation functions? No
Does this PR include the addition of new environment variables in the README? No
Licensing
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.