Conversation
|
I think probably inspect should fail if any of containers doesn't exist :) |
|
Oh my 😍 That looks pretty impressive! |
|
Everything failed 🎆 |
3328c57 to
fc61f80
Compare
|
Haha, seems like tests fixing won't be easy |
|
Its kind of disturbing that the change in semantics you mentioned didn't result in a change to a testcase. Aside from squashing this down :-) can we get a new testcase for that? btw - I really like the idea of a cli lib! |
|
😻 Will have to take a look but |
3737202 to
b77aed4
Compare
There was a problem hiding this comment.
Do we need both ImageCreate and ImagePull? Their implementation looks the same and ImageCreate is only called by pull helper. Also Parent in ImageCreate looks misleading as it is still just a reference to pull(together with tag).
There was a problem hiding this comment.
we probably don't need both, it's something to consider. I agree that the implementation is very similar.
b77aed4 to
d418fa3
Compare
api/client/client.go
Outdated
There was a problem hiding this comment.
Does this have to return pointer? + few other places (ExecStartCheck, ExecConfig). I think if there is no strict requirement for it we should be consistent with other methods.
There was a problem hiding this comment.
I've changed these references to be consistent.
d418fa3 to
07c1961
Compare
api/client/stats.go
Outdated
There was a problem hiding this comment.
should still check for all flag
There was a problem hiding this comment.
good catch! thank you.
|
|
|
@tonistiigi yep, there are still a few tests failing that I'm currently fixing. |
07c1961 to
13d6f25
Compare
|
Definitely high-level +1! ❤️
|
|
nice love the description definitely helps :) |
13d6f25 to
1db5748
Compare
1db5748 to
19cdcd1
Compare
|
https://github.com/docker/docker/blob/master/project/PACKAGERS.md#build-dependencies
We do still officially support compiling with Go 1.4, so we'll need to
figure out something (or decide whether that requirement can be bumped, but
it's sounding like that's not really plausible right at the moment).
|
|
okay, I'll remove that call and go back to the ugly workaround 😔 Thanks for checking! |
|
@calavera You can use version build tags! Like |
|
@LK4D4 indeed. Doing that. |
|
@calavera Hang fire - I'll update the CI nodes, shouldn't take too long. I have already updated node 1 as I'm playing with Windows CI on it. @mikedougherty I assume you're OK me updating 2..9? |
|
gccgo master builds failed because of this. I think the best would be to add gccgo PR builds to catch go1.5 related breakage earlier? |
|
It's OK, he's adding a shim for Go 1.4 support (which is still worthwhile
to keep for now IMO).
|
|
We have to move to 1.5.2 on those machines anyway. I just accelerated the update. All nodes are updated with the exception of Jenkins-prs-3. @mikedougherty I sent you an email about that node - I was unable to logon to it, even after a restart through the portal. |
|
Wow, this is really amazing!! 👍 |
|
@jhowardmsft just got host 3 back up and running. sent you an email with details. thanks for the ping |
relates to: - moby/moby#11397 - moby/moby#18472 This warning was added in [moby@4a8b3ca] to print a warning when building Linux images from a Windows client. Window's filesystem does not have an "executable" bit, which mean that, for example, copying a shell script to an image during build would lose the executable bit. So for Windows clients, the executable bit would be set on all files, unconditionally. Originally this was detected in the client, which had direct access to the API response headers, but when refactoring the client to use a common library in [moby@535c4c9], this was refactored into a `ImageBuildResponse` wrapper, deconstructing the API response into an `io.Reader` and a string field containing only the `OSType` header. This was the only use and only purpose of the `OSType` field, and now that BuildKit is the default builder for Linux images, this warning didn't get printed unless BuildKit was explicitly disabled. This patch removes the warning, so that we can potentially remove the field, or the `ImageBuildResponse` type altogether. [moby@4a8b3ca]: moby/moby@4a8b3ca [moby@535c4c9]: moby/moby@535c4c9 Signed-off-by: Sebastiaan van Stijn <[email protected]>
I extracted a standalone client library from the cli that can be used outside of docker. In the process of doing that I end up removing a bunch of code from the cli.
Why do you do this to us??!!
We should own the main go library to interact with docker. This makes the docker cli be the first consumer of this library.
How did you do this??!
I extracted all the calls the client needs into an interface, you can see it here:
https://github.com/calavera/docker/blob/api_client_lib/api/client/client.go#L19
Functions are very well defined but there are a couple things to consider.
I removed
cli.streamandcli.hijackentirely.After reading every single line in the client, I believe nobody knows how those two functions work and they made our code very complicated. You can compare the start command, no need for a diff:
Master: https://github.com/docker/docker/blob/master/api/client/start.go
My branch: https://github.com/calavera/docker/blob/api_client_lib/api/client/start.go
Every response in the new library that can be streamed returns an
io.ReadCloser. It's up to the caller to implement streaming. This makes the intention of the caller much more clear. Compare the image create functions:Master: https://github.com/docker/docker/blob/master/api/client/create.go#L53-L70
My branch: https://github.com/calavera/docker/blob/api_client_lib/api/client/create.go#L51-L63
did you know that the response of that function was always a json message that we stream in the client?
Breaking changes
Of course there are always consequences. I introduced what can be considered as a breaking change. In my opinion, the new behavior is more correct 😸
Until now,
docker inspectcontinued evaluating containers if you typed a wrong id, see this example:The message about
this_container_does_not_existnot existing would be followed by the test container output, a json payload of about 100 lines. This makes almost impossible to see the error.With the new behavior, the cli stops execution as soon as it finds an error. This is a more predictable behavior. Users know sooner and more clear that there is a problem with the command they just executed.
The code in inspect has also been highly simplified. Compare both files:
Master: https://github.com/docker/docker/blob/master/api/client/inspect.go
My branch: https://github.com/calavera/docker/blob/api_client_lib/api/client/inspect.go
https://github.com/calavera/docker/blob/api_client_lib/api/client/inspect/inspector.go
This is impossible to review
I'm afraid so too. I tried very hard to keep changes very well defined. But the best way to review this change might be to browse my branch directly, and to play with the cli.
The new client library is in https://github.com/calavera/docker/blob/api_client_lib/api/client/lib