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

ociruntime: reapply tar unpack #8023

Merged
merged 6 commits into from
Dec 13, 2024
Merged

Conversation

sluongng
Copy link
Contributor

@sluongng sluongng commented Dec 6, 2024

This change include a few small changes inside:

@sluongng sluongng requested review from bduffany and fmeum December 6, 2024 16:07
@sluongng sluongng force-pushed the sluongng/reapply-go-tar-unpack branch 2 times, most recently from e8794bf to e8e3285 Compare December 6, 2024 16:09
@sluongng sluongng marked this pull request as ready for review December 6, 2024 16:11
@sluongng
Copy link
Contributor Author

sluongng commented Dec 6, 2024

--- PASS: TestPullImage (74.35s)
    --- PASS: TestPullImage/dockerhub_busybox (1.09s)
    --- PASS: TestPullImage/ghcr_nix (7.38s)
    --- PASS: TestPullImage/executor_image (17.39s)
    --- PASS: TestPullImage/executor_docker (24.34s)
    --- PASS: TestPullImage/workflow_2004 (14.00s)
    --- PASS: TestPullImage/workflow_2204 (10.16s)
PASS

Also tested some public images that our users used and did not find any issues.

@@ -102,6 +102,72 @@ go_test(
],
)

# keep
Copy link
Member

Choose a reason for hiding this comment

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

nit: we have a few of these types of targets elsewhere but they are a bit of a hassle to maintain because gazelle doesn't handle them properly. I think it would be fine to use a flag (instead of env var) to guard the test, and then people could run it by passing the flag to the "normal" test target, like bazel test enterprise/server/remote_execution/containers/ociruntime:ociruntime_test --config=remote --test_arg=-test_pull=true (optionally adding --test_filter=TestPullImage to run just that test case)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will fix

return status.UnavailableErrorf("create directory: %s", err)
}
case tar.TypeReg:
if err := os.MkdirAll(dir, os.ModePerm); err != nil {
Copy link
Member

Choose a reason for hiding this comment

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

do we need to make the parent dir for TypeSymlink and TypeLink as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yeah, I can add the create parent dir to all known cases

if err := os.Link(source, target); err != nil {
return status.UnavailableErrorf("create hard link: %s", err)
}
if err := os.Chown(target, header.Uid, header.Gid); err != nil {
Copy link
Contributor

Choose a reason for hiding this comment

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

As far as I understand hardlinks, this would change the metadata of the target, which is shared between all hardlinks. Since we ensure that the target is created by this tar and thus could have had a mode set, should we skip it here to prevent flip-flopping? I don't know how tar handles 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.

will remove this

@sluongng sluongng force-pushed the sluongng/reapply-go-tar-unpack branch from e8e3285 to bfe7051 Compare December 12, 2024 16:18
@sluongng sluongng requested review from fmeum and bduffany December 13, 2024 11:39
@sluongng sluongng force-pushed the sluongng/reapply-go-tar-unpack branch from bfe7051 to 24962b0 Compare December 13, 2024 11:58
@sluongng sluongng merged commit f5ce15e into master Dec 13, 2024
12 of 15 checks passed
@sluongng sluongng deleted the sluongng/reapply-go-tar-unpack branch December 13, 2024 19:43
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.

3 participants