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 ExtractTarStep and SaveDockerStep #1906

Merged
merged 16 commits into from
Aug 16, 2019
Merged

Conversation

TadCordle
Copy link
Contributor

@TadCordle TadCordle commented Aug 15, 2019

Towards #1468 and #1905.

Will probably need to figure out ways to optimize this in a follow-up. For local images, we unfortunately need to compress uncompressed layers and recalculate the compressed layer digests, and this is a bit slow.

For Jib-built images, we name all the layers with their digest, so we could maybe leverage that, but there's no guarantee that this is true for all tarballs (e.g. a docker saved tarball contains uncompressed layers named "layer.tar" in a folder that is named with the uncompressed layer's digest).

Edit: We discussed in the design meeting that it might make sense to save the compressed layer + digest in a folder named with the layer's diff id in Jib's cache; this way we can retrieve the diff ID for a layer in a local base image, use that to check if the layer is in the cache, and only do all the work of compressing/calculating the digest if it isn't.

Also todo: check blob existence on target registry.

@TadCordle TadCordle requested a review from a team August 15, 2019 16:29
* @param blob the {@link Blob} to compress
* @return the compressed {@link Blob}
*/
public static Blob compress(Blob blob) {
Copy link
Contributor Author

@TadCordle TadCordle Aug 15, 2019

Choose a reason for hiding this comment

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

Note: this method was moved from CacheTest.

Copy link
Member

@chanseokoh chanseokoh left a comment

Choose a reason for hiding this comment

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

Reviewed the first half. I'll look into the rest later.

Copy link
Member

@chanseokoh chanseokoh left a comment

Choose a reason for hiding this comment

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

LGTM, just some minor things.

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.

4 participants