-
Notifications
You must be signed in to change notification settings - Fork 1.7k
implement stream demultiplexing for exec commands #2150
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
Conversation
Please sign your commits following these rules: $ git clone -b "master" git@github.com:little-dude/docker-py.git somewhere
$ cd somewhere
$ git commit --amend -s --no-edit
$ git push -f Amending updates the existing PR. You DO NOT need to open a new one. |
@shin- do you mind taking a quick look at this? I'll have some time this week to fix the tests (and add some for this feature). If you have any comment I'll handle them as well. |
Tests should pass now. I'd like to add a few other tests for |
@shin- any chance of getting this reviewed? It's quite demoralizing to not get any feedback... |
Sorry - it looked like you still had test failures, but they're due to moby/moby#37920 Can you rebase against the current master to pick up a3111d9 and clear the CI failures? |
Thank you! Rebased. Edit: it looks ok :) |
@shin- CI passed. What do you think? As I said I can add additional tests, but I'd like to know you like the implementation first to avoid extra work. |
@little-dude Thanks! Design-wise, I don't think there's ever a case where the data we receive from the server is in the |
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.
Good on design overall, just a few style / organizational nits
:py:class:`docker.errors.APIError` | ||
If the server returns an error. | ||
Example: |
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.
Not sure this is the best place for such a long example, especially since it applies to attach()
as well.
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'm not sure where to put it though. I can just copy paste if for attach()
, or add a reference to it.
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.
Maybe as a separate docs page. We can figure that out later though, it's not worth blocking the PR.
Thanks a lot for the review! I'll address the comments and add a test or two.
Yeah I was confused by this as well, this is a weird API. |
Addressed the comment (except the one about the docstring), and rebased on top of #2178 for now to prevent some pytest failures. I still need to add a test for the new API. |
Looks like Jenkins caught a bit of a cold over the weekend! I kicked the build again, but everything looks solid now. |
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.
Found a couple outdated docstrings, otherwise LGTM
fixes #1952 Signed-off-by: Corentin Henry <corentinhenry@gmail.com>
Rebased, comments addressed! I added a bunch of unit tests (and found a bug!). I'll look at the integration tests to see if there's something I can easily add there. |
I found a couple places where I could add tests. I'll update the PR in a few hours. |
Check that the return value against the various combination of parameters this function can take (tty, stream, and demux). This commit also fixes a bug that the tests uncovered a bug in consume_socket_output. Signed-off-by: Corentin Henry <corentinhenry@gmail.com>
Test the interation of the tty, demux and stream parameters Signed-off-by: Corentin Henry <corentinhenry@gmail.com>
@shin- I think this is ready (provided that CI passes). |
Thanks! I'll give it another round of review. |
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.
Found a couple mentions to "stdin" I need to remove, and left a comment about an inconsistency (I think it's fixable, I'm just not sure if it's ok to do that in another PR later).
Signed-off-by: Corentin Henry <corentinhenry@gmail.com>
Signed-off-by: Corentin Henry <corentinhenry@gmail.com>
Merged - thank you for your help and your patience! |
Thanks a lot for your reviews @shin- ! |
Hi there,
This is an attempt to fix #1952: offering the possibility to demultiplex stdout, stderr and stdin. Currently, it's only implemented for
docker exec
but can be extended to other APIs where it's relevant.The implementation is not complete: some tests need to be added, and some needs to be adjusted. But since I'm new to this codebase, I wanted to open the PR to get early feedback, before spending time polishing it.
Here is an example of how it works:
fixes #1952