status
stringclasses
1 value
repo_name
stringclasses
31 values
repo_url
stringclasses
31 values
issue_id
int64
1
104k
title
stringlengths
4
233
body
stringlengths
0
186k
βŒ€
issue_url
stringlengths
38
56
pull_url
stringlengths
37
54
before_fix_sha
stringlengths
40
40
after_fix_sha
stringlengths
40
40
report_datetime
timestamp[us, tz=UTC]
language
stringclasses
5 values
commit_datetime
timestamp[us, tz=UTC]
updated_file
stringlengths
7
188
chunk_content
stringlengths
1
1.03M
closed
dagger/dagger
https://github.com/dagger/dagger
4,085
Container From removes existing env vars
Example: https://play.dagger.cloud/playground/JBT8x7KCicC ```graphql { container { withEnvVariable(name:"FOO", value:"BAR") { from(address:"alpine:latest") { withExec(args:["env"]) { stdout } } } } } ``` That will not show `FOO` in the output. --- I suppose the correct behavior is not totally obvious, but I'd argue that we should not remove existing env vars because: 1. It can be nice for certain use cases. I was trying to set some env vars that would be shared across all our sdk base containers but I couldn't set them in a common base container because each SDK calls `From`. 2. Other APIs like `WithMountedFile` change the container state but don't get removed by calling `From`, so we should be consistent one way or the other at least
https://github.com/dagger/dagger/issues/4085
https://github.com/dagger/dagger/pull/4455
3c0192e2b9c644ee4a5aad285df94f07a107ccd8
b43d267a7f7657017188bec57d7826059475a2f3
2022-12-02T23:30:33Z
go
2023-01-31T18:49:32Z
core/container.go
return nil, err } dirPayload, err := dir.ID.Decode() if err != nil { return nil, err } dirPayload.Pipeline = containerPayload.Pipeline dir, err = dirPayload.ToDirectory() if err != nil { return nil, err } dir, err = fn(dir) if err != nil { return nil, err } if mount == nil { return container.WithRootFS(ctx, dir) } dirPayload, err = dir.ID.Decode() if err != nil { return nil, err } return container.withMounted(mount.Target, dirPayload.LLB, mount.SourcePath) } func (container *Container) ImageConfig(ctx context.Context) (specs.ImageConfig, error) { payload, err := container.ID.decode() if err != nil { return specs.ImageConfig{}, err }
closed
dagger/dagger
https://github.com/dagger/dagger
4,085
Container From removes existing env vars
Example: https://play.dagger.cloud/playground/JBT8x7KCicC ```graphql { container { withEnvVariable(name:"FOO", value:"BAR") { from(address:"alpine:latest") { withExec(args:["env"]) { stdout } } } } } ``` That will not show `FOO` in the output. --- I suppose the correct behavior is not totally obvious, but I'd argue that we should not remove existing env vars because: 1. It can be nice for certain use cases. I was trying to set some env vars that would be shared across all our sdk base containers but I couldn't set them in a common base container because each SDK calls `From`. 2. Other APIs like `WithMountedFile` change the container state but don't get removed by calling `From`, so we should be consistent one way or the other at least
https://github.com/dagger/dagger/issues/4085
https://github.com/dagger/dagger/pull/4455
3c0192e2b9c644ee4a5aad285df94f07a107ccd8
b43d267a7f7657017188bec57d7826059475a2f3
2022-12-02T23:30:33Z
go
2023-01-31T18:49:32Z
core/container.go
return payload.Config, nil } func (container *Container) UpdateImageConfig(ctx context.Context, updateFn func(specs.ImageConfig) specs.ImageConfig) (*Container, error) { payload, err := container.ID.decode() if err != nil { return nil, err } payload.Config = updateFn(payload.Config) id, err := payload.Encode() if err != nil { return nil, err } return &Container{ID: id}, nil } func (container *Container) Pipeline(ctx context.Context, name, description string) (*Container, error) { payload, err := container.ID.decode() if err != nil { return nil, fmt.Errorf("decode id: %w", err) } payload.Pipeline = payload.Pipeline.Add(Pipeline{ Name: name, Description: description, }) id, err := payload.Encode() if err != nil { return nil, err } return &Container{ID: id}, nil } func (container *Container) Exec(ctx context.Context, gw bkgw.Client, defaultPlatform specs.Platform, opts ContainerExecOpts) (*Container, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,085
Container From removes existing env vars
Example: https://play.dagger.cloud/playground/JBT8x7KCicC ```graphql { container { withEnvVariable(name:"FOO", value:"BAR") { from(address:"alpine:latest") { withExec(args:["env"]) { stdout } } } } } ``` That will not show `FOO` in the output. --- I suppose the correct behavior is not totally obvious, but I'd argue that we should not remove existing env vars because: 1. It can be nice for certain use cases. I was trying to set some env vars that would be shared across all our sdk base containers but I couldn't set them in a common base container because each SDK calls `From`. 2. Other APIs like `WithMountedFile` change the container state but don't get removed by calling `From`, so we should be consistent one way or the other at least
https://github.com/dagger/dagger/issues/4085
https://github.com/dagger/dagger/pull/4455
3c0192e2b9c644ee4a5aad285df94f07a107ccd8
b43d267a7f7657017188bec57d7826059475a2f3
2022-12-02T23:30:33Z
go
2023-01-31T18:49:32Z
core/container.go
payload, err := container.ID.decode() if err != nil { return nil, fmt.Errorf("decode id: %w", err) } cfg := payload.Config mounts := payload.Mounts platform := payload.Platform if platform.OS == "" { platform = defaultPlatform } args := opts.Args if len(args) == 0 { args = cfg.Cmd } if len(cfg.Entrypoint) > 0 { args = append(cfg.Entrypoint, args...) } runOpts := []llb.RunOption{ llb.Args(args), payload.Pipeline.LLBOpt(), llb.WithCustomNamef("exec %s", strings.Join(args, " ")), } if opts.ExperimentalPrivilegedNesting { runOpts = append(runOpts, llb.AddEnv("_DAGGER_ENABLE_NESTING", ""), ) }
closed
dagger/dagger
https://github.com/dagger/dagger
4,085
Container From removes existing env vars
Example: https://play.dagger.cloud/playground/JBT8x7KCicC ```graphql { container { withEnvVariable(name:"FOO", value:"BAR") { from(address:"alpine:latest") { withExec(args:["env"]) { stdout } } } } } ``` That will not show `FOO` in the output. --- I suppose the correct behavior is not totally obvious, but I'd argue that we should not remove existing env vars because: 1. It can be nice for certain use cases. I was trying to set some env vars that would be shared across all our sdk base containers but I couldn't set them in a common base container because each SDK calls `From`. 2. Other APIs like `WithMountedFile` change the container state but don't get removed by calling `From`, so we should be consistent one way or the other at least
https://github.com/dagger/dagger/issues/4085
https://github.com/dagger/dagger/pull/4455
3c0192e2b9c644ee4a5aad285df94f07a107ccd8
b43d267a7f7657017188bec57d7826059475a2f3
2022-12-02T23:30:33Z
go
2023-01-31T18:49:32Z
core/container.go
meta := llb.Mkdir(metaSourcePath, 0o777) if opts.Stdin != "" { meta = meta.Mkfile(path.Join(metaSourcePath, "stdin"), 0o600, []byte(opts.Stdin)) } runOpts = append(runOpts, llb.AddMount(metaMountDestPath, llb.Scratch().File(meta, CustomName{Name: "creating dagger metadata", Internal: true}.LLBOpt(), payload.Pipeline.LLBOpt()), llb.SourcePath(metaSourcePath))) if opts.RedirectStdout != "" { runOpts = append(runOpts, llb.AddEnv("_DAGGER_REDIRECT_STDOUT", opts.RedirectStdout)) } if opts.RedirectStderr != "" { runOpts = append(runOpts, llb.AddEnv("_DAGGER_REDIRECT_STDERR", opts.RedirectStderr)) } if cfg.User != "" { runOpts = append(runOpts, llb.User(cfg.User)) } if cfg.WorkingDir != "" { runOpts = append(runOpts, llb.Dir(cfg.WorkingDir)) } for _, env := range cfg.Env { name, val, ok := strings.Cut(env, "=") if !ok { _ = ok
closed
dagger/dagger
https://github.com/dagger/dagger
4,085
Container From removes existing env vars
Example: https://play.dagger.cloud/playground/JBT8x7KCicC ```graphql { container { withEnvVariable(name:"FOO", value:"BAR") { from(address:"alpine:latest") { withExec(args:["env"]) { stdout } } } } } ``` That will not show `FOO` in the output. --- I suppose the correct behavior is not totally obvious, but I'd argue that we should not remove existing env vars because: 1. It can be nice for certain use cases. I was trying to set some env vars that would be shared across all our sdk base containers but I couldn't set them in a common base container because each SDK calls `From`. 2. Other APIs like `WithMountedFile` change the container state but don't get removed by calling `From`, so we should be consistent one way or the other at least
https://github.com/dagger/dagger/issues/4085
https://github.com/dagger/dagger/pull/4455
3c0192e2b9c644ee4a5aad285df94f07a107ccd8
b43d267a7f7657017188bec57d7826059475a2f3
2022-12-02T23:30:33Z
go
2023-01-31T18:49:32Z
core/container.go
} if name == "_DAGGER_ENABLE_NESTING" && !opts.ExperimentalPrivilegedNesting { continue } if name == DebugFailedExecEnv { continue } runOpts = append(runOpts, llb.AddEnv(name, val)) } for i, secret := range payload.Secrets { secretOpts := []llb.SecretOption{llb.SecretID(secret.Secret.String())} var secretDest string switch { case secret.EnvName != "": secretDest = secret.EnvName secretOpts = append(secretOpts, llb.SecretAsEnv(true)) case secret.MountPath != "": secretDest = secret.MountPath default: return nil, fmt.Errorf("malformed secret config at index %d", i) } runOpts = append(runOpts, llb.AddSecret(secretDest, secretOpts...)) } for _, socket := range payload.Sockets { if socket.UnixPath == "" { return nil, fmt.Errorf("unsupported socket: only unix paths are implemented") }
closed
dagger/dagger
https://github.com/dagger/dagger
4,085
Container From removes existing env vars
Example: https://play.dagger.cloud/playground/JBT8x7KCicC ```graphql { container { withEnvVariable(name:"FOO", value:"BAR") { from(address:"alpine:latest") { withExec(args:["env"]) { stdout } } } } } ``` That will not show `FOO` in the output. --- I suppose the correct behavior is not totally obvious, but I'd argue that we should not remove existing env vars because: 1. It can be nice for certain use cases. I was trying to set some env vars that would be shared across all our sdk base containers but I couldn't set them in a common base container because each SDK calls `From`. 2. Other APIs like `WithMountedFile` change the container state but don't get removed by calling `From`, so we should be consistent one way or the other at least
https://github.com/dagger/dagger/issues/4085
https://github.com/dagger/dagger/pull/4455
3c0192e2b9c644ee4a5aad285df94f07a107ccd8
b43d267a7f7657017188bec57d7826059475a2f3
2022-12-02T23:30:33Z
go
2023-01-31T18:49:32Z
core/container.go
runOpts = append(runOpts, llb.AddSSHSocket( llb.SSHID(socket.Socket.LLBID()), llb.SSHSocketTarget(socket.UnixPath), )) } fsSt, err := payload.FSState() if err != nil { return nil, fmt.Errorf("fs state: %w", err) } for _, mnt := range mounts { srcSt, err := mnt.SourceState() if err != nil { return nil, fmt.Errorf("mount %s: %w", mnt.Target, err) } mountOpts := []llb.MountOption{} if mnt.SourcePath != "" { mountOpts = append(mountOpts, llb.SourcePath(mnt.SourcePath)) } if mnt.CacheSharingMode != "" { var sharingMode llb.CacheMountSharingMode switch mnt.CacheSharingMode { case "shared": sharingMode = llb.CacheMountShared case "private": sharingMode = llb.CacheMountPrivate case "locked": sharingMode = llb.CacheMountLocked default: return nil, errors.Errorf("invalid cache mount sharing mode %q", mnt.CacheSharingMode)
closed
dagger/dagger
https://github.com/dagger/dagger
4,085
Container From removes existing env vars
Example: https://play.dagger.cloud/playground/JBT8x7KCicC ```graphql { container { withEnvVariable(name:"FOO", value:"BAR") { from(address:"alpine:latest") { withExec(args:["env"]) { stdout } } } } } ``` That will not show `FOO` in the output. --- I suppose the correct behavior is not totally obvious, but I'd argue that we should not remove existing env vars because: 1. It can be nice for certain use cases. I was trying to set some env vars that would be shared across all our sdk base containers but I couldn't set them in a common base container because each SDK calls `From`. 2. Other APIs like `WithMountedFile` change the container state but don't get removed by calling `From`, so we should be consistent one way or the other at least
https://github.com/dagger/dagger/issues/4085
https://github.com/dagger/dagger/pull/4455
3c0192e2b9c644ee4a5aad285df94f07a107ccd8
b43d267a7f7657017188bec57d7826059475a2f3
2022-12-02T23:30:33Z
go
2023-01-31T18:49:32Z
core/container.go
} mountOpts = append(mountOpts, llb.AsPersistentCacheDir(mnt.CacheID, sharingMode)) } if mnt.Tmpfs { mountOpts = append(mountOpts, llb.Tmpfs()) } runOpts = append(runOpts, llb.AddMount(mnt.Target, srcSt, mountOpts...)) } execSt := fsSt.Run(runOpts...) execDef, err := execSt.Root().Marshal(ctx, llb.Platform(platform)) if err != nil { return nil, fmt.Errorf("marshal root: %w", err) } payload.FS = execDef.ToPB() metaDef, err := execSt.GetMount(metaMountDestPath).Marshal(ctx, llb.Platform(platform)) if err != nil { return nil, fmt.Errorf("get meta mount: %w", err) } payload.Meta = metaDef.ToPB() for i, mnt := range mounts { if mnt.Tmpfs || mnt.CacheID != "" { continue } mountSt := execSt.GetMount(mnt.Target) execMountDef, err := mountSt.Marshal(ctx, llb.Platform(platform)) if err != nil { return nil, fmt.Errorf("propagate %s: %w", mnt.Target, err) } mounts[i].Source = execMountDef.ToPB()
closed
dagger/dagger
https://github.com/dagger/dagger
4,085
Container From removes existing env vars
Example: https://play.dagger.cloud/playground/JBT8x7KCicC ```graphql { container { withEnvVariable(name:"FOO", value:"BAR") { from(address:"alpine:latest") { withExec(args:["env"]) { stdout } } } } } ``` That will not show `FOO` in the output. --- I suppose the correct behavior is not totally obvious, but I'd argue that we should not remove existing env vars because: 1. It can be nice for certain use cases. I was trying to set some env vars that would be shared across all our sdk base containers but I couldn't set them in a common base container because each SDK calls `From`. 2. Other APIs like `WithMountedFile` change the container state but don't get removed by calling `From`, so we should be consistent one way or the other at least
https://github.com/dagger/dagger/issues/4085
https://github.com/dagger/dagger/pull/4455
3c0192e2b9c644ee4a5aad285df94f07a107ccd8
b43d267a7f7657017188bec57d7826059475a2f3
2022-12-02T23:30:33Z
go
2023-01-31T18:49:32Z
core/container.go
} payload.Mounts = mounts id, err := payload.Encode() if err != nil { return nil, fmt.Errorf("encode: %w", err) } return &Container{ID: id}, nil } func (container *Container) ExitCode(ctx context.Context, gw bkgw.Client) (*int, error) { content, err := container.MetaFileContents(ctx, gw, "exitCode") if err != nil { return nil, err } if content == nil { return nil, nil } exitCode, err := strconv.Atoi(*content) if err != nil { return nil, err } return &exitCode, nil } func (container *Container) MetaFileContents(ctx context.Context, gw bkgw.Client, filePath string) (*string, error) { file, err := container.MetaFile(ctx, gw, filePath) if err != nil { return nil, err } if file == nil { return nil, nil }
closed
dagger/dagger
https://github.com/dagger/dagger
4,085
Container From removes existing env vars
Example: https://play.dagger.cloud/playground/JBT8x7KCicC ```graphql { container { withEnvVariable(name:"FOO", value:"BAR") { from(address:"alpine:latest") { withExec(args:["env"]) { stdout } } } } } ``` That will not show `FOO` in the output. --- I suppose the correct behavior is not totally obvious, but I'd argue that we should not remove existing env vars because: 1. It can be nice for certain use cases. I was trying to set some env vars that would be shared across all our sdk base containers but I couldn't set them in a common base container because each SDK calls `From`. 2. Other APIs like `WithMountedFile` change the container state but don't get removed by calling `From`, so we should be consistent one way or the other at least
https://github.com/dagger/dagger/issues/4085
https://github.com/dagger/dagger/pull/4455
3c0192e2b9c644ee4a5aad285df94f07a107ccd8
b43d267a7f7657017188bec57d7826059475a2f3
2022-12-02T23:30:33Z
go
2023-01-31T18:49:32Z
core/container.go
content, err := file.Contents(ctx, gw) if err != nil { return nil, err } strContent := string(content) if err != nil { return nil, err } return &strContent, nil } func (container *Container) MetaFile(ctx context.Context, gw bkgw.Client, filePath string) (*File, error) { payload, err := container.ID.decode() if err != nil { return nil, err } meta, err := payload.MetaState() if err != nil { return nil, err } if meta == nil { return nil, nil } return NewFile(ctx, *meta, path.Join(metaSourcePath, filePath), payload.Pipeline, payload.Platform) } func (container *Container) Publish( ctx context.Context, ref string, platformVariants []ContainerID, bkClient *bkclient.Client, solveOpts bkclient.SolveOpt,
closed
dagger/dagger
https://github.com/dagger/dagger
4,085
Container From removes existing env vars
Example: https://play.dagger.cloud/playground/JBT8x7KCicC ```graphql { container { withEnvVariable(name:"FOO", value:"BAR") { from(address:"alpine:latest") { withExec(args:["env"]) { stdout } } } } } ``` That will not show `FOO` in the output. --- I suppose the correct behavior is not totally obvious, but I'd argue that we should not remove existing env vars because: 1. It can be nice for certain use cases. I was trying to set some env vars that would be shared across all our sdk base containers but I couldn't set them in a common base container because each SDK calls `From`. 2. Other APIs like `WithMountedFile` change the container state but don't get removed by calling `From`, so we should be consistent one way or the other at least
https://github.com/dagger/dagger/issues/4085
https://github.com/dagger/dagger/pull/4455
3c0192e2b9c644ee4a5aad285df94f07a107ccd8
b43d267a7f7657017188bec57d7826059475a2f3
2022-12-02T23:30:33Z
go
2023-01-31T18:49:32Z
core/container.go
solveCh chan<- *bkclient.SolveStatus, ) (string, error) { solveOpts.Exports = []bkclient.ExportEntry{ { Type: bkclient.ExporterImage, Attrs: map[string]string{ "name": ref, "push": "true", }, }, } ch, wg := mirrorCh(solveCh) defer wg.Wait() res, err := bkClient.Build(ctx, solveOpts, "", func(ctx context.Context, gw bkgw.Client) (*bkgw.Result, error) { return container.export(ctx, gw, platformVariants) }, ch) if err != nil { return "", err } refName, err := reference.ParseNormalizedNamed(ref) if err != nil { return "", err } imageDigest, found := res.ExporterResponse[exptypes.ExporterImageDigestKey] if found { dig, err := digest.Parse(imageDigest) if err != nil { return "", fmt.Errorf("parse digest: %w", err) }
closed
dagger/dagger
https://github.com/dagger/dagger
4,085
Container From removes existing env vars
Example: https://play.dagger.cloud/playground/JBT8x7KCicC ```graphql { container { withEnvVariable(name:"FOO", value:"BAR") { from(address:"alpine:latest") { withExec(args:["env"]) { stdout } } } } } ``` That will not show `FOO` in the output. --- I suppose the correct behavior is not totally obvious, but I'd argue that we should not remove existing env vars because: 1. It can be nice for certain use cases. I was trying to set some env vars that would be shared across all our sdk base containers but I couldn't set them in a common base container because each SDK calls `From`. 2. Other APIs like `WithMountedFile` change the container state but don't get removed by calling `From`, so we should be consistent one way or the other at least
https://github.com/dagger/dagger/issues/4085
https://github.com/dagger/dagger/pull/4455
3c0192e2b9c644ee4a5aad285df94f07a107ccd8
b43d267a7f7657017188bec57d7826059475a2f3
2022-12-02T23:30:33Z
go
2023-01-31T18:49:32Z
core/container.go
withDig, err := reference.WithDigest(refName, dig) if err != nil { return "", fmt.Errorf("with digest: %w", err) } return withDig.String(), nil } return ref, nil } func (container *Container) Platform() (specs.Platform, error) { payload, err := container.ID.decode() if err != nil { return specs.Platform{}, err } return payload.Platform, nil } func (container *Container) Export( ctx context.Context, host *Host, dest string, platformVariants []ContainerID, bkClient *bkclient.Client, solveOpts bkclient.SolveOpt, solveCh chan<- *bkclient.SolveStatus, ) error { dest, err := host.NormalizeDest(dest) if err != nil { return err } out, err := os.Create(dest) if err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
4,085
Container From removes existing env vars
Example: https://play.dagger.cloud/playground/JBT8x7KCicC ```graphql { container { withEnvVariable(name:"FOO", value:"BAR") { from(address:"alpine:latest") { withExec(args:["env"]) { stdout } } } } } ``` That will not show `FOO` in the output. --- I suppose the correct behavior is not totally obvious, but I'd argue that we should not remove existing env vars because: 1. It can be nice for certain use cases. I was trying to set some env vars that would be shared across all our sdk base containers but I couldn't set them in a common base container because each SDK calls `From`. 2. Other APIs like `WithMountedFile` change the container state but don't get removed by calling `From`, so we should be consistent one way or the other at least
https://github.com/dagger/dagger/issues/4085
https://github.com/dagger/dagger/pull/4455
3c0192e2b9c644ee4a5aad285df94f07a107ccd8
b43d267a7f7657017188bec57d7826059475a2f3
2022-12-02T23:30:33Z
go
2023-01-31T18:49:32Z
core/container.go
return err } defer out.Close() return host.Export(ctx, bkclient.ExportEntry{ Type: bkclient.ExporterOCI, Output: func(map[string]string) (io.WriteCloser, error) { return out, nil }, }, dest, bkClient, solveOpts, solveCh, func(ctx context.Context, gw bkgw.Client) (*bkgw.Result, error) { return container.export(ctx, gw, platformVariants) }) } func (container *Container) export( ctx context.Context, gw bkgw.Client, platformVariants []ContainerID, ) (*bkgw.Result, error) { var payloads []*containerIDPayload if container.ID != "" { payload, err := container.ID.decode() if err != nil { return nil, err } if payload.FS != nil { payloads = append(payloads, payload) } } for _, id := range platformVariants { payload, err := id.decode() if err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
4,085
Container From removes existing env vars
Example: https://play.dagger.cloud/playground/JBT8x7KCicC ```graphql { container { withEnvVariable(name:"FOO", value:"BAR") { from(address:"alpine:latest") { withExec(args:["env"]) { stdout } } } } } ``` That will not show `FOO` in the output. --- I suppose the correct behavior is not totally obvious, but I'd argue that we should not remove existing env vars because: 1. It can be nice for certain use cases. I was trying to set some env vars that would be shared across all our sdk base containers but I couldn't set them in a common base container because each SDK calls `From`. 2. Other APIs like `WithMountedFile` change the container state but don't get removed by calling `From`, so we should be consistent one way or the other at least
https://github.com/dagger/dagger/issues/4085
https://github.com/dagger/dagger/pull/4455
3c0192e2b9c644ee4a5aad285df94f07a107ccd8
b43d267a7f7657017188bec57d7826059475a2f3
2022-12-02T23:30:33Z
go
2023-01-31T18:49:32Z
core/container.go
return nil, err } if payload.FS != nil { payloads = append(payloads, payload) } } if len(payloads) == 0 { return nil, errors.New("no containers to export") } if len(payloads) == 1 { payload := payloads[0] st, err := payload.FSState() if err != nil { return nil, err } stDef, err := st.Marshal(ctx, llb.Platform(payload.Platform)) if err != nil { return nil, err } res, err := gw.Solve(ctx, bkgw.SolveRequest{ Evaluate: true, Definition: stDef.ToPB(), }) if err != nil { return nil, err } cfgBytes, err := json.Marshal(specs.Image{ Architecture: payload.Platform.Architecture, OS: payload.Platform.OS,
closed
dagger/dagger
https://github.com/dagger/dagger
4,085
Container From removes existing env vars
Example: https://play.dagger.cloud/playground/JBT8x7KCicC ```graphql { container { withEnvVariable(name:"FOO", value:"BAR") { from(address:"alpine:latest") { withExec(args:["env"]) { stdout } } } } } ``` That will not show `FOO` in the output. --- I suppose the correct behavior is not totally obvious, but I'd argue that we should not remove existing env vars because: 1. It can be nice for certain use cases. I was trying to set some env vars that would be shared across all our sdk base containers but I couldn't set them in a common base container because each SDK calls `From`. 2. Other APIs like `WithMountedFile` change the container state but don't get removed by calling `From`, so we should be consistent one way or the other at least
https://github.com/dagger/dagger/issues/4085
https://github.com/dagger/dagger/pull/4455
3c0192e2b9c644ee4a5aad285df94f07a107ccd8
b43d267a7f7657017188bec57d7826059475a2f3
2022-12-02T23:30:33Z
go
2023-01-31T18:49:32Z
core/container.go
OSVersion: payload.Platform.OSVersion, OSFeatures: payload.Platform.OSFeatures, Config: payload.Config, }) if err != nil { return nil, err } res.AddMeta(exptypes.ExporterImageConfigKey, cfgBytes) return res, nil } res := bkgw.NewResult() expPlatforms := &exptypes.Platforms{ Platforms: make([]exptypes.Platform, len(payloads)), } for i, payload := range payloads { st, err := payload.FSState() if err != nil { return nil, err } stDef, err := st.Marshal(ctx, llb.Platform(payload.Platform)) if err != nil { return nil, err } r, err := gw.Solve(ctx, bkgw.SolveRequest{ Evaluate: true, Definition: stDef.ToPB(), }) if err != nil { return nil, err }
closed
dagger/dagger
https://github.com/dagger/dagger
4,085
Container From removes existing env vars
Example: https://play.dagger.cloud/playground/JBT8x7KCicC ```graphql { container { withEnvVariable(name:"FOO", value:"BAR") { from(address:"alpine:latest") { withExec(args:["env"]) { stdout } } } } } ``` That will not show `FOO` in the output. --- I suppose the correct behavior is not totally obvious, but I'd argue that we should not remove existing env vars because: 1. It can be nice for certain use cases. I was trying to set some env vars that would be shared across all our sdk base containers but I couldn't set them in a common base container because each SDK calls `From`. 2. Other APIs like `WithMountedFile` change the container state but don't get removed by calling `From`, so we should be consistent one way or the other at least
https://github.com/dagger/dagger/issues/4085
https://github.com/dagger/dagger/pull/4455
3c0192e2b9c644ee4a5aad285df94f07a107ccd8
b43d267a7f7657017188bec57d7826059475a2f3
2022-12-02T23:30:33Z
go
2023-01-31T18:49:32Z
core/container.go
ref, err := r.SingleRef() if err != nil { return nil, err } platformKey := platforms.Format(payload.Platform) res.AddRef(platformKey, ref) expPlatforms.Platforms[i] = exptypes.Platform{ ID: platformKey, Platform: payload.Platform, } cfgBytes, err := json.Marshal(specs.Image{ Architecture: payload.Platform.Architecture, OS: payload.Platform.OS, OSVersion: payload.Platform.OSVersion, OSFeatures: payload.Platform.OSFeatures, Config: payload.Config, }) if err != nil { return nil, err } res.AddMeta(fmt.Sprintf("%s/%s", exptypes.ExporterImageConfigKey, platformKey), cfgBytes) } platformBytes, err := json.Marshal(expPlatforms) if err != nil { return nil, err } res.AddMeta(exptypes.ExporterPlatformsKey, platformBytes) return res, nil } type ContainerExecOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,085
Container From removes existing env vars
Example: https://play.dagger.cloud/playground/JBT8x7KCicC ```graphql { container { withEnvVariable(name:"FOO", value:"BAR") { from(address:"alpine:latest") { withExec(args:["env"]) { stdout } } } } } ``` That will not show `FOO` in the output. --- I suppose the correct behavior is not totally obvious, but I'd argue that we should not remove existing env vars because: 1. It can be nice for certain use cases. I was trying to set some env vars that would be shared across all our sdk base containers but I couldn't set them in a common base container because each SDK calls `From`. 2. Other APIs like `WithMountedFile` change the container state but don't get removed by calling `From`, so we should be consistent one way or the other at least
https://github.com/dagger/dagger/issues/4085
https://github.com/dagger/dagger/pull/4455
3c0192e2b9c644ee4a5aad285df94f07a107ccd8
b43d267a7f7657017188bec57d7826059475a2f3
2022-12-02T23:30:33Z
go
2023-01-31T18:49:32Z
core/container.go
Args []string Stdin string RedirectStdout string RedirectStderr string ExperimentalPrivilegedNesting bool } type BuildArg struct { Name string `json:"name"` Value string `json:"value"` }
closed
dagger/dagger
https://github.com/dagger/dagger
4,538
🐞 Sometimes pipelines fail with EOF randomly
### What is the issue? Some users have reported that seems like after bumping go to 1.20, some pipelines have randomly started to fail with an `EOF` error: - https://discord.com/channels/707636530424053791/1070997951503151104 - https://discord.com/channels/707636530424053791/1071076724458131610 ### Log output ``` time="2023-02-03T16:10:48Z" level=debug msg="session finished: <nil>" time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=a3pnf2678hnh2qw8fsy4dyuws snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=ky13d6x635szkhqgvp2u076q9 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=m4ifraund99pseap731l6ubyw snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=w5ogr03j22gzyqg5wzkg0fh35 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=x7qr5jqyi5jht905l8idi9vzd snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="schedule snapshotter cleanup" snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/26/m4ifraund99pseap731l6ubyw snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/31/ky13d6x635szkhqgvp2u076q9 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/34/x7qr5jqyi5jht905l8idi9vzd snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/45/a3pnf2678hnh2qw8fsy4dyuws snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/41/w5ogr03j22gzyqg5wzkg0fh35 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="snapshot garbage collected" d=102.083581ms snapshotter=overlayfs time="2023-02-03T16:10:50Z" level=error msg="/moby.buildkit.v1.frontend.LLBBridge/ReadFile returned error: rpc error: code = Canceled desc = context canceled\n" ``` ``` β€Ί go version go version go1.20 linux/amd64 β€Ί mage -v test:unit Running target: Test:Unit ... #1 DONE 2.0s #2 copy / / #2 DONE 0.3s #3 copy /go.mod / #3 DONE 0.1s #4 copy /go.sum / #4 DONE 0.6s Error: Post "http://dagger/query": EOF Please visit https://dagger.io/help#go for troubleshooting guidance. ``` ``` "error": "Post \"http://dagger/query\": EOF\nPlease visit https://dagger.io/help#go for troubleshooting guidance." ``` ### Steps to reproduce I haven't been able to reproduce locally since users don't know what triggers it. However, some users reported that they can make it fail every time on their machines. We're continuing to troubleshoot on this thread: https://discord.com/channels/707636530424053791/1070997951503151104 ### SDK version 0.4.2 to 0.4.4 ### OS version N/A
https://github.com/dagger/dagger/issues/4538
https://github.com/dagger/dagger/pull/4551
18744003b6fd6865f7c518f6f8801ac52c25d5d2
5455656a4128f569b2d8f664d777120aa79d715d
2023-02-06T18:17:01Z
go
2023-02-08T13:47:37Z
sdk/go/internal/engineconn/session.go
package engineconn import ( "bufio" "bytes" "context" "encoding/json" "fmt" "io" "net/http" "os" "os/exec" "strings" "sync" "time" ) type cliSessionConn struct { *http.Client childStdin io.Closer } func (c *cliSessionConn) Host() string { return "dagger" } func (c *cliSessionConn) Close() error { if c.childStdin != nil { return c.childStdin.Close() } return nil } func startCLISession(ctx context.Context, binPath string, cfg *Config) (_ EngineConn, rerr error) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,538
🐞 Sometimes pipelines fail with EOF randomly
### What is the issue? Some users have reported that seems like after bumping go to 1.20, some pipelines have randomly started to fail with an `EOF` error: - https://discord.com/channels/707636530424053791/1070997951503151104 - https://discord.com/channels/707636530424053791/1071076724458131610 ### Log output ``` time="2023-02-03T16:10:48Z" level=debug msg="session finished: <nil>" time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=a3pnf2678hnh2qw8fsy4dyuws snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=ky13d6x635szkhqgvp2u076q9 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=m4ifraund99pseap731l6ubyw snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=w5ogr03j22gzyqg5wzkg0fh35 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=x7qr5jqyi5jht905l8idi9vzd snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="schedule snapshotter cleanup" snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/26/m4ifraund99pseap731l6ubyw snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/31/ky13d6x635szkhqgvp2u076q9 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/34/x7qr5jqyi5jht905l8idi9vzd snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/45/a3pnf2678hnh2qw8fsy4dyuws snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/41/w5ogr03j22gzyqg5wzkg0fh35 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="snapshot garbage collected" d=102.083581ms snapshotter=overlayfs time="2023-02-03T16:10:50Z" level=error msg="/moby.buildkit.v1.frontend.LLBBridge/ReadFile returned error: rpc error: code = Canceled desc = context canceled\n" ``` ``` β€Ί go version go version go1.20 linux/amd64 β€Ί mage -v test:unit Running target: Test:Unit ... #1 DONE 2.0s #2 copy / / #2 DONE 0.3s #3 copy /go.mod / #3 DONE 0.1s #4 copy /go.sum / #4 DONE 0.6s Error: Post "http://dagger/query": EOF Please visit https://dagger.io/help#go for troubleshooting guidance. ``` ``` "error": "Post \"http://dagger/query\": EOF\nPlease visit https://dagger.io/help#go for troubleshooting guidance." ``` ### Steps to reproduce I haven't been able to reproduce locally since users don't know what triggers it. However, some users reported that they can make it fail every time on their machines. We're continuing to troubleshoot on this thread: https://discord.com/channels/707636530424053791/1070997951503151104 ### SDK version 0.4.2 to 0.4.4 ### OS version N/A
https://github.com/dagger/dagger/issues/4538
https://github.com/dagger/dagger/pull/4551
18744003b6fd6865f7c518f6f8801ac52c25d5d2
5455656a4128f569b2d8f664d777120aa79d715d
2023-02-06T18:17:01Z
go
2023-02-08T13:47:37Z
sdk/go/internal/engineconn/session.go
args := []string{"session"} if cfg.Workdir != "" { args = append(args, "--workdir", cfg.Workdir) } if cfg.ConfigPath != "" { args = append(args, "--project", cfg.ConfigPath) } env := os.Environ() var proc *exec.Cmd var stdout io.ReadCloser var stderrBuf *bytes.Buffer
closed
dagger/dagger
https://github.com/dagger/dagger
4,538
🐞 Sometimes pipelines fail with EOF randomly
### What is the issue? Some users have reported that seems like after bumping go to 1.20, some pipelines have randomly started to fail with an `EOF` error: - https://discord.com/channels/707636530424053791/1070997951503151104 - https://discord.com/channels/707636530424053791/1071076724458131610 ### Log output ``` time="2023-02-03T16:10:48Z" level=debug msg="session finished: <nil>" time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=a3pnf2678hnh2qw8fsy4dyuws snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=ky13d6x635szkhqgvp2u076q9 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=m4ifraund99pseap731l6ubyw snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=w5ogr03j22gzyqg5wzkg0fh35 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=x7qr5jqyi5jht905l8idi9vzd snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="schedule snapshotter cleanup" snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/26/m4ifraund99pseap731l6ubyw snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/31/ky13d6x635szkhqgvp2u076q9 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/34/x7qr5jqyi5jht905l8idi9vzd snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/45/a3pnf2678hnh2qw8fsy4dyuws snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/41/w5ogr03j22gzyqg5wzkg0fh35 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="snapshot garbage collected" d=102.083581ms snapshotter=overlayfs time="2023-02-03T16:10:50Z" level=error msg="/moby.buildkit.v1.frontend.LLBBridge/ReadFile returned error: rpc error: code = Canceled desc = context canceled\n" ``` ``` β€Ί go version go version go1.20 linux/amd64 β€Ί mage -v test:unit Running target: Test:Unit ... #1 DONE 2.0s #2 copy / / #2 DONE 0.3s #3 copy /go.mod / #3 DONE 0.1s #4 copy /go.sum / #4 DONE 0.6s Error: Post "http://dagger/query": EOF Please visit https://dagger.io/help#go for troubleshooting guidance. ``` ``` "error": "Post \"http://dagger/query\": EOF\nPlease visit https://dagger.io/help#go for troubleshooting guidance." ``` ### Steps to reproduce I haven't been able to reproduce locally since users don't know what triggers it. However, some users reported that they can make it fail every time on their machines. We're continuing to troubleshoot on this thread: https://discord.com/channels/707636530424053791/1070997951503151104 ### SDK version 0.4.2 to 0.4.4 ### OS version N/A
https://github.com/dagger/dagger/issues/4538
https://github.com/dagger/dagger/pull/4551
18744003b6fd6865f7c518f6f8801ac52c25d5d2
5455656a4128f569b2d8f664d777120aa79d715d
2023-02-06T18:17:01Z
go
2023-02-08T13:47:37Z
sdk/go/internal/engineconn/session.go
var childStdin io.WriteCloser for i := 0; i < 10; i++ { proc = exec.CommandContext(ctx, binPath, args...) proc.Env = env setPlatformOpts(proc) var err error stdout, err = proc.StdoutPipe() if err != nil { return nil, err } defer stdout.Close() stderrPipe, err := proc.StderrPipe() if err != nil { return nil, err } if cfg.LogOutput == nil { cfg.LogOutput = io.Discard } stderrBuf = bytes.NewBuffer(nil) discardableBuf := &discardableWriter{w: stderrBuf} go io.Copy(io.MultiWriter(cfg.LogOutput, discardableBuf), stderrPipe) defer discardableBuf.Discard() childStdin, err = proc.StdinPipe()
closed
dagger/dagger
https://github.com/dagger/dagger
4,538
🐞 Sometimes pipelines fail with EOF randomly
### What is the issue? Some users have reported that seems like after bumping go to 1.20, some pipelines have randomly started to fail with an `EOF` error: - https://discord.com/channels/707636530424053791/1070997951503151104 - https://discord.com/channels/707636530424053791/1071076724458131610 ### Log output ``` time="2023-02-03T16:10:48Z" level=debug msg="session finished: <nil>" time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=a3pnf2678hnh2qw8fsy4dyuws snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=ky13d6x635szkhqgvp2u076q9 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=m4ifraund99pseap731l6ubyw snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=w5ogr03j22gzyqg5wzkg0fh35 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=x7qr5jqyi5jht905l8idi9vzd snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="schedule snapshotter cleanup" snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/26/m4ifraund99pseap731l6ubyw snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/31/ky13d6x635szkhqgvp2u076q9 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/34/x7qr5jqyi5jht905l8idi9vzd snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/45/a3pnf2678hnh2qw8fsy4dyuws snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/41/w5ogr03j22gzyqg5wzkg0fh35 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="snapshot garbage collected" d=102.083581ms snapshotter=overlayfs time="2023-02-03T16:10:50Z" level=error msg="/moby.buildkit.v1.frontend.LLBBridge/ReadFile returned error: rpc error: code = Canceled desc = context canceled\n" ``` ``` β€Ί go version go version go1.20 linux/amd64 β€Ί mage -v test:unit Running target: Test:Unit ... #1 DONE 2.0s #2 copy / / #2 DONE 0.3s #3 copy /go.mod / #3 DONE 0.1s #4 copy /go.sum / #4 DONE 0.6s Error: Post "http://dagger/query": EOF Please visit https://dagger.io/help#go for troubleshooting guidance. ``` ``` "error": "Post \"http://dagger/query\": EOF\nPlease visit https://dagger.io/help#go for troubleshooting guidance." ``` ### Steps to reproduce I haven't been able to reproduce locally since users don't know what triggers it. However, some users reported that they can make it fail every time on their machines. We're continuing to troubleshoot on this thread: https://discord.com/channels/707636530424053791/1070997951503151104 ### SDK version 0.4.2 to 0.4.4 ### OS version N/A
https://github.com/dagger/dagger/issues/4538
https://github.com/dagger/dagger/pull/4551
18744003b6fd6865f7c518f6f8801ac52c25d5d2
5455656a4128f569b2d8f664d777120aa79d715d
2023-02-06T18:17:01Z
go
2023-02-08T13:47:37Z
sdk/go/internal/engineconn/session.go
if err != nil { return nil, err } if err := proc.Start(); err != nil { if strings.Contains(err.Error(), "text file busy") { time.Sleep(100 * time.Millisecond) proc = nil stdout.Close() stdout = nil stderrPipe.Close() stderrBuf = nil childStdin.Close() childStdin = nil continue } return nil, err } break } if proc == nil { return nil, fmt.Errorf("failed to start dagger session") } defer func() { if rerr != nil { stderrContents := stderrBuf.String() if stderrContents != "" { rerr = fmt.Errorf("%s: %s", rerr, stderrContents) } } }()
closed
dagger/dagger
https://github.com/dagger/dagger
4,538
🐞 Sometimes pipelines fail with EOF randomly
### What is the issue? Some users have reported that seems like after bumping go to 1.20, some pipelines have randomly started to fail with an `EOF` error: - https://discord.com/channels/707636530424053791/1070997951503151104 - https://discord.com/channels/707636530424053791/1071076724458131610 ### Log output ``` time="2023-02-03T16:10:48Z" level=debug msg="session finished: <nil>" time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=a3pnf2678hnh2qw8fsy4dyuws snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=ky13d6x635szkhqgvp2u076q9 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=m4ifraund99pseap731l6ubyw snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=w5ogr03j22gzyqg5wzkg0fh35 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=x7qr5jqyi5jht905l8idi9vzd snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="schedule snapshotter cleanup" snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/26/m4ifraund99pseap731l6ubyw snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/31/ky13d6x635szkhqgvp2u076q9 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/34/x7qr5jqyi5jht905l8idi9vzd snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/45/a3pnf2678hnh2qw8fsy4dyuws snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/41/w5ogr03j22gzyqg5wzkg0fh35 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="snapshot garbage collected" d=102.083581ms snapshotter=overlayfs time="2023-02-03T16:10:50Z" level=error msg="/moby.buildkit.v1.frontend.LLBBridge/ReadFile returned error: rpc error: code = Canceled desc = context canceled\n" ``` ``` β€Ί go version go version go1.20 linux/amd64 β€Ί mage -v test:unit Running target: Test:Unit ... #1 DONE 2.0s #2 copy / / #2 DONE 0.3s #3 copy /go.mod / #3 DONE 0.1s #4 copy /go.sum / #4 DONE 0.6s Error: Post "http://dagger/query": EOF Please visit https://dagger.io/help#go for troubleshooting guidance. ``` ``` "error": "Post \"http://dagger/query\": EOF\nPlease visit https://dagger.io/help#go for troubleshooting guidance." ``` ### Steps to reproduce I haven't been able to reproduce locally since users don't know what triggers it. However, some users reported that they can make it fail every time on their machines. We're continuing to troubleshoot on this thread: https://discord.com/channels/707636530424053791/1070997951503151104 ### SDK version 0.4.2 to 0.4.4 ### OS version N/A
https://github.com/dagger/dagger/issues/4538
https://github.com/dagger/dagger/pull/4551
18744003b6fd6865f7c518f6f8801ac52c25d5d2
5455656a4128f569b2d8f664d777120aa79d715d
2023-02-06T18:17:01Z
go
2023-02-08T13:47:37Z
sdk/go/internal/engineconn/session.go
paramCh := make(chan error, 1) var params ConnectParams go func() { defer close(paramCh) paramBytes, err := bufio.NewReader(stdout).ReadBytes('\n') if err != nil { paramCh <- err return } if err := json.Unmarshal(paramBytes, &params); err != nil { paramCh <- err } }() ctx, cancel := context.WithTimeout(ctx, 300*time.Second) defer cancel() select { case err := <-paramCh: if err != nil { return nil, err } case <-ctx.Done(): return nil, ctx.Err() } return &cliSessionConn{ Client: defaultHTTPClient(&params), childStdin: childStdin, }, nil } type discardableWriter struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,538
🐞 Sometimes pipelines fail with EOF randomly
### What is the issue? Some users have reported that seems like after bumping go to 1.20, some pipelines have randomly started to fail with an `EOF` error: - https://discord.com/channels/707636530424053791/1070997951503151104 - https://discord.com/channels/707636530424053791/1071076724458131610 ### Log output ``` time="2023-02-03T16:10:48Z" level=debug msg="session finished: <nil>" time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=a3pnf2678hnh2qw8fsy4dyuws snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=ky13d6x635szkhqgvp2u076q9 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=m4ifraund99pseap731l6ubyw snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=w5ogr03j22gzyqg5wzkg0fh35 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="remove snapshot" key=x7qr5jqyi5jht905l8idi9vzd snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="schedule snapshotter cleanup" snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/26/m4ifraund99pseap731l6ubyw snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/31/ky13d6x635szkhqgvp2u076q9 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/34/x7qr5jqyi5jht905l8idi9vzd snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/45/a3pnf2678hnh2qw8fsy4dyuws snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="removed snapshot" key=buildkit/41/w5ogr03j22gzyqg5wzkg0fh35 snapshotter=overlayfs time="2023-02-03T16:10:49Z" level=debug msg="snapshot garbage collected" d=102.083581ms snapshotter=overlayfs time="2023-02-03T16:10:50Z" level=error msg="/moby.buildkit.v1.frontend.LLBBridge/ReadFile returned error: rpc error: code = Canceled desc = context canceled\n" ``` ``` β€Ί go version go version go1.20 linux/amd64 β€Ί mage -v test:unit Running target: Test:Unit ... #1 DONE 2.0s #2 copy / / #2 DONE 0.3s #3 copy /go.mod / #3 DONE 0.1s #4 copy /go.sum / #4 DONE 0.6s Error: Post "http://dagger/query": EOF Please visit https://dagger.io/help#go for troubleshooting guidance. ``` ``` "error": "Post \"http://dagger/query\": EOF\nPlease visit https://dagger.io/help#go for troubleshooting guidance." ``` ### Steps to reproduce I haven't been able to reproduce locally since users don't know what triggers it. However, some users reported that they can make it fail every time on their machines. We're continuing to troubleshoot on this thread: https://discord.com/channels/707636530424053791/1070997951503151104 ### SDK version 0.4.2 to 0.4.4 ### OS version N/A
https://github.com/dagger/dagger/issues/4538
https://github.com/dagger/dagger/pull/4551
18744003b6fd6865f7c518f6f8801ac52c25d5d2
5455656a4128f569b2d8f664d777120aa79d715d
2023-02-06T18:17:01Z
go
2023-02-08T13:47:37Z
sdk/go/internal/engineconn/session.go
mu sync.RWMutex w io.Writer } func (w *discardableWriter) Write(p []byte) (int, error) { w.mu.RLock() defer w.mu.RUnlock() return w.w.Write(p) } func (w *discardableWriter) Discard() { w.mu.Lock() defer w.mu.Unlock() w.w = io.Discard }
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4dGJXRnVhV1psYzNSeldnQT0iLCJDa2tLUjNOb1lUSTFOam96TlRaaE16azVNakprTXpsak4yVmpOVEkzWVRnNE5ERmtZMlkwWkRFek9UTTVNRGsyTnpGaFpHUTFPRFZtWXpJNFpqa3hNRGMyTm1Kak5XTmtNemt3SWlzU0tRai8vLy8vLy8vLy8vOEJJaHdLQVM4U0FTOGcvLy8vLy8vLy8vLy9BVmovLy8vLy8vLy8vLzhCVWc0S0JXRnliVFkwRWdWc2FXNTFlRm9BIiwiQ2trS1IzTm9ZVEkxTmpwaU9ERTVZVFEyWkRjek16ZzVPV00zWXpjMllqWmtZamRrWmpBeU5qZzVNekEyWTJSaU1UZzFNV0ZqWldNMlpERTNZVEF5WVRRMk1XUTFZVGMxTmpFeCJdLCJtZXRhZGF0YSI6eyJzaGEyNTY6MzU2YTM5OTIyZDM5YzdlYzUyN2E4ODQxZGNmNGQxMzkzOTA5NjcxYWRkNTg1ZmMyOGY5MTA3NjZiYzVjZDM5MCI6eyJjYXBzIjp7InNvdXJjZS5sb2NhbCI6dHJ1ZSwic291cmNlLmxvY2FsLnNoYXJlZGtleWhpbnQiOnRydWUsInNvdXJjZS5sb2NhbC51bmlxdWUiOnRydWV9fSwic2hhMjU2OmI4MTlhNDZkNzMzODk5YzdjNzZiNmRiN2RmMDI2ODkzMDZjZGIxODUxYWNlYzZkMTdhMDJhNDYxZDVhNzU2MTEiOnsiY2FwcyI6eyJmaWxlLmJhc2UiOnRydWV9fSwic2hhMjU2OmUxODE1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/directory.go
package core import ( "context" "fmt" "io/fs" "path" "reflect" "strings" "time" "github.com/dagger/dagger/core/pipeline" bkclient "github.com/moby/buildkit/client" "github.com/moby/buildkit/client/llb" bkgw "github.com/moby/buildkit/frontend/gateway/client" "github.com/moby/buildkit/solver/pb" specs "github.com/opencontainers/image-spec/specs-go/v1" fstypes "github.com/tonistiigi/fsutil/types" ) type Directory struct { ID DirectoryID `json:"id"` } type DirectoryID string type directoryIDPayload struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4dGJXRnVhV1psYzNSeldnQT0iLCJDa2tLUjNOb1lUSTFOam96TlRaaE16az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OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/directory.go
LLB *pb.Definition `json:"llb"` Dir string `json:"dir"` Platform specs.Platform `json:"platform"` Pipeline pipeline.Path `json:"pipeline"` Services ServiceBindings `json:"services,omitempty"` } func (id DirectoryID) Decode() (*directoryIDPayload, error) { if id == "" { return &directoryIDPayload{}, nil } var payload directoryIDPayload if err := decodeID(&payload, id); err != nil { return nil, err } return &payload, nil } func (payload *directoryIDPayload) State() (llb.State, error) { if payload.LLB == nil { return llb.Scratch(), nil } return defToState(payload.LLB) } func (payload *directoryIDPayload) SetState(ctx context.Context, st llb.State) error { def, err := st.Marshal(ctx, llb.Platform(payload.Platform)) if err != nil { return nil
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIz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0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/directory.go
} payload.LLB = def.ToPB() return nil } func (payload *directoryIDPayload) ToDirectory() (*Directory, error) { id, err := encodeID(payload) if err != nil { return nil, err } return &Directory{ ID: DirectoryID(id), }, nil } func NewDirectory(ctx context.Context, st llb.State, cwd string, pipeline pipeline.Path, platform specs.Platform, services ServiceBindings) (*Directory, error) { payload := directoryIDPayload{ Dir: cwd, Platform: platform, Pipeline: pipeline.Copy(), Services: services, } def, err := st.Marshal(ctx, llb.Platform(platform)) if err != nil { return nil, err } payload.LLB = def.ToPB() return payload.ToDirectory() } func (dir *Directory) Pipeline(ctx context.Context, name, description string, labels []pipeline.Label) (*Directory, error) { payload, err := dir.ID.Decode() if err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4dGJXRnVhV1psYzNSeldnQT0iLCJDa2tLUjNOb1lUSTFOam96TlRaaE16azVNakprTXpsak4yVmpOVEkzWVRnNE5ERmtZMlkwWkRFek9UTTVNRGsyTnpGaFpHUTFPRFZtWXpJNFpqa3hNRGMyTm1Kak5XTmtNemt3SWlzU0tRai8vLy8vLy8vLy8vOEJJaHdLQVM4U0FTOGcvLy8vLy8vLy8vLy9BVmovLy8vLy8vLy8vLzhCVWc0S0JXRnliVFkwRWdWc2FXNTFlRm9BIiwiQ2trS1IzTm9ZVEkxTmpwaU9ERTVZVFEyWkRjek16ZzVPV00zWXpjMllqWmtZamRrWmpBeU5qZzVNekEyWTJSaU1UZzFNV0ZqWldNMlpERTNZVEF5WVRRMk1XUTFZVGMxTmpFeCJdLCJtZXRhZGF0YSI6eyJzaGEyNTY6MzU2YTM5OTIyZDM5YzdlYzUyN2E4ODQxZGNmNGQxMzkzOTA5NjcxYWRkNTg1ZmMyOGY5MTA3NjZiYzVjZDM5MCI6eyJjYXBzIjp7InNvdXJjZS5sb2NhbCI6dHJ1ZSwic291cmNlLmxvY2FsLnNoYXJlZGtleWhpbnQiOnRydWUsInNvdXJjZS5sb2NhbC51bmlxdWUiOnRydWV9fSwic2hhMjU2OmI4MTlhNDZkNzMzODk5YzdjNzZiNmRiN2RmMDI2ODkzMDZjZGIxODUxYWNlYzZkMTdhMDJhNDYxZDVhNzU2MTEiOnsiY2FwcyI6eyJmaWxlLmJhc2UiOnRydWV9fSwic2hhMjU2OmUxODE1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/directory.go
return nil, err } payload.Pipeline = payload.Pipeline.Add(pipeline.Pipeline{ Name: name, Description: description, Labels: labels, }) return payload.ToDirectory() } func (dir *Directory) Stat(ctx context.Context, gw bkgw.Client, src string) (*fstypes.Stat, error) { payload, err := dir.ID.Decode() if err != nil { return nil, err } src = path.Join(payload.Dir, src) return WithServices(ctx, gw, payload.Services, func() (*fstypes.Stat, error) { res, err := gw.Solve(ctx, bkgw.SolveRequest{ Definition: payload.LLB, }) if err != nil { return nil, err } ref, err := res.SingleRef() if err != nil { return nil, err } if ref == nil { if clean := path.Clean(src); clean == "." || clean == "/" {
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4dGJXRnVhV1psYzNSeldnQT0iLCJDa2tLUjNOb1lUSTFOam96TlRaaE16azVNakprTXpsak4yVmpOVEkzWVRnNE5ERmtZMlkwWkRFek9UTTVNRGsyTnpGaFpHUTFPRFZtWXpJNFpqa3hNRGMyTm1Kak5XTmtNemt3SWlzU0tRai8vLy8vLy8vLy8vOEJJaHdLQVM4U0FTOGcvLy8vLy8vLy8vLy9BVmovLy8vLy8vLy8vL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though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/directory.go
return &fstypes.Stat{ Path: src, Mode: uint32(fs.ModeDir), }, nil } return nil, fmt.Errorf("%s: no such file or directory", src) } return ref.StatFile(ctx, bkgw.StatRequest{ Path: src, }) }) } func (dir *Directory) Entries(ctx context.Context, gw bkgw.Client, src string) ([]string, error) { payload, err := dir.ID.Decode() if err != nil { return nil, err } src = path.Join(payload.Dir, src) return WithServices(ctx, gw, payload.Services, func() ([]string, error) { res, err := gw.Solve(ctx, bkgw.SolveRequest{ Definition: payload.LLB, }) if err != nil { return nil, err } ref, err := res.SingleRef() if err != nil { return nil, err }
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wy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M5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/directory.go
if ref == nil { if clean := path.Clean(src); clean == "." || clean == "/" { return []string{}, nil } return nil, fmt.Errorf("%s: no such file or directory", src) } entries, err := ref.ReadDir(ctx, bkgw.ReadDirRequest{ Path: src, }) if err != nil { return nil, err } paths := []string{} for _, entry := range entries { paths = append(paths, entry.GetPath()) } return paths, nil }) } func (dir *Directory) WithNewFile(ctx context.Context, dest string, content []byte, permissions fs.FileMode) (*Directory, error) { payload, err := dir.ID.Decode() if err != nil { return nil, err } if permissions == 0 { permissions = 0o644 } dest = path.Join(payload.Dir, dest) st, err := payload.State()
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1l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iOnRydWV9fSwic2hhMjU2OmUxODE1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/directory.go
if err != nil { return nil, err } parent, _ := path.Split(dest) if parent != "" { st = st.File(llb.Mkdir(parent, 0755, llb.WithParents(true)), payload.Pipeline.LLBOpt()) } st = st.File( llb.Mkfile( dest, permissions, content, ), payload.Pipeline.LLBOpt(), ) err = payload.SetState(ctx, st) if err != nil { return nil, err } return payload.ToDirectory() } func (dir *Directory) Directory(ctx context.Context, subdir string) (*Directory, error) { payload, err := dir.ID.Decode() if err != nil { return nil, err } payload.Dir = path.Join(payload.Dir, subdir) return payload.ToDirectory() } func (dir *Directory) File(ctx context.Context, file string) (*File, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4dGJXRnVhV1psYzNSeldnQT0iLCJDa2tLUjNOb1lUSTFOam96TlRaaE16azVNakprTXpsak4yVmpOVEkzWVRnNE5ERmtZMlkwWkRFek9UTTVNRGsyTnpGaFpHUTFPRFZtWXpJNFpqa3hNRGMyTm1Kak5XTmtNemt3SWlzU0tRai8vLy8vLy8vLy8vOEJJaHdLQVM4U0FTOGcvLy8vLy8vLy8vLy9BVmovLy8vLy8vLy8vLzhCVWc0S0JXRnliVFkwRWdWc2FXNTFlRm9BIiwiQ2trS1IzTm9ZVEkxTmpwaU9ERTVZVFEyWkRjek16ZzVPV00zWXpjMllqWmtZamRrWmpBeU5qZzVNekEyWTJSaU1UZzFNV0ZqWldNMlpERTNZVEF5WVRRMk1XUTFZVGMxTmpFeCJdLCJtZXRhZGF0YSI6eyJzaGEyNTY6MzU2YTM5OTIyZDM5YzdlYzUyN2E4ODQxZGNmNGQxMzkzOTA5NjcxYWRkNTg1ZmMyOGY5MTA3NjZiYzVjZDM5MCI6eyJjYXBzIjp7InNvdXJjZS5sb2NhbCI6dHJ1ZSwic291cmNlLmxvY2FsLnNoYXJlZGtleWhpbnQiOnRydWUsInNvdXJjZS5sb2NhbC51bmlxdWUiOnRydWV9fSwic2hhMjU2OmI4MTlhNDZkNzMzODk5YzdjNzZiNmRiN2RmMDI2ODkzMDZjZGIxODUxYWNlYzZkMTdhMDJhNDYxZDVhNzU2MTEiOnsiY2FwcyI6eyJmaWxlLmJhc2UiOnRydWV9fSwic2hhMjU2OmUxODE1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/directory.go
payload, err := dir.ID.Decode() if err != nil { return nil, err } return (&fileIDPayload{ LLB: payload.LLB, File: path.Join(payload.Dir, file), Platform: payload.Platform, Services: payload.Services, }).ToFile() } func (dir *Directory) WithDirectory(ctx context.Context, subdir string, src *Directory, filter CopyFilter) (*Directory, error) { destPayload, err := dir.ID.Decode() if err != nil { return nil, err } srcPayload, err := src.ID.Decode() if err != nil { return nil, err } st, err := destPayload.State() if err != nil { return nil, err } srcSt, err := srcPayload.State() if err != nil { return nil, err } st = st.File(llb.Copy(srcSt, srcPayload.Dir, path.Join(destPayload.Dir, subdir), &llb.CopyInfo{ CreateDestPath: true,
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4dGJXRnVhV1psYzNSeldnQT0iLCJDa2tLUjNOb1lUSTFOam96TlRaaE16azVNakprTXpsak4yVmpOVEkzWVRnNE5ERmtZMlkwWkRFek9UTTVNRGsyTnpGaFpHUTFPRFZtWXpJNFpqa3hNRGMyTm1Kak5XTmtNemt3SWlzU0tRai8vLy8vLy8vLy8vOEJJaHdLQVM4U0FTOGcvLy8vLy8vLy8vLy9BVm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too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/directory.go
CopyDirContentsOnly: true, IncludePatterns: filter.Include, ExcludePatterns: filter.Exclude, }), destPayload.Pipeline.LLBOpt(), ) err = destPayload.SetState(ctx, st) if err != nil { return nil, err } destPayload.Services.Merge(srcPayload.Services) return destPayload.ToDirectory() } func (dir *Directory) WithTimestamps(ctx context.Context, unix int) (*Directory, error) { payload, err := dir.ID.Decode() if err != nil { return nil, err } st, err := payload.State() if err != nil { return nil, err } t := time.Unix(int64(unix), 0) stamped := llb.Scratch().File( llb.Copy(st, payload.Dir, ".", &llb.CopyInfo{ CopyDirContentsOnly: true, CreatedTime: &t, }), payload.Pipeline.LLBOpt(), )
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtO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MjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/directory.go
return NewDirectory(ctx, stamped, "", payload.Pipeline, payload.Platform, payload.Services) } func (dir *Directory) WithNewDirectory(ctx context.Context, dest string, permissions fs.FileMode) (*Directory, error) { payload, err := dir.ID.Decode() if err != nil { return nil, err } dest = path.Clean(dest) if strings.HasPrefix(dest, "../") { return nil, fmt.Errorf("cannot create directory outside parent: %s", dest) } dest = path.Join(payload.Dir, dest) st, err := payload.State() if err != nil { return nil, err } if permissions == 0 { permissions = 0755 } st = st.File(llb.Mkdir(dest, permissions, llb.WithParents(true)), payload.Pipeline.LLBOpt()) err = payload.SetState(ctx, st) if err != nil { return nil, err } return payload.ToDirectory() } func (dir *Directory) WithFile(ctx context.Context, subdir string, src *File, permissions fs.FileMode) (*Directory, error) { destPayload, err := dir.ID.Decode() if err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvS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NvdXJjZS5sb2NhbC51bmlxdWUiOnRydWV9fSwic2hhMjU2OmI4MTlhNDZkNzMzODk5YzdjNzZiNmRiN2RmMDI2ODkzMDZjZGIxODUxYWNlYzZkMTdhMDJhNDYxZDVhNzU2MTEiOnsiY2FwcyI6eyJmaWxlLmJhc2UiOnRydWV9fSwic2hhMjU2OmUxODE1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/directory.go
return nil, err } srcPayload, err := src.ID.decode() if err != nil { return nil, err } st, err := destPayload.State() if err != nil { return nil, err } srcSt, err := srcPayload.State() if err != nil { return nil, err } var perm *fs.FileMode if permissions != 0 { perm = &permissions } st = st.File(llb.Copy(srcSt, srcPayload.File, path.Join(destPayload.Dir, subdir), &llb.CopyInfo{ CreateDestPath: true, Mode: perm, }), destPayload.Pipeline.LLBOpt()) err = destPayload.SetState(ctx, st) if err != nil { return nil, err } destPayload.Services.Merge(srcPayload.Services) return destPayload.ToDirectory() } func MergeDirectories(ctx context.Context, dirs []*Directory, platform specs.Platform) (*Directory, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4dGJXRnVhV1psYzNSeldnQT0iLCJDa2tLUjNOb1lUSTFOam96TlRaaE16azVNakprTXpsak4yVmpOVEkzWVRnNE5ERmtZMlkwWkRFek9UTTVNRGsyTnpGaFpHUTFPRFZtWXpJNFpqa3hNRGMyTm1Kak5XTmtNemt3SWlzU0tRai8vLy8vLy8vLy8vOEJJaHdLQVM4U0FTOGcvLy8vLy8vLy8vLy9BVmovLy8vLy8vLy8vLzhCVWc0S0JXRnliVFkwRWdWc2FXNTFlRm9BIiwiQ2trS1IzTm9ZVEkxTmpwaU9ERTVZVFEyWkRjek16ZzVPV00zWXpjMllqWmtZamRrWmpBeU5qZzVNekEyWTJSaU1UZzFNV0ZqWldNMlpERTNZVEF5WVRRMk1XUTFZVGMxTmpFeCJdLCJtZXRhZGF0YSI6eyJzaGEyNTY6MzU2YTM5OTIyZDM5YzdlYzUyN2E4ODQxZGNmNGQxMzkzOTA5NjcxYWRkNTg1ZmMyOGY5MTA3NjZiYzVjZDM5MCI6eyJjYXBzIjp7InNvdXJjZS5sb2NhbCI6dHJ1ZSwic291cmNlLmxvY2FsLnNoYXJlZGtleWhpbnQiOnRydWUsInNvdXJjZS5sb2NhbC51bmlxdWUiOnRydWV9fSwic2hhMjU2OmI4MTlhNDZkNzMzODk5YzdjNzZiNmRiN2RmMDI2ODkzMDZjZGIxODUxYWNlYzZkMTdhMDJhNDYxZDVhNzU2MTEiOnsiY2FwcyI6eyJmaWxlLmJhc2UiOnRydWV9fSwic2hhMjU2OmUxODE1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/directory.go
states := make([]llb.State, 0, len(dirs)) var pipeline pipeline.Path for _, fs := range dirs { payload, err := fs.ID.Decode() if err != nil { return nil, err } if !reflect.DeepEqual(platform, payload.Platform) { return nil, fmt.Errorf("TODO: cannot merge across platforms: %+v != %+v", platform, payload.Platform) } if pipeline.Name() == "" { pipeline = payload.Pipeline } state, err := payload.State() if err != nil { return nil, err } states = append(states, state) } return NewDirectory(ctx, llb.Merge(states, pipeline.LLBOpt()), "", pipeline, platform, nil) } func (dir *Directory) Diff(ctx context.Context, other *Directory) (*Directory, error) { lowerPayload, err := dir.ID.Decode() if err != nil { return nil, err
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4dGJXRnVhV1psYzNSeldnQT0iLCJDa2tLUjNOb1lUSTFOam96Tl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3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/directory.go
} upperPayload, err := other.ID.Decode() if err != nil { return nil, err } if lowerPayload.Dir != upperPayload.Dir { return nil, fmt.Errorf("TODO: cannot diff with different relative paths: %q != %q", lowerPayload.Dir, upperPayload.Dir) } if !reflect.DeepEqual(lowerPayload.Platform, upperPayload.Platform) { return nil, fmt.Errorf("TODO: cannot diff across platforms: %+v != %+v", lowerPayload.Platform, upperPayload.Platform) } lowerSt, err := lowerPayload.State() if err != nil { return nil, err } upperSt, err := upperPayload.State() if err != nil { return nil, err } err = lowerPayload.SetState(ctx, llb.Diff(lowerSt, upperSt, lowerPayload.Pipeline.LLBOpt())) if err != nil { return nil, err } return lowerPayload.ToDirectory() } func (dir *Directory) Without(ctx context.Context, path string) (*Directory, error) { payload, err := dir.ID.Decode() if err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXW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MTEiOnsiY2FwcyI6eyJmaWxlLmJhc2UiOnRydWV9fSwic2hhMjU2OmUxODE1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/directory.go
return nil, err } st, err := payload.State() if err != nil { return nil, err } err = payload.SetState(ctx, st.File(llb.Rm(path, llb.WithAllowWildcard(true)), payload.Pipeline.LLBOpt())) if err != nil { return nil, err } return payload.ToDirectory() } func (dir *Directory) Export( ctx context.Context, host *Host, dest string, bkClient *bkclient.Client, solveOpts bkclient.SolveOpt, solveCh chan<- *bkclient.SolveStatus, ) error { dest, err := host.NormalizeDest(dest) if err != nil { return err } srcPayload, err := dir.ID.Decode() if err != nil { return err } return host.Export(ctx, bkclient.ExportEntry{ Type: bkclient.ExporterLocal,
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4dGJXRnVhV1psYzNSeldnQT0iLCJDa2tLUjNOb1lUSTFOam96TlRaaE16azVNakprTXpsak4yVmpOVEkzWVRnNE5ERmtZMlkwWkRFek9UTTVNRGsyTnpGaFpHUTFPRFZtWXpJNFpqa3hNRGMyTm1Kak5XTmtNemt3SWlzU0tRai8vLy8vLy8vLy8vOEJJaHdLQVM4U0FTOGcvLy8vLy8vLy8vLy9BVmovLy8vLy8vLy8vLzhCVWc0S0JXRnliVFkwRWdWc2FXNTFlRm9BIiwiQ2trS1IzTm9ZVEkxTmpwaU9ERTVZVFEyWkRjek16ZzVPV00zWXpjMllqWmtZamRrWmpBeU5qZzVNekEyWTJSaU1UZzFNV0ZqWldNMlpERTNZVEF5WVRRMk1XUTFZVGMxTmpFeCJdLCJtZXRhZGF0YSI6eyJzaGEyNTY6MzU2YTM5OTIyZDM5YzdlYzUyN2E4ODQxZGNmNGQxMzkzOTA5NjcxYWRkNTg1ZmMyOGY5MTA3NjZiYzVjZDM5MCI6eyJjYXBzIjp7InNvdXJjZS5sb2NhbCI6dHJ1ZSwic291cmNlLmxvY2FsLnNoYXJlZGtleWhpbnQiOnRydWUsInNvdXJjZS5sb2NhbC51bmlxdWUiOnRydWV9fSwic2hhMjU2OmI4MTlhNDZkNzMzODk5YzdjNzZiNmRiN2RmMDI2ODkzMDZjZGIxODUxYWNlYzZkMTdhMDJhNDYxZDVhNzU2MTEiOnsiY2FwcyI6eyJmaWxlLmJhc2UiOnRydWV9fSwic2hhMjU2OmUxODE1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/directory.go
OutputDir: dest, }, dest, bkClient, solveOpts, solveCh, func(ctx context.Context, gw bkgw.Client) (*bkgw.Result, error) { return WithServices(ctx, gw, srcPayload.Services, func() (*bkgw.Result, error) { src, err := srcPayload.State() if err != nil { return nil, err } var defPB *pb.Definition if srcPayload.Dir != "" { src = llb.Scratch().File(llb.Copy(src, srcPayload.Dir, ".", &llb.CopyInfo{ CopyDirContentsOnly: true, }), srcPayload.Pipeline.LLBOpt(), ) def, err := src.Marshal(ctx, llb.Platform(srcPayload.Platform)) if err != nil { return nil, err } defPB = def.ToPB() } else { defPB = srcPayload.LLB } return gw.Solve(ctx, bkgw.SolveRequest{ Evaluate: true, Definition: defPB, }) }) }) }
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4dGJXRnVhV1psYzNSeldnQT0iLCJDa2tLUjNOb1lUSTFOam96TlRaaE16azVNakprTXpsak4yVmpOVEkzWVRnNE5ERmtZMlkwWkRFek9UTTVNRGsyTnpGaFpHUTFPRFZtWXpJNFpqa3hNRGMyTm1Kak5XTmtNemt3SWlzU0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7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
package core import ( "context" "regexp" "testing" "time" "dagger.io/dagger" "github.com/dagger/dagger/core" "github.com/dagger/dagger/internal/testutil" "github.com/moby/buildkit/identity" "github.com/stretchr/testify/require" ) func TestEmptyDirectory(t *testing.T) { t.Parallel() var res struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4dGJXRnVhV1psYzNSeldnQT0iLCJDa2tLUjNOb1lUSTFOam96TlRaaE16azVNakprTXp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NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
Directory struct { ID core.DirectoryID Entries []string } } err := testutil.Query( `{ directory { entries } }`, &res, nil) require.NoError(t, err) require.Empty(t, res.Directory.Entries) } func TestScratchDirectory(t *testing.T) { t.Parallel() c, ctx := connect(t) defer c.Close() _, err := c.Container().Directory("/").Entries(ctx) require.NoError(t, err) } func TestDirectoryWithNewFile(t *testing.T) { t.Parallel() var res struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04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6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
Directory struct { WithNewFile struct { ID core.DirectoryID Entries []string } } } err := testutil.Query( `{ directory { withNewFile(path: "some-file", contents: "some-content") { id entries } } }`, &res, nil) require.NoError(t, err) require.NotEmpty(t, res.Directory.WithNewFile.ID) require.Equal(t, []string{"some-file"}, res.Directory.WithNewFile.Entries) } func TestDirectoryEntries(t *testing.T) { t.Parallel() var res struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2Y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1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
Directory struct { WithNewFile struct { WithNewFile struct { Entries []string } } } } err := testutil.Query( `{ directory { withNewFile(path: "some-file", contents: "some-content") { withNewFile(path: "some-dir/sub-file", contents: "some-content") { entries } } } }`, &res, nil) require.NoError(t, err) require.ElementsMatch(t, []string{"some-file", "some-dir"}, res.Directory.WithNewFile.WithNewFile.Entries) } func TestDirectoryEntriesOfPath(t *testing.T) { t.Parallel() var res struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa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JjZS5sb2NhbC51bmlxdWUiOnRydWV9fSwic2hhMjU2OmI4MTlhNDZkNzMzODk5YzdjNzZiNmRiN2RmMDI2ODkzMDZjZGIxODUxYWNlYzZkMTdhMDJhNDYxZDVhNzU2MTEiOnsiY2FwcyI6eyJmaWxlLmJhc2UiOnRydWV9fSwic2hhMjU2OmUxODE1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
Directory struct { WithNewFile struct { WithNewFile struct { Entries []string } } } } err := testutil.Query( `{ directory { withNewFile(path: "some-file", contents: "some-content") { withNewFile(path: "some-dir/sub-file", contents: "some-content") { entries(path: "some-dir") } } } }`, &res, nil) require.NoError(t, err) require.Equal(t, []string{"sub-file"}, res.Directory.WithNewFile.WithNewFile.Entries) } func TestDirectoryDirectory(t *testing.T) { t.Parallel() var res struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4dGJXRnVhV1psYzNSeldnQT0iLCJDa2tLUjNOb1lUSTFOam96TlRaaE16azVNakprTXpsak4yVmpOVEkzWVRnNE5ERmtZMlkwWkRFek9UTTVNRGsyTnpGaFpHUTFPRFZtWXpJNFpqa3hNRGMyTm1Kak5XTmtNemt3SWlzU0tRai8vLy8vLy8vLy8vOEJJaHdLQVM4U0FTOGcvLy8vLy8vLy8vLy9BVmovLy8vLy8vLy8vLzhCVWc0S0JXRnliVFkwRWdWc2FXNTFlRm9BIiwiQ2trS1IzTm9ZVEkxTmpwaU9ERTVZVFEyWkRjek16ZzVPV00zWXpjMllqWmtZamRrWmpBeU5qZzVNekEyWTJSaU1UZzFNV0ZqWldNMlpERTNZVEF5WVRRMk1XUTFZVGMxTmpFeCJdLCJtZXRhZGF0YSI6eyJzaGEyNTY6MzU2YTM5OTIyZDM5YzdlYzUyN2E4ODQxZGNmNGQxMzkzOTA5NjcxYWRkNTg1ZmMyOGY5MTA3NjZiYzVjZDM5MCI6eyJjYXBzIjp7InNvdXJjZS5sb2NhbCI6dHJ1ZSwic291cmNlLmxvY2FsLnNoYXJlZGtleWhpbnQiOnRydWUsInNvdXJjZS5sb2NhbC51bmlxdWUiOnRydWV9fSwic2hhMjU2OmI4MTlhNDZkNzMzODk5YzdjNzZiNmRiN2RmMDI2ODkzMDZjZGIxODUxYWNlYzZkMTdhMDJhNDYxZDVhNzU2MTEiOnsiY2FwcyI6eyJmaWxlLmJhc2UiOnRydWV9fSwic2hhMjU2OmUxODE1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
Directory struct { WithNewFile struct { WithNewFile struct { Directory struct { Entries []string } } } } } err := testutil.Query( `{ directory { withNewFile(path: "some-file", contents: "some-content") { withNewFile(path: "some-dir/sub-file", contents: "some-content") { directory(path: "some-dir") { entries } } } } }`, &res, nil) require.NoError(t, err) require.Equal(t, []string{"sub-file"}, res.Directory.WithNewFile.WithNewFile.Directory.Entries) } func TestDirectoryDirectoryWithNewFile(t *testing.T) { t.Parallel() var res struct { Directory struct { WithNewFile struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4dGJXRnVhV1psYzNSeldnQT0iLCJDa2tLUjNOb1lUSTFOam96TlRaaE16azVNakprTXpsak4yVmpOVEkzWVRnNE5ERmtZMlkwWkRFek9UTTVNRGsyTnpGaFpHUTFPRFZtWXpJNFpqa3hNRGMyTm1Kak5XTmtNemt3SWlzU0tRai8vLy8vLy8vLy8vOEJJaHdLQVM4U0FTOGcvLy8vLy8vLy8vLy9BVmovL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``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
WithNewFile struct { Directory struct { WithNewFile struct { Entries []string } } } } } } err := testutil.Query( `{ directory { withNewFile(path: "some-file", contents: "some-content") { withNewFile(path: "some-dir/sub-file", contents: "some-content") { directory(path: "some-dir") { withNewFile(path: "another-file", contents: "more-content") { entries } } } } } }`, &res, nil) require.NoError(t, err) require.ElementsMatch(t, []string{"sub-file", "another-file"}, res.Directory.WithNewFile.WithNewFile.Directory.WithNewFile.Entries) } func TestDirectoryWithDirectory(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4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EwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
t.Parallel() c, ctx := connect(t) defer c.Close() dir := c.Directory(). WithNewFile("some-file", "some-content"). WithNewFile("some-dir/sub-file", "sub-content"). Directory("some-dir") entries, err := c.Directory().WithDirectory("with-dir", dir).Entries(ctx, dagger.DirectoryEntriesOpts{ Path: "with-dir", }) require.NoError(t, err) require.Equal(t, []string{"sub-file"}, entries) entries, err = c.Directory().WithDirectory("sub-dir/sub-sub-dir/with-dir", dir).Entries(ctx, dagger.DirectoryEntriesOpts{
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOW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1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
Path: "sub-dir/sub-sub-dir/with-dir", }) require.NoError(t, err) require.Equal(t, []string{"sub-file"}, entries) t.Run("copies directory contents to .", func(t *testing.T) { entries, err := c.Directory().WithDirectory(".", dir).Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"sub-file"}, entries) }) t.Run("respects permissions", func(t *testing.T) { dir := c.Directory(). WithNewFile("some-file", "some content", dagger.DirectoryWithNewFileOpts{Permissions: 0444}). WithNewDirectory("some-dir", dagger.DirectoryWithNewDirectoryOpts{Permissions: 0444}). WithNewFile("some-dir/sub-file", "sub-content", dagger.DirectoryWithNewFileOpts{Permissions: 0444}) ctr := c.Container().From("alpine").WithDirectory("/permissions-test", dir) stdout, err := ctr.WithExec([]string{"ls", "-ld", "/permissions-test"}).Stdout(ctx) require.NoError(t, err) require.Contains(t, stdout, "drwxr-xr-x") stdout, err = ctr.WithExec([]string{"ls", "-l", "/permissions-test/some-file"}).Stdout(ctx) require.NoError(t, err) require.Contains(t, stdout, "-r--r--r--") stdout, err = ctr.WithExec([]string{"ls", "-ld", "/permissions-test/some-dir"}).Stdout(ctx) require.NoError(t, err) require.Contains(t, stdout, "dr--r--r--") stdout, err = ctr.WithExec([]string{"ls", "-l", "/permissions-test/some-dir/sub-file"}).Stdout(ctx) require.NoError(t, err) require.Contains(t, stdout, "-r--r--r--") }) } func TestDirectoryWithDirectoryIncludeExclude(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4dGJXRnVhV1psYzNSeldnQT0iLCJDa2tLUjNOb1lUSTFOam96TlRaaE16azVNakprTXpsak4yVmpOVEkzWVRnNE5ERmtZMlkwWkRFek9UTTVNRGsyTnpGaFpHUTFPRFZtWXpJNFpqa3hNRGMyT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I6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
t.Parallel() c, ctx := connect(t) defer c.Close() dir := c.Directory(). WithNewFile("a.txt", ""). WithNewFile("b.txt", ""). WithNewFile("c.txt.rar", ""). WithNewFile("subdir/d.txt", ""). WithNewFile("subdir/e.txt", ""). WithNewFile("subdir/f.txt.rar", "") t.Run("exclude", func(t *testing.T) { entries, err := c.Directory().WithDirectory(".", dir, dagger.DirectoryWithDirectoryOpts{ Exclude: []string{"*.rar"}, }).Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"a.txt", "b.txt", "subdir"}, entries) }) t.Run("include", func(t *testing.T) { entries, err := c.Directory().WithDirectory(".", dir, dagger.DirectoryWithDirectoryOpts{ Include: []string{"*.rar"}, }).Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"c.txt.rar"}, entries) }) t.Run("exclude overrides include", func(t *testing.T) { entries, err := c.Directory().WithDirectory(".", dir, dagger.DirectoryWithDirectoryOpts{ Include: []string{"*.txt"},
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXW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MTEiOnsiY2FwcyI6eyJmaWxlLmJhc2UiOnRydWV9fSwic2hhMjU2OmUxODE1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
Exclude: []string{"b.txt"}, }).Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"a.txt"}, entries) }) t.Run("include does not override exclude", func(t *testing.T) { entries, err := c.Directory().WithDirectory(".", dir, dagger.DirectoryWithDirectoryOpts{ Include: []string{"a.txt"}, Exclude: []string{"*.txt"}, }).Entries(ctx) require.NoError(t, err) require.Equal(t, []string{}, entries) }) t.Run("exclude works on directory", func(t *testing.T) { entries, err := c.Directory().WithDirectory(".", dir, dagger.DirectoryWithDirectoryOpts{ Exclude: []string{"subdir"}, }).Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"a.txt", "b.txt", "c.txt.rar"}, entries) }) subdir := dir.Directory("subdir") t.Run("exclude respects subdir", func(t *testing.T) { entries, err := c.Directory().WithDirectory(".", subdir, dagger.DirectoryWithDirectoryOpts{ Exclude: []string{"*.rar"}, }).Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"d.txt", "e.txt"}, entries) }) } func TestDirectoryWithNewDirectory(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4dGJXRnVhV1psYzNSeldnQT0iLCJDa2tLUjNOb1lUSTFOam96TlRaaE16azVNakprTXpsak4yVmpOVEkzWVRnNE5ERmtZMlkwWkRFek9UTTVNRGsyTnpGaFpHUTFPRFZtWXpJNFpqa3hNRGMyTm1Kak5XTmtNemt3SWlzU0tRai8vLy8vLy8vLy8vOEJJaHdLQVM4U0FTOGcvLy8vLy8vLy8vLy9BVmovLy8vLy8vLy8vLzhCVWc0S0JXRnliVFkwRWdWc2FXNTFlRm9BIiwiQ2trS1IzTm9ZVEkxTmpwaU9ERTVZVFEyWkRjek16ZzVPV00zWXpjMllqWmtZamRrWmpBeU5qZzVNekEyWTJSaU1UZzFNV0ZqWldNMlpERTNZVEF5WVRRMk1XUTFZVGMxTmpFeCJdLCJtZXRhZGF0YSI6eyJzaGEyNTY6MzU2YTM5OTIyZDM5YzdlYzUyN2E4ODQxZGNmNGQxMzkzOTA5NjcxYWRkNTg1ZmMyOGY5MTA3NjZiYzVjZDM5MCI6eyJjYXBzIjp7InNvdXJjZS5sb2NhbCI6dHJ1ZSwic291cmNlLmxvY2FsLnNoYXJlZGtleWhpbnQiOnRydWUsInNvdXJjZS5sb2NhbC51bmlxdWUiOnRydWV9fSwic2hhMjU2OmI4MTlhNDZkNzMzODk5YzdjNzZiNmRiN2RmMDI2ODkzMDZjZGIxODUxYWNlYzZkMTdhMDJhNDYxZDVhNzU2MTEiOnsiY2FwcyI6eyJmaWxlLmJhc2UiOnRydWV9fSwic2hhMjU2OmUxODE1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
ctx := context.Background() c, err := dagger.Connect(ctx) require.NoError(t, err) defer c.Close() dir := c.Directory(). WithNewDirectory("a"). WithNewDirectory("b/c") entries, err := dir.Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"a", "b"}, entries) entries, err = dir.Entries(ctx, dagger.DirectoryEntriesOpts{ Path: "b", }) require.NoError(t, err) require.Equal(t, []string{"c"}, entries) t.Run("does not permit creating directory outside of root", func(t *testing.T) { _, err := dir.Directory("b").WithNewDirectory("../c").ID(ctx) require.Error(t, err) }) } func TestDirectoryWithFile(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMW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kZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
ctx := context.Background() c, err := dagger.Connect(ctx) require.NoError(t, err) defer c.Close() file := c.Directory(). WithNewFile("some-file", "some-content"). File("some-file") content, err := c.Directory(). WithFile("target-file", file). File("target-file").Contents(ctx) require.NoError(t, err) require.Equal(t, "some-content", content) content, err = c.Directory(). WithFile("sub-dir/target-file", file). File("sub-dir/target-file").Contents(ctx) require.NoError(t, err) require.Equal(t, "some-content", content) t.Run("respects permissions", func(t *testing.T) { dir := c.Directory().
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21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MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
WithNewFile( "file-with-permissions", "this should have rwxrwxrwx permissions", dagger.DirectoryWithNewFileOpts{Permissions: 0777}) ctr := c.Container().From("alpine").WithDirectory("/permissions-test", dir) stdout, err := ctr.WithExec([]string{"ls", "-l", "/permissions-test/file-with-permissions"}).Stdout(ctx) require.NoError(t, err) require.Contains(t, stdout, "rwxrwxrwx") dir2 := c.Directory(). WithNewFile( "file-with-permissions", "this should have rw-r--r-- permissions") ctr2 := c.Container().From("alpine").WithDirectory("/permissions-test", dir2) stdout2, err := ctr2.WithExec([]string{"ls", "-l", "/permissions-test/file-with-permissions"}).Stdout(ctx) require.NoError(t, err) require.Contains(t, stdout2, "rw-r--r--") }) } func TestDirectoryWithTimestamps(t *testing.T) { ctx := context.Background() c, err := dagger.Connect(ctx) require.NoError(t, err) defer c.Close() reallyImportantTime := time.Date(1985, 10, 26, 8, 15, 0, 0, time.UTC) dir := c.Container(). From("alpine:3.16.2"). WithExec([]string{"sh", "-c", ` mkdir output touch output/some-file mkdir output/sub-dir
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4dGJXRnVhV1psYzNSeldnQT0iLCJDa2tLUjNOb1lUSTFOam96TlRaaE16azVNakprTXpsak4yVmpOVEkzWVRnNE5ERmtZMlkwWkRFek9UTTVNRGsyTnpGaFpHUTFPRFZtWXpJNFpqa3hNRGMyTm1Kak5XTmtNemt3SWlzU0tRai8vLy8vLy8vLy8vOEJJaHdLQVM4U0FTOGcvLy8vLy8vLy8vLy9BVmovLy8vLy8vLy8vLzhCVWc0S0JXRnliVFkwRWdWc2FXNTFlRm9BIiwiQ2trS1IzTm9ZVEkxTmpwaU9ERTVZVFEyWkRjek16ZzVPV00zWXpjMllqWmtZamRrWmpBeU5qZzVNekEyWTJSaU1UZzFNV0ZqWldNMlpERTNZVEF5WVRRMk1XUTFZVGMxTmpFeCJdLCJtZXRhZGF0YSI6eyJzaGEyNTY6MzU2YTM5OTIyZDM5YzdlYzUyN2E4ODQxZGNmNGQxMzkzOTA5NjcxYWRkNTg1ZmMyOGY5MTA3NjZiYzVjZDM5MCI6eyJjYXBzIjp7InNvdXJjZS5sb2NhbCI6dHJ1ZSwic291cmNlLmxvY2FsLnNoYXJlZGtleWhpbnQiOnRydWUsInNvdXJjZS5sb2NhbC51bmlxdWUiOnRydWV9fSwic2hhMjU2OmI4MTlhNDZkNzMzODk5YzdjNzZiNmRiN2RmMDI2ODkzMDZjZGIxODUxYWNlYzZkMTdhMDJhNDYxZDVhNzU2MTEiOnsiY2FwcyI6eyJmaWxlLmJhc2UiOnRydWV9fSwic2hhMjU2OmUxODE1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
touch output/sub-dir/sub-file `}). Directory("output"). WithTimestamps(int(reallyImportantTime.Unix())) t.Run("changes file and directory timestamps recursively", func(t *testing.T) { ls, err := c.Container(). From("alpine:3.16.2"). WithMountedDirectory("/dir", dir). WithEnvVariable("RANDOM", identity.NewID()). WithExec([]string{"sh", "-c", "ls -al /dir && ls -al /dir/sub-dir"}). Stdout(ctx) require.NoError(t, err) require.Regexp(t, regexp.MustCompile(`-rw-r--r--\s+1 root\s+root\s+\d+ Oct 26 1985 some-file`), ls) require.Regexp(t, regexp.MustCompile(`drwxr-xr-x\s+2 root\s+root\s+\d+ Oct 26 1985 sub-dir`), ls) require.Regexp(t, regexp.MustCompile(`-rw-r--r--\s+1 root\s+root\s+\d+ Oct 26 1985 sub-file`), ls) }) t.Run("results in stable tar archiving", func(t *testing.T) { content, err := c.Container(). From("alpine:3.16.2"). WithMountedDirectory("/dir", dir). WithEnvVariable("RANDOM", identity.NewID()). WithExec([]string{"sh", "-c", "tar -cf - -C /dir * | sha256sum -"}). Stdout(ctx) require.NoError(t, err) require.Contains(t, content, "5f70bf18a086007016e948b04aed3b82103a36bea41755b6cddfaf10ace3c6ef") }) } func TestDirectoryWithoutDirectoryWithoutFile(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3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9fSwic2hhMjU2OmUxODE1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
t.Parallel() ctx := context.Background() c, err := dagger.Connect(ctx) require.NoError(t, err) defer c.Close() dir1 := c.Directory(). WithNewFile("some-file", "some-content"). WithNewFile("some-dir/sub-file", "sub-content") entries, err := dir1. WithoutDirectory("some-dir"). Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"some-file"}, entries) dir := c.Directory(). WithNewFile("foo.txt", "foo"). WithNewFile("a/bar.txt", "bar"). WithNewFile("a/data.json", "{\"datum\": 10}"). WithNewFile("b/foo.txt", "foo"). WithNewFile("b/bar.txt", "bar"). WithNewFile("b/data.json", "{\"datum\": 10}"). WithNewFile("c/file-a1.txt", "file-a1.txt"). WithNewFile("c/file-a1.json", "file-a1.json"). WithNewFile("c/file-b1.txt", "file-b1.txt"). WithNewFile("c/file-b1.json", "file-b1.json") entries, err = dir.Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"a", "b", "c", "foo.txt"}, entries) entries, err = dir. WithoutDirectory("a"). Entries(ctx)
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4dGJXRnVhV1psYzNSeldnQT0iLCJDa2tLUjNOb1lUSTFOam96TlRaaE16azVNakprTXpsak4yVmpOVEkzWVRnNE5ERmtZMlkwWkRFek9UTTVNRGsyTnpGaFpHUTFPRFZtWXpJNFpqa3hNRGMyTm1Kak5XTmtNemt3SWlzU0tRai8vLy8vLy8vLy8vOEJJaHdLQVM4U0FTOGcvLy8vLy8vLy8vLy9BVmovLy8vLy8vLy8vLzhCVWc0S0JXRnliVFkwRWdWc2FXNTFlRm9BIiwiQ2trS1IzTm9ZVEkxTmpwaU9ERTVZVFEyWkRjek16ZzVPV00zWXpjMllqWmtZamRrWmpBeU5qZzVNekEyWTJSaU1UZzFNV0ZqWldNMlpERTNZVEF5WVRRMk1XUTFZVGMxTmpFeCJdLCJtZXRhZGF0YSI6eyJzaGEyNTY6MzU2YTM5OTIyZDM5YzdlYzUyN2E4ODQxZGNmNGQxMzkzOTA5NjcxYWRkNTg1ZmMyOGY5MTA3NjZiYzVjZDM5MCI6eyJjYXBzIjp7InNvdXJjZS5sb2NhbCI6dHJ1ZSwic291cmNlLmxvY2FsLnNoYXJlZGtleWhpbnQiOnRydWUsInNvdXJjZS5sb2NhbC51bmlxdWUiOnRydWV9fSwic2hhMjU2OmI4MTlhNDZkNzMzODk5YzdjNzZiNmRiN2RmMDI2ODkzMDZjZGIxODUxYWNlYzZkMTdhMDJhNDYxZDVhNzU2MTEiOnsiY2FwcyI6eyJmaWxlLmJhc2UiOnRydWV9fSwic2hhMjU2OmUxODE1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
require.NoError(t, err) require.Equal(t, []string{"b", "c", "foo.txt"}, entries) entries, err = dir. WithoutFile("b/*.txt"). Entries(ctx, dagger.DirectoryEntriesOpts{Path: "b"}) require.NoError(t, err) require.Equal(t, []string{"data.json"}, entries) entries, err = dir. WithoutFile("c/*a1*"). Entries(ctx, dagger.DirectoryEntriesOpts{Path: "c"}) require.NoError(t, err) require.Equal(t, []string{"file-b1.json", "file-b1.txt"}, entries) dirDir := c.Directory(). WithNewFile("foo.txt", "foo"). WithNewFile("a1/a1-file", "a1-file"). WithNewFile("a2/a2-file", "a2-file"). WithNewFile("b1/b1-file", "b1-file") entries, err = dirDir.WithoutDirectory("a*").Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"b1", "foo.txt"}, entries) filesDir := c.Directory(). WithNewFile("some-file", "some-content"). WithNewFile("some-dir/sub-file", "sub-content"). WithoutFile("some-file") entries, err = filesDir.Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"some-dir"}, entries) } func TestDirectoryDiff(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMk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lZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
t.Parallel() aID := newDirWithFile(t, "a-file", "a-content") bID := newDirWithFile(t, "b-file", "b-content") var res struct { Directory struct { Diff struct { Entries []string } } } diff := `query Diff($id: DirectoryID!, $other: DirectoryID!) { directory(id: $id) { diff(other: $other) { entries } } }` err := testutil.Query(diff, &res, &testutil.QueryOptions{ Variables: map[string]any{ "id": aID,
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMk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NlYzZkMTdhMDJhNDYxZDVhNzU2MTEiOnsiY2FwcyI6eyJmaWxlLmJhc2UiOnRydWV9fSwic2hhMjU2OmUxODE1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
"other": bID, }, }) require.NoError(t, err) require.Equal(t, []string{"b-file"}, res.Directory.Diff.Entries) err = testutil.Query(diff, &res, &testutil.QueryOptions{ Variables: map[string]any{ "id": bID, "other": aID, }, }) require.NoError(t, err) require.Equal(t, []string{"a-file"}, res.Directory.Diff.Entries) /* This triggers a nil panic in Buildkit! Issue: https://github.com/dagger/dagger/issues/3337 This might be fixed once we update Buildkit. err = testutil.Query(diff, &res, &testutil.QueryOptions{ Variables: map[string]any{ "id": aID, "other": aID, }, }) require.NoError(t, err) require.Empty(t, res.Directory.Diff.Entries) */ } func TestDirectoryExport(t *testing.T) { t.Parallel() ctx := context.Background()
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4dGJXRnVhV1psYzNSeldnQT0iLCJDa2tLUjNOb1lUSTFOam96TlRaaE16azVNakprTXpsak4yVmpOVEkzWVRnNE5ERmtZMlkwWkRFek9UTTVNRGsyTnpGaFpHUTFPRFZtWXpJNFpqa3hNRGMyTm1Kak5XTmtNemt3SWlzU0tRai8vLy8vLy8vLy8vOEJJaHdLQVM4U0FTOGcvLy8vLy8vLy8vLy9BVmovLy8vLy8vLy8vLzhCVWc0S0JXRnliVFkwRWdWc2FXNTFlRm9BIiwiQ2trS1IzTm9ZVEkxTmpwaU9ERTVZVFEyWkRjek16ZzVPV00zWXpjMllqWmtZamRrWmpBeU5qZzVNekEyWTJSaU1UZzFNV0ZqWldNMlpERTNZVEF5WVRRMk1XUTFZVGMxTmpFeCJdLCJtZXRhZGF0YSI6eyJzaGEyNTY6MzU2YTM5OTIyZDM5YzdlYzUyN2E4ODQxZGNmNGQxMzkzOTA5NjcxYWRkNTg1ZmMyOGY5MTA3NjZiYzVjZDM5MCI6eyJjYXBzIjp7InNvdXJjZS5sb2NhbCI6dHJ1ZSwic291cmNlLmxvY2FsLnNoYXJlZGtleWhpbnQiOnRydWUsInNvdXJjZS5sb2NhbC51bmlxdWUiOnRydWV9fSwic2hhMjU2OmI4MTlhNDZkNzMzODk5YzdjNzZiNmRiN2RmMDI2ODkzMDZjZGIxODUxYWNlYzZkMTdhMDJhNDYxZDVhNzU2MTEiOnsiY2FwcyI6eyJmaWxlLmJhc2UiOnRydWV9fSwic2hhMjU2OmUxODE1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
wd := t.TempDir() dest := t.TempDir() c, err := dagger.Connect(ctx, dagger.WithWorkdir(wd)) require.NoError(t, err) defer c.Close() dir := c.Container().From("alpine:3.16.2").Directory("/etc/profile.d") t.Run("to absolute dir", func(t *testing.T) { ok, err := dir.Export(ctx, dest) require.NoError(t, err) require.True(t, ok) entries, err := ls(dest) require.NoError(t, err) require.Equal(t, []string{"README", "color_prompt.sh.disabled", "locale.sh"}, entries) }) t.Run("to workdir", func(t *testing.T) { ok, err := dir.Export(ctx, ".") require.NoError(t, err) require.True(t, ok) entries, err := ls(wd) require.NoError(t, err) require.Equal(t, []string{"README", "color_prompt.sh.disabled", "locale.sh"}, entries) }) t.Run("to outer dir", func(t *testing.T) { ok, err := dir.Export(ctx, "../") require.Error(t, err) require.False(t, ok) }) } func TestDirectoryDockerBuild(t *testing.T) { ctx := context.Background()
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMk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jMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
c, err := dagger.Connect(ctx) require.NoError(t, err) defer c.Close() contextDir := c.Directory(). WithNewFile("main.go", `package main import "fmt" import "os" func main() { for _, env := range os.Environ() { fmt.Println(env) } }`) t.Run("default Dockerfile location", func(t *testing.T) { src := contextDir. WithNewFile("Dockerfile", `FROM golang:1.18.2-alpine WORKDIR /src COPY main.go . RUN go mod init hello RUN go build -o /usr/bin/goenv main.go ENV FOO=bar CMD goenv `) env, err := src.DockerBuild().WithExec([]string{}).Stdout(ctx) require.NoError(t, err) require.Contains(t, env, "FOO=bar\n") }) t.Run("custom Dockerfile location", func(t *testing.T) { src := contextDir.
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZ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maWxlLmJhc2UiOnRydWV9fSwic2hhMjU2OmUxODE1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
WithNewFile("subdir/Dockerfile.whee", `FROM golang:1.18.2-alpine WORKDIR /src COPY main.go . RUN go mod init hello RUN go build -o /usr/bin/goenv main.go ENV FOO=bar CMD goenv `) env, err := src.DockerBuild(dagger.DirectoryDockerBuildOpts{ Dockerfile: "subdir/Dockerfile.whee", }).WithExec([]string{}).Stdout(ctx) require.NoError(t, err) require.Contains(t, env, "FOO=bar\n") }) t.Run("subdirectory with default Dockerfile location", func(t *testing.T) { src := contextDir. WithNewFile("Dockerfile", `FROM golang:1.18.2-alpine WORKDIR /src COPY main.go . RUN go mod init hello RUN go build -o /usr/bin/goenv main.go ENV FOO=bar CMD goenv `) sub := c.Directory().WithDirectory("subcontext", src).Directory("subcontext") env, err := sub.DockerBuild().WithExec([]string{}).Stdout(ctx) require.NoError(t, err) require.Contains(t, env, "FOO=bar\n")
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc1a0wyOXRibWxoTDJKMWFXeGtMMkZ5WjI4dGJXRnVhV1psYzNSeldnQT0iLCJDa2tLUjNOb1lUSTFOam96TlRaaE16azVNakprTXpsak4yVmpOVEkzWVRnNE5ERmtZMlkwWkRFek9UTTVNRGsyTnpGaFpHUTFPRFZtWXpJNFpqa3hNRGMyTm1Kak5XTmtNemt3SWlzU0tRai8vLy8vLy8vLy8vOEJJaHdLQVM4U0FTOGcvLy8vLy8vLy8vLy9BVmovLy8vLy8vLy8vLzhCVWc0S0JXRnliVFkwRWdWc2FXNTFlRm9BIiwiQ2trS1IzTm9ZVEkxTmpwaU9ERTVZVFEyWkRjek16ZzVPV00zWXpjMllqWmtZamRrWmpBeU5qZzVNekEyWTJSaU1UZzFNV0ZqWldNMlpERTNZVEF5WVRRMk1XUTFZVGMxTmpFeCJdLCJtZXRhZGF0YSI6eyJzaGEyNTY6MzU2YTM5OTIyZDM5YzdlYzUyN2E4ODQxZGNmNGQxMzkzOTA5NjcxYWRkNTg1ZmMyOGY5MTA3NjZiYzVjZDM5MCI6eyJjYXBzIjp7InNvdXJjZS5sb2NhbCI6dHJ1ZSwic291cmNlLmxvY2FsLnNoYXJlZGtleWhpbnQiOnRydWUsInNvdXJjZS5sb2NhbC51bmlxdWUiOnRydWV9fSwic2hhMjU2OmI4MTlhNDZkNzMzODk5YzdjNzZiNmRiN2RmMDI2ODkzMDZjZGIxODUxYWNlYzZkMTdhMDJhNDYxZDVhNzU2MTEiOnsiY2FwcyI6eyJmaWxlLmJhc2UiOnRydWV9fSwic2hhMjU2OmUxODE1ZjUyYzk1MzllMzNmODY1ZDU0OTQ4YTk4MDYxNmM1ZjExZjM0MjZlNzc5YTFlZDgzOThiMmY0NWI4M2MiOnsiY2FwcyI6eyJjb25zdHJhaW50cyI6dHJ1ZSwicGxhdGZvcm0iOnRydWV9fX0sIlNvdXJjZSI6eyJsb2NhdGlvbnMiOnsic2hhMjU2OjM1NmEzOTkyMmQzOWM3ZWM1MjdhODg0MWRjZjRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
}) t.Run("subdirectory with custom Dockerfile location", func(t *testing.T) { src := contextDir. WithNewFile("subdir/Dockerfile.whee", `FROM golang:1.18.2-alpine WORKDIR /src COPY main.go . RUN go mod init hello RUN go build -o /usr/bin/goenv main.go ENV FOO=bar CMD goenv `) sub := c.Directory().WithDirectory("subcontext", src).Directory("subcontext") env, err := sub.DockerBuild(dagger.DirectoryDockerBuildOpts{ Dockerfile: "subdir/Dockerfile.whee", }).WithExec([]string{}).Stdout(ctx) require.NoError(t, err) require.Contains(t, env, "FOO=bar\n") }) t.Run("with build args", func(t *testing.T) { src := contextDir. WithNewFile("Dockerfile", `FROM golang:1.18.2-alpine ARG FOOARG=bar WORKDIR /src COPY main.go . RUN go mod init hello RUN go build -o /usr/bin/goenv main.go ENV FOO=$FOOARG CMD goenv
closed
dagger/dagger
https://github.com/dagger/dagger
4,190
Enforce size limit on paths in engine
If you provide a path that exceeds a certain length you will get an error from buildkit like ``` ClientError: lstat /var/lib/buildkit/runc-overlayfs/cachemounts/buildkit1109656980/app/eyJsbGIiOnsiZGVmIjpbIkdvSUNDa2xzYjJOaGJEb3ZMeTlWYzJWeWN5OXNaVzl6YW05aVpYSm5MME52WkdVdmFtOWlhV3hzWVM5aVlXTnJaVzVrTDI5dGJtbGhMMkoxYVd4a0wyRnlaMjh0YldGdWFXWmxjM1J6RWwwS0UyeHZZMkZzTG5Ob1lYSmxaR3RsZVdocGJuUVNSbWh2YzNRNkwxVnpaWEp6TDJ4bGIzTnFiMkpsY21jdlEyOWtaUzlxYjJKcGJHeGhMMkpoWTJ0bGJtUXZiMjF1YVdFdlluVnBiR1F2WVhKbmJ5MXRZVzVwWm1WemRITVNWZ29NYkc5allXd3VkVzVwY1hWbEVrWm9iM04wT2k5VmMyVnljeTlzWlc5emFtOWlaWEpuTDBOdlpHVXZhbTlpYVd4c1lTOWlZV05yWlc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jRkMTM5MzkwOTY3MWFkZDU4NWZjMjhmOTEwNzY2YmM1Y2QzOTAiOnt9LCJzaGEyNTY6YjgxOWE0NmQ3MzM4OTljN2M3NmI2ZGI3ZGYwMjY4OTMwNmNkYjE4NTFhY2VjNmQxN2EwMmE0NjFkNWE3NTYxMSI6e319fX0sImRpciI6IiIsInBsYXRmb3JtIjp7ImFyY2hpdGVjdHVyZSI6ImFybTY0Iiwib3MiOiJsaW51eCJ9fQ==: file name too long ``` This is not very clear to end users though since it is a path that buildkit itself is trying to mount, not the exact path that the user specified. We should instead enforce the size limit in our engine code and return a more clear error message.
https://github.com/dagger/dagger/issues/4190
https://github.com/dagger/dagger/pull/4654
78f8c1050bed0ec349dbf3be27398c4955136439
253e3b227216468202a5b512838a77bd4315ed06
2022-12-13T22:23:18Z
go
2023-02-28T23:42:33Z
core/integration/directory_test.go
`) env, err := c.Container().Build(src).WithExec([]string{}).Stdout(ctx) require.NoError(t, err) require.Contains(t, env, "FOO=bar\n") env, err = c.Container().Build(src, dagger.ContainerBuildOpts{BuildArgs: []dagger.BuildArg{{Name: "FOOARG", Value: "barbar"}}}).WithExec([]string{}).Stdout(ctx) require.NoError(t, err) require.Contains(t, env, "FOO=barbar\n") }) t.Run("with target", func(t *testing.T) { src := contextDir. WithNewFile("Dockerfile", `FROM golang:1.18.2-alpine AS base CMD echo "base" FROM base AS stage1 CMD echo "stage1" FROM base AS stage2 CMD echo "stage2" `) output, err := src.DockerBuild().WithExec([]string{}).Stdout(ctx) require.NoError(t, err) require.Contains(t, output, "stage2\n") output, err = src.DockerBuild(dagger.DirectoryDockerBuildOpts{ Target: "stage1", }).WithExec([]string{}).Stdout(ctx) require.NoError(t, err) require.Contains(t, output, "stage1\n") require.NotContains(t, output, "stage2\n") }) }
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
package main import ( "context" "crypto/tls" "crypto/x509" "fmt" "net" "os" "os/user" "path/filepath" "sort" "strconv" "strings" "time" "github.com/containerd/containerd/pkg/seed" "github.com/containerd/containerd/pkg/userns" "github.com/containerd/containerd/platforms" "github.com/containerd/containerd/remotes/docker" "github.com/containerd/containerd/sys"
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
sddaemon "github.com/coreos/go-systemd/v22/daemon" daggerremotecache "github.com/dagger/dagger/engine/remotecache" "github.com/docker/docker/pkg/reexec" "github.com/gofrs/flock" grpc_middleware "github.com/grpc-ecosystem/go-grpc-middleware" "github.com/moby/buildkit/cache/remotecache" "github.com/moby/buildkit/client" "github.com/moby/buildkit/cmd/buildkitd/config" "github.com/moby/buildkit/control" "github.com/moby/buildkit/executor/oci" "github.com/moby/buildkit/frontend" dockerfile "github.com/moby/buildkit/frontend/dockerfile/builder" "github.com/moby/buildkit/frontend/gateway" "github.com/moby/buildkit/frontend/gateway/forwarder" "github.com/moby/buildkit/session" "github.com/moby/buildkit/solver/bboltcachestorage" "github.com/moby/buildkit/util/apicaps" "github.com/moby/buildkit/util/appcontext" "github.com/moby/buildkit/util/appdefaults" "github.com/moby/buildkit/util/archutil" "github.com/moby/buildkit/util/bklog" "github.com/moby/buildkit/util/grpcerrors" "github.com/moby/buildkit/util/profiler" "github.com/moby/buildkit/util/resolver" "github.com/moby/buildkit/util/stack" "github.com/moby/buildkit/util/tracing/detect" _ "github.com/moby/buildkit/util/tracing/detect/jaeger" _ "github.com/moby/buildkit/util/tracing/env" "github.com/moby/buildkit/util/tracing/transform" "github.com/moby/buildkit/version"
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
"github.com/moby/buildkit/worker" ocispecs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/pkg/errors" "github.com/sirupsen/logrus" "github.com/urfave/cli" "go.etcd.io/bbolt" "go.opentelemetry.io/contrib/instrumentation/google.golang.org/grpc/otelgrpc" "go.opentelemetry.io/otel/propagation" sdktrace "go.opentelemetry.io/otel/sdk/trace" "go.opentelemetry.io/otel/trace" tracev1 "go.opentelemetry.io/proto/otlp/collector/trace/v1" "golang.org/x/sync/errgroup" "google.golang.org/grpc" ) const ( autoMode = "auto" ) func init() { apicaps.ExportedProduct = "buildkit" stack.SetVersionInfo(version.Version, version.Revision) seed.WithTimeAndRand() if reexec.Init() { os.Exit(0) } detect.Recorder = detect.NewTraceRecorder() } var propagators = propagation.NewCompositeTextMapPropagator(propagation.TraceContext{}, propagation.Baggage{}) type workerInitializerOpt struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
config *config.Config sessionManager *session.Manager traceSocket string } type workerInitializer struct { fn func(c *cli.Context, common workerInitializerOpt) ([]worker.Worker, error) priority int } var ( appFlags []cli.Flag workerInitializers []workerInitializer ) func registerWorkerInitializer(wi workerInitializer, flags ...cli.Flag) { workerInitializers = append(workerInitializers, wi) sort.Slice(workerInitializers, func(i, j int) bool { return workerInitializers[i].priority < workerInitializers[j].priority }) appFlags = append(appFlags, flags...) } func main() { cli.VersionPrinter = func(c *cli.Context) { fmt.Println(c.App.Name, version.Package, c.App.Version, version.Revision) } app := cli.NewApp() app.Name = "buildkitd" app.Usage = "build daemon"
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
app.Version = version.Version defaultConf, err := defaultConf() if err != nil { fmt.Fprintf(os.Stderr, "%+v\n", err) os.Exit(1) } rootlessUsage := "set all the default options to be compatible with rootless containers" if userns.RunningInUserNS() { app.Flags = append(app.Flags, cli.BoolTFlag{ Name: "rootless", Usage: rootlessUsage + " (default: true)", }) } else { app.Flags = append(app.Flags, cli.BoolFlag{ Name: "rootless", Usage: rootlessUsage, }) } groupValue := func(gid *int) string { if gid == nil { return "" } return strconv.Itoa(*gid) } app.Flags = append(app.Flags, cli.StringFlag{ Name: "config", Usage: "path to config file", Value: defaultConfigPath(), },
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
cli.BoolFlag{ Name: "debug", Usage: "enable debug output in logs", }, cli.StringFlag{ Name: "root", Usage: "path to state directory", Value: defaultConf.Root, }, cli.StringSliceFlag{ Name: "addr", Usage: "listening address (socket or tcp)", Value: &cli.StringSlice{defaultConf.GRPC.Address[0]}, }, cli.StringFlag{ Name: "group", Usage: "group (name or gid) which will own all Unix socket listening addresses", Value: groupValue(defaultConf.GRPC.GID), }, cli.StringFlag{ Name: "debugaddr", Usage: "debugging address (eg. 0.0.0.0:6060)", Value: defaultConf.GRPC.DebugAddress, }, cli.StringFlag{ Name: "tlscert", Usage: "certificate file to use", Value: defaultConf.GRPC.TLS.Cert, }, cli.StringFlag{
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
Name: "tlskey", Usage: "key file to use", Value: defaultConf.GRPC.TLS.Key, }, cli.StringFlag{ Name: "tlscacert", Usage: "ca certificate to verify clients", Value: defaultConf.GRPC.TLS.CA, }, cli.StringSliceFlag{ Name: "allow-insecure-entitlement", Usage: "allows insecure entitlements e.g. network.host, security.insecure", }, ) app.Flags = append(app.Flags, appFlags...) app.Action = func(c *cli.Context) error { if os.Geteuid() > 0 { return errors.New("rootless mode requires to be executed as the mapped root in a user namespace; you may use RootlessKit for setting up the namespace") } ctx, cancel := context.WithCancel(appcontext.Context()) defer cancel() cfg, err := config.LoadFile(c.GlobalString("config")) if err != nil { return err } setDefaultConfig(&cfg) if err := applyMainFlags(c, &cfg); err != nil { return err
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
} logrus.SetFormatter(&logrus.TextFormatter{FullTimestamp: true}) if cfg.Debug { logrus.SetLevel(logrus.DebugLevel) } if cfg.GRPC.DebugAddress != "" { if err := setupDebugHandlers(cfg.GRPC.DebugAddress); err != nil { return err } } tp, err := detect.TracerProvider() if err != nil { return err } streamTracer := otelgrpc.StreamServerInterceptor(otelgrpc.WithTracerProvider(tp), otelgrpc.WithPropagators(propagators)) unary := grpc_middleware.ChainUnaryServer(unaryInterceptor(ctx, tp), grpcerrors.UnaryServerInterceptor) stream := grpc_middleware.ChainStreamServer(streamTracer, grpcerrors.StreamServerInterceptor) opts := []grpc.ServerOption{grpc.UnaryInterceptor(unary), grpc.StreamInterceptor(stream)} server := grpc.NewServer(opts...) root, err := filepath.Abs(cfg.Root) if err != nil { return err } cfg.Root = root if err := os.MkdirAll(root, 0700); err != nil { return errors.Wrapf(err, "failed to create %s", root) } lockPath := filepath.Join(root, "buildkitd.lock") lock := flock.New(lockPath)
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
locked, err := lock.TryLock() if err != nil { return errors.Wrapf(err, "could not lock %s", lockPath) } if !locked { return errors.Errorf("could not lock %s, another instance running?", lockPath) } defer func() { lock.Unlock() os.RemoveAll(lockPath) }() controller, err := newController(c, &cfg) if err != nil { return err } defer controller.Close() controller.Register(server) ents := c.GlobalStringSlice("allow-insecure-entitlement") if len(ents) > 0 { cfg.Entitlements = []string{} for _, e := range ents { switch e { case "security.insecure": cfg.Entitlements = append(cfg.Entitlements, e) case "network.host": cfg.Entitlements = append(cfg.Entitlements, e) default: return errors.Errorf("invalid entitlement : %s", e) } }
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
} errCh := make(chan error, 1) if err := serveGRPC(cfg.GRPC, server, errCh); err != nil { return err } select { case serverErr := <-errCh: err = serverErr cancel() case <-ctx.Done(): err = ctx.Err() } bklog.G(ctx).Infof("stopping server") if os.Getenv("NOTIFY_SOCKET") != "" { notified, notifyErr := sddaemon.SdNotify(false, sddaemon.SdNotifyStopping) bklog.G(ctx).Debugf("SdNotifyStopping notified=%v, err=%v", notified, notifyErr) } server.GracefulStop() return err } app.After = func(_ *cli.Context) error { return detect.Shutdown(context.TODO()) } profiler.Attach(app) if err := app.Run(os.Args); err != nil { fmt.Fprintf(os.Stderr, "buildkitd: %+v\n", err) os.Exit(1) } } func serveGRPC(cfg config.GRPCConfig, server *grpc.Server, errCh chan error) error {
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
addrs := cfg.Address if len(addrs) == 0 { return errors.New("--addr cannot be empty") } tlsConfig, err := serverCredentials(cfg.TLS) if err != nil { return err } eg, _ := errgroup.WithContext(context.Background()) listeners := make([]net.Listener, 0, len(addrs)) for _, addr := range addrs { l, err := getListener(addr, *cfg.UID, *cfg.GID, tlsConfig) if err != nil { for _, l := range listeners { l.Close() } return err } listeners = append(listeners, l) } if os.Getenv("NOTIFY_SOCKET") != "" { notified, notifyErr := sddaemon.SdNotify(false, sddaemon.SdNotifyReady) logrus.Debugf("SdNotifyReady notified=%v, err=%v", notified, notifyErr) } for _, l := range listeners { func(l net.Listener) { eg.Go(func() error {
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
defer l.Close() logrus.Infof("running server on %s", l.Addr()) return server.Serve(l) }) }(l) } go func() { errCh <- eg.Wait() }() return nil } func defaultConfigPath() string { if userns.RunningInUserNS() { return filepath.Join(appdefaults.UserConfigDir(), "buildkitd.toml") } return filepath.Join(appdefaults.ConfigDir, "buildkitd.toml") } func defaultConf() (config.Config, error) { cfg, err := config.LoadFile(defaultConfigPath()) if err != nil { var pe *os.PathError if !errors.As(err, &pe) { return config.Config{}, err } logrus.Warnf("failed to load default config: %v", err) } setDefaultConfig(&cfg) return cfg, nil } func setDefaultNetworkConfig(nc config.NetworkConfig) config.NetworkConfig {
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
if nc.Mode == "" { nc.Mode = autoMode } if nc.CNIConfigPath == "" { nc.CNIConfigPath = appdefaults.DefaultCNIConfigPath } if nc.CNIBinaryPath == "" { nc.CNIBinaryPath = appdefaults.DefaultCNIBinDir } return nc } func setDefaultConfig(cfg *config.Config) { orig := *cfg if cfg.Root == "" { cfg.Root = appdefaults.Root } if len(cfg.GRPC.Address) == 0 { cfg.GRPC.Address = []string{appdefaults.Address} } if cfg.Workers.OCI.Platforms == nil { cfg.Workers.OCI.Platforms = formatPlatforms(archutil.SupportedPlatforms(false)) } if cfg.Workers.Containerd.Platforms == nil { cfg.Workers.Containerd.Platforms = formatPlatforms(archutil.SupportedPlatforms(false)) } cfg.Workers.OCI.NetworkConfig = setDefaultNetworkConfig(cfg.Workers.OCI.NetworkConfig)
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
cfg.Workers.Containerd.NetworkConfig = setDefaultNetworkConfig(cfg.Workers.Containerd.NetworkConfig) if userns.RunningInUserNS() { if u := os.Getenv("USER"); u != "" && u != "root" { if orig.Root == "" { cfg.Root = appdefaults.UserRoot() } if len(orig.GRPC.Address) == 0 { cfg.GRPC.Address = []string{appdefaults.UserAddress()} } appdefaults.EnsureUserAddressDir() } } } func applyMainFlags(c *cli.Context, cfg *config.Config) error { if c.IsSet("debug") { cfg.Debug = c.Bool("debug") } if c.IsSet("root") { cfg.Root = c.String("root") } if c.IsSet("addr") || len(cfg.GRPC.Address) == 0 { cfg.GRPC.Address = c.StringSlice("addr") } if c.IsSet("allow-insecure-entitlement") { cfg.Entitlements = c.StringSlice("allow-insecure-entitlement") }
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
if c.IsSet("debugaddr") { cfg.GRPC.DebugAddress = c.String("debugaddr") } if cfg.GRPC.UID == nil { uid := os.Getuid() cfg.GRPC.UID = &uid } if cfg.GRPC.GID == nil { gid := os.Getgid() cfg.GRPC.GID = &gid } if group := c.String("group"); group != "" { gid, err := grouptoGID(group) if err != nil { return err } cfg.GRPC.GID = &gid } if tlscert := c.String("tlscert"); tlscert != "" { cfg.GRPC.TLS.Cert = tlscert } if tlskey := c.String("tlskey"); tlskey != "" { cfg.GRPC.TLS.Key = tlskey } if tlsca := c.String("tlscacert"); tlsca != "" { cfg.GRPC.TLS.CA = tlsca } return nil } func grouptoGID(group string) (int, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
if group == "" { return os.Getgid(), nil } var ( err error id int ) if id, err = strconv.Atoi(group); err == nil { return id, nil } else if err.(*strconv.NumError).Err != strconv.ErrSyntax { return 0, err } ginfo, err := user.LookupGroup(group) if err != nil { return 0, err } group = ginfo.Gid if id, err = strconv.Atoi(group); err != nil { return 0, err } return id, nil } func getListener(addr string, uid, gid int, tlsConfig *tls.Config) (net.Listener, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
addrSlice := strings.SplitN(addr, "://", 2) if len(addrSlice) < 2 { return nil, errors.Errorf("address %s does not contain proto, you meant unix://%s ?", addr, addr) } proto := addrSlice[0] listenAddr := addrSlice[1] switch proto { case "unix", "npipe": if tlsConfig != nil { logrus.Warnf("TLS is disabled for %s", addr) } return sys.GetLocalListener(listenAddr, uid, gid) case "fd": return listenFD(listenAddr, tlsConfig) case "tcp": l, err := net.Listen("tcp", listenAddr) if err != nil { return nil, err } if tlsConfig == nil { logrus.Warnf("TLS is not enabled for %s. enabling mutual TLS authentication is highly recommended", addr) return l, nil } return tls.NewListener(l, tlsConfig), nil default: return nil, errors.Errorf("addr %s not supported", addr) } } func unaryInterceptor(globalCtx context.Context, tp trace.TracerProvider) grpc.UnaryServerInterceptor {
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
withTrace := otelgrpc.UnaryServerInterceptor(otelgrpc.WithTracerProvider(tp), otelgrpc.WithPropagators(propagators)) return func(ctx context.Context, req interface{}, info *grpc.UnaryServerInfo, handler grpc.UnaryHandler) (resp interface{}, err error) { ctx, cancel := context.WithCancel(ctx) defer cancel() go func() { select { case <-ctx.Done(): case <-globalCtx.Done(): cancel() } }() if strings.HasSuffix(info.FullMethod, "opentelemetry.proto.collector.trace.v1.TraceService/Export") { return handler(ctx, req) } resp, err = withTrace(ctx, req, info, handler) if err != nil { logrus.Errorf("%s returned error: %v", info.FullMethod, err) if logrus.GetLevel() >= logrus.DebugLevel { fmt.Fprintf(os.Stderr, "%+v", stack.Formatter(grpcerrors.FromGRPC(err))) } } return } } func serverCredentials(cfg config.TLSConfig) (*tls.Config, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
certFile := cfg.Cert keyFile := cfg.Key caFile := cfg.CA if certFile == "" && keyFile == "" { return nil, nil } err := errors.New("you must specify key and cert file if one is specified") if certFile == "" { return nil, err } if keyFile == "" { return nil, err
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
} certificate, err := tls.LoadX509KeyPair(certFile, keyFile) if err != nil { return nil, errors.Wrap(err, "could not load server key pair") } tlsConf := &tls.Config{ Certificates: []tls.Certificate{certificate}, MinVersion: tls.VersionTLS12, } if caFile != "" { certPool := x509.NewCertPool() ca, err := os.ReadFile(caFile) if err != nil { return nil, errors.Wrap(err, "could not read ca certificate") } if ok := certPool.AppendCertsFromPEM(ca); !ok { return nil, errors.New("failed to append ca cert") } tlsConf.ClientAuth = tls.RequireAndVerifyClientCert tlsConf.ClientCAs = certPool } return tlsConf, nil } func newController(c *cli.Context, cfg *config.Config) (*control.Controller, error) { sessionManager, err := session.NewManager() if err != nil { return nil, err } tc, err := detect.Exporter()
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
if err != nil { return nil, err } var traceSocket string if tc != nil { traceSocket = filepath.Join(cfg.Root, "otel-grpc.sock") if err := runTraceController(traceSocket, tc); err != nil { logrus.Warnf("failed set up otel-grpc controller: %v", err) traceSocket = "" } } wc, err := newWorkerController(c, workerInitializerOpt{ config: cfg, sessionManager: sessionManager, traceSocket: traceSocket, }) if err != nil { return nil, err } frontends := map[string]frontend.Frontend{} frontends["dockerfile.v0"] = forwarder.NewGatewayForwarder(wc, dockerfile.Build) frontends["gateway.v0"] = gateway.NewGatewayFrontend(wc) cacheStorage, err := bboltcachestorage.NewStore(filepath.Join(cfg.Root, "cache.db")) if err != nil { return nil, err } historyDB, err := bbolt.Open(filepath.Join(cfg.Root, "history.db"), 0600, nil) if err != nil { return nil, err }
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
resolverFn := resolverFunc(cfg) w, err := wc.GetDefault() if err != nil { return nil, err } remoteCacheExporterFuncs := map[string]remotecache.ResolveCacheExporterFunc{ "dagger": daggerremotecache.ResolveCacheExporterFunc(sessionManager, resolverFn), } remoteCacheImporterFuncs := map[string]remotecache.ResolveCacheImporterFunc{ "dagger": daggerremotecache.ResolveCacheImporterFunc(sessionManager, w.ContentStore(), resolverFn), } return control.NewController(control.Opt{ SessionManager: sessionManager, WorkerController: wc, Frontends: frontends, ResolveCacheExporterFuncs: remoteCacheExporterFuncs, ResolveCacheImporterFuncs: remoteCacheImporterFuncs, CacheKeyStorage: cacheStorage, Entitlements: cfg.Entitlements, TraceCollector: tc, HistoryDB: historyDB, LeaseManager: w.LeaseManager(), ContentStore: w.ContentStore(), HistoryConfig: cfg.History, }) } func resolverFunc(cfg *config.Config) docker.RegistryHosts { return resolver.NewRegistryConfig(cfg.Registries) } func newWorkerController(c *cli.Context, wiOpt workerInitializerOpt) (*worker.Controller, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
wc := &worker.Controller{} nWorkers := 0 for _, wi := range workerInitializers { ws, err := wi.fn(c, wiOpt) if err != nil { return nil, err } for _, w := range ws { p := w.Platforms(false) logrus.Infof("found worker %q, labels=%v, platforms=%v", w.ID(), w.Labels(), formatPlatforms(p)) archutil.WarnIfUnsupported(p) if err = wc.Add(w); err != nil { return nil, err } nWorkers++ } } if nWorkers == 0 { return nil, errors.New("no worker found, rebuild the buildkit daemon?") } defaultWorker, err := wc.GetDefault() if err != nil { return nil, err } logrus.Infof("found %d workers, default=%q", nWorkers, defaultWorker.ID()) logrus.Warn("currently, only the default worker can be used.") return wc, nil } func attrMap(sl []string) (map[string]string, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
m := map[string]string{} for _, v := range sl { parts := strings.SplitN(v, "=", 2) if len(parts) != 2 { return nil, errors.Errorf("invalid value %s", v) } m[parts[0]] = parts[1] } return m, nil } func formatPlatforms(p []ocispecs.Platform) []string { str := make([]string, 0, len(p)) for _, pp := range p { str = append(str, platforms.Format(platforms.Normalize(pp))) } return str } func parsePlatforms(platformsStr []string) ([]ocispecs.Platform, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
out := make([]ocispecs.Platform, 0, len(platformsStr)) for _, s := range platformsStr { p, err := platforms.Parse(s) if err != nil { return nil, err } out = append(out, platforms.Normalize(p)) } return out, nil } func getGCPolicy(cfg config.GCConfig, root string) []client.PruneInfo { if cfg.GC != nil && !*cfg.GC { return nil } if len(cfg.GCPolicy) == 0 { cfg.GCPolicy = config.DefaultGCPolicy(root, cfg.GCKeepStorage) } out := make([]client.PruneInfo, 0, len(cfg.GCPolicy)) for _, rule := range cfg.GCPolicy { out = append(out, client.PruneInfo{ Filter: rule.Filters, All: rule.All, KeepBytes: rule.KeepBytes, KeepDuration: time.Duration(rule.KeepDuration) * time.Second, }) } return out } func getBuildkitVersion() client.BuildkitVersion {
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
return client.BuildkitVersion{ Package: version.Package, Version: version.Version, Revision: version.Revision, } } func getDNSConfig(cfg *config.DNSConfig) *oci.DNSConfig { var dns *oci.DNSConfig if cfg != nil { dns = &oci.DNSConfig{ Nameservers: cfg.Nameservers, Options: cfg.Options, SearchDomains: cfg.SearchDomains, } } return dns } func parseBoolOrAuto(s string) (*bool, error) { if s == "" || strings.EqualFold(s, autoMode) { return nil, nil } b, err := strconv.ParseBool(s) return &b, err } func runTraceController(p string, exp sdktrace.SpanExporter) error {
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
cmd/engine/main.go
server := grpc.NewServer() tracev1.RegisterTraceServiceServer(server, &traceCollector{exporter: exp}) uid := os.Getuid() l, err := sys.GetLocalListener(p, uid, uid) if err != nil { return err } if err := os.Chmod(p, 0666); err != nil { l.Close() return err } go server.Serve(l) return nil } type traceCollector struct { *tracev1.UnimplementedTraceServiceServer exporter sdktrace.SpanExporter } func (t *traceCollector) Export(ctx context.Context, req *tracev1.ExportTraceServiceRequest) (*tracev1.ExportTraceServiceResponse, error) { err := t.exporter.ExportSpans(ctx, transform.Spans(req.GetResourceSpans())) if err != nil { return nil, err } return &tracev1.ExportTraceServiceResponse{}, nil }
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
internal/mage/engine.go
package mage import ( "bytes" "context" "encoding/json" "fmt" "os" "os/exec" "path/filepath" "runtime" "strings" "text/template" "time" "dagger.io/dagger" "github.com/dagger/dagger/internal/mage/sdk" "github.com/dagger/dagger/internal/mage/util" "github.com/dagger/dagger/network"
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
internal/mage/engine.go
"github.com/magefile/mage/mg" "golang.org/x/mod/semver" ) const ( engineBinName = "dagger-engine" shimBinName = "dagger-shim" alpineVersion = "3.17" runcVersion = "v1.1.4" buildkitRepo = "github.com/moby/buildkit" buildkitRef = "34a576c411eaab55c40f3e06478a628ef73bdfc7" qemuBinImage = "tonistiigi/binfmt:buildkit-v7.1.0-30@sha256:45dd57b4ba2f24e2354f71f1e4e51f073cb7a28fd848ce6f5f2a7701142a6bf0" engineTomlPath = "/etc/dagger/engine.toml" engineDefaultStateDir = "/var/lib/dagger" engineEntrypointPath = "/usr/local/bin/dagger-entrypoint.sh" engineEntrypointCommand = "/usr/local/bin/" + engineBinName + " --debug --config " + engineTomlPath + " --oci-worker-binary /usr/local/bin/" + shimBinName cacheConfigEnvName = "_EXPERIMENTAL_DAGGER_CACHE_CONFIG" servicesDNSEnvName = "_EXPERIMENTAL_DAGGER_SERVICES_DNS" ) var engineEntrypoint string const engineEntrypointTmpl = `#!/bin/sh set -e # cgroup v2: enable nesting # see https://github.com/moby/moby/blob/38805f20f9bcc5e87869d6c79d432b166e1c88b4/hack/dind#L28 if [ -f /sys/fs/cgroup/cgroup.controllers ]; then # move the processes from the root group to the /init group, # otherwise writing subtree_control fails with EBUSY. # An error during moving non-existent process (i.e., "cat") is ignored. mkdir -p /sys/fs/cgroup/init
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
internal/mage/engine.go
xargs -rn1 < /sys/fs/cgroup/cgroup.procs > /sys/fs/cgroup/init/cgroup.procs || : # enable controllers sed -e 's/ / +/g' -e 's/^/+/' < /sys/fs/cgroup/cgroup.controllers \ > /sys/fs/cgroup/cgroup.subtree_control fi if [ -n "$` + servicesDNSEnvName + `" ]; then # relocate resolv.conf mount touch /etc/resolv.conf.upstream mount --bind /etc/resolv.conf /etc/resolv.conf.upstream umount /etc/resolv.conf # add dnsmasq to resolver so buildkit can reach local services echo '# dagger dnsmasq server' > /etc/resolv.conf echo 'nameserver {{.Bridge}}' >> /etc/resolv.conf # preserve DNS search/options config, but let dnsmasq delegate to # /etc/resolv.conf.upstream for upstream nameservers grep -v '^nameserver' /etc/resolv.conf.upstream >> /etc/resolv.conf cat >> ` + engineTomlPath + ` <<EOF # configure bridge networking [worker.oci] networkMode = "cni" cniConfigPath = "/etc/dagger/cni.conflist" [worker.containerd] networkMode = "cni" cniConfigPath = "/etc/dagger/cni.conflist" EOF fi exec {{.EntrypointCommand}} ` func init() { type tmplParams struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
internal/mage/engine.go
Bridge string SearchDomain string EntrypointCommand string } tmpl := template.Must(template.New("entrypoint").Parse(engineEntrypointTmpl)) buf := new(bytes.Buffer) err := tmpl.Execute(buf, tmplParams{ Bridge: network.Bridge, SearchDomain: network.DNSDomain, EntrypointCommand: engineEntrypointCommand, }) if err != nil { panic(err) } engineEntrypoint = buf.String() } var publishedEngineArches = []string{"amd64", "arm64"} func parseRef(tag string) error {
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
internal/mage/engine.go
if tag == "main" { return nil } if ok := semver.IsValid(tag); !ok { return fmt.Errorf("invalid semver tag: %s", tag) } return nil } type Engine mg.Namespace func (t Engine) Build(ctx context.Context) error { c, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr)) if err != nil { return err } defer c.Close() c = c.Pipeline("engine").Pipeline("build")
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
internal/mage/engine.go
build := util.GoBase(c). WithEnvVariable("GOOS", runtime.GOOS). WithEnvVariable("GOARCH", runtime.GOARCH). WithExec([]string{"go", "build", "-o", "./bin/dagger", "-ldflags", "-s -w", "/app/cmd/dagger"}) _, err = build.Directory("./bin").Export(ctx, "./bin") return err } func (t Engine) Lint(ctx context.Context) error { c, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr)) if err != nil { return err } defer c.Close() c = c.Pipeline("engine").Pipeline("lint") repo := util.RepositoryGoCodeOnly(c) goMod, err := repo.File("go.mod").Contents(ctx) if err != nil { return err } for _, l := range strings.Split(goMod, "\n") { l = strings.TrimSpace(l) parts := strings.SplitN(l, " ", 2) if len(parts) != 2 { continue } repo, version := parts[0], parts[1] if repo != buildkitRepo { continue }
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
internal/mage/engine.go
buildkitRef := buildkitRef if strings.Contains(version, "-") { version = version[strings.LastIndex(version, "-")+1:] buildkitRef = buildkitRef[:12] } if version != buildkitRef { return fmt.Errorf("buildkit version mismatch: %s (buildkitd) != %s (buildkit in go.mod)", buildkitRef, version) } } _, err = c.Container(). From("golangci/golangci-lint:v1.51"). WithMountedDirectory("/app", repo). WithWorkdir("/app"). WithExec([]string{"golangci-lint", "run", "-v", "--timeout", "5m"}). ExitCode(ctx) return err } func (t Engine) Publish(ctx context.Context, version string) error { if err := parseRef(version); err != nil { return err } c, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr)) if err != nil { return err } defer c.Close() c = c.Pipeline("engine").Pipeline("publish") engineImage, err := util.WithSetHostVar(ctx, c.Host(), "DAGGER_ENGINE_IMAGE").Value(ctx) if err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
internal/mage/engine.go
return err } ref := fmt.Sprintf("%s:%s", engineImage, version) digest, err := c.Container().Publish(ctx, ref, dagger.ContainerPublishOpts{ PlatformVariants: devEngineContainer(c, publishedEngineArches), }) if err != nil { return err } if semver.IsValid(version) { sdks := sdk.All{} if err := sdks.Bump(ctx, version); err != nil { return err } } else { fmt.Printf("'%s' is not a semver version, skipping image bump in SDKs", version) } time.Sleep(3 * time.Second) fmt.Println("PUBLISHED IMAGE REF:", digest) return nil } func (t Engine) TestPublish(ctx context.Context) error { c, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr)) if err != nil { return err } defer c.Close() c = c.Pipeline("engine").Pipeline("test-publish") _, err = c.Container().Export(ctx, "./engine.tar.gz", dagger.ContainerExportOpts{ PlatformVariants: devEngineContainer(c, publishedEngineArches),
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
internal/mage/engine.go
}) return err } func (t Engine) test(ctx context.Context, race bool) error { c, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr)) if err != nil { return err } defer c.Close() c = c.Pipeline("engine").Pipeline("test") cgoEnabledEnv := "0" args := []string{"go", "test", "-p", "16", "-v", "-count=1"} if race { args = append(args, "-race", "-timeout=1h") cgoEnabledEnv = "1" } args = append(args, "./...") output, err := util.GoBase(c). WithMountedDirectory("/app", util.Repository(c)). WithWorkdir("/app"). WithEnvVariable("CGO_ENABLED", cgoEnabledEnv). WithMountedDirectory("/root/.docker", util.HostDockerDir(c)). WithExec(args). Stdout(ctx) if err != nil { return err } fmt.Println(output) return nil }
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
internal/mage/engine.go
func (t Engine) Test(ctx context.Context) error { return t.test(ctx, false) } func (t Engine) TestRace(ctx context.Context) error { return t.test(ctx, true) } func (t Engine) Dev(ctx context.Context) error { c, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr)) if err != nil { return err } defer c.Close() c = c.Pipeline("engine").Pipeline("dev") tmpfile, err := os.CreateTemp("", "dagger-engine-export") if err != nil { return err } defer os.Remove(tmpfile.Name()) arches := []string{runtime.GOARCH} _, err = c.Container().Export(ctx, tmpfile.Name(), dagger.ContainerExportOpts{ PlatformVariants: devEngineContainer(c, arches), }) if err != nil { return err } volumeName := util.EngineContainerName imageName := fmt.Sprintf("localhost/%s:latest", util.EngineContainerName) loadCmd := exec.CommandContext(ctx, "docker", "load", "-i", tmpfile.Name()) output, err := loadCmd.CombinedOutput()
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
internal/mage/engine.go
if err != nil { return fmt.Errorf("docker load failed: %w: %s", err, output) } _, imageID, ok := strings.Cut(string(output), "sha256:") if !ok { return fmt.Errorf("unexpected output from docker load: %s", output) } imageID = strings.TrimSpace(imageID) if output, err := exec.CommandContext(ctx, "docker", "tag", imageID, imageName, ).CombinedOutput(); err != nil { return fmt.Errorf("docker tag: %w: %s", err, output) } if output, err := exec.CommandContext(ctx, "docker", "rm", "-fv", util.EngineContainerName, ).CombinedOutput(); err != nil { return fmt.Errorf("docker rm: %w: %s", err, output) } runArgs := []string{ "run", "-d", "-e", cacheConfigEnvName, "-e", servicesDNSEnvName, "-v", volumeName + ":" + engineDefaultStateDir, "--name", util.EngineContainerName,
closed
dagger/dagger
https://github.com/dagger/dagger
4,652
🐞 network issue with [email protected] in k8s pod
### What is the issue? May cause by https://github.com/dagger/dagger/pull/4505 Here a new search in `/etc/resolv.conf` added before k8s searches ```conf search dns.dagger search gitlab.svc.cluster.local. svc.cluster.local. cluster.local. openstacklocal options ndots:5 ``` Then network because very slow to fetch anything. ### Log output _No response_ ### Steps to reproduce _No response_ ### SDK version Go SDK v0.4.6 ### OS version Unbuntu
https://github.com/dagger/dagger/issues/4652
https://github.com/dagger/dagger/pull/4666
253e3b227216468202a5b512838a77bd4315ed06
318cb775bed51438f6eb45fb4c96db1c2a2d39cd
2023-02-27T08:40:03Z
go
2023-03-01T01:16:55Z
internal/mage/engine.go
"--privileged", } runArgs = append(runArgs, imageName, "--debug") if output, err := exec.CommandContext(ctx, "docker", runArgs...).CombinedOutput(); err != nil { return fmt.Errorf("docker run: %w: %s", err, output) } binDest := filepath.Join(os.Getenv("DAGGER_SRC_ROOT"), "bin", "dagger") _, err = util.HostDaggerBinary(c).Export(ctx, binDest) if err != nil { return err } fmt.Println("export _EXPERIMENTAL_DAGGER_CLI_BIN=" + binDest) fmt.Println("export _EXPERIMENTAL_DAGGER_RUNNER_HOST=docker-container://" + util.EngineContainerName) return nil } const cniVersion = "v1.2.0" func dnsnameBinary(c *dagger.Client, arch string) *dagger.File { return util.GoBase(c). WithEnvVariable("GOOS", "linux"). WithEnvVariable("GOARCH", arch). WithExec([]string{ "go", "build", "-o", "./bin/dnsname", "-ldflags", "-s -w", "/app/cmd/dnsname", }). File("./bin/dnsname") } func devEngineContainer(c *dagger.Client, arches []string) []*dagger.Container {