-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Conversation
* @param blob the {@link Blob} to compress | ||
* @return the compressed {@link Blob} | ||
*/ | ||
public static Blob compress(Blob blob) { |
There was a problem hiding this comment.
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
.
jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/ExtractTarStep.java
Show resolved
Hide resolved
There was a problem hiding this 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.
jib-core/src/main/java/com/google/cloud/tools/jib/blob/Blobs.java
Outdated
Show resolved
Hide resolved
jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/ExtractTarStep.java
Outdated
Show resolved
Hide resolved
jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/ExtractTarStep.java
Outdated
Show resolved
Hide resolved
jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/ExtractTarStep.java
Outdated
Show resolved
Hide resolved
jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/ExtractTarStep.java
Show resolved
Hide resolved
jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/ExtractTarStep.java
Show resolved
Hide resolved
jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/ExtractTarStep.java
Outdated
Show resolved
Hide resolved
jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/ExtractTarStep.java
Outdated
Show resolved
Hide resolved
jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/ExtractTarStep.java
Show resolved
Hide resolved
jib-core/src/main/java/com/google/cloud/tools/jib/builder/steps/SaveDockerStep.java
Outdated
Show resolved
Hide resolved
There was a problem hiding this 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.
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 save
d 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.