-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add device requests #2471
Add device requests #2471
Conversation
d6139c4
to
60f5a8c
Compare
Seems to work. For all those currently using this fork - do not forget to specify api version when instantiating the
(the default version is |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good to me. Would be nice if a docker-py maintainer could take a look as well.
fd20b24
to
9aacf76
Compare
A note on the I would recommend using The client defaults to 1.35 because it is the value of |
@Lucidiot Thanks a lot for this implementation, it solved a problem for us. I hope this PR gets merged soon, so that we don't have to build this fork manually as a part of our CI/CD pipeline |
What's the hold-up on this PR? Christmas? The two failing tests in Jenkins? Is there any way I can help? |
ping @shin- @ulyssessouza @aanand @bfirsh |
+1 for the code, merge it! @shin- @ulyssessouza @aanand @bfirsh |
Tests failing:
|
Tested it and it works great! |
For an in-library patch until this is merged, I've created a module which you can use here: _docker_patch.py |
@ulyssessouza could you please take a look at this PR? It would be really nice to be able to use this feature with Docker SDK for Python. |
Ansible team desperately needs this merged for the ansible docker_container module functionality, please please please merge it! The world is waiting! 📟 |
Any updates on this? The docker-compose guys are waiting on this too docker/compose#6691 (much frustration is being felt by many) |
I've made a new PR #2581 with the test fixed |
Create a v1.40 client for the device-requests test
I work with @Lucidiot and merged your fix @EpicWink. Thanks a lot for your help ! Looks like Jenkins is happy now ! |
@ulyssessouza whats the ETA on this PR merging? Are there any blockers? |
I would also be interested in this PR! |
Same Here! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
@ulyssessouza When do you plan to merge this PR ? Thanks ! |
@ulyssessouza or any maintainer : Could you provide us with an update ? Is there a blocker ? I know it's summer in the northern hemisphere, and lots of folks are not working, but the lack of communication is pretty disturbing for such an important project 😢 |
Thanks @Lucidiot, @La0, @ulyssessouza, @aiordache and the rest of the Docker team for getting this merged in. So many of us are looking forward to using it in downstream projects. |
Thanks a lot! You are awesome! 🍺 |
* Add DeviceRequest type Signed-off-by: Erwan Rouchet <[email protected]> * Add device_requests kwarg in host config Signed-off-by: Erwan Rouchet <[email protected]> * Add unit test for device requests Signed-off-by: Erwan Rouchet <[email protected]> * Fix unit test Signed-off-by: Erwan Rouchet <[email protected]> * Use parentheses for multiline import Signed-off-by: Erwan Rouchet <[email protected]> * Create 1.40 client for device-requests test Signed-off-by: Laurie O <[email protected]> Co-authored-by: Laurie O <[email protected]> Co-authored-by: Bastien Abadie <[email protected]>
Another take on #2395: while the Docker CLI adds a
--gpus
parameter, it is in fact syntatic sugar for theDeviceRequests
argument in a container's host config. This PR adds support for any kind of device request, as it seems the API was designed to handle more in the future than just GPUs.It would still be possible to support another
gpus=...
argument in a way similar to #2465, that could handle the previousnvidia
runtime and set the environment variables itself or use the new device requests.For example, with NVIDIA's test image, the equivalent of
--gpus all
would be:The equivalent of
--gpus 2
would beDeviceRequest(count=2, capabilities=[['gpu']])
.And for something like
--gpus device=GPU-c6e298ba-aa33-4083-8ae3-db4e27037475,driver=nvidia,capabilities="utility,display"
: