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

The new load command still uses the cache directory #10744

Closed
afbjorklund opened this issue Mar 7, 2021 · 6 comments · Fixed by #10807
Closed

The new load command still uses the cache directory #10744

afbjorklund opened this issue Mar 7, 2021 · 6 comments · Fixed by #10807
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.

Comments

@afbjorklund
Copy link
Collaborator

Instead of loading to the container runtime directly, it still copies to the cache...

machine.CacheAndLoadImages

This is not needed, it should be able to transfer the file to the machine directly.

With the current API we have to make a remote disk copy, but that is more minor*...


* Eventually it should be possible to stream the tarball directly into the runtime.
But not every runtime supports this at the moment, so load from a temporary file.

@afbjorklund afbjorklund added the kind/bug Categorizes issue or PR as related to a bug. label Mar 7, 2021
@afbjorklund
Copy link
Collaborator Author

Ping @priyawadhwa

@afbjorklund
Copy link
Collaborator Author

My bad, I thought that it worked with regular files but it still works with this magic daemon. An example would have been nice.

Load a local image into minikube

Usage:
  minikube image load [flags] [options]

Use "minikube options" for a list of global command-line options (applies to all commands).

So it expects an image, rather than a file:

I0310 16:20:15.361844   35946 image.go:168] retrieving image: busybox:latest
I0310 16:20:15.362232   35946 image.go:176] daemon lookup for busybox:latest: Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running?
I0310 16:20:16.780338   35946 cache.go:135] opening:  /home/anders/.minikube/cache/images/busybox
I0310 16:20:17.286312   35946 cache.go:130] /home/anders/.minikube/cache/images/busybox exists
I0310 16:20:17.286356   35946 cache.go:82] cache image "busybox:latest" -> "/home/anders/.minikube/cache/images/busybox" took 1.924919985s
I0310 16:20:17.286375   35946 cache.go:66] save to tar file busybox -> /home/anders/.minikube/cache/images/busybox succeeded
I0310 16:20:17.286399   35946 cache.go:73] Successfully saved all images to host disk.

It doesn't work, when trying to pass a file:

❌ Exiting due to GUEST_IMAGE_LOAD: save to dir: caching images: caching image "/home/anders/.minikube/cache/images/busybox.tar": nil image for busybox.tar:latest: GET https://index.docker.io/v2/library/busybox.tar/manifests/latest: UNAUTHORIZED: authentication required; [map[Action:pull Class: Name:library/busybox.tar Type:repository]]

@afbjorklund
Copy link
Collaborator Author

Probably some overlap with minikube ssh sudo crictl pull

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Mar 10, 2021

KIND has two different commands:

Loads images into node from an archive or image on host

Usage:
  kind load [command]

Available Commands:
  docker-image  Loads docker image from host into nodes
  image-archive Loads docker image from archive into nodes
Usage:
  kind load docker-image <IMAGE> [flags]
Usage:
  kind load image-archive <IMAGE.tar> [flags]

Would be nice to have this in minikube as well

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Mar 13, 2021

I think go-containerregistry only supports Docker, it's a limitation in the API...

But it probably shouldn't say "docker image", but instead "container image".

So that it works with any container runtime, both on host and in the cluster.

All of them will support network images and archive images, though.

Examples:

docker.io/library/busybox:latest

./busybox_latest.tar

Some other tools prefix the legacy things with daemon:// or somesuch.

And the "short names", like busybox, are something left to decide upon.

Currently we are hardcoding the Docker daemon and the Docker hub...

But with Docker getting removed from Kubernetes, we probably shouldn't ?

@afbjorklund
Copy link
Collaborator Author

afbjorklund commented Mar 13, 2021

Implemented both commands, in minikube image load.

minikube image load busybox:latest
minikube image load busybox_latest.tar

If the argument exists as a file, it is assumed to be a tarball...

If you don't want it to check for local files, you can use the flags:

--daemon for docker daemon or --remote for remote registry

@medyagh medyagh added the priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. label Mar 15, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug Categorizes issue or PR as related to a bug. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants