The Wayback Machine - http://web.archive.org/web/20201209081808/https://github.com/KostyaSha/yet-another-docker-plugin/pull/267
Skip to content
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

Fix slave provisioning errors #267

Open
wants to merge 2 commits into
base: master
from

Conversation

@bhuisgen
Copy link

@bhuisgen bhuisgen commented Jul 17, 2019

This PR attempts to fix the problem of slave provisioning errors on a swarm cluster with a lot of images and/or containers.

Instead of inspecting all existing cluster resources, a docker tag and filter are used to list only the needed resources.

Issue: #249 + docker-java/docker-java#977

@@ -199,17 +198,9 @@ protected boolean shouldPullImage(DockerClient client, String imageName) {
return false;
}

List<Image> images = client.listImagesCmd().exec();
List<Image> images = client.listImagesCmd().withImageNameFilter(fullImageName).exec();

This comment has been minimized.

@KostyaSha

KostyaSha Jul 18, 2019
Owner

now it's missing docker.io prefix check

This comment has been minimized.

@bhuisgen

bhuisgen Jul 18, 2019
Author

Is it really useful to check that ? Doing it will force to inspect all images without filtering which will crash with the 1MB (or 3MB) output exception.

This comment has been minimized.

@KostyaSha

KostyaSha Jul 18, 2019
Owner

When i were initially implementing docker had this prefix for images, without it image search didn't work.

This comment has been minimized.

@KostyaSha

KostyaSha Jul 18, 2019
Owner

I not sure how filter works, it happens on daemon side, maybe it's dealing with this nuance

This comment has been minimized.

@KostyaSha

KostyaSha Jul 18, 2019
Owner

Well, here you can have filter (i hope it returns images with docker.io and without), but on results list you may not remove check

This comment has been minimized.

@KostyaSha

KostyaSha Jul 18, 2019
Owner

$ docker run -d -v /var/run/docker.sock:/var/run/docker.sock -p 127.0.0.1:2374:2374 bobrik/socat TCP-LISTEN:2374,fork UNIX-CONNECT:/var/run/docker.sock
3945abd2b12dd549e30e285bebd0553223b84f58f1919e8af9dbac9c45185dda
$ docker pull docker.io/nginx:latest
latest: Pulling from library/nginx
0a4690c5d889: Pull complete
9719afee3eb7: Pull complete
44446b456159: Pull complete
Digest: sha256:b4b9b3eee194703fc2fa8afa5b7510c77ae70cfba567af1376a573a967c03dbb
Status: Downloaded newer image for nginx:latest

Though http://127.0.0.1:2374/v1.16/images/json doesn't show prefix. Probably prefix appears when daemon has private registry images.

@bhuisgen bhuisgen force-pushed the bhuisgen:feature/docker-slave-label-and-filter branch 3 times, most recently from 37c5c79 to 7ea9d3d Jul 18, 2019
@bhuisgen bhuisgen force-pushed the bhuisgen:feature/docker-slave-label-and-filter branch from 7ea9d3d to b862832 Jul 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.