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

fix(gzip)!: change the default block size #529

Merged
merged 1 commit into from
Oct 20, 2023

Conversation

rchincha
Copy link
Contributor

BREAKING CHANGE: the default gzip block size is changed to 256<<12, was previously 256<<10.

The layers created by ecosystem tools and stacker are different for the same tar content. Unfortunately, the OCI image spec doesn't standardize/encode this in the document. Hence, we standardize in the implementation.

We now link against our own fork: github.com/project-stacker/umoci which may change depending on the PR getting merged to upstream.

What type of PR is this?

Which issue does this PR fix:

What does this PR do / Why do we need it:

If an issue # is not available please add repro steps and logs showing the issue:

Testing done on this change:

Automation added to e2e:

Will this break upgrades or downgrades?

Does this PR introduce any user-facing change?:


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@rchincha rchincha requested a review from raharper October 19, 2023 20:16
pkg/overlay/pack.go Outdated Show resolved Hide resolved
@codecov
Copy link

codecov bot commented Oct 19, 2023

Codecov Report

Merging #529 (d89af75) into main (565b032) will not change coverage.
Report is 1 commits behind head on main.
The diff coverage is 0.00%.

@@           Coverage Diff           @@
##             main     #529   +/-   ##
=======================================
  Coverage   13.34%   13.34%           
=======================================
  Files          40       40           
  Lines        5852     5852           
=======================================
  Hits          781      781           
  Misses       4943     4943           
  Partials      128      128           
Files Coverage Δ
pkg/overlay/pack.go 0.00% <0.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Contributor

@raharper raharper left a comment

Choose a reason for hiding this comment

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

Suggestion in commit message:

A tar layer with the same content but compressed with different gzip blocksize
will result in different sha256sums in the final OCI Image. Ecosystem tools
have one current size in use and stacker's current size differ.

Interactions between a stacker-built OCI image and ecosystem tools
which recompress lower layers results in bloated registries which will have
identical tar content but different compressed sha256 blobs.

Unfortunately, the OCI image spec doesn't standardize/encode this in the
specification document. Hence, we change to the current common block size used
in the ecosystem here in the stacker implementation.

BREAKING CHANGE: the default gzip block size is changed to 256<<12, was
previously 256<<10.

A tar layer with the same content but compressed with different gzip
blocksize will result in different sha256sums in the final OCI Image.
Ecosystem tools have one current size in use and stacker's current size
differ.

Interactions between a stacker-built OCI image and ecosystem tools which
recompress lower layers results in bloated registries which will have
identical tar content but different compressed sha256 blobs.

Unfortunately, the OCI image spec doesn't standardize/encode this in the
specification document. Hence, we change to the current common block
size used in the ecosystem here in the stacker implementation.

We now link against our own fork: github.com/project-stacker/umoci
which may change depending on the PR getting merged to upstream.

Signed-off-by: Ramkumar Chinchani <[email protected]>
@rchincha
Copy link
Contributor Author

Suggestion in commit message:

Updated.

@rchincha rchincha requested a review from raharper October 19, 2023 21:11
@rchincha rchincha merged commit 0cf2d70 into project-stacker:main Oct 20, 2023
8 of 9 checks passed
rchincha added a commit to rchincha/stacker that referenced this pull request Nov 17, 2023
BREAKING CHANGE: the default gzip block size is changed to 256<<12, was
previously 256<<10.

A tar layer with the same content but compressed with different gzip
blocksize will result in different sha256sums in the final OCI Image.
Ecosystem tools have one current size in use and stacker's current size
differ.

Interactions between a stacker-built OCI image and ecosystem tools which
recompress lower layers results in bloated registries which will have
identical tar content but different compressed sha256 blobs.

Unfortunately, the OCI image spec doesn't standardize/encode this in the
specification document. Hence, we change to the current common block
size used in the ecosystem here in the stacker implementation.

We now link against our own fork: github.com/project-stacker/umoci
which may change depending on the PR getting merged to upstream.

Signed-off-by: Ramkumar Chinchani <[email protected]>
(cherry picked from commit 0cf2d70)
Signed-off-by: Ramkumar Chinchani <[email protected]>
rchincha added a commit to rchincha/stacker that referenced this pull request Nov 17, 2023
BREAKING CHANGE: the default gzip block size is changed to 256<<12, was
previously 256<<10.

A tar layer with the same content but compressed with different gzip
blocksize will result in different sha256sums in the final OCI Image.
Ecosystem tools have one current size in use and stacker's current size
differ.

Interactions between a stacker-built OCI image and ecosystem tools which
recompress lower layers results in bloated registries which will have
identical tar content but different compressed sha256 blobs.

Unfortunately, the OCI image spec doesn't standardize/encode this in the
specification document. Hence, we change to the current common block
size used in the ecosystem here in the stacker implementation.

We now link against our own fork: github.com/project-stacker/umoci
which may change depending on the PR getting merged to upstream.

Signed-off-by: Ramkumar Chinchani <[email protected]>
(cherry picked from commit 0cf2d70)
Signed-off-by: Ramkumar Chinchani <[email protected]>
rchincha added a commit that referenced this pull request Nov 17, 2023
BREAKING CHANGE: the default gzip block size is changed to 256<<12, was
previously 256<<10.

A tar layer with the same content but compressed with different gzip
blocksize will result in different sha256sums in the final OCI Image.
Ecosystem tools have one current size in use and stacker's current size
differ.

Interactions between a stacker-built OCI image and ecosystem tools which
recompress lower layers results in bloated registries which will have
identical tar content but different compressed sha256 blobs.

Unfortunately, the OCI image spec doesn't standardize/encode this in the
specification document. Hence, we change to the current common block
size used in the ecosystem here in the stacker implementation.

We now link against our own fork: github.com/project-stacker/umoci
which may change depending on the PR getting merged to upstream.


(cherry picked from commit 0cf2d70)

Signed-off-by: Ramkumar Chinchani <[email protected]>
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.

2 participants