Skip to content

[v0.8 backport] frontend: fix testMultiStageImplicitFrom to account for busybox changes#3439

Closed
thaJeztah wants to merge 4 commits intomoby:v0.8from
thaJeztah:0.8_backport_fix_tests2
Closed

[v0.8 backport] frontend: fix testMultiStageImplicitFrom to account for busybox changes#3439
thaJeztah wants to merge 4 commits intomoby:v0.8from
thaJeztah:0.8_backport_fix_tests2

Conversation

@thaJeztah
Copy link
Copy Markdown
Member

@thaJeztah thaJeztah commented Dec 27, 2022

backport of

It looks like there's some changes between busybox:1.34.0 and up; version 1.34.0 of the image did not have a /usr/bin directory (only /usr/sbin);

docker run --rm -it busybox:1.34.0 ls -al /usr/
total 12
drwxr-xr-x    3 root     root          4096 Sep 13  2021 .
drwxr-xr-x    1 root     root          4096 Dec 27 14:45 ..
drwxr-xr-x    2 daemon   daemon        4096 Sep 13  2021 sbin

But 1.34.1 and up do;

docker run --rm -it busybox:1.34.1 ls -al usr/
total 16
drwxr-xr-x    4 root     root          4096 Dec 21 18:28 .
drwxr-xr-x    1 root     root          4096 Dec 27 14:44 ..
drwxr-xr-x    2 root     root          4096 Dec 21 18:28 bin
drwxr-xr-x    2 daemon   daemon        4096 Dec 21 18:28 sbin

It's not immediately apparent what caused this change, or if it's in busybox itself, or in the official image only;
mirror/busybox@1_34_0...1_34_1

But either way, this change caused a test to fail:

sandbox.go:238: time="2022-12-27T13:45:25.294022820Z" level=debug msg="> creating 4gr5bno8rj7l3k7h9jxe3jhal [/bin/sh -c mkdir /usr/bin && echo -n foo > /usr/bin/go]" span="[golang 2/2] RUN mkdir /usr/bin && echo -n foo > /usr/bin/go"
sandbox.go:238: time="2022-12-27T13:45:25.433886983Z" level=debug msg="sandbox set key processing took 70.062631ms for container 5b4o358g2ryquk4s6ami38gqo"
sandbox.go:238: mkdir: can't create directory '/usr/bin': File exists

(cherry picked from commit 34f9898)

crazy-max
crazy-max previously approved these changes Dec 27, 2022
@crazy-max crazy-max dismissed their stale review December 27, 2022 17:44

needs fix TestSecurityModeSysfs on cgroup v2

@crazy-max
Copy link
Copy Markdown
Member

https://github.com/moby/buildkit/actions/runs/3788940749/jobs/6442288496#step:7:3762

=== CONT  TestIntegration/TestSecurityModeSysfs/worker=oci/secmode=insecure
    client_test.go:680: 
        	Error Trace:	client_test.go:680
        	            				run.go:171
        	Error:      	Received unexpected error:
        	            	rpc error: code = Unknown desc = executor failed running [mkdir /sys/fs/cgroup/cpuset/securitytest]: exit code: 1
        	            	github.com/moby/buildkit/util/stack.Enable
        	            		/src/util/stack/stack.go:77
        	            	github.com/moby/buildkit/util/grpcerrors.FromGRPC
        	            		/src/util/grpcerrors/grpcerrors.go:188
        	            	github.com/moby/buildkit/util/grpcerrors.UnaryClientInterceptor
        	            		/src/util/grpcerrors/intercept.go:41
        	            	google.golang.org/grpc.(*ClientConn).Invoke
        	            		/src/vendor/google.golang.org/grpc/call.go:35
        	            	github.com/moby/buildkit/api/services/control.(*controlClient).Solve
        	            		/src/api/services/control/control.pb.go:1321
        	            	github.com/moby/buildkit/client.(*Client).solve.func2
        	            		/src/client/solve.go:201
        	            	golang.org/x/sync/errgroup.(*Group).Go.func1
        	            		/src/vendor/golang.org/x/sync/errgroup/errgroup.go:57
        	            	runtime.goexit
        	            		/usr/local/go/src/runtime/asm_amd64.s:1571
        	            	failed to solve
        	            	github.com/moby/buildkit/client.(*Client).solve.func2
        	            		/src/client/solve.go:214
        	            	golang.org/x/sync/errgroup.(*Group).Go.func1
        	            		/src/vendor/golang.org/x/sync/errgroup/errgroup.go:57
        	            	runtime.goexit
        	            		/usr/local/go/src/runtime/asm_amd64.s:1571
        	Test:       	TestIntegration/TestSecurityModeSysfs/worker=oci/secmode=insecure

This branch needs 0f34fc6

Also don't think we should backport to this branch as we don't run buildkit tests on moby/20.10 anyway.

AkihiroSuda and others added 2 commits December 27, 2022 18:51
Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
(cherry picked from commit 030483a)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
It looks like there's some changes between `busybox:1.34.0` and up; version
1.34.0 of the image did not have a `/usr/bin` directory (only `/usr/sbin`);

    docker run --rm -it busybox:1.34.0 ls -al /usr/
    total 12
    drwxr-xr-x    3 root     root          4096 Sep 13  2021 .
    drwxr-xr-x    1 root     root          4096 Dec 27 14:45 ..
    drwxr-xr-x    2 daemon   daemon        4096 Sep 13  2021 sbin

But 1.34.1 and up do;

    docker run --rm -it busybox:1.34.1 ls -al usr/
    total 16
    drwxr-xr-x    4 root     root          4096 Dec 21 18:28 .
    drwxr-xr-x    1 root     root          4096 Dec 27 14:44 ..
    drwxr-xr-x    2 root     root          4096 Dec 21 18:28 bin
    drwxr-xr-x    2 daemon   daemon        4096 Dec 21 18:28 sbin

It's not immediately apparent what caused this change, or if it's in
busybox itself, or in the official image only;
mirror/busybox@1_34_0...1_34_1

But either way, this change caused a test to fail:

    sandbox.go:238: time="2022-12-27T13:45:25.294022820Z" level=debug msg="> creating 4gr5bno8rj7l3k7h9jxe3jhal [/bin/sh -c mkdir /usr/bin && echo -n foo > /usr/bin/go]" span="[golang 2/2] RUN mkdir /usr/bin && echo -n foo > /usr/bin/go"
    sandbox.go:238: time="2022-12-27T13:45:25.433886983Z" level=debug msg="sandbox set key processing took 70.062631ms for container 5b4o358g2ryquk4s6ami38gqo"
    sandbox.go:238: mkdir: can't create directory '/usr/bin': File exists

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
(cherry picked from commit 34f9898)
Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
@thaJeztah thaJeztah force-pushed the 0.8_backport_fix_tests2 branch from 5499176 to 55b69a2 Compare December 27, 2022 17:54
@thaJeztah
Copy link
Copy Markdown
Member Author

Tried applying that patch, but looks like it still fails on something 🤔

022/12/27 18:01:06 http2: server connection error from localhost: connection error: PROTOCOL_ERROR
=== CONT  TestIntegration/TestSecurityModeSysfs/worker=oci/secmode=insecure
    client_test.go:685: 
        	Error Trace:	client_test.go:685
        	            				run.go:171
        	Error:      	Received unexpected error:
        	            	rpc error: code = Unknown desc = executor failed running [mkdir /sys/fs/cgroup/securitytest]: exit code: 1

@crazy-max

This comment was marked as resolved.

AkihiroSuda and others added 2 commits January 3, 2023 10:58
See https://github.com/moby/moby/blob/v20.10.21/hack/dind#L28-L38

Fix issue 3265

Signed-off-by: Akihiro Suda <akihiro.suda.cz@hco.ntt.co.jp>
(cherry picked from commit e5516c2)
This branch is only used for vendoring in moby/moby, which doesn't use this.

```
=== CONT  TestIntegration/TestSecurityModeSysfs/worker=oci/secmode=insecure
    client_test.go:685:
        	Error Trace:	client_test.go:685
        	            				run.go:171
        	Error:      	Received unexpected error:
        	            	rpc error: code = Unknown desc = executor failed running [mkdir /sys/fs/cgroup/securitytest]: exit code: 1
        	            	github.com/moby/buildkit/util/stack.Enable
        	            		/src/util/stack/stack.go:77
        	            	github.com/moby/buildkit/util/grpcerrors.FromGRPC
        	            		/src/util/grpcerrors/grpcerrors.go:188
        	            	github.com/moby/buildkit/util/grpcerrors.UnaryClientInterceptor
        	            		/src/util/grpcerrors/intercept.go:41
        	            	google.golang.org/grpc.(*ClientConn).Invoke
        	            		/src/vendor/google.golang.org/grpc/call.go:35
        	            	github.com/moby/buildkit/api/services/control.(*controlClient).Solve
        	            		/src/api/services/control/control.pb.go:1321
        	            	github.com/moby/buildkit/client.(*Client).solve.func2
        	            		/src/client/solve.go:201
        	            	golang.org/x/sync/errgroup.(*Group).Go.func1
        	            		/src/vendor/golang.org/x/sync/errgroup/errgroup.go:57
        	            	runtime.goexit
        	            		/usr/local/go/src/runtime/asm_amd64.s:1571
        	            	failed to solve
        	            	github.com/moby/buildkit/client.(*Client).solve.func2
        	            		/src/client/solve.go:214
        	            	golang.org/x/sync/errgroup.(*Group).Go.func1
        	            		/src/vendor/golang.org/x/sync/errgroup/errgroup.go:57
        	            	runtime.goexit
        	            		/usr/local/go/src/runtime/asm_amd64.s:1571
        	Test:       	TestIntegration/TestSecurityModeSysfs/worker=oci/secmode=insecure
...
...
    sandbox.go:223: time="2023-01-03T10:10:16Z" level=debug msg="> creating 501jemvwbacokctnpm9779p7y [mkdir /sys/fs/cgroup/securitytest]"
    sandbox.go:223: mkdir: can't create directory '/sys/fs/cgroup/securitytest': File exists
```

Signed-off-by: CrazyMax <crazy-max@users.noreply.github.com>
@crazy-max
Copy link
Copy Markdown
Member

Closing this one as we are not running BuildKit tests on Moby 20.10 branch anyway.

@crazy-max crazy-max closed this Jan 30, 2023
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