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

Add progress events to LoadDockerStep #1960

Merged
merged 4 commits into from
Sep 6, 2019

Conversation

TadCordle
Copy link
Contributor

Fixes #1959.

@TadCordle TadCordle requested a review from a team September 6, 2019 19:57
ImageTarball imageTarball = new ImageTarball(builtImage, targetImageReference);
try (ProgressEventDispatcher progressEventDispatcher =
progressEventDispatcherFactory.create(
"loading to Docker daemon", imageTarball.getSize());
Copy link
Member

Choose a reason for hiding this comment

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

The only problem is that we will go over the total progress allocation, because it will also write two more files (config.json and manifest.json), whose size we cannot know ahead, unfortunately. We won't crash, as we lifted the assertion that the progress completion cannot go over the given allocation at some point due to some corner case (#1522), but still, the computation here will always be incorrect. BTW, BlobPuller uses blobSizeListener coming from ThrottledProgressEventDispatcherWrapper::setProgressTarget() to lazily set the total progress, so we can do the same, but this require more changes to ImageTarball, so I can't say I like it.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I don't really mind that much that the calculation is incorrect as long as it's close. The layers are almost always going to be much bigger than the manifest and configuration, so the progress being reported will at least be close to accurate. It certainly doesn't matter with the plugins, since the progress bar moves too fast to be able to even tell that there's any inaccuracy, but I suppose it might matter a little bit for jib-core users if they need totally accurate progress reporting. But even then, the progress event API still isn't finalized.

Copy link
Member

Choose a reason for hiding this comment

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

Agreed. Let's just leave a code comment that the progress will always go over the limit.

@TadCordle TadCordle merged commit bafd55c into master Sep 6, 2019
@TadCordle TadCordle deleted the i1959-loaddockerstep-progress branch September 6, 2019 21:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add progress indicator to LoadDockerStep
3 participants