Remove cmd/docker and other directories in cli/ in accordance with the new Moby project scope#32694
Conversation
|
How to test future moby features without CLI? |
|
@AkihiroSuda hack/make/.fetch-test-client it seems that will be installed as binary |
|
Docker product CLI could not be used for testing new features that are not available yet in Docker product. How about renaming |
|
I think the idea would be to write tests that target the API instead of using the CLI to test everything. Writing tests against the API is actually a better idea because it helps verify the quality of the API design. Writing tests using the CLI hides mistakes in API design (and could even hide accidental breaking API changes). The existing CLI will be available for running the existing tests, but new tests should either be unit tests or target the API. |
|
Yes, I agree API-oriented testing is better, but I just thought manual ad-hoc testing using CLI is still effective, although it is not ideal. A concrete example is my PR #26331 (introspection mount). |
|
I think the idea would be to write tests that target the API instead of using the CLI to test everything. Writing tests against the API is actually a better idea because it helps verify the quality of the API design. Writing tests using the CLI hides mistakes in API design (and could even hide accidental breaking API changes).
The existing CLI will be available for running the existing tests, but new tests should either be unit tests or target the API.
It looks like the API client is being moved as well (to `cli`, which doesn't make sense to me), so I don't think writing tests against the API will help.
Either way, I think it's very important to be able to manually test PRs. We shouldn't assume that a new feature works properly just because its tests pass.
We previously had engine-api split out and it was very painful. That repo would often get out of sync with docker, and it would become impossible to merge PRs that needed a newer version. I was surprised by this PR that would abruptly go back to that, in a more extreme form. IMHO we should figure out a usable workflow before making such a drastic change.
|
Why not? If API stays the same, old client should work? If API changes it would be a different version and warrants a change in the cli repo? |
|
With the goal of moby to split out everything from this repo other than core bits , I think this makes perfect sense although is going to be a rough transition to start off. That said, I think the API client library needs to live next to the API definition. |
So the SDK will gradually become the source of truth for Docker APIs, rather than the rest API. (of course this can be implemented gradually and carefully, and without breaking existing tools) |
|
One last point, on the moby side we want to remove client implementation BUT implement tools which can generate custom clients for your blueprint using the grpc definitions. Both client libraries and cli can be generated in that way. |
004ba7b to
d28a396
Compare
|
@tiborvass I think most of the comments above are for rapid-iterative-development and hence I think a bit more explanation on
and an example usage will help. |
Makefile
Outdated
There was a problem hiding this comment.
sorry if i'm not following, what's /usr/local/cli ?
There was a problem hiding this comment.
@vieux a place i decided to bind mount the folder where the cli is. I need to bind mount the folder so that rebuilding the binary propagates inside the container.
dnephin
left a comment
There was a problem hiding this comment.
I think docs/yaml needs to be added to docker/cli since it's being removed here, otherwise I think it looks correct
c16ba14 to
9b993b7
Compare
|
nice teamwork @tiborvass @clnperez 👋 LGTM if green |
|
The failing powerpc test is a known failure. So CI can be considered green! |
|
shall we merge then... |
|
needs rebase |
Makefile
Outdated
There was a problem hiding this comment.
@tiborvass just to clarify, is it the case that setting the environment variable for the CLI path, and then running something like make BIND_DIR=. binary shell will set up a test dind container?
There was a problem hiding this comment.
@nishanttotla yes, it will do the same as usual, but will also have the bind-mounted binary specified by DOCKER_CLI_PATH. It will be added to your PATH so you can use it right away inside the dev container. Note that instead of DOCKER_CLI_PATH, you can also specify a different remote and git sha in hack/dockerfile/binaries-commits if you want to show case the full feature on one branch.
9f45491 to
1a61a99
Compare
…e new Moby project scope Starting with this commit, integration tests should no longer rely on the docker cli, they should be API tests instead. For the existing tests the scripts will use a frozen version of the docker cli with a DOCKER_API_VERSION frozen to 1.30, which should ensure that the CI remains green at all times. To help contributors develop and test manually with a modified docker cli, this commit also adds a DOCKER_CLI_PATH environment variable to the Makefile. This allows to set the path of a custom cli that will be available inside the development container and used to run the integration tests. Signed-off-by: Arnaud Porterie (icecrime) <arnaud.porterie@docker.com> Signed-off-by: Tibor Vass <tibor@docker.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
Signed-off-by: Tibor Vass <tibor@docker.com>
|
LGTM 🎉 |
Moving the client-side binary to the https://github.com/docker/cli repository in accordance with the transition to the Moby project.
See #32691 and #32867 for context.
Starting with this commit, integration tests should no longer rely on
the docker cli, they should be API tests instead. For the existing tests
the scripts will use a frozen version of the docker cli with a
DOCKER_API_VERSION frozen to 1.30, which should ensure that the CI remains
green at all times.
To help contributors develop and test manually with a modified docker
cli, this commit also adds a DOCKER_CLI_PATH environment variable to the
Makefile. This allows to set the path of a custom cli that will be
available inside the development container and used to run the
integration tests.
Example on how to make changes to do iterative dev:
New workflow for PRs impacting the Docker CLI:
Additionally, in order to get a green CI, the PR fixes a CGO_ENABLED envvar leak with our install-binaries.sh script, and modifies a Go build tag in pkg/term to ensure we catch the issue earlier next time.