Skip to content

Conversation

@hanwen-flow
Copy link
Contributor

@hanwen-flow hanwen-flow commented May 6, 2025

What type of PR is this?

/kind cleanup

What this PR does / why we need it:

  • containerImageRef.NewImageSource is hard to follow because it is large; this reduces complexity a bit

  • container commit is bottlenecked (among others) by running the layer blob through sha256, which is single-threaded. This refactoring is a preparation to split the blob into multiple streams which can be processed in parallel (not part of this PR).

How to verify it

Which issue(s) this PR fixes:

None

Special notes for your reviewer:

Does this PR introduce a user-facing change?

no.

@openshift-ci openshift-ci bot added the kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. label May 6, 2025
@packit-as-a-service
Copy link

Ephemeral COPR build failed. @containers/packit-build please check.

@TomSweeneyRedHat
Copy link
Member

@hanwen-flow thanks for the PR. Looks like your branch needs an update, and there are all kinds of failing tests.

@hanwen-flow
Copy link
Contributor Author

Looks like your branch needs an update, and there are all kinds of failing tests.

you folks need to fix your CI:

go: go.mod requires go >= 1.23.3 (running go 1.23.1; GOTOOLCHAIN=local)

This PR doesn't introduce new functionality, hence no new tests (somebody with permissions has to set a label on this PR)

@hanwen-flow
Copy link
Contributor Author

@giuseppe

@hanwen-flow
Copy link
Contributor Author

@giuseppe , @TomSweeneyRedHat could you add the 'No New Tests' github label here?

@rhatdan rhatdan added the No New Tests Allow PR to proceed without adding regression tests label May 13, 2025
@hanwen-flow
Copy link
Contributor Author

ping? @TomSweeneyRedHat @giuseppe @mtrmac

Copy link
Member

@giuseppe giuseppe left a comment

Choose a reason for hiding this comment

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

LGTM

@openshift-ci
Copy link
Contributor

openshift-ci bot commented May 19, 2025

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: giuseppe, hanwen-flow

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@hanwen-flow
Copy link
Contributor Author

needs a second reviewer. @TomSweeneyRedHat , @mtrmac ?

@mtrmac
Copy link
Contributor

mtrmac commented May 20, 2025

I’m afraid I can’t spend much time on this now, and this is probably locally not helpful: I happened to notice parallel #5743 .

@hanwen-flow
Copy link
Contributor Author

parallel #5743 .

thanks for the heads-up, I'll need to update this PR, but that change is a big improvement. Thanks, @aaronlehmann !

@github-actions
Copy link

A friendly reminder that this PR had no activity for 30 days.

Just for ease of reviewing.

No functional changes, hence no test updates.

Signed-off-by: Han-Wen Nienhuys <[email protected]>
No functional changes, hence no test updates.

Signed-off-by: Han-Wen Nienhuys <[email protected]>
No functional changes, hence no test updates.

Signed-off-by: Han-Wen Nienhuys <[email protected]>
No functional changes, hence no test updates.

Signed-off-by: Han-Wen Nienhuys <[email protected]>
No functional changes (hence, no tests).

Signed-off-by: Han-Wen Nienhuys <[email protected]>
No functional changes (hence, no tests).

Signed-off-by: Han-Wen Nienhuys <[email protected]>
@github-actions
Copy link

A friendly reminder that this PR had no activity for 30 days.

Comment on lines +830 to +832
if err := layerFile.Close(); err != nil {
return nil, fmt.Errorf("storing %s to file: on file close: %w", what, err)
}
Copy link
Contributor

Choose a reason for hiding this comment

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

there's a defer up top that should take care of this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the defer handles resource freeing in error paths. For ensuring success, the return value of close should still be checked, as closing the file may flush buffers, which can fail.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ping? @danishprakash @giuseppe @mtrmac

I'd love to work further on this, but rebasing to keep up with changes is here is a lot of work.

For further context, introducing a separate routine for saving blobs enables splitting a single large layer into multiple disjunct layers. These can then be written and hashed in parallel. I've seen 2-3x speed improvement for podman commit.

Copy link
Contributor

Choose a reason for hiding this comment

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

@flouthoc maybe? Also Cc: @sebsoto , who suggested ca836c5 . Hopefully the two proposals are compatible.

Copy link

Choose a reason for hiding this comment

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

Thanks for tagging me. I didn't know this existed.

My proposed change was just to reduce the complexity of the existing code and help document existing behaviors.
The slightly updated version is here sebsoto@eaa8098

@github-actions github-actions bot removed the stale-pr label Jul 26, 2025
@hanwen-flow
Copy link
Contributor Author

@giuseppe - do you know how we can get this to move?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved kind/cleanup Categorizes issue or PR as related to cleaning up code, process, or technical debt. No New Tests Allow PR to proceed without adding regression tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants