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

exec: fix incorrect deps computation for special mounts #5251

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

tonistiigi
Copy link
Member

@tonistiigi tonistiigi commented Aug 13, 2024

fixes docker/buildx#2479
regression from #4624 (v0.13)

Secret, SSH and Tmpfs mounts never have an input vertex and zero value for input should not be considered an input at index 0 .

Currently, if for example secret mount had a input=0, it caused content based checksum from first input(rootfs), that could take quite a lot of time when image was big and had lots of files. The computation result was cached but if there was a cache invalidation in previous commands it caused checksum to recomputed again for the command with the secret mount.

Secret, SSH and Tmpfs mounts never have an input vertex
and zero value for input should not be considered and input
at index 0 .

Currently, if for example secret mount had a input=0, it
caused content based checksum from first input(rootfs),
that could take quite a lot of time when image was big
and had lots of files. The computation result was cached
but if there was a cache invalidation in previous commands
it caused checksum to recomputed again for the command with
the secret mount.

Signed-off-by: Tonis Tiigi <tonistiigi@gmail.com>
Copy link
Member

@crazy-max crazy-max left a comment

Choose a reason for hiding this comment

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

LGTM and I can't repro anymore docker/buildx#2479

@crazy-max crazy-max added this to the v0.16.0 milestone Aug 13, 2024
@AkihiroSuda AkihiroSuda merged commit 32a794b into moby:master Aug 13, 2024
79 checks passed
@jedevc
Copy link
Member

jedevc commented Aug 13, 2024

I guess this is specifically a regression from #4624 - I'm assuming it's ab17c1d (#4624)?

Currently, if for example secret mount had a input=0

The caller should probably also be setting Input to pb.Empty, right? That's already handled - note, tmp mounts already set this, it's just ssh/secret that have a separate code path in ExecOp.Marshal.

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

Successfully merging this pull request may close these issues.

accessing secret very slow
4 participants