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

show progress bar for downloading kic base image #7012

Closed
medyagh opened this issue Mar 11, 2020 · 10 comments · Fixed by #10887
Closed

show progress bar for downloading kic base image #7012

medyagh opened this issue Mar 11, 2020 · 10 comments · Fixed by #10887
Labels
co/docker-driver Issues related to kubernetes in container kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence.
Milestone

Comments

@medyagh
Copy link
Member

medyagh commented Mar 11, 2020

we need to treat the kic base image same as VM ISO in the UI

1- download kic base image before creating container (in the same step that we download iso for VM)
2- show progress bar for docker pull (if proress bar not possible, we should show some sort of animation so the user dont be bored and they also know they are waiting on the base image be pulled.

@medyagh medyagh added the co/docker-driver Issues related to kubernetes in container label Mar 11, 2020
@medyagh medyagh added this to the v1.9.0 March 30th milestone Mar 11, 2020
@medyagh medyagh added good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. priority/important-soon Must be staffed and worked on either currently, or very soon, ideally in time for the next release. kind/feature Categorizes issue or PR as related to a new feature. labels Mar 11, 2020
@afbjorklund
Copy link
Collaborator

This would be nice to have for all containers (e.g. cache), even though the kindest is the biggest...

There's some discussion upstream, in google/go-containerregistry#670 - it adds a lot of complexity

@afbjorklund
Copy link
Collaborator

@medyagh : are you planning to load kic from a tarball too, similar to the preload ?

Or maybe just run docker pull in a separate step, before doing the 'docker run` ?

@medyagh
Copy link
Member Author

medyagh commented Mar 11, 2020

@medyagh : are you planning to load kic from a tarball too, similar to the preload ?

Or maybe just run docker pull in a separate step, before doing the 'docker run` ?

yeah I meant that wherever we download the ISO, for kic drivers we just do a docker or podman pull
and show some sort of animation
so when docker run goes, it already has the image.

@medyagh medyagh added help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. and removed good first issue Denotes an issue ready for a new contributor, according to the "help wanted" guidelines. labels Mar 12, 2020
@tstromberg tstromberg removed this from the v1.9.0 March 24th milestone Mar 18, 2020
@afbjorklund
Copy link
Collaborator

As workaround, we could load the kicbase image from a tarball that we download ?

313M gcr.io/k8s-minikube/kicbase_v0.0.9

docker load -i kicbase_v0.0.9.tgz

That way, cache would also work with the non-daemon drivers (such as podman).

@afbjorklund
Copy link
Collaborator

afbjorklund commented Apr 15, 2020

docker pull gcr.io/k8s-minikube/kicbase:v0.0.9
docker save gcr.io/k8s-minikube/kicbase:v0.0.9 | gzip -9 -c -n > kicbase_v0.0.9.tgz

@medyagh This would also make it available in china #7447

And perhaps as an alternative to using docker hub #7316 #7579

@fejta-bot
Copy link

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale.
Stale issues rot after an additional 30d of inactivity and eventually close.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle stale

@k8s-ci-robot k8s-ci-robot added the lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. label Aug 26, 2020
@fejta-bot
Copy link

Stale issues rot after 30d of inactivity.
Mark the issue as fresh with /remove-lifecycle rotten.
Rotten issues close after an additional 30d of inactivity.

If this issue is safe to close now please do so with /close.

Send feedback to sig-testing, kubernetes/test-infra and/or fejta.
/lifecycle rotten

@k8s-ci-robot k8s-ci-robot added lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. and removed lifecycle/stale Denotes an issue or PR has remained open with no activity and has become stale. labels Sep 25, 2020
@sharifelgamal sharifelgamal added lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. and removed lifecycle/rotten Denotes an issue or PR that has aged beyond stale and will be auto-closed. labels Sep 30, 2020
@afbjorklund
Copy link
Collaborator

afbjorklund commented Mar 21, 2021

Unfortunately progress is only implemented for tarball, but not for daemon.

But that API only supports running Docker anyway, so it is obsolete-by-design.

        if cc.Driver != "docker" {
                // TODO: driver == "podman"
                klog.Info("Driver isn't docker, skipping base image download")
                return
        }
        if image.ExistsImageInDaemon(cc.KicBaseImage) {
                klog.Infof("%s exists in daemon, skipping pull", cc.KicBaseImage)
                return
        }
// ExistsImageInDaemon if img exist in local docker daemon
func ExistsImageInDaemon(img string) bool {
        // Check if image exists locally
        cmd := exec.Command("docker", "images", "--format", "{{.Repository}}:{{.Tag}}@{{.Digest}}")
        if output, err := cmd.Output(); err == nil {
                if strings.Contains(string(output), img) {
                        klog.Infof("Found %s in local docker daemon, skipping pull", img)
                        return true
                }
        }
        // Else, pull it
        return false
}

@afbjorklund afbjorklund removed the help wanted Denotes an issue that needs help from a contributor. Must meet "help wanted" guidelines. label Mar 21, 2021
@afbjorklund afbjorklund added this to the v.1.19.0 milestone Mar 21, 2021
@afbjorklund
Copy link
Collaborator

Turns out that go-containerregistry doesn't do pull, but uses load from archive internally...

@praneshvr00
Copy link

yes @medyagh , I thought it was stuck and I just gonna ctrl+c, should upgrade this pulling feature.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
co/docker-driver Issues related to kubernetes in container kind/feature Categorizes issue or PR as related to a new feature. lifecycle/frozen Indicates that an issue or PR should not be auto-closed due to staleness. priority/backlog Higher priority than priority/awaiting-more-evidence.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

7 participants