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

Dedupe layer uploads where possible #396

Merged
merged 4 commits into from
Mar 6, 2019
Merged

Dedupe layer uploads where possible #396

merged 4 commits into from
Mar 6, 2019

Conversation

imjasonh
Copy link
Collaborator

@imjasonh imjasonh commented Mar 6, 2019

Fixes issue in GoogleContainerTools/kaniko#599

Prior to #301 we deduped layers using BlobSet, but that was dropped when some layers might not be digestable ahead of time.

TODO: tests, I wanted to get this out in case there were comments about the overall direction.

@codecov-io
Copy link

codecov-io commented Mar 6, 2019

Codecov Report

Merging #396 into master will increase coverage by 0.2%.
The diff coverage is 87.5%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master     #396     +/-   ##
=========================================
+ Coverage   51.67%   51.87%   +0.2%     
=========================================
  Files          78       78             
  Lines        3712     3728     +16     
=========================================
+ Hits         1918     1934     +16     
+ Misses       1504     1501      -3     
- Partials      290      293      +3
Impacted Files Coverage Δ
pkg/v1/stream/layer.go 79.16% <100%> (+2.6%) ⬆️
pkg/v1/remote/write.go 61.27% <75%> (+1.36%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4aac97b...0d3185a. Read the comment docs.

Copy link
Collaborator

@jonjohnsonjr jonjohnsonjr left a comment

Choose a reason for hiding this comment

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

approach seems fine to me

@imjasonh imjasonh changed the title [WIP] Dedupe layer uploads where possible Dedupe layer uploads where possible Mar 6, 2019
var g errgroup.Group
seen := map[v1.Hash]struct{}{}
Copy link
Contributor

Choose a reason for hiding this comment

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

If you call this uploaded - it'll probably be a little clearer.

Also if you use map[v1.Hash]bool, then you can do

if uploaded[h]

@imjasonh imjasonh merged commit 1b9964c into google:master Mar 6, 2019
@imjasonh imjasonh deleted the fix branch March 6, 2019 17:42
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.

4 participants