-
Notifications
You must be signed in to change notification settings - Fork 31
Conversation
6636864
to
40a38d0
Compare
Implement remove on client side
@@ -135,7 +135,7 @@ def testDockerModeStdio(self): | |||
sys.stdout = _old | |||
|
|||
lines = stdout_captor.getvalue().splitlines() | |||
message = '%s\n' % self._test_message | |||
message = '%s\r\n' % self._test_message |
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.
Are we OK with the extra \r?
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.
Sure
@zachmullen I have added support for add extra docker run args. I am using the same property |
Great! |
I am finally getting around to testing this out. I am getting the following error when running a docker task:
Here's the job kwargs:
|
Is this in a virtualenv? This issue seems similar ... |
No, installed at system level. I'll try it in a VE so it's a more fresh environment. |
requirements.txt
Outdated
@@ -7,3 +7,4 @@ pytz==2016.4 | |||
requests[security]==2.10.0 | |||
six==1.10.0 | |||
wsgiref==0.1.2 | |||
docker==2.1.0 |
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.
We have per-plugin requirements files that can be installed as extras, so this should go in plugins/docker/requirements.txt.
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.
Sure, not sure why it ended up here
Reinstalling in a virtualenv worked 👍 |
From the look of that issue, it might be related to a naming conflict with docker-compose, did you have that installed? |
client.containers.run('busybox', args, **config) | ||
except DockerException as dex: | ||
logger.error('Error setting perms on docker tempdir %s.' % tmpdir) | ||
logger.error(dex) |
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.
I think logger.exception()
will automatically log the most recently raised exception.
client.images.pull(image) | ||
except DockerException as dex: | ||
logger.error('Error pulling Docker image %s:' % image) | ||
logger.error(dex) |
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.
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.
Sure, will fix
@@ -135,7 +135,7 @@ def testDockerModeStdio(self): | |||
sys.stdout = _old | |||
|
|||
lines = stdout_captor.getvalue().splitlines() | |||
message = '%s\n' % self._test_message | |||
message = '%s\r\n' % self._test_message |
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.
Sure
No, but one of these others might have a conflict:
|
Will this require a change to installation or configuration instructions? I don't see any such changes in the docs. |
What I meant to say primarily is, great feature, thanks for sticking with this over a long period and getting it done @cjh1 . 🤖 |
Agreed! Thanks! |
@mgrauer Doesn't require any installation changes, the update to the requirements.txt should take care of everything. In fact now it should be possible to run the docker plugin without the docker cli, not that this is going to be a big use-case 😄 |
@cjh1 I wanted to bring up something @cdeepakroy asked me about yesterday -- apparently to use CUDA with docker, nvidia provides an alternative client called |
Here is a high level overview on their wiki, BTW. It makes it sound like it's mostly a matter of mounting special volumes... |
@zachmullen Was I too quick to push the green button? I have not come across nvidia-docker. Read the docs it looks like nvidia-docker-plugin would still work, as this is server side, then we would just have to work what calls to the plugin endpoints the modified client is makes. Actually we may be in luck, looks like docker-py are working on added support docker/docker-py#1560, looks like it be actively worked on ... |
Nope, this is for a future use case, just trying to contemplate how it would work in the new setup. Great to hear they are adding first-class support; if that doesn't land, I think we'll still be OK with rolling our own thing down the road. |
+1 for supporting nvidia-docker, this is often used with SMQTK. |
Just a heads up, I'm moving forward on the nvidia-docker exploration. If anybody has already started down this path, let's sync up. |
Finally got this to behaving on Travis ( real bug, so was worth persevering ).
This PR moves to docker-py for all docker interactions. It refactors run_process(...) to break out the select loops so it can be used with a process or with sockets returned by docker-py when running a container. I think this was the right approach, but open to other ideas.
@zachmullen @manthey I would appreciate your reviews/input. I would also like some testing using a real world application that is using the docker plugin, particularly using named pipes as this has all changed, before we push any buttons.