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

Revert "detach-netns: simplify unshare helper" #500

Merged
merged 3 commits into from
Mar 10, 2025

Conversation

AkihiroSuda
Copy link
Member

@AkihiroSuda AkihiroSuda commented Mar 10, 2025

This reverts commit 0dfe464.


Revert:

Due to a regression moby/buildkit#5825 (comment)

This might be a regression in v2.3.3

=== FAIL: frontend/dockerfile TestIntegration (0.05s)
    run.go:315: copied local:/mainline.tar to local mirror localhost:44447/buildkit_test/mtd7m2emwrrj5deqz9jduk2hb:latest
time="2025-03-10T01:18:46Z" level=info msg="fetch failed after status: 404 Not Found" host="localhost:44447"
    run.go:315: copied docker.io/amd64/alpine:latest@sha256:25fad2a32ad1f6f510e528448ae1ec69a28ef81916a004d3629874104f8a7f70 to local mirror localhost:44447/library/alpine:latest
time="2025-03-10T01:18:47Z" level=info msg="fetch failed after status: 404 Not Found" host="localhost:44447"
    run.go:315: copied docker.io/amd64/busybox:stable-musl to local mirror localhost:44447/library/busybox:stable-musl
time="2025-03-10T01:18:48Z" level=info msg="fetch failed after status: 404 Not Found" host="localhost:44447"
    run.go:315: copied docker.io/amd64/busybox:latest@sha256:023917ec6a886d0e8e15f28fb543515a5fcd8d938edb091e8147db4efed388ee to local mirror localhost:44447/library/busybox:latest
    run.go:315: copied docker.io/amd64/debian:bullseye-20230109-slim@sha256:1acb06a0c31fb467eb8327ad361f1091ab265e0bf26d452dea45dcb0c0ea5e75 to local mirror localhost:44947/amd64/debian:bullseye-20230109-slim
== FAIL: frontend/dockerfile TestIntegration (0.09s)
    run.go:315: copied docker.io/amd64/alpine:latest@sha256:25fad2a32ad1f6f510e528448ae1ec69a28ef81916a004d3629874104f8a7f70 to local mirror localhost:42351/library/alpine:latest
time="2025-03-10T01:18:45Z" level=info msg="fetch failed after status: 404 Not Found" host="localhost:42351"
    run.go:315: copied docker.io/amd64/busybox:stable-musl to local mirror localhost:42351/library/busybox:stable-musl
time="2025-03-10T01:18:46Z" level=info msg="fetch failed after status: 404 Not Found" host="localhost:42351"
    run.go:315: copied docker.io/amd64/busybox:latest@sha256:023917ec6a886d0e8e15f28fb543515a5fcd8d938edb091e8147db4efed388ee to local mirror localhost:42351/library/busybox:latest
    run.go:315: copied docker.io/amd64/debian:bullseye-20230109-slim@sha256:1acb06a0c31fb467eb8327ad361f1091ab265e0bf26d452dea45dcb0c0ea5e75 to local mirror localhost:35903/amd64/debian:bullseye-20230109-slim

=== FAIL: frontend TestFrontendIntegration/TestRefStatFile/worker=oci-rootless-slirp4netns-detachnetns (15.12s)
    run.go:238: 
        	Error Trace:	/src/util/testutil/integration/run.go:238
        	Error:      	Received unexpected error:
        	            	failed dialing: /tmp/bktest_buildkitd3359171510/buildkitd.sock
        	            	github.com/moby/buildkit/util/testutil/integration.WaitSocket
        	            		/src/util/testutil/integration/util.go:138
        	            	github.com/moby/buildkit/util/testutil/workers.runBuildkitd
        	            		/src/util/testutil/workers/util.go:115
        	            	github.com/moby/buildkit/util/testutil/workers.(*OCI).New
        	            		/src/util/testutil/workers/oci.go:85
        	            	github.com/moby/buildkit/util/testutil/integration.newSandbox
        	            		/src/util/testutil/integration/sandbox.go:127
        	            	github.com/moby/buildkit/util/testutil/integration.Run.func2.1
        	            		/src/util/testutil/integration/run.go:237
        	            	testing.tRunner
        	            		/usr/local/go/src/testing/testing.go:1690
        	            	runtime.goexit
        	            		/usr/local/go/src/runtime/asm_amd64.s:1700
        	            	creating worker
        	            	github.com/moby/buildkit/util/testutil/integration.newSandbox
        	            		/src/util/testutil/integration/sandbox.go:129
        	            	github.com/moby/buildkit/util/testutil/integration.Run.func2.1
        	            		/src/util/testutil/integration/run.go:237
        	            	testing.tRunner
        	            		/usr/local/go/src/testing/testing.go:1690
        	            	runtime.goexit
        	            		/usr/local/go/src/runtime/asm_amd64.s:1700
        	Test:       	TestFrontendIntegration/TestRefStatFile/worker=oci-rootless-slirp4netns-detachnetns
2025/03/10 01:21:19 stdout: /usr/bin/sudo -u #1000 -i -- exec rootlesskit --net=slirp4netns --copy-up=/etc --disable-host-loopback --detach-netns buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --config=/tmp/bktest_config3279013865/buildkitd.toml --root /tmp/bktest_buildkitd43008409 --addr unix:///tmp/bktest_buildkitd43008409/buildkitd.sock --debug
2025/03/10 01:21:19 stderr: /usr/bin/sudo -u #1000 -i -- exec rootlesskit --net=slirp4netns --copy-up=/etc --disable-host-loopback --detach-netns buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --config=/tmp/bktest_config3279013865/buildkitd.toml --root /tmp/bktest_buildkitd43008409 --addr unix:///tmp/bktest_buildkitd43008409/buildkitd.sock --debug
2025/03/10 01:21:19 > StartCmd 2025-03-10 01:21:04.558913329 +0000 UTC m=+0.030075216 /usr/bin/sudo -u #1000 -i -- exec rootlesskit --net=slirp4netns --copy-up=/etc --disable-host-loopback --detach-netns buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --config=/tmp/bktest_config3279013865/buildkitd.toml --root /tmp/bktest_buildkitd43008409 --addr unix:///tmp/bktest_buildkitd43008409/buildkitd.sock --debug
2025/03/10 01:21:19 [rootlesskit:child ] error: failed to create a detached netns on "/tmp/rootlesskit2584759687/netns": failed to Statfs "/proc/14943/task/15004/ns/net": no such file or directory
2025/03/10 01:21:19 > sending sigterm 2025-03-10 01:21:19.6604122 +0000 UTC m=+15.131574057
2025/03/10 01:21:19 > sending SIGTERM 2025-03-10 01:21:19.660419885 +0000 UTC m=+15.131581741
2025/03/10 01:21:19 > stopped 2025-03-10 01:21:19.661570195 +0000 UTC m=+15.132732052 signal: terminated -1
    --- FAIL: TestFrontendIntegration/TestRefStatFile/worker=oci-rootless-slirp4netns-detachnetns (15.12s)

Originally posted by @AkihiroSuda in moby/buildkit#5825 (comment)

@AkihiroSuda AkihiroSuda added this to the v2.3.4 milestone Mar 10, 2025
This reverts commit 0dfe464.

Signed-off-by: Akihiro Suda <[email protected]>
Signed-off-by: Akihiro Suda <[email protected]>
Signed-off-by: Akihiro Suda <[email protected]>
@AkihiroSuda AkihiroSuda marked this pull request as ready for review March 10, 2025 01:57
@AkihiroSuda AkihiroSuda merged commit c6df51d into rootless-containers:master Mar 10, 2025
6 checks passed
if err != nil {
return err
}
defer tempNS.Close()
tempNSPath := tempNS.Path()
Copy link
Contributor

Choose a reason for hiding this comment

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

@AkihiroSuda, I don't understand why ns.WithNetNSPath cannot detect the AppArmor profile configuration.

Copy link
Member Author

Choose a reason for hiding this comment

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

Probably a race condition?

nerdctl CI was green without reverting this commit, but BuildKit CI was failing.

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