-
Notifications
You must be signed in to change notification settings - Fork 481
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
check context builder endpoint #1129
Conversation
7f89e02
to
3b2a288
Compare
I don't really understand this. If the driver is wrong this does not depend on whether API can be pinged or not. It is either wrong or correct and if it is running doesn't have anything to do with it.
The API struct should not store context. If the context is needed it should be passed by the caller who wants to initialize the client. |
3b2a288
to
e775fd2
Compare
Indeed it should be checked after client initialization if a context builder is being used. Pushed some changes. Let me know if it lgty. |
I still don't understand what does builder being inactive or not have to do with if it can be deleted or not. |
Something @rumpl found out and might be linked to this. If a docker context is created with an healthy endpoint but the GRPC connection is broken, when he runs
Here is a repro. Create an unreachable docker context: $ docker context create --docker host=ssh://notexist mycontext
mycontext
Successfully created context "mycontext" $ docker buildx ls
NAME/NODE DRIVER/ENDPOINT STATUS BUILDKIT PLATFORMS
default docker
default default running 20.10.17 linux/amd64, linux/arm64, linux/riscv64, linux/ppc64le, linux/s390x, linux/386, linux/arm/v7, linux/arm/v6
mycontext docker-container
mycontext mycontext error
Failed to get status for mycontext (mycontext): error during connect: Get "http://docker.example.com/v1.24/info": command [ssh -- notexist docker system dial-stdio] has exited with exit status 255, please make sure the URL is valid, and Docker 18.09 or later is installed on the remote host: stderr=ssh: Could not resolve hostname notexist: Name or service not known As you can see:
is wrong and I think should be
|
No reproducible test case here, but can confirm I've seen something like this before running Docker Desktop alongside the docker daemon on Linux. Occasionally, for mysterious reasons, it would appear like the |
1aed151
to
f1ecb3b
Compare
@tonistiigi As discussed, added a comment explaining the situation with fallback to docker-container driver. |
f1ecb3b
to
3c4cfad
Compare
Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
3c4cfad
to
e27a596
Compare
while making some tests with @tonistiigi about an issue with
rm --all-inactive
that doesn't effectively remove some inactive nodes we saw that there is an underlying issue with docker context being detected as a docker-container builder:here
remote-buildkit
should not be a docker-container builder. that's because we don't check this endpoint while initializing the docker client so it assumes the underlying node is a docker-container when returned from:buildx/commands/util.go
Line 196 in 908ce2d
this PR adds a basic
Ping
check when docker client is initialized so we can find out early that this builder is faulty:Signed-off-by: CrazyMax crazy-max@users.noreply.github.com