Skip to content

Commit

Permalink
bake: display read definition files in build output
Browse files Browse the repository at this point in the history
Signed-off-by: CrazyMax <[email protected]>
  • Loading branch information
crazy-max committed Oct 14, 2023
1 parent 01245e7 commit 66212c0
Show file tree
Hide file tree
Showing 6 changed files with 171 additions and 17 deletions.
108 changes: 102 additions & 6 deletions bake/bake.go
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,18 @@ import (
"sort"
"strconv"
"strings"
"time"

composecli "github.com/compose-spec/compose-go/cli"
"github.com/docker/buildx/bake/hclparser"
"github.com/docker/buildx/build"
controllerapi "github.com/docker/buildx/controller/pb"
"github.com/docker/buildx/util/buildflags"
"github.com/docker/buildx/util/platformutil"
"github.com/docker/buildx/util/progress"
"github.com/docker/cli/cli/config"
hcl "github.com/hashicorp/hcl/v2"
"github.com/moby/buildkit/client"
"github.com/moby/buildkit/client/llb"
"github.com/moby/buildkit/session/auth/authprovider"
"github.com/pkg/errors"
Expand Down Expand Up @@ -54,28 +57,34 @@ func defaultFilenames() []string {
return names
}

func ReadLocalFiles(names []string, stdin io.Reader) ([]File, error) {
func ReadLocalFiles(names []string, stdin io.Reader, l progress.SubLogger) ([]File, error) {
isDefault := false
if len(names) == 0 {
isDefault = true
names = defaultFilenames()
}
out := make([]File, 0, len(names))

setStatus := func(st *client.VertexStatus) {
if l != nil {
l.SetStatus(st)
}
}

for _, n := range names {
var dt []byte
var err error
if n == "-" {
dt, err = io.ReadAll(stdin)
dt, err = readWithStatus(stdin, setStatus)
if err != nil {
return nil, err
}
} else {
dt, err = os.ReadFile(n)
dt, err = readFileWithStatus(n, isDefault, setStatus)
if dt == nil && err == nil {
continue
}
if err != nil {
if isDefault && errors.Is(err, os.ErrNotExist) {
continue
}
return nil, err
}
}
Expand All @@ -84,6 +93,93 @@ func ReadLocalFiles(names []string, stdin io.Reader) ([]File, error) {
return out, nil
}

func readFileWithStatus(fname string, isDefault bool, setStatus func(st *client.VertexStatus)) (dt []byte, err error) {
st := &client.VertexStatus{
ID: "reading " + fname,
}

defer func() {
now := time.Now()
st.Completed = &now
if dt != nil || err != nil {
setStatus(st)
}
}()

now := time.Now()
st.Started = &now

f, err := os.Open(fname)
if err != nil {
if isDefault && errors.Is(err, os.ErrNotExist) {
return nil, nil
}
setStatus(st)
return nil, err
}
defer f.Close()
setStatus(st)

info, err := f.Stat()
if err != nil {
return nil, err
}
st.Total = info.Size()
setStatus(st)

buf := make([]byte, 1024)
current := int64(0)
for {
n, err := f.Read(buf)
if err == io.EOF {
break
}
if err != nil {
return nil, err
}
dt = append(dt, buf[:n]...)
current += int64(n)
st.Current = current
setStatus(st)
}

return dt, nil
}

func readWithStatus(r io.Reader, setStatus func(st *client.VertexStatus)) (dt []byte, err error) {
st := &client.VertexStatus{
ID: "reading from stdin",
}

defer func() {
now := time.Now()
st.Completed = &now
setStatus(st)
}()

now := time.Now()
st.Started = &now
setStatus(st)

buf := make([]byte, 1024)
current := int64(0)
for {
n, err := r.Read(buf)
if err == io.EOF {
break
}
if err != nil {
return nil, err
}
dt = append(dt, buf[:n]...)
current += int64(n)
st.Current = current
setStatus(st)
}

return dt, nil
}

func ListTargets(files []File) ([]string, error) {
c, err := ParseFiles(files, nil)
if err != nil {
Expand Down
2 changes: 1 addition & 1 deletion bake/bake_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1408,7 +1408,7 @@ func TestReadLocalFilesDefault(t *testing.T) {
for _, tf := range tt.filenames {
require.NoError(t, os.WriteFile(tf, []byte(tf), 0644))
}
files, err := ReadLocalFiles(nil, nil)
files, err := ReadLocalFiles(nil, nil, nil)
require.NoError(t, err)
if len(files) == 0 {
require.Equal(t, len(tt.expected), len(files))
Expand Down
33 changes: 25 additions & 8 deletions bake/remote.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"archive/tar"
"bytes"
"context"
"time"

"github.com/docker/buildx/builder"
controllerapi "github.com/docker/buildx/controller/pb"
Expand Down Expand Up @@ -76,11 +77,14 @@ func ReadRemoteFiles(ctx context.Context, nodes []builder.Node, url string, name
return nil, err
}

if filename != "" {
files, err = filesFromURLRef(ctx, c, ref, inp, filename, names)
} else {
files, err = filesFromRef(ctx, ref, names)
}
progress.Wrap("[internal] load remote bake definitions", pw.Write, func(sub progress.SubLogger) error {
if filename != "" {
files, err = filesFromURLRef(ctx, c, ref, inp, filename, names, sub)
} else {
files, err = filesFromRef(ctx, ref, names, sub)
}
return nil
})
return nil, err
}, ch)

Expand Down Expand Up @@ -110,7 +114,7 @@ func isArchive(header []byte) bool {
return err == nil
}

func filesFromURLRef(ctx context.Context, c gwclient.Client, ref gwclient.Reference, inp *Input, filename string, names []string) ([]File, error) {
func filesFromURLRef(ctx context.Context, c gwclient.Client, ref gwclient.Reference, inp *Input, filename string, names []string, l progress.SubLogger) ([]File, error) {
stat, err := ref.StatFile(ctx, gwclient.StatRequest{Path: filename})
if err != nil {
return nil, err
Expand Down Expand Up @@ -148,13 +152,20 @@ func filesFromURLRef(ctx context.Context, c gwclient.Client, ref gwclient.Refere
return nil, err
}

return filesFromRef(ctx, ref, names)
return filesFromRef(ctx, ref, names, l)
}

inp.State = nil
name := inp.URL
inp.URL = ""

now := time.Now()
l.SetStatus(&client.VertexStatus{
ID: "reading " + name,
Started: &now,
Completed: &now,
})

if len(dt) > stat.Size() {
if stat.Size() > 1024*512 {
return nil, errors.Errorf("non-archive definition URL bigger than maximum allowed size")
Expand All @@ -171,7 +182,7 @@ func filesFromURLRef(ctx context.Context, c gwclient.Client, ref gwclient.Refere
return []File{{Name: name, Data: dt}}, nil
}

func filesFromRef(ctx context.Context, ref gwclient.Reference, names []string) ([]File, error) {
func filesFromRef(ctx context.Context, ref gwclient.Reference, names []string, l progress.SubLogger) ([]File, error) {
// TODO: auto-remove parent dir in needed
var files []File

Expand All @@ -189,6 +200,12 @@ func filesFromRef(ctx context.Context, ref gwclient.Reference, names []string) (
}
return nil, err
}
now := time.Now()
l.SetStatus(&client.VertexStatus{
ID: "reading " + name,
Started: &now,
Completed: &now,
})
dt, err := ref.ReadFile(ctx, gwclient.ReadRequest{Filename: name})
if err != nil {
return nil, err
Expand Down
5 changes: 4 additions & 1 deletion commands/bake.go
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,10 @@ func runBake(dockerCli command.Cli, targets []string, in bakeOptions, cFlags com
if url != "" {
files, inp, err = bake.ReadRemoteFiles(ctx, nodes, url, in.files, printer)
} else {
files, err = bake.ReadLocalFiles(in.files, dockerCli.In())
progress.Wrap("[internal] load local bake definitions", printer.Write, func(sub progress.SubLogger) error {
files, err = bake.ReadLocalFiles(in.files, dockerCli.In(), sub)
return nil
})
}
if err != nil {
return err
Expand Down
38 changes: 38 additions & 0 deletions tests/bake.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ func bakeCmd(sb integration.Sandbox, opts ...cmdOpt) (string, error) {

var bakeTests = []func(t *testing.T, sb integration.Sandbox){
testBakeLocal,
testBakeLocalMulti,
testBakeRemote,
testBakeRemoteCmdContext,
testBakeRemoteCmdContextOverride,
Expand Down Expand Up @@ -46,6 +47,41 @@ target "default" {

out, err := bakeCmd(sb, withDir(dir), withArgs("--set", "*.output=type=local,dest="+dirDest))
require.NoError(t, err, out)
require.Contains(t, out, `#1 [internal] load local bake definitions`)

Check failure on line 50 in tests/bake.go

View workflow job for this annotation

GitHub Actions / test (docker, ./tests)

Failed: tests/TestIntegration/TestBakeLocal/worker=docker

=== RUN TestIntegration/TestBakeLocal/worker=docker === PAUSE TestIntegration/TestBakeLocal/worker=docker === CONT TestIntegration/TestBakeLocal/worker=docker bake.go:50: Error Trace: /src/tests/bake.go:50 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:91 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:205 Error: "" does not contain "#1 [internal] load local bake definitions" Test: TestIntegration/TestBakeLocal/worker=docker sandbox.go:128: stderr: /usr/bin/dockerd sandbox.go:131: > startCmd 2023-10-14 04:04:52.92157632 +0000 UTC m=+30.906349539 /usr/bin/dockerd --data-root /tmp/integration955553365/d0zxmmu2d3kgk/root --exec-root /tmp/dxr/d0zxmmu2d3kgk --pidfile /tmp/integration955553365/d0zxmmu2d3kgk/docker.pid --containerd-namespace d0zxmmu2d3kgk --containerd-plugins-namespace d0zxmmu2d3kgkp --host unix:///tmp/docker-integration/d0zxmmu2d3kgk.sock --config-file /tmp/integration955553365/daemon.json --userland-proxy=false --tls=false --debug sandbox.go:131: time="2023-10-14T04:04:52.952923354Z" level=info msg="Starting up" sandbox.go:131: time="2023-10-14T04:04:52.954869962Z" level=warning msg="could not change group /tmp/docker-integration/d0zxmmu2d3kgk.sock to docker: group docker not found" sandbox.go:131: time="2023-10-14T04:04:52.955027863Z" level=debug msg="Listener created for HTTP on unix (/tmp/docker-integration/d0zxmmu2d3kgk.sock)" sandbox.go:131: time="2023-10-14T04:04:52.955041463Z" level=info msg="containerd not running, starting managed containerd" sandbox.go:131: time="2023-10-14T04:04:52.955693966Z" level=info msg="started new containerd process" address=/tmp/dxr/d0zxmmu2d3kgk/containerd/containerd.sock module=libcontainerd pid=8172 sandbox.go:131: time="2023-10-14T04:04:52.969556925Z" level=info msg="starting containerd" revision=1677a17964311325ed1c31e2c0a3589ce6d5c30d version=v1.7.1 sandbox.go:131: time="2023-10-14T04:04:52.987578002Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.aufs\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:52.988370805Z" 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:131: time="2023-10-14T04:04:52.988417805Z" level=info msg="loading plugin \"io.containerd.content.v1.content\"..." type=io.containerd.content.v1 sandbox.go:131: time="2023-10-14T04:04:52.988535106Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.native\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:52.988616406Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.overlayfs\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:52.988843607Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.devmapper\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:52.988882707Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.devmapper" error="devmapper not configured" sandbox.go:131: time="2023-10-14T04:04:52.988902807Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.zfs\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:52.989035708Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.zfs\"..." error="path /tmp/integration955553365/d0zxmmu2d3kgk/root/containerd/daemon/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:131: time="2023-10-14T04:04:52.989069108Z" level=info msg="loading plugin \"io.containerd.metadata.v1.bolt\"..." type=io.containerd.metadata.v1 sandbox.go:131: time="2023-10-14T04:04:52.989130508Z" level=warning

Check failure on line 50 in tests/bake.go

View workflow job for this annotation

GitHub Actions / test (docker\+containerd, ./tests)

Failed: tests/TestIntegration/TestBakeLocal/worker=docker+containerd

=== RUN TestIntegration/TestBakeLocal/worker=docker+containerd === PAUSE TestIntegration/TestBakeLocal/worker=docker+containerd === CONT TestIntegration/TestBakeLocal/worker=docker+containerd bake.go:50: Error Trace: /src/tests/bake.go:50 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:91 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:205 Error: "" does not contain "#1 [internal] load local bake definitions" Test: TestIntegration/TestBakeLocal/worker=docker+containerd sandbox.go:128: stdout: /usr/bin/dockerd sandbox.go:128: stderr: /usr/bin/dockerd sandbox.go:131: > startCmd 2023-10-14 04:04:13.68443287 +0000 UTC m=+7.381098938 /usr/bin/dockerd --data-root /tmp/integration1760211180/dyfs7dsj0jksv/root --exec-root /tmp/dxr/dyfs7dsj0jksv --pidfile /tmp/integration1760211180/dyfs7dsj0jksv/docker.pid --containerd-namespace dyfs7dsj0jksv --containerd-plugins-namespace dyfs7dsj0jksvp --host unix:///tmp/docker-integration/dyfs7dsj0jksv.sock --config-file /tmp/integration1760211180/daemon.json --userland-proxy=false --tls=false --debug sandbox.go:131: time="2023-10-14T04:04:13.731914493Z" level=info msg="Starting up" sandbox.go:131: time="2023-10-14T04:04:13.732998516Z" level=warning msg="could not change group /tmp/docker-integration/dyfs7dsj0jksv.sock to docker: group docker not found" sandbox.go:131: time="2023-10-14T04:04:13.733153619Z" level=debug msg="Listener created for HTTP on unix (/tmp/docker-integration/dyfs7dsj0jksv.sock)" sandbox.go:131: time="2023-10-14T04:04:13.733167320Z" level=info msg="containerd not running, starting managed containerd" sandbox.go:131: time="2023-10-14T04:04:13.733822934Z" level=info msg="started new containerd process" address=/tmp/dxr/dyfs7dsj0jksv/containerd/containerd.sock module=libcontainerd pid=4729 sandbox.go:131: time="2023-10-14T04:04:13.749133964Z" level=info msg="starting containerd" revision=1677a17964311325ed1c31e2c0a3589ce6d5c30d version=v1.7.1 sandbox.go:131: time="2023-10-14T04:04:13.777020465Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.aufs\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:13.777779881Z" 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:131: time="2023-10-14T04:04:13.777802281Z" level=info msg="loading plugin \"io.containerd.content.v1.content\"..." type=io.containerd.content.v1 sandbox.go:131: time="2023-10-14T04:04:13.777900683Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.native\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:13.777959485Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.overlayfs\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:13.778127088Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.devmapper\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:13.778141889Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.devmapper" error="devmapper not configured" sandbox.go:131: time="2023-10-14T04:04:13.778150189Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.zfs\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:13.778257191Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.zfs\"..." error="path /tmp/integration1760211180/dyfs7dsj0jksv/root/containerd/daemon/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:131: time="2023-10-14T04:04:13.778270091Z" level=info msg="loading plugin \"io.containerd.metadata.v1.bolt\"..." type=io.con

Check failure on line 50 in tests/bake.go

View workflow job for this annotation

GitHub Actions / test (docker-container, ./tests)

Failed: tests/TestIntegration/TestBakeLocal/worker=docker-container

=== RUN TestIntegration/TestBakeLocal/worker=docker-container === PAUSE TestIntegration/TestBakeLocal/worker=docker-container === CONT TestIntegration/TestBakeLocal/worker=docker-container bake.go:50: Error Trace: /src/tests/bake.go:50 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:91 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:205 Error: "" does not contain "#1 [internal] load local bake definitions" Test: TestIntegration/TestBakeLocal/worker=docker-container --- FAIL: TestIntegration/TestBakeLocal/worker=docker-container (5.11s)

Check failure on line 50 in tests/bake.go

View workflow job for this annotation

GitHub Actions / test (remote, ./tests)

Failed: tests/TestIntegration/TestBakeLocal/worker=remote

=== RUN TestIntegration/TestBakeLocal/worker=remote === PAUSE TestIntegration/TestBakeLocal/worker=remote === CONT TestIntegration/TestBakeLocal/worker=remote bake.go:50: Error Trace: /src/tests/bake.go:50 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:91 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:205 Error: "" does not contain "#1 [internal] load local bake definitions" Test: TestIntegration/TestBakeLocal/worker=remote sandbox.go:128: 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_config3992441669/buildkitd.toml --root /tmp/bktest_buildkitd1507912281 --addr unix:///tmp/bktest_buildkitd1507912281/buildkitd.sock --debug sandbox.go:128: 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_config3992441669/buildkitd.toml --root /tmp/bktest_buildkitd1507912281 --addr unix:///tmp/bktest_buildkitd1507912281/buildkitd.sock --debug sandbox.go:131: > StartCmd 2023-10-14 04:05:12.454866926 +0000 UTC m=+6.951946840 /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_config3992441669/buildkitd.toml --root /tmp/bktest_buildkitd1507912281 --addr unix:///tmp/bktest_buildkitd1507912281/buildkitd.sock --debug sandbox.go:131: time="2023-10-14T04:05:13Z" level=info msg="auto snapshotter: using overlayfs" sandbox.go:131: time="2023-10-14T04:05:13Z" level=warning msg="using host network as the default" sandbox.go:131: time="2023-10-14T04:05:13Z" level=info msg="found worker \"qoacpco4dv4ndyo03ncmgzd8e\", labels=map[org.mobyproject.buildkit.worker.executor:oci org.mobyproject.buildkit.worker.hostname:280691ad597e 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:131: time="2023-10-14T04:05:13Z" level=info msg="found 1 workers, default=\"qoacpco4dv4ndyo03ncmgzd8e\"" sandbox.go:131: time="2023-10-14T04:05:13Z" level=warning msg="currently, only the default worker can be used." sandbox.go:131: time="2023-10-14T04:05:13Z" level=info msg="running server on /tmp/bktest_buildkitd1507912281/buildkitd.sock" sandbox.go:131: time="2023-10-14T04:05:13Z" level=debug msg="session started" spanID=c01c86523a96cc04 traceID=081402c84a9ef8a4298ebf8d57f98771 sandbox.go:131: time="2023-10-14T04:05:13Z" level=debug msg="session finished: <nil>" spanID=c01c86523a96cc04 traceID=081402c84a9ef8a4298ebf8d57f98771 sandbox.go:131: time="2023-10-14T04:05:13Z" level=debug msg="session started" spanID=7db548f922e6e25e traceID=081402c84a9ef8a4298ebf8d57f98771 sandbox.go:131: time="2023-10-14T04:05:13Z" level=debug msg="new ref for local: p3hq3c5ibpqih5a6erpsj8vke" span="[internal] load build definition from Dockerfile" spanID=42b151e96eb82228 traceID=081402c84a9ef8a4298ebf8d57f98771 sandbox.go:131: time="2023-10-14T04:05:13Z" level=debug msg="diffcopy took: 2.190914ms" span="[internal] load build definition from Dockerfile" spanID=19d69f6e425f5fd7 traceID=081402c84a9ef8a4298ebf8d57f98771 sandbox.go:131: time="2023-10-14T04:05:13Z" level=debug msg="new ref for local: hd2jzqx3j48fqn30bodga6445" span="[internal] load .dockerignore" spanID=c3ba43d7dce9c7ac traceID=081402c84a9ef8a4298ebf8d57f98771 sandbox.go:131: time="2023-10-14T04:05:13Z" level=debug msg="diffcopy took: 1.56181ms" span="[internal] load .dockerignore" s
require.Contains(t, out, `#1 [internal] reading docker-bake.hcl`)

require.FileExists(t, filepath.Join(dirDest, "foo"))
}

func testBakeLocalMulti(t *testing.T, sb integration.Sandbox) {
dockerfile := []byte(`
FROM scratch
COPY foo /foo
`)
bakefile := []byte(`
target "default" {
}
`)
composefile := []byte(`
services:
app:
build: {}
`)

dir := tmpdir(
t,
fstest.CreateFile("docker-bake.hcl", bakefile, 0600),
fstest.CreateFile("compoose.yaml", composefile, 0600),
fstest.CreateFile("Dockerfile", dockerfile, 0600),
fstest.CreateFile("foo", []byte("foo"), 0600),
)
dirDest := t.TempDir()

out, err := bakeCmd(sb, withDir(dir), withArgs("--set", "*.output=type=local,dest="+dirDest))
require.NoError(t, err, out)
require.Contains(t, out, `#1 [internal] load local bake definitions`)

Check failure on line 82 in tests/bake.go

View workflow job for this annotation

GitHub Actions / test (docker, ./tests)

Failed: tests/TestIntegration/TestBakeLocalMulti/worker=docker

=== RUN TestIntegration/TestBakeLocalMulti/worker=docker === PAUSE TestIntegration/TestBakeLocalMulti/worker=docker === CONT TestIntegration/TestBakeLocalMulti/worker=docker bake.go:82: Error Trace: /src/tests/bake.go:82 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:91 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:205 Error: "" does not contain "#1 [internal] load local bake definitions" Test: TestIntegration/TestBakeLocalMulti/worker=docker sandbox.go:128: stderr: /usr/bin/dockerd sandbox.go:131: > startCmd 2023-10-14 04:04:51.517774031 +0000 UTC m=+29.502547350 /usr/bin/dockerd --data-root /tmp/integration2879893371/d09j03xb8hwoz/root --exec-root /tmp/dxr/d09j03xb8hwoz --pidfile /tmp/integration2879893371/d09j03xb8hwoz/docker.pid --containerd-namespace d09j03xb8hwoz --containerd-plugins-namespace d09j03xb8hwozp --host unix:///tmp/docker-integration/d09j03xb8hwoz.sock --config-file /tmp/integration2879893371/daemon.json --userland-proxy=false --tls=false --debug sandbox.go:131: time="2023-10-14T04:04:51.552355378Z" level=info msg="Starting up" sandbox.go:131: time="2023-10-14T04:04:51.553322182Z" level=warning msg="could not change group /tmp/docker-integration/d09j03xb8hwoz.sock to docker: group docker not found" sandbox.go:131: time="2023-10-14T04:04:51.553454683Z" level=debug msg="Listener created for HTTP on unix (/tmp/docker-integration/d09j03xb8hwoz.sock)" sandbox.go:131: time="2023-10-14T04:04:51.553469983Z" level=info msg="containerd not running, starting managed containerd" sandbox.go:131: time="2023-10-14T04:04:51.554088686Z" level=info msg="started new containerd process" address=/tmp/dxr/d09j03xb8hwoz/containerd/containerd.sock module=libcontainerd pid=7993 sandbox.go:131: time="2023-10-14T04:04:51.569349651Z" level=info msg="starting containerd" revision=1677a17964311325ed1c31e2c0a3589ce6d5c30d version=v1.7.1 sandbox.go:131: time="2023-10-14T04:04:51.587354928Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.aufs\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:51.588109531Z" 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:131: time="2023-10-14T04:04:51.588132831Z" level=info msg="loading plugin \"io.containerd.content.v1.content\"..." type=io.containerd.content.v1 sandbox.go:131: time="2023-10-14T04:04:51.588214531Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.native\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:51.588278432Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.overlayfs\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:51.588440932Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.devmapper\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:51.588458132Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.devmapper" error="devmapper not configured" sandbox.go:131: time="2023-10-14T04:04:51.588494732Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.zfs\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:51.588603233Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.zfs\"..." error="path /tmp/integration2879893371/d09j03xb8hwoz/root/containerd/daemon/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:131: time="2023-10-14T04:04:51.588619733Z" level=info msg="loading plugin \"io.containerd.metadata.v1.bolt\"..." type=io.containerd.metadata.v1 sandbox.go:131: time="2023-10-14T04:04:51.5

Check failure on line 82 in tests/bake.go

View workflow job for this annotation

GitHub Actions / test (docker\+containerd, ./tests)

Failed: tests/TestIntegration/TestBakeLocalMulti/worker=docker+containerd

=== RUN TestIntegration/TestBakeLocalMulti/worker=docker+containerd === PAUSE TestIntegration/TestBakeLocalMulti/worker=docker+containerd === CONT TestIntegration/TestBakeLocalMulti/worker=docker+containerd bake.go:82: Error Trace: /src/tests/bake.go:82 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:91 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:205 Error: "" does not contain "#1 [internal] load local bake definitions" Test: TestIntegration/TestBakeLocalMulti/worker=docker+containerd sandbox.go:128: stdout: /usr/bin/dockerd sandbox.go:128: stderr: /usr/bin/dockerd sandbox.go:131: > startCmd 2023-10-14 04:04:36.523109998 +0000 UTC m=+30.219776066 /usr/bin/dockerd --data-root /tmp/integration3639917833/datbjh78b14ta/root --exec-root /tmp/dxr/datbjh78b14ta --pidfile /tmp/integration3639917833/datbjh78b14ta/docker.pid --containerd-namespace datbjh78b14ta --containerd-plugins-namespace datbjh78b14tap --host unix:///tmp/docker-integration/datbjh78b14ta.sock --config-file /tmp/integration3639917833/daemon.json --userland-proxy=false --tls=false --debug sandbox.go:131: time="2023-10-14T04:04:36.560235792Z" level=info msg="Starting up" sandbox.go:131: time="2023-10-14T04:04:36.561334415Z" level=warning msg="could not change group /tmp/docker-integration/datbjh78b14ta.sock to docker: group docker not found" sandbox.go:131: time="2023-10-14T04:04:36.561507419Z" level=debug msg="Listener created for HTTP on unix (/tmp/docker-integration/datbjh78b14ta.sock)" sandbox.go:131: time="2023-10-14T04:04:36.561525019Z" level=info msg="containerd not running, starting managed containerd" sandbox.go:131: time="2023-10-14T04:04:36.562157033Z" level=info msg="started new containerd process" address=/tmp/dxr/datbjh78b14ta/containerd/containerd.sock module=libcontainerd pid=7970 sandbox.go:131: time="2023-10-14T04:04:36.579579305Z" level=info msg="starting containerd" revision=1677a17964311325ed1c31e2c0a3589ce6d5c30d version=v1.7.1 sandbox.go:131: time="2023-10-14T04:04:36.598082701Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.aufs\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:36.598799017Z" 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:131: time="2023-10-14T04:04:36.598822517Z" level=info msg="loading plugin \"io.containerd.content.v1.content\"..." type=io.containerd.content.v1 sandbox.go:131: time="2023-10-14T04:04:36.598922519Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.native\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:36.598985320Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.overlayfs\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:36.599158224Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.devmapper\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:36.599175325Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.devmapper" error="devmapper not configured" sandbox.go:131: time="2023-10-14T04:04:36.599223926Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.zfs\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:36.599335428Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.zfs\"..." error="path /tmp/integration3639917833/datbjh78b14ta/root/containerd/daemon/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:131: time="2023-10-14T04:04:36.599352628Z" level=info msg="loading plugin \"io.containerd.metadata.v1.

Check failure on line 82 in tests/bake.go

View workflow job for this annotation

GitHub Actions / test (docker-container, ./tests)

Failed: tests/TestIntegration/TestBakeLocalMulti/worker=docker-container

=== RUN TestIntegration/TestBakeLocalMulti/worker=docker-container === PAUSE TestIntegration/TestBakeLocalMulti/worker=docker-container === CONT TestIntegration/TestBakeLocalMulti/worker=docker-container bake.go:82: Error Trace: /src/tests/bake.go:82 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:91 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:205 Error: "" does not contain "#1 [internal] load local bake definitions" Test: TestIntegration/TestBakeLocalMulti/worker=docker-container --- FAIL: TestIntegration/TestBakeLocalMulti/worker=docker-container (6.48s)

Check failure on line 82 in tests/bake.go

View workflow job for this annotation

GitHub Actions / test (remote, ./tests)

Failed: tests/TestIntegration/TestBakeLocalMulti/worker=remote

=== RUN TestIntegration/TestBakeLocalMulti/worker=remote === PAUSE TestIntegration/TestBakeLocalMulti/worker=remote === CONT TestIntegration/TestBakeLocalMulti/worker=remote bake.go:82: Error Trace: /src/tests/bake.go:82 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:91 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:205 Error: "2023/10/14 04:05:19 http2: server connection error from localhost: connection error: PROTOCOL_ERROR\n" does not contain "#1 [internal] load local bake definitions" Test: TestIntegration/TestBakeLocalMulti/worker=remote sandbox.go:128: 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_config2406996484/buildkitd.toml --root /tmp/bktest_buildkitd1972080005 --addr unix:///tmp/bktest_buildkitd1972080005/buildkitd.sock --debug sandbox.go:128: 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_config2406996484/buildkitd.toml --root /tmp/bktest_buildkitd1972080005 --addr unix:///tmp/bktest_buildkitd1972080005/buildkitd.sock --debug sandbox.go:131: > StartCmd 2023-10-14 04:05:18.951836722 +0000 UTC m=+13.448916736 /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_config2406996484/buildkitd.toml --root /tmp/bktest_buildkitd1972080005 --addr unix:///tmp/bktest_buildkitd1972080005/buildkitd.sock --debug sandbox.go:131: time="2023-10-14T04:05:19Z" level=info msg="auto snapshotter: using overlayfs" sandbox.go:131: time="2023-10-14T04:05:19Z" level=warning msg="using host network as the default" sandbox.go:131: time="2023-10-14T04:05:19Z" level=info msg="found worker \"jthmlf8cwhpl5g971nzlax2ky\", labels=map[org.mobyproject.buildkit.worker.executor:oci org.mobyproject.buildkit.worker.hostname:280691ad597e 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:131: time="2023-10-14T04:05:19Z" level=info msg="found 1 workers, default=\"jthmlf8cwhpl5g971nzlax2ky\"" sandbox.go:131: time="2023-10-14T04:05:19Z" level=warning msg="currently, only the default worker can be used." sandbox.go:131: time="2023-10-14T04:05:19Z" level=info msg="running server on /tmp/bktest_buildkitd1972080005/buildkitd.sock" sandbox.go:131: time="2023-10-14T04:05:19Z" level=debug msg="session started" spanID=1f6bba74b5267b4e traceID=96869828475adff577c88ffb73c466d2 sandbox.go:131: time="2023-10-14T04:05:19Z" level=debug msg="session finished: <nil>" spanID=1f6bba74b5267b4e traceID=96869828475adff577c88ffb73c466d2 sandbox.go:131: time="2023-10-14T04:05:20Z" level=debug msg="session started" spanID=d8b38f4a10416641 traceID=96869828475adff577c88ffb73c466d2 sandbox.go:131: time="2023-10-14T04:05:20Z" level=debug msg="new ref for local: 5d4ogq67k9byfcuf3ass6u6an" span="[internal] load .dockerignore" spanID=f4b6c98f71887616 traceID=96869828475adff577c88ffb73c466d2 sandbox.go:131: time="2023-10-14T04:05:20Z" level=debug msg="diffcopy took: 1.889313ms" span="[internal] load .dockerignore" spanID=dff1d80f62f6a78a traceID=96869828475adff577c88ffb73c466d2 sandbox.go:131: time="2023-10-14T04:05:20Z" level=debug msg="new ref for local: 9m2cztno0374uky13vmaj3m4y" span="[internal] load build definition from Dockerfile" spanID=8a70c172880064da traceID=96869828475adff577c88ffb73c466d2 sandbox.go:131: time="
require.Contains(t, out, `#1 [internal] reading compose.yaml`)
require.Contains(t, out, `#1 [internal] reading docker-bake.hcl`)

require.FileExists(t, filepath.Join(dirDest, "foo"))
}
Expand Down Expand Up @@ -76,6 +112,8 @@ EOT

out, err := bakeCmd(sb, withDir(dir), withArgs(addr, "--set", "*.output=type=local,dest="+dirDest))
require.NoError(t, err, out)
require.Contains(t, out, `#1 [internal] load remote bake definitions`)

Check failure on line 115 in tests/bake.go

View workflow job for this annotation

GitHub Actions / test (docker, ./tests)

Failed: tests/TestIntegration/TestBakeRemote/worker=docker

=== RUN TestIntegration/TestBakeRemote/worker=docker === PAUSE TestIntegration/TestBakeRemote/worker=docker === CONT TestIntegration/TestBakeRemote/worker=docker bake.go:115: Error Trace: /src/tests/bake.go:115 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:91 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:205 Error: "" does not contain "#1 [internal] load remote bake definitions" Test: TestIntegration/TestBakeRemote/worker=docker sandbox.go:128: stderr: /usr/bin/dockerd sandbox.go:131: > startCmd 2023-10-14 04:04:49.517848898 +0000 UTC m=+27.502622117 /usr/bin/dockerd --data-root /tmp/integration486175480/dlgdxlr46vvym/root --exec-root /tmp/dxr/dlgdxlr46vvym --pidfile /tmp/integration486175480/dlgdxlr46vvym/docker.pid --containerd-namespace dlgdxlr46vvym --containerd-plugins-namespace dlgdxlr46vvymp --host unix:///tmp/docker-integration/dlgdxlr46vvym.sock --config-file /tmp/integration486175480/daemon.json --userland-proxy=false --tls=false --debug sandbox.go:131: time="2023-10-14T04:04:49.552739847Z" level=info msg="Starting up" sandbox.go:131: time="2023-10-14T04:04:49.553742051Z" level=warning msg="could not change group /tmp/docker-integration/dlgdxlr46vvym.sock to docker: group docker not found" sandbox.go:131: time="2023-10-14T04:04:49.553907552Z" level=debug msg="Listener created for HTTP on unix (/tmp/docker-integration/dlgdxlr46vvym.sock)" sandbox.go:131: time="2023-10-14T04:04:49.553924052Z" level=info msg="containerd not running, starting managed containerd" sandbox.go:131: time="2023-10-14T04:04:49.554538155Z" level=info msg="started new containerd process" address=/tmp/dxr/dlgdxlr46vvym/containerd/containerd.sock module=libcontainerd pid=7621 sandbox.go:131: time="2023-10-14T04:04:49.572953833Z" level=info msg="starting containerd" revision=1677a17964311325ed1c31e2c0a3589ce6d5c30d version=v1.7.1 sandbox.go:131: time="2023-10-14T04:04:49.590846410Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.aufs\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:49.592125015Z" 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:131: time="2023-10-14T04:04:49.592152815Z" level=info msg="loading plugin \"io.containerd.content.v1.content\"..." type=io.containerd.content.v1 sandbox.go:131: time="2023-10-14T04:04:49.592252116Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.native\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:49.592314116Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.overlayfs\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:49.592492417Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.devmapper\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:49.592509717Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.devmapper" error="devmapper not configured" sandbox.go:131: time="2023-10-14T04:04:49.592521717Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.zfs\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:49.592625417Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.zfs\"..." error="path /tmp/integration486175480/dlgdxlr46vvym/root/containerd/daemon/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:131: time="2023-10-14T04:04:49.592638817Z" level=info msg="loading plugin \"io.containerd.metadata.v1.bolt\"..." type=io.containerd.metadata.v1 sandbox.go:131: time="2023-10-14T04:04:49.592679718Z" level=

Check failure on line 115 in tests/bake.go

View workflow job for this annotation

GitHub Actions / test (docker\+containerd, ./tests)

Failed: tests/TestIntegration/TestBakeRemote/worker=docker+containerd

=== RUN TestIntegration/TestBakeRemote/worker=docker+containerd === PAUSE TestIntegration/TestBakeRemote/worker=docker+containerd === CONT TestIntegration/TestBakeRemote/worker=docker+containerd bake.go:115: Error Trace: /src/tests/bake.go:115 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:91 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:205 Error: "" does not contain "#1 [internal] load remote bake definitions" Test: TestIntegration/TestBakeRemote/worker=docker+containerd sandbox.go:128: stdout: /usr/bin/dockerd sandbox.go:128: stderr: /usr/bin/dockerd sandbox.go:131: > startCmd 2023-10-14 04:04:34.505794347 +0000 UTC m=+28.202460515 /usr/bin/dockerd --data-root /tmp/integration3379790908/djz5wyrvts9j7/root --exec-root /tmp/dxr/djz5wyrvts9j7 --pidfile /tmp/integration3379790908/djz5wyrvts9j7/docker.pid --containerd-namespace djz5wyrvts9j7 --containerd-plugins-namespace djz5wyrvts9j7p --host unix:///tmp/docker-integration/djz5wyrvts9j7.sock --config-file /tmp/integration3379790908/daemon.json --userland-proxy=false --tls=false --debug sandbox.go:131: time="2023-10-14T04:04:34.543601456Z" level=info msg="Starting up" sandbox.go:131: time="2023-10-14T04:04:34.544636878Z" level=warning msg="could not change group /tmp/docker-integration/djz5wyrvts9j7.sock to docker: group docker not found" sandbox.go:131: time="2023-10-14T04:04:34.544777581Z" level=debug msg="Listener created for HTTP on unix (/tmp/docker-integration/djz5wyrvts9j7.sock)" sandbox.go:131: time="2023-10-14T04:04:34.544793582Z" level=info msg="containerd not running, starting managed containerd" sandbox.go:131: time="2023-10-14T04:04:34.545466696Z" level=info msg="started new containerd process" address=/tmp/dxr/djz5wyrvts9j7/containerd/containerd.sock module=libcontainerd pid=7614 sandbox.go:131: time="2023-10-14T04:04:34.562157553Z" level=info msg="starting containerd" revision=1677a17964311325ed1c31e2c0a3589ce6d5c30d version=v1.7.1 sandbox.go:131: time="2023-10-14T04:04:34.579524825Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.aufs\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:34.580371143Z" 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:131: time="2023-10-14T04:04:34.580422744Z" level=info msg="loading plugin \"io.containerd.content.v1.content\"..." type=io.containerd.content.v1 sandbox.go:131: time="2023-10-14T04:04:34.580538846Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.native\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:34.580624748Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.overlayfs\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:34.580855653Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.devmapper\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:34.580895454Z" level=warning msg="failed to load plugin io.containerd.snapshotter.v1.devmapper" error="devmapper not configured" sandbox.go:131: time="2023-10-14T04:04:34.580914154Z" level=info msg="loading plugin \"io.containerd.snapshotter.v1.zfs\"..." type=io.containerd.snapshotter.v1 sandbox.go:131: time="2023-10-14T04:04:34.581047357Z" level=info msg="skip loading plugin \"io.containerd.snapshotter.v1.zfs\"..." error="path /tmp/integration3379790908/djz5wyrvts9j7/root/containerd/daemon/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:131: time="2023-10-14T04:04:34.581076458Z" level=info msg="loading plugin \"io.containerd.metadata.v1.bolt\"..." ty

Check failure on line 115 in tests/bake.go

View workflow job for this annotation

GitHub Actions / test (docker-container, ./tests)

Failed: tests/TestIntegration/TestBakeRemote/worker=docker-container

=== RUN TestIntegration/TestBakeRemote/worker=docker-container === PAUSE TestIntegration/TestBakeRemote/worker=docker-container === CONT TestIntegration/TestBakeRemote/worker=docker-container bake.go:115: Error Trace: /src/tests/bake.go:115 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:91 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:205 Error: "" does not contain "#1 [internal] load remote bake definitions" Test: TestIntegration/TestBakeRemote/worker=docker-container --- FAIL: TestIntegration/TestBakeRemote/worker=docker-container (5.77s)

Check failure on line 115 in tests/bake.go

View workflow job for this annotation

GitHub Actions / test (remote, ./tests)

Failed: tests/TestIntegration/TestBakeRemote/worker=remote

=== RUN TestIntegration/TestBakeRemote/worker=remote === PAUSE TestIntegration/TestBakeRemote/worker=remote === CONT TestIntegration/TestBakeRemote/worker=remote bake.go:115: Error Trace: /src/tests/bake.go:115 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:91 /src/vendor/github.com/moby/buildkit/util/testutil/integration/run.go:205 Error: "" does not contain "#1 [internal] load remote bake definitions" Test: TestIntegration/TestBakeRemote/worker=remote sandbox.go:128: 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_config2850959334/buildkitd.toml --root /tmp/bktest_buildkitd490641556 --addr unix:///tmp/bktest_buildkitd490641556/buildkitd.sock --debug sandbox.go:128: 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_config2850959334/buildkitd.toml --root /tmp/bktest_buildkitd490641556 --addr unix:///tmp/bktest_buildkitd490641556/buildkitd.sock --debug sandbox.go:131: > StartCmd 2023-10-14 04:05:18.082403044 +0000 UTC m=+12.579483058 /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_config2850959334/buildkitd.toml --root /tmp/bktest_buildkitd490641556 --addr unix:///tmp/bktest_buildkitd490641556/buildkitd.sock --debug sandbox.go:131: time="2023-10-14T04:05:18Z" level=info msg="auto snapshotter: using overlayfs" sandbox.go:131: time="2023-10-14T04:05:18Z" level=warning msg="using host network as the default" sandbox.go:131: time="2023-10-14T04:05:18Z" level=info msg="found worker \"82o22e4413zza8724k7sefo9m\", labels=map[org.mobyproject.buildkit.worker.executor:oci org.mobyproject.buildkit.worker.hostname:280691ad597e 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:131: time="2023-10-14T04:05:18Z" level=info msg="found 1 workers, default=\"82o22e4413zza8724k7sefo9m\"" sandbox.go:131: time="2023-10-14T04:05:18Z" level=warning msg="currently, only the default worker can be used." sandbox.go:131: time="2023-10-14T04:05:18Z" level=info msg="running server on /tmp/bktest_buildkitd490641556/buildkitd.sock" sandbox.go:131: time="2023-10-14T04:05:18Z" level=debug msg="session started" spanID=475666b81e0f930f traceID=f53a4bab82e9f0789fc0e47c3516b82a sandbox.go:131: time="2023-10-14T04:05:19Z" level=error msg="/moby.buildkit.v1.frontend.LLBBridge/StatFile returned error: rpc error: code = Unknown desc = lstat /tmp/bktest_buildkitd490641556/tmp/buildkit-mount3112880583/compose.yaml: no such file or directory" sandbox.go:131: lstat /tmp/bktest_buildkitd490641556/tmp/buildkit-mount3112880583/compose.yaml: no such file or directory sandbox.go:131: 7203 v0.11.6 buildkitd --oci-worker=true --containerd-worker=false --oci-worker-gc=false --oci-worker-labels=org.mobyproject.buildkit.worker.sandbox=true --config=/tmp/bktest_config2850959334/buildkitd.toml --root /tmp/bktest_buildkitd490641556 --addr unix:///tmp/bktest_buildkitd490641556/buildkitd.sock --debug sandbox.go:131: github.com/tonistiigi/fsutil.Stat sandbox.go:131: /src/vendor/github.com/tonistiigi/fsutil/stat.go:61 sandbox.go:131: github.com/moby/buildkit/cache/util.StatFile.func1 sandbox.go:131: /src/cache/util/fsutil.go:126 sandbox.go:131: github.com/moby/buildkit/cache/util.withMount sandbox.go:131: /src/cache/util/fsutil.go:
require.Contains(t, out, `#1 [internal] reading docker-bake.hcl`)

require.FileExists(t, filepath.Join(dirDest, "foo"))
}
Expand Down
2 changes: 1 addition & 1 deletion util/cobrautil/completion/completion.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ func Disable(cmd *cobra.Command, args []string, toComplete string) ([]string, co

func BakeTargets(files []string) ValidArgsFn {
return func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
f, err := bake.ReadLocalFiles(files, nil)
f, err := bake.ReadLocalFiles(files, nil, nil)
if err != nil {
return nil, cobra.ShellCompDirectiveError
}
Expand Down

0 comments on commit 66212c0

Please sign in to comment.