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

build: sublogger to show docker load progress output #1994

Merged
merged 1 commit into from
Sep 13, 2023

Conversation

crazy-max
Copy link
Member

@crazy-max crazy-max commented Aug 8, 2023

Adds sublogger to show load progress when importing to docker:

record-2023-08-10.105831.mp4
$ docker buildx create --name foo
$ docker buildx --builder foo bake --load https://github.com/crazy-max/docker-docker.git
...
#35 exporting to docker image format
#35 exporting layers
#35 exporting layers 7.3s done
#35 exporting manifest sha256:3ddc93cb4082a582552e7b32cfe439ae4fc2c003f353a8259e055a8b9e373fb6 0.0s done
#35 exporting config sha256:b2f1eaf0595fd4ccb26c63715aca3698d6433d9e34220cd8db358e0332d2b18e 0.0s done
#35 sending tarball
#35 ...

#36 importing to docker
#36 loading layer 4270763b4b7f 294.91kB / 27.73MB 3.0s done
#36 loading layer fc8ab555be16 557.06kB / 70.77MB 2.5s done
#36 loading layer b7eb284ce929 163.84kB / 13.78MB 1.7s done
#36 loading layer 13a4dd8d8fd7 557.06kB / 52.93MB 1.5s done
#36 loading layer 5f70bf18a086 32B / 32B 1.0s done
#36 loading layer a7f29fd70512 196.61kB / 17.46MB 1.0s done
#36 loading layer a950fc94a643 196.61kB / 17.78MB 0.8s done
#36 loading layer d859045f8607 458.75kB / 45.74MB 0.5s done
#36 loading layer 12aba25a1c9f 332B / 332B 0.1s done
#36 loading layer 0dbb41e3c807 116B / 116B 0.1s done
#36 loading layer 089d02ae3a66 546B / 546B 0.1s done
#36 loading layer a08aa04b3edb 1.02kB / 1.02kB 0.1s done
#36 DONE 3.0s

@crazy-max crazy-max requested review from tonistiigi and jedevc August 10, 2023 14:56
@crazy-max crazy-max marked this pull request as ready for review August 10, 2023 15:17
@jedevc
Copy link
Collaborator

jedevc commented Aug 11, 2023

Not a blocker: I wonder if we should show layer extraction? Especially on lower-powered machines (e.g. raspberry pis), this is probably quite a slow step.

I put together an idea of how we might do something like this in moby/buildkit#4041 - the issue is that it involves updating the Name of a VertexStatus which today isn't supported (or we end up having to have 2 VertexStatuss, one for downloading, one for extracting, which clogs up the progress output).

@jedevc jedevc added this to the v0.12.0 milestone Aug 14, 2023
@crazy-max crazy-max force-pushed the load-progress branch 3 times, most recently from f46315e to 721c234 Compare September 12, 2023 20:11
func fromReader(w progress.Writer, name string, rc io.ReadCloser) error {
dgst := digest.FromBytes([]byte(identity.NewID()))
tm := time.Now()
const minTimeDelta = 5 * time.Second
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

1 or 2 is fine in here. 5sec already feels like something might be stuck if there are not many layers.

@crazy-max crazy-max merged commit e018f8b into docker:master Sep 13, 2023
59 checks passed
@crazy-max crazy-max deleted the load-progress branch September 13, 2023 06:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants