Skip to content

Commit

Permalink
history: fix empty Exporters attribute
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <1951866+crazy-max@users.noreply.github.com>
  • Loading branch information
crazy-max committed Jun 11, 2024
1 parent eed17a4 commit fa2a8b9
Show file tree
Hide file tree
Showing 8 changed files with 61 additions and 15 deletions.
1 change: 1 addition & 0 deletions client/client_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2937,6 +2937,7 @@ func testMultipleExporters(t *testing.T, sb integration.Sandbox) {
break
}
require.Equal(t, ref, ev.Record.Ref)
require.Len(t, ev.Record.Exporters, 4)

Check failure on line 2940 in client/client_test.go

View workflow job for this annotation

GitHub Actions / test / run (containerd, ./client ./cmd/buildctl ./worker/containerd ./solver ./frontend, integration)

Failed: client/TestIntegration/TestMultipleExporters/worker=containerd

=== RUN TestIntegration/TestMultipleExporters/worker=containerd === PAUSE TestIntegration/TestMultipleExporters/worker=containerd === CONT TestIntegration/TestMultipleExporters/worker=containerd client_test.go:2940: Error Trace: /src/client/client_test.go:2940 /src/util/testutil/integration/run.go:95 /src/util/testutil/integration/run.go:212 Error: "[Type:"image" Attrs:<key:"name" value:"localhost:36163/buildkit/build/exporter:image" > Type:"image" Attrs:<key:"name" value:"localhost:36163/buildkit/build/alternative:image" > Attrs:<key:"oci-mediatypes" value:"true" > Type:"local" Type:"local" Type:"tar" Type:"tar" ]" should have 4 item(s), but has 6 Test: TestIntegration/TestMultipleExporters/worker=containerd sandbox.go:133: stdout: /usr/bin/containerd --config /tmp/bktest_containerd1029714144/config.toml sandbox.go:133: stderr: /usr/bin/containerd --config /tmp/bktest_containerd1029714144/config.toml sandbox.go:136: > StartCmd 2024-06-11 11:02:33.031711159 +0000 UTC m=+44.416008957 /usr/bin/containerd --config /tmp/bktest_containerd1029714144/config.toml sandbox.go:136: time="2024-06-11T11:02:33Z" level=warning msg="containerd config version `1` has been deprecated and will be converted on each startup in containerd v2.0, use `containerd config migrate` after upgrading to containerd 2.0 to avoid conversion on startup" sandbox.go:136: time="2024-06-11T11:02:33.047845539Z" level=info msg="starting containerd" revision=ae71819c4f5e67bb4d5ae76a6b735f29cc25774e version=v1.7.18 sandbox.go:136: time="2024-06-11T11:02:33.061525116Z" level=info msg="loading plugin \"io.containerd.event.v1.exchange\"..." type=io.containerd.event.v1 sandbox.go:136: time="2024-06-11T11:02:33.061590969Z" level=info msg="loading plugin \"io.containerd.internal.v1.opt\"..." type=io.containerd.internal.v1 sandbox.go:136: time="2024-06-11T11:02:33.061670567Z" level=info msg="loading plugin \"io.containerd.warning.v1.deprecations\"..." type=io.containerd.warning.v1 sandbox.go:136: time="2024-06-11T11:02:33.061730980Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.blockfile\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:02:33.061874828Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.blockfile\"..." error="no scratch file generator: skip plugin" type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:02:33.061934900Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.devmapper\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:02:33.061988369Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.devmapper" error="devmapper not configured" sandbox.go:136: time="2024-06-11T11:02:33.062023695Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.native\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:02:33.062202618Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.overlayfs\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:02:33.062565494Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.aufs\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:02:33.063392985Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.aufs\"..." error="aufs is not supported (modprobe aufs failed: exit status 1 \"modprobe: can't change directory to '/lib/modules': No such file or directory\\n\"): skip plugin" type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:02:33.063424063Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.zfs\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:02:33.063606594Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.zfs\"..." error="path /tmp/bktest_containerd1029714144/root/io.containerd.snapshotter.v1.zfs must be a zfs filesystem to be used with

Check failure on line 2940 in client/client_test.go

View workflow job for this annotation

GitHub Actions / test / run (containerd-rootless, ./client ./cmd/buildctl ./worker/containerd ./solver ./frontend, integr...

Failed: client/TestIntegration/TestMultipleExporters/worker=containerd-rootless

=== RUN TestIntegration/TestMultipleExporters/worker=containerd-rootless === PAUSE TestIntegration/TestMultipleExporters/worker=containerd-rootless === CONT TestIntegration/TestMultipleExporters/worker=containerd-rootless client_test.go:2940: Error Trace: /src/client/client_test.go:2940 /src/util/testutil/integration/run.go:95 /src/util/testutil/integration/run.go:212 Error: "[Type:"image" Attrs:<key:"name" value:"localhost:35495/buildkit/build/exporter:image" > Type:"image" Attrs:<key:"name" value:"localhost:35495/buildkit/build/alternative:image" > Attrs:<key:"oci-mediatypes" value:"true" > Type:"local" Type:"local" Type:"tar" Type:"tar" ]" should have 4 item(s), but has 6 Test: TestIntegration/TestMultipleExporters/worker=containerd-rootless sandbox.go:133: stderr: /usr/bin/sudo -u #1000 -i CONTAINERD_ROOTLESS_ROOTLESSKIT_STATE_DIR=/tmp/bktest_containerd4087094359/rootlesskit-containerd CONTAINERD_ROOTLESS_ROOTLESSKIT_NET=host CONTAINERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER=none CONTAINERD_ROOTLESS_ROOTLESSKIT_FLAGS=--mtu=0 containerd-rootless.sh -c /tmp/bktest_containerd4087094359/config.toml sandbox.go:136: > StartCmd 2024-06-11 11:07:04.107965604 +0000 UTC m=+319.113094592 /usr/bin/sudo -u #1000 -i CONTAINERD_ROOTLESS_ROOTLESSKIT_STATE_DIR=/tmp/bktest_containerd4087094359/rootlesskit-containerd CONTAINERD_ROOTLESS_ROOTLESSKIT_NET=host CONTAINERD_ROOTLESS_ROOTLESSKIT_PORT_DRIVER=none CONTAINERD_ROOTLESS_ROOTLESSKIT_FLAGS=--mtu=0 containerd-rootless.sh -c /tmp/bktest_containerd4087094359/config.toml sandbox.go:136: time="2024-06-11T11:07:04Z" level=warning msg="containerd config version `1` has been deprecated and will be converted on each startup in containerd v2.0, use `containerd config migrate` after upgrading to containerd 2.0 to avoid conversion on startup" sandbox.go:136: time="2024-06-11T11:07:04.176760606Z" level=info msg="starting containerd" revision=ae71819c4f5e67bb4d5ae76a6b735f29cc25774e version=v1.7.18 sandbox.go:136: time="2024-06-11T11:07:04.205263886Z" level=info msg="loading plugin \"io.containerd.event.v1.exchange\"..." type=io.containerd.event.v1 sandbox.go:136: time="2024-06-11T11:07:04.205298952Z" level=info msg="loading plugin \"io.containerd.internal.v1.opt\"..." type=io.containerd.internal.v1 sandbox.go:136: time="2024-06-11T11:07:04.205357913Z" level=warning msg="failed to load plugin io.containerd.internal.v1.opt" error="mkdir /opt/containerd: permission denied" sandbox.go:136: time="2024-06-11T11:07:04.205374313Z" level=info msg="loading plugin \"io.containerd.warning.v1.deprecations\"..." type=io.containerd.warning.v1 sandbox.go:136: time="2024-06-11T11:07:04.205385805Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.blockfile\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:07:04.205998739Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.blockfile\"..." error="no scratch file generator: skip plugin" type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:07:04.206064543Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.devmapper\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:07:04.206146076Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.devmapper" error="devmapper not configured" sandbox.go:136: time="2024-06-11T11:07:04.206179729Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.native\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:07:04.206759112Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.overlayfs\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:07:04.207100583Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.aufs\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:07:04.208018831Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.aufs\"

Check failure on line 2940 in client/client_test.go

View workflow job for this annotation

GitHub Actions / test / run (containerd-1.6, ./client ./cmd/buildctl ./worker/containerd ./solver ./frontend, integration)

Failed: client/TestIntegration/TestMultipleExporters/worker=containerd-1.6

=== RUN TestIntegration/TestMultipleExporters/worker=containerd-1.6 === PAUSE TestIntegration/TestMultipleExporters/worker=containerd-1.6 === CONT TestIntegration/TestMultipleExporters/worker=containerd-1.6 client_test.go:2940: Error Trace: /src/client/client_test.go:2940 /src/util/testutil/integration/run.go:95 /src/util/testutil/integration/run.go:212 Error: "[Type:"image" Attrs:<key:"name" value:"localhost:40689/buildkit/build/exporter:image" > Type:"image" Attrs:<key:"name" value:"localhost:40689/buildkit/build/alternative:image" > Attrs:<key:"oci-mediatypes" value:"true" > Type:"local" Type:"local" Type:"tar" Type:"tar" ]" should have 4 item(s), but has 6 Test: TestIntegration/TestMultipleExporters/worker=containerd-1.6 sandbox.go:133: stdout: /opt/containerd-alt-16/bin/containerd --config /tmp/bktest_containerd112624049/config.toml sandbox.go:133: stderr: /opt/containerd-alt-16/bin/containerd --config /tmp/bktest_containerd112624049/config.toml sandbox.go:136: > StartCmd 2024-06-11 11:05:28.266296105 +0000 UTC m=+238.270582787 /opt/containerd-alt-16/bin/containerd --config /tmp/bktest_containerd112624049/config.toml sandbox.go:136: time="2024-06-11T11:05:28Z" level=warning msg="containerd config version `1` has been deprecated and will be converted on each startup in containerd v2.0, use `containerd config migrate` after upgrading to containerd 2.0 to avoid conversion on startup" sandbox.go:136: time="2024-06-11T11:05:28.289414240Z" level=info msg="starting containerd" revision=d2d58213f83a351ca8f528a95fbd145f5654e957 version=v1.6.33 sandbox.go:136: time="2024-06-11T11:05:28.309015317Z" level=info msg="loading plugin \"io.containerd.content.v1.content\"..." type=io.containerd.content.v1 sandbox.go:136: time="2024-06-11T11:05:28.309265976Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.devmapper\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:05:28.309313154Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.devmapper" error="devmapper not configured" sandbox.go:136: time="2024-06-11T11:05:28.309369870Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.native\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:05:28.309532104Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.overlayfs\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:05:28.309832806Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.aufs\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:05:28.311176682Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.aufs\"..." error="aufs is not supported (modprobe aufs failed: exit status 1 \"modprobe: can't change directory to '/lib/modules': No such file or directory\\n\"): skip plugin" type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:05:28.311213511Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.zfs\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:05:28.312711513Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.zfs\"..." error="path /tmp/bktest_containerd112624049/root/io.containerd.snapshotter.v1.zfs must be a zfs filesystem to be used with the zfs snapshotter: skip plugin" type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:05:28.312736740Z" level=info msg="loading plugin \"io.containerd.metadata.v1.bolt\"..." type=io.containerd.metadata.v1 sandbox.go:136: time="2024-06-11T11:05:28.312814495Z" level=warning msg="could not use snapshotter devmapper in metadata plugin" error="devmapper not configured" sandbox.go:136: time="2024-06-11T11:05:28.312835655Z" level=info msg="metadata content store policy set" policy=shared sandbox.go:136: time="2024-06-11T11:05:28.314383199Z" level=info msg="loading plugin \"io.containerd.differ.v1.walking\"..."

Check failure on line 2940 in client/client_test.go

View workflow job for this annotation

GitHub Actions / test / run (containerd-snapshotter-stargz, ./client ./cmd/buildctl ./worker/containerd ./solver ./fronte...

Failed: client/TestIntegration/TestMultipleExporters/worker=containerd-snapshotter-stargz

=== RUN TestIntegration/TestMultipleExporters/worker=containerd-snapshotter-stargz === PAUSE TestIntegration/TestMultipleExporters/worker=containerd-snapshotter-stargz === CONT TestIntegration/TestMultipleExporters/worker=containerd-snapshotter-stargz client_test.go:2940: Error Trace: /src/client/client_test.go:2940 /src/util/testutil/integration/run.go:95 /src/util/testutil/integration/run.go:212 Error: "[Type:"image" Attrs:<key:"name" value:"localhost:38123/buildkit/build/exporter:image" > Type:"image" Attrs:<key:"name" value:"localhost:38123/buildkit/build/alternative:image" > Attrs:<key:"oci-mediatypes" value:"true" > Type:"local" Type:"local" Type:"tar" Type:"tar" ]" should have 4 item(s), but has 6 Test: TestIntegration/TestMultipleExporters/worker=containerd-snapshotter-stargz sandbox.go:133: stdout: /usr/bin/containerd --config /tmp/bktest_containerd2336159173/config.toml sandbox.go:133: stderr: /usr/bin/containerd --config /tmp/bktest_containerd2336159173/config.toml sandbox.go:136: > StartCmd 2024-06-11 11:02:20.025386818 +0000 UTC m=+54.973641453 /usr/bin/containerd --config /tmp/bktest_containerd2336159173/config.toml sandbox.go:136: time="2024-06-11T11:02:20Z" level=warning msg="containerd config version `1` has been deprecated and will be converted on each startup in containerd v2.0, use `containerd config migrate` after upgrading to containerd 2.0 to avoid conversion on startup" sandbox.go:136: time="2024-06-11T11:02:20.067137588Z" level=info msg="starting containerd" revision=ae71819c4f5e67bb4d5ae76a6b735f29cc25774e version=v1.7.18 sandbox.go:136: time="2024-06-11T11:02:20.095320744Z" level=info msg="loading plugin \"io.containerd.event.v1.exchange\"..." type=io.containerd.event.v1 sandbox.go:136: time="2024-06-11T11:02:20.095349257Z" level=info msg="loading plugin \"io.containerd.internal.v1.opt\"..." type=io.containerd.internal.v1 sandbox.go:136: time="2024-06-11T11:02:20.095440288Z" level=info msg="loading plugin \"io.containerd.warning.v1.deprecations\"..." type=io.containerd.warning.v1 sandbox.go:136: time="2024-06-11T11:02:20.095460275Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.blockfile\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:02:20.095555274Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.blockfile\"..." error="no scratch file generator: skip plugin" type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:02:20.095574129Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.devmapper\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:02:20.095591041Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.devmapper" error="devmapper not configured" sandbox.go:136: time="2024-06-11T11:02:20.095603324Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.native\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:02:20.095715855Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.overlayfs\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:02:20.095985932Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.aufs\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:02:20.097209193Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.aufs\"..." error="aufs is not supported (modprobe aufs failed: exit status 1 \"modprobe: can't change directory to '/lib/modules': No such file or directory\\n\"): skip plugin" type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:02:20.097237907Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.zfs\"..." type=io.containerd.snapshotter.v1 sandbox.go:136: time="2024-06-11T11:02:20.097574238Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.zfs\"..." error="path /tmp/bktest_containerd2336159173/roo

Check failure on line 2940 in client/client_test.go

View workflow job for this annotation

GitHub Actions / test / run (oci, ./client ./cmd/buildctl ./worker/containerd ./solver ./frontend, integration)

Failed: client/TestIntegration/TestMultipleExporters/worker=oci

=== RUN TestIntegration/TestMultipleExporters/worker=oci === PAUSE TestIntegration/TestMultipleExporters/worker=oci === CONT TestIntegration/TestMultipleExporters/worker=oci client_test.go:2940: Error Trace: /src/client/client_test.go:2940 /src/util/testutil/integration/run.go:95 /src/util/testutil/integration/run.go:212 Error: "[Type:"image" Attrs:<key:"name" value:"localhost:42683/buildkit/build/exporter:image" > Type:"image" Attrs:<key:"name" value:"localhost:42683/buildkit/build/alternative:image" > Attrs:<key:"oci-mediatypes" value:"true" > Type:"local" Type:"local" Type:"tar" Type:"tar" ]" should have 4 item(s), but has 6 Test: TestIntegration/TestMultipleExporters/worker=oci sandbox.go:133: stdout: /usr/bin/buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --config=/tmp/bktest_config4103387173/buildkitd.toml --root /tmp/bktest_buildkitd4287101719 --addr unix:///tmp/bktest_buildkitd4287101719/buildkitd.sock --debug sandbox.go:133: stderr: /usr/bin/buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --config=/tmp/bktest_config4103387173/buildkitd.toml --root /tmp/bktest_buildkitd4287101719 --addr unix:///tmp/bktest_buildkitd4287101719/buildkitd.sock --debug sandbox.go:136: > StartCmd 2024-06-11 11:03:14.804553022 +0000 UTC m=+107.874098491 /usr/bin/buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --config=/tmp/bktest_config4103387173/buildkitd.toml --root /tmp/bktest_buildkitd4287101719 --addr unix:///tmp/bktest_buildkitd4287101719/buildkitd.sock --debug sandbox.go:136: time="2024-06-11T11:03:14Z" level=warning msg="failed to get disk size: no such file or directory" sandbox.go:136: time="2024-06-11T11:03:14Z" level=warning msg="failed to get disk size: no such file or directory" sandbox.go:136: time="2024-06-11T11:03:14Z" level=info msg="auto snapshotter: using overlayfs" sandbox.go:136: time="2024-06-11T11:03:14Z" level=debug msg="could not read \"/tmp/bktest_buildkitd4287101719/net/cni\" for cleanup: open /tmp/bktest_buildkitd4287101719/net/cni: no such file or directory" sandbox.go:136: time="2024-06-11T11:03:14Z" level=debug msg="creating new network namespace dvq86cl7f0ie7n3oec8zm8qew" sandbox.go:136: time="2024-06-11T11:03:14Z" level=debug msg="finished creating network namespace dvq86cl7f0ie7n3oec8zm8qew" sandbox.go:136: time="2024-06-11T11:03:14Z" level=debug msg="finished setting up network namespace dvq86cl7f0ie7n3oec8zm8qew" sandbox.go:136: time="2024-06-11T11:03:14Z" level=info msg="found worker \"n4li1rekbsp3lt6bcaiyw23nw\", labels=map[org.mobyproject.buildkit.worker.executor:oci org.mobyproject.buildkit.worker.hostname:2886be810498 org.mobyproject.buildkit.worker.network:cni org.mobyproject.buildkit.worker.oci.process-mode:sandbox org.mobyproject.buildkit.worker.sandbox:true org.mobyproject.buildkit.worker.selinux.enabled:false org.mobyproject.buildkit.worker.snapshotter:overlayfs], platforms=[linux/amd64 linux/amd64/v2 linux/amd64/v3 linux/arm64 linux/riscv64 linux/ppc64le linux/s390x linux/386 linux/mips64le linux/mips64 linux/arm/v7 linux/arm/v6]" sandbox.go:136: time="2024-06-11T11:03:15Z" level=info msg="found 1 workers, default=\"n4li1rekbsp3lt6bcaiyw23nw\"" sandbox.go:136: time="2024-06-11T11:03:15Z" level=warning msg="currently, only the default worker can be used." sandbox.go:136: time="2024-06-11T11:03:15Z" level=info msg="running server on /tmp/bktest_buildkitd4287101719/buildkitd.sock" sandbox.go:136: time="2024-06-11T11:03:15Z" level=debug msg="session started" sandbox.go:136: time="2024-06-11T11:03:15Z" level=debug msg="session finished: <nil>" --- FAIL: TestIntegration/TestMultipleExporters/worker=oci (1.25s)

Check failure on line 2940 in client/client_test.go

View workflow job for this annotation

GitHub Actions / test / run (oci-rootless, ./client ./cmd/buildctl ./worker/containerd ./solver ./frontend, integration)

Failed: client/TestIntegration/TestMultipleExporters/worker=oci-rootless

=== RUN TestIntegration/TestMultipleExporters/worker=oci-rootless === PAUSE TestIntegration/TestMultipleExporters/worker=oci-rootless === CONT TestIntegration/TestMultipleExporters/worker=oci-rootless client_test.go:2940: Error Trace: /src/client/client_test.go:2940 /src/util/testutil/integration/run.go:95 /src/util/testutil/integration/run.go:212 Error: "[Type:"image" Attrs:<key:"name" value:"localhost:46209/buildkit/build/exporter:image" > Type:"image" Attrs:<key:"name" value:"localhost:46209/buildkit/build/alternative:image" > Attrs:<key:"oci-mediatypes" value:"true" > Type:"local" Type:"local" Type:"tar" Type:"tar" ]" should have 4 item(s), but has 6 Test: TestIntegration/TestMultipleExporters/worker=oci-rootless sandbox.go:133: stdout: /usr/bin/sudo -u #1000 -i -- exec rootlesskit buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --config=/tmp/bktest_config3232241181/buildkitd.toml --root /tmp/bktest_buildkitd3807893153 --addr unix:///tmp/bktest_buildkitd3807893153/buildkitd.sock --debug sandbox.go:133: stderr: /usr/bin/sudo -u #1000 -i -- exec rootlesskit buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --config=/tmp/bktest_config3232241181/buildkitd.toml --root /tmp/bktest_buildkitd3807893153 --addr unix:///tmp/bktest_buildkitd3807893153/buildkitd.sock --debug sandbox.go:136: > StartCmd 2024-06-11 11:01:50.514765243 +0000 UTC m=+24.515266490 /usr/bin/sudo -u #1000 -i -- exec rootlesskit buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --config=/tmp/bktest_config3232241181/buildkitd.toml --root /tmp/bktest_buildkitd3807893153 --addr unix:///tmp/bktest_buildkitd3807893153/buildkitd.sock --debug sandbox.go:136: warning: GOCOVERDIR not set, no coverage data emitted sandbox.go:136: time="2024-06-11T11:01:50Z" level=warning msg="failed to get disk size: no such file or directory" sandbox.go:136: time="2024-06-11T11:01:50Z" level=warning msg="failed to get disk size: no such file or directory" sandbox.go:136: time="2024-06-11T11:01:50Z" level=info msg="auto snapshotter: using overlayfs" sandbox.go:136: time="2024-06-11T11:01:50Z" level=debug msg="running in rootless mode" sandbox.go:136: time="2024-06-11T11:01:50Z" level=info msg="found worker \"c8vyzmngkeppppvwdgldnyhvr\", labels=map[org.mobyproject.buildkit.worker.executor:oci org.mobyproject.buildkit.worker.hostname:8f9642949892 org.mobyproject.buildkit.worker.network:host org.mobyproject.buildkit.worker.oci.process-mode:sandbox org.mobyproject.buildkit.worker.sandbox:true org.mobyproject.buildkit.worker.selinux.enabled:false org.mobyproject.buildkit.worker.snapshotter:overlayfs], platforms=[linux/amd64 linux/amd64/v2 linux/amd64/v3 linux/arm64 linux/riscv64 linux/ppc64le linux/s390x linux/386 linux/mips64le linux/mips64 linux/arm/v7 linux/arm/v6]" sandbox.go:136: time="2024-06-11T11:01:50Z" level=info msg="found 1 workers, default=\"c8vyzmngkeppppvwdgldnyhvr\"" sandbox.go:136: time="2024-06-11T11:01:50Z" level=warning msg="currently, only the default worker can be used." sandbox.go:136: time="2024-06-11T11:01:50Z" level=info msg="running server on /tmp/bktest_buildkitd3807893153/buildkitd.sock" sandbox.go:136: time="2024-06-11T11:01:50Z" level=debug msg="session started" sandbox.go:136: time="2024-06-11T11:01:50Z" level=debug msg="session finished: <nil>" --- FAIL: TestIntegration/TestMultipleExporters/worker=oci-rootless (0.40s)

Check failure on line 2940 in client/client_test.go

View workflow job for this annotation

GitHub Actions / test / run (oci-rootless-slirp4netns-detachnetns, ./client ./cmd/buildctl ./worker/containerd ./solver ....

Failed: client/TestIntegration/TestMultipleExporters/worker=oci-rootless-slirp4netns-detachnetns

=== RUN TestIntegration/TestMultipleExporters/worker=oci-rootless-slirp4netns-detachnetns === PAUSE TestIntegration/TestMultipleExporters/worker=oci-rootless-slirp4netns-detachnetns === CONT TestIntegration/TestMultipleExporters/worker=oci-rootless-slirp4netns-detachnetns client_test.go:2940: Error Trace: /src/client/client_test.go:2940 /src/util/testutil/integration/run.go:95 /src/util/testutil/integration/run.go:212 Error: "[Type:"image" Attrs:<key:"name" value:"localhost:37529/buildkit/build/exporter:image" > Type:"image" Attrs:<key:"name" value:"localhost:37529/buildkit/build/alternative:image" > Attrs:<key:"oci-mediatypes" value:"true" > Type:"local" Type:"local" Type:"tar" Type:"tar" ]" should have 4 item(s), but has 6 Test: TestIntegration/TestMultipleExporters/worker=oci-rootless-slirp4netns-detachnetns sandbox.go:133: 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_config4147274409/buildkitd.toml --root /tmp/bktest_buildkitd33156449 --addr unix:///tmp/bktest_buildkitd33156449/buildkitd.sock --debug sandbox.go:133: 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_config4147274409/buildkitd.toml --root /tmp/bktest_buildkitd33156449 --addr unix:///tmp/bktest_buildkitd33156449/buildkitd.sock --debug sandbox.go:136: > StartCmd 2024-06-11 11:02:39.34008008 +0000 UTC m=+68.253101974 /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_config4147274409/buildkitd.toml --root /tmp/bktest_buildkitd33156449 --addr unix:///tmp/bktest_buildkitd33156449/buildkitd.sock --debug sandbox.go:136: warning: GOCOVERDIR not set, no coverage data emitted sandbox.go:136: time="2024-06-11T11:02:39Z" level=warning msg="failed to get disk size: no such file or directory" sandbox.go:136: time="2024-06-11T11:02:39Z" level=warning msg="failed to get disk size: no such file or directory" sandbox.go:136: time="2024-06-11T11:02:39Z" level=info msg="auto snapshotter: using overlayfs" sandbox.go:136: time="2024-06-11T11:02:39Z" level=debug msg="running in rootless mode" sandbox.go:136: time="2024-06-11T11:02:39Z" level=info msg="found worker \"cd04j922459txd8tndkuc5gqo\", labels=map[org.mobyproject.buildkit.worker.executor:oci org.mobyproject.buildkit.worker.hostname:acff32875660 org.mobyproject.buildkit.worker.network:host org.mobyproject.buildkit.worker.oci.process-mode:sandbox org.mobyproject.buildkit.worker.sandbox:true org.mobyproject.buildkit.worker.selinux.enabled:false org.mobyproject.buildkit.worker.snapshotter:overlayfs], platforms=[linux/amd64 linux/amd64/v2 linux/amd64/v3 linux/arm64 linux/riscv64 linux/ppc64le linux/s390x linux/386 linux/mips64le linux/mips64 linux/arm/v7 linux/arm/v6]" sandbox.go:136: time="2024-06-11T11:02:39Z" level=info msg="found 1 workers, default=\"cd04j922459txd8tndkuc5gqo\"" sandbox.go:136: time="2024-06-11T11:02:39Z" level=warning msg="currently, only the default worker can be used." sandbox.go:136: time="2024-06-11T11:02:39Z" level=info msg="running server on /tmp/bktest_buildkitd33156449/buildkitd.sock" sandbox.go:136: time="2024-06-11T11:02:39Z" level=debug msg="session started" sandbox.go:136: time="2024-06-11T11:02:40Z" level=debug msg="session finished: <nil>" --- FAIL: TestIntegration/TestMultipleExporters/worker=oci-rootless-slirp4netns-detachnetns

Check failure on line 2940 in client/client_test.go

View workflow job for this annotation

GitHub Actions / test / run (oci-snapshotter-stargz, ./client ./cmd/buildctl ./worker/containerd ./solver ./frontend, int...

Failed: client/TestIntegration/TestMultipleExporters/worker=oci-snapshotter-stargz

=== RUN TestIntegration/TestMultipleExporters/worker=oci-snapshotter-stargz === PAUSE TestIntegration/TestMultipleExporters/worker=oci-snapshotter-stargz === CONT TestIntegration/TestMultipleExporters/worker=oci-snapshotter-stargz client_test.go:2940: Error Trace: /src/client/client_test.go:2940 /src/util/testutil/integration/run.go:95 /src/util/testutil/integration/run.go:212 Error: "[Type:"image" Attrs:<key:"name" value:"localhost:38345/buildkit/build/exporter:image" > Type:"image" Attrs:<key:"name" value:"localhost:38345/buildkit/build/alternative:image" > Attrs:<key:"oci-mediatypes" value:"true" > Type:"local" Type:"local" Type:"tar" Type:"tar" ]" should have 4 item(s), but has 6 Test: TestIntegration/TestMultipleExporters/worker=oci-snapshotter-stargz sandbox.go:133: stdout: /usr/bin/buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --oci-worker-snapshotter=stargz --config=/tmp/bktest_config3901699591/buildkitd.toml --root /tmp/bktest_buildkitd1966987570 --addr unix:///tmp/bktest_buildkitd1966987570/buildkitd.sock --debug sandbox.go:133: stderr: /usr/bin/buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --oci-worker-snapshotter=stargz --config=/tmp/bktest_config3901699591/buildkitd.toml --root /tmp/bktest_buildkitd1966987570 --addr unix:///tmp/bktest_buildkitd1966987570/buildkitd.sock --debug sandbox.go:136: > StartCmd 2024-06-11 11:02:12.991538911 +0000 UTC m=+45.589476403 /usr/bin/buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --oci-worker-snapshotter=stargz --config=/tmp/bktest_config3901699591/buildkitd.toml --root /tmp/bktest_buildkitd1966987570 --addr unix:///tmp/bktest_buildkitd1966987570/buildkitd.sock --debug sandbox.go:136: time="2024-06-11T11:02:13Z" level=warning msg="failed to get disk size: no such file or directory" sandbox.go:136: time="2024-06-11T11:02:13Z" level=warning msg="failed to get disk size: no such file or directory" sandbox.go:136: time="2024-06-11T11:02:13Z" level=debug msg="could not read \"/tmp/bktest_buildkitd1966987570/net/cni\" for cleanup: open /tmp/bktest_buildkitd1966987570/net/cni: no such file or directory" sandbox.go:136: time="2024-06-11T11:02:13Z" level=debug msg="creating new network namespace ajp0e1jy1vet09mnqrv910rc0" sandbox.go:136: time="2024-06-11T11:02:13Z" level=debug msg="finished creating network namespace ajp0e1jy1vet09mnqrv910rc0" sandbox.go:136: time="2024-06-11T11:02:13Z" level=debug msg="finished setting up network namespace ajp0e1jy1vet09mnqrv910rc0" sandbox.go:136: time="2024-06-11T11:02:13Z" level=info msg="found worker \"p7hffe63f1af2vrlr0lb6sueh\", labels=map[org.mobyproject.buildkit.worker.executor:oci org.mobyproject.buildkit.worker.hostname:7bb0d7ed9077 org.mobyproject.buildkit.worker.network:cni org.mobyproject.buildkit.worker.oci.process-mode:sandbox org.mobyproject.buildkit.worker.sandbox:true org.mobyproject.buildkit.worker.selinux.enabled:false org.mobyproject.buildkit.worker.snapshotter:stargz], platforms=[linux/amd64 linux/amd64/v2 linux/amd64/v3 linux/arm64 linux/riscv64 linux/ppc64le linux/s390x linux/386 linux/mips64le linux/mips64 linux/arm/v7 linux/arm/v6]" sandbox.go:136: time="2024-06-11T11:02:13Z" level=info msg="found 1 workers, default=\"p7hffe63f1af2vrlr0lb6sueh\"" sandbox.go:136: time="2024-06-11T11:02:13Z" level=warning msg="currently, only the default worker can be used." sandbox.go:136: time="2024-06-11T11:02:13Z" level=info msg="running server on /tmp/bktest_buildkitd1966987570/buildkitd.sock" sandbox.go:136: time="2024-06-11T11:02:13Z" level=debug msg="session started" sandbox.go:136: time="2024-06-11T11:02:13Z" level=debug msg="checking layer availability" span="mkfile /foo.txt" sandbox.go:136

Check failure on line 2940 in client/client_test.go

View workflow job for this annotation

GitHub Actions / test / run (./client, containerd, nydus, integration)

Failed: client/TestIntegration/TestMultipleExporters/worker=containerd

=== RUN TestIntegration/TestMultipleExporters/worker=containerd === PAUSE TestIntegration/TestMultipleExporters/worker=containerd === CONT TestIntegration/TestMultipleExporters/worker=containerd client_test.go:2940: Error Trace: /src/client/client_test.go:2940 /src/util/testutil/integration/run.go:95 /src/util/testutil/integration/run.go:212 Error: "[Type:"image" Attrs:<key:"name" value:"localhost:40569/buildkit/build/exporter:image" > Type:"image" Attrs:<key:"name" value:"localhost:40569/buildkit/build/alternative:image" > Attrs:<key:"oci-mediatypes" value:"true" > Type:"local" Type:"local" Type:"tar" Type:"tar" ]" should have 4 item(s), but has 6 Test: TestIntegration/TestMultipleExporters/worker=containerd sandbox.go:133: stderr: /usr/bin/buildkitd --containerd-worker-gc=false --containerd-worker=true --containerd-worker-addr /tmp/bktest_containerd3919964054/containerd.sock --containerd-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --oci-worker=false --config=/tmp/bktest_config1288773912/buildkitd.toml --root /tmp/bktest_buildkitd3943694062 --addr unix:///tmp/bktest_buildkitd3943694062/buildkitd.sock --debug sandbox.go:136: > StartCmd 2024-06-11 11:05:07.879891411 +0000 UTC m=+210.069959178 /usr/bin/buildkitd --containerd-worker-gc=false --containerd-worker=true --containerd-worker-addr /tmp/bktest_containerd3919964054/containerd.sock --containerd-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --oci-worker=false --config=/tmp/bktest_config1288773912/buildkitd.toml --root /tmp/bktest_buildkitd3943694062 --addr unix:///tmp/bktest_buildkitd3943694062/buildkitd.sock --debug sandbox.go:136: time="2024-06-11T11:05:07Z" level=warning msg="failed to get disk size: no such file or directory" sandbox.go:136: time="2024-06-11T11:05:07Z" level=warning msg="failed to get disk size: no such file or directory" sandbox.go:136: time="2024-06-11T11:05:07Z" level=debug msg="could not read \"/tmp/bktest_buildkitd3943694062/net/cni\" for cleanup: open /tmp/bktest_buildkitd3943694062/net/cni: no such file or directory" sandbox.go:136: time="2024-06-11T11:05:07Z" level=debug msg="creating new network namespace rotb99tb8iuhyruvhs3w284rx" sandbox.go:136: time="2024-06-11T11:05:07Z" level=debug msg="finished creating network namespace rotb99tb8iuhyruvhs3w284rx" sandbox.go:136: time="2024-06-11T11:05:07Z" level=debug msg="finished setting up network namespace rotb99tb8iuhyruvhs3w284rx" sandbox.go:136: time="2024-06-11T11:05:07Z" level=debug msg="remote introspection plugin filters" filters="[type==io.containerd.runtime.v1 type==io.containerd.runtime.v2]" sandbox.go:136: time="2024-06-11T11:05:08Z" level=info msg="found worker \"xfk8bt9n8qa6u16hpsw8bjuwf\", labels=map[org.mobyproject.buildkit.worker.containerd.namespace:buildkit org.mobyproject.buildkit.worker.containerd.uuid:c027056a-cd71-49f7-aa68-229e46187039 org.mobyproject.buildkit.worker.executor:containerd org.mobyproject.buildkit.worker.hostname:0c180b15b5a2 org.mobyproject.buildkit.worker.network:cni org.mobyproject.buildkit.worker.sandbox:true org.mobyproject.buildkit.worker.selinux.enabled:false org.mobyproject.buildkit.worker.snapshotter:overlayfs], platforms=[linux/amd64 linux/amd64/v2 linux/amd64/v3 linux/arm64 linux/riscv64 linux/ppc64le linux/s390x linux/386 linux/mips64le linux/mips64 linux/arm/v7 linux/arm/v6]" sandbox.go:136: time="2024-06-11T11:05:08Z" level=info msg="found 1 workers, default=\"xfk8bt9n8qa6u16hpsw8bjuwf\"" sandbox.go:136: time="2024-06-11T11:05:08Z" level=warning msg="currently, only the default worker can be used." sandbox.go:136: time="2024-06-11T11:05:08Z" level=info msg="running server on /tmp/bktest_buildkitd3943694062/buildkitd.sock" sandbox.go:136: time="2024-06-11T11:05:08Z" level=debug msg="session started" sandbox.go:136: time="2024-06-11T11:05:08Z" level=debug msg="session finished: <nil>" sandbox.go:133: stdout: /usr/bin/containerd --config /tmp/bktest_contai

Check failure on line 2940 in client/client_test.go

View workflow job for this annotation

GitHub Actions / test / run (./client, oci, nydus, integration)

Failed: client/TestIntegration/TestMultipleExporters/worker=oci

=== RUN TestIntegration/TestMultipleExporters/worker=oci === PAUSE TestIntegration/TestMultipleExporters/worker=oci === CONT TestIntegration/TestMultipleExporters/worker=oci client_test.go:2940: Error Trace: /src/client/client_test.go:2940 /src/util/testutil/integration/run.go:95 /src/util/testutil/integration/run.go:212 Error: "[Type:"image" Attrs:<key:"name" value:"localhost:41803/buildkit/build/exporter:image" > Type:"image" Attrs:<key:"name" value:"localhost:41803/buildkit/build/alternative:image" > Attrs:<key:"oci-mediatypes" value:"true" > Type:"local" Type:"local" Type:"tar" Type:"tar" ]" should have 4 item(s), but has 6 Test: TestIntegration/TestMultipleExporters/worker=oci sandbox.go:133: stderr: /usr/bin/buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --config=/tmp/bktest_config2434657063/buildkitd.toml --root /tmp/bktest_buildkitd761378546 --addr unix:///tmp/bktest_buildkitd761378546/buildkitd.sock --debug sandbox.go:136: > StartCmd 2024-06-11 11:02:47.683885394 +0000 UTC m=+77.896376438 /usr/bin/buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --config=/tmp/bktest_config2434657063/buildkitd.toml --root /tmp/bktest_buildkitd761378546 --addr unix:///tmp/bktest_buildkitd761378546/buildkitd.sock --debug sandbox.go:136: time="2024-06-11T11:02:47Z" level=warning msg="failed to get disk size: no such file or directory" sandbox.go:136: time="2024-06-11T11:02:47Z" level=warning msg="failed to get disk size: no such file or directory" sandbox.go:136: time="2024-06-11T11:02:47Z" level=info msg="auto snapshotter: using overlayfs" sandbox.go:136: time="2024-06-11T11:02:47Z" level=debug msg="could not read \"/tmp/bktest_buildkitd761378546/net/cni\" for cleanup: open /tmp/bktest_buildkitd761378546/net/cni: no such file or directory" sandbox.go:136: time="2024-06-11T11:02:47Z" level=debug msg="creating new network namespace i717mfocxtukdwntrvuq4s012" sandbox.go:136: time="2024-06-11T11:02:47Z" level=debug msg="finished creating network namespace i717mfocxtukdwntrvuq4s012" sandbox.go:136: time="2024-06-11T11:02:47Z" level=debug msg="finished setting up network namespace i717mfocxtukdwntrvuq4s012" sandbox.go:136: time="2024-06-11T11:02:47Z" level=info msg="found worker \"gq8aru25jdvps3h538nkg2x8v\", labels=map[org.mobyproject.buildkit.worker.executor:oci org.mobyproject.buildkit.worker.hostname:2701bf830537 org.mobyproject.buildkit.worker.network:cni org.mobyproject.buildkit.worker.oci.process-mode:sandbox org.mobyproject.buildkit.worker.sandbox:true org.mobyproject.buildkit.worker.selinux.enabled:false org.mobyproject.buildkit.worker.snapshotter:overlayfs], platforms=[linux/amd64 linux/amd64/v2 linux/amd64/v3 linux/arm64 linux/riscv64 linux/ppc64le linux/s390x linux/386 linux/mips64le linux/mips64 linux/arm/v7 linux/arm/v6]" sandbox.go:136: time="2024-06-11T11:02:47Z" level=info msg="found 1 workers, default=\"gq8aru25jdvps3h538nkg2x8v\"" sandbox.go:136: time="2024-06-11T11:02:47Z" level=warning msg="currently, only the default worker can be used." sandbox.go:136: time="2024-06-11T11:02:47Z" level=info msg="running server on /tmp/bktest_buildkitd761378546/buildkitd.sock" sandbox.go:136: time="2024-06-11T11:02:47Z" level=debug msg="session started" sandbox.go:136: time="2024-06-11T11:02:48Z" level=debug msg="session finished: <nil>" sandbox.go:133: stdout: /usr/bin/buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --config=/tmp/bktest_config2434657063/buildkitd.toml --root /tmp/bktest_buildkitd761378546 --addr unix:///tmp/bktest_buildkitd761378546/buildkitd.sock --debug --- FAIL: TestIntegration/TestMultipleExporters/worker=oci (0.98s)

if workers.IsTestDockerd() {
require.Len(t, ev.Record.Result.Results, 1)
Expand Down
13 changes: 12 additions & 1 deletion exporter/containerimage/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ import (
cerrdefs "github.com/containerd/errdefs"
"github.com/moby/buildkit/cache"
cacheconfig "github.com/moby/buildkit/cache/config"
"github.com/moby/buildkit/client"
"github.com/moby/buildkit/exporter"
"github.com/moby/buildkit/exporter/containerimage/exptypes"
"github.com/moby/buildkit/session"
Expand Down Expand Up @@ -68,6 +69,7 @@ func (e *imageExporter) Resolve(ctx context.Context, id int, opt map[string]stri
i := &imageExporterInstance{
imageExporter: e,
id: id,
attrs: opt,
opts: ImageCommitOpts{
RefCfg: cacheconfig.RefConfig{
Compression: compression.New(compression.Default),
Expand Down Expand Up @@ -168,7 +170,8 @@ func (e *imageExporter) Resolve(ctx context.Context, id int, opt map[string]stri

type imageExporterInstance struct {
*imageExporter
id int
id int
attrs map[string]string

opts ImageCommitOpts
push bool
Expand All @@ -187,6 +190,14 @@ func (e *imageExporterInstance) ID() int {
}

func (e *imageExporterInstance) Name() string {
return client.ExporterImage
}

func (e *imageExporterInstance) Attrs() map[string]string {
return e.attrs
}

func (e *imageExporterInstance) ProgressName() string {
return "exporting to image"
}

Expand Down
2 changes: 2 additions & 0 deletions exporter/exporter.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@ type Exporter interface {
type ExporterInstance interface {
ID() int
Name() string
Attrs() map[string]string
ProgressName() string
Config() *Config
Export(ctx context.Context, src *Source, inlineCache exptypes.InlineCache, sessionID string) (map[string]string, DescriptorReference, error)
}
Expand Down
13 changes: 12 additions & 1 deletion exporter/local/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import (
"time"

"github.com/moby/buildkit/cache"
"github.com/moby/buildkit/client"
"github.com/moby/buildkit/exporter"
"github.com/moby/buildkit/exporter/containerimage/exptypes"
"github.com/moby/buildkit/exporter/util/epoch"
Expand Down Expand Up @@ -38,6 +39,7 @@ func New(opt Opt) (exporter.Exporter, error) {
func (e *localExporter) Resolve(ctx context.Context, id int, opt map[string]string) (exporter.ExporterInstance, error) {
i := &localExporterInstance{
id: id,
attrs: opt,
localExporter: e,
}
_, err := i.opts.Load(opt)
Expand All @@ -50,7 +52,8 @@ func (e *localExporter) Resolve(ctx context.Context, id int, opt map[string]stri

type localExporterInstance struct {
*localExporter
id int
id int
attrs map[string]string

opts CreateFSOpts
}
Expand All @@ -60,6 +63,14 @@ func (e *localExporterInstance) ID() int {
}

func (e *localExporterInstance) Name() string {
return client.ExporterLocal
}

func (e *localExporterInstance) Attrs() map[string]string {
return e.attrs
}

func (e *localExporterInstance) ProgressName() string {
return "exporting to client directory"
}

Expand Down
17 changes: 14 additions & 3 deletions exporter/oci/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"github.com/distribution/reference"
"github.com/moby/buildkit/cache"
cacheconfig "github.com/moby/buildkit/cache/config"
"github.com/moby/buildkit/client"
"github.com/moby/buildkit/exporter"
"github.com/moby/buildkit/exporter/containerimage"
"github.com/moby/buildkit/exporter/containerimage/exptypes"
Expand All @@ -34,8 +35,8 @@ import (
type ExporterVariant string

const (
VariantOCI = "oci"
VariantDocker = "docker"
VariantOCI = client.ExporterOCI
VariantDocker = client.ExporterDocker
)

const (
Expand All @@ -62,6 +63,7 @@ func (e *imageExporter) Resolve(ctx context.Context, id int, opt map[string]stri
i := &imageExporterInstance{
imageExporter: e,
id: id,
attrs: opt,
tar: true,
opts: containerimage.ImageCommitOpts{
RefCfg: cacheconfig.RefConfig{
Expand Down Expand Up @@ -100,7 +102,8 @@ func (e *imageExporter) Resolve(ctx context.Context, id int, opt map[string]stri

type imageExporterInstance struct {
*imageExporter
id int
id int
attrs map[string]string

opts containerimage.ImageCommitOpts
tar bool
Expand All @@ -112,6 +115,14 @@ func (e *imageExporterInstance) ID() int {
}

func (e *imageExporterInstance) Name() string {
return string(e.opt.Variant)
}

func (e *imageExporterInstance) Attrs() map[string]string {
return e.attrs
}

func (e *imageExporterInstance) ProgressName() string {
return fmt.Sprintf("exporting to %s image format", e.opt.Variant)
}

Expand Down
13 changes: 12 additions & 1 deletion exporter/tar/export.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import (
"time"

"github.com/moby/buildkit/cache"
"github.com/moby/buildkit/client"
"github.com/moby/buildkit/exporter"
"github.com/moby/buildkit/exporter/containerimage/exptypes"
"github.com/moby/buildkit/exporter/local"
Expand Down Expand Up @@ -37,6 +38,7 @@ func (e *localExporter) Resolve(ctx context.Context, id int, opt map[string]stri
li := &localExporterInstance{
localExporter: e,
id: id,
attrs: opt,
}
_, err := li.opts.Load(opt)
if err != nil {
Expand All @@ -49,7 +51,8 @@ func (e *localExporter) Resolve(ctx context.Context, id int, opt map[string]stri

type localExporterInstance struct {
*localExporter
id int
id int
attrs map[string]string

opts local.CreateFSOpts
}
Expand All @@ -59,6 +62,14 @@ func (e *localExporterInstance) ID() int {
}

func (e *localExporterInstance) Name() string {
return client.ExporterTar
}

func (e *localExporterInstance) Attrs() map[string]string {
return e.attrs
}

func (e *localExporterInstance) ProgressName() string {
return "exporting to client tarball"
}

Expand Down
1 change: 1 addition & 0 deletions frontend/dockerfile/dockerfile_provenance_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1369,6 +1369,7 @@ COPY bar bar2
break
}
require.Equal(t, ref, ev.Record.Ref)
require.Len(t, ev.Record.Exporters, 1)

for _, prov := range ev.Record.Result.Attestations {
if len(prov.Annotations) == 0 || prov.Annotations["in-toto.io/predicate-type"] != "https://slsa.dev/provenance/v0.2" {
Expand Down
16 changes: 7 additions & 9 deletions solver/llbsolver/solver.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,6 @@ const (
)

type ExporterRequest struct {
Type string
Attrs map[string]string
Exporters []exporter.ExporterInstance
CacheExporters []RemoteCacheExporter
}
Expand Down Expand Up @@ -173,11 +171,11 @@ func (s *Solver) recordBuildHistory(ctx context.Context, id string, req frontend
CreatedAt: &st,
}

if exp.Type != "" {
rec.Exporters = []*controlapi.Exporter{{
Type: exp.Type,
Attrs: exp.Attrs,
}}
for _, e := range exp.Exporters {
rec.Exporters = append(rec.Exporters, &controlapi.Exporter{
Type: e.Name(),
Attrs: e.Attrs(),
})
}

if err := s.history.Update(ctx, &controlapi.BuildHistoryEvent{
Expand Down Expand Up @@ -750,8 +748,8 @@ func (s *Solver) runExporters(ctx context.Context, exporters []exporter.Exporter
i, exp := i, exp
eg.Go(func() error {
id := fmt.Sprint(job.SessionID, "-export-", i)
return inBuilderContext(ctx, job, exp.Name(), id, func(ctx context.Context, _ session.Group) error {
span, ctx := tracing.StartSpan(ctx, exp.Name())
return inBuilderContext(ctx, job, exp.ProgressName(), id, func(ctx context.Context, _ session.Group) error {
span, ctx := tracing.StartSpan(ctx, exp.ProgressName())
defer span.End()

if i == 0 && len(warnings) > 0 {
Expand Down

0 comments on commit fa2a8b9

Please sign in to comment.