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
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
cmd/dagger/cmd/input/socket.go
if err := viper.BindPFlags(cmd.Flags()); err != nil { panic(err) } }, Run: func(cmd *cobra.Command, args []string) { lg := logger.New() ctx := lg.WithContext(cmd.Context()) unix := args[1] st, err := os.Stat(unix) if err != nil { lg.Fatal().Err(err).Str("path", unix).Msg("invalid unix socket") } if st.Mode()&os.ModeSocket == 0 { lg.Fatal().Str("path", unix).Msg("not a unix socket") } updateEnvironmentInput( ctx, cmd, args[0], state.SocketInput(unix), ) }, } func init() { if err := viper.BindPFlags(boolCmd.Flags()); err != nil { panic(err) } }
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
package environment import ( "context" "encoding/json" "errors" "fmt" "io" "io/fs" "net" "net/url" "strings" "time" "cuelang.org/go/cue" bkplatforms "github.com/containerd/containerd/platforms" "github.com/docker/distribution/reference" bk "github.com/moby/buildkit/client" "github.com/moby/buildkit/client/llb" "github.com/moby/buildkit/exporter/containerimage/exptypes" dockerfilebuilder "github.com/moby/buildkit/frontend/dockerfile/builder"
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
"github.com/moby/buildkit/frontend/dockerfile/dockerfile2llb" bkgw "github.com/moby/buildkit/frontend/gateway/client" bkpb "github.com/moby/buildkit/solver/pb" digest "github.com/opencontainers/go-digest" specs "github.com/opencontainers/image-spec/specs-go/v1" "github.com/rs/zerolog/log" "gopkg.in/yaml.v3" "go.dagger.io/dagger/compiler" "go.dagger.io/dagger/solver" ) type State string const ( StateComputing = State("computing") StateCanceled = State("canceled") StateFailed = State("failed") StateCompleted = State("completed") ) type Pipeline struct { code *compiler.Value name string s solver.Solver state llb.State platform specs.Platform result bkgw.Reference image dockerfile2llb.Image computed *compiler.Value } func NewPipeline(code *compiler.Value, s solver.Solver, platform specs.Platform) *Pipeline { return &Pipeline{ code: code,
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
name: code.Path().String(), platform: platform, s: s, state: llb.Scratch(), computed: compiler.NewValue(), } } func (p *Pipeline) WithCustomName(name string) *Pipeline { p.name = name return p } func (p *Pipeline) State() llb.State { return p.state } func (p *Pipeline) Result() (llb.State, error) { if p.result == nil { return llb.Scratch(), nil } return p.result.ToState() } func (p *Pipeline) FS() fs.FS { return solver.NewBuildkitFS(p.result) } func (p *Pipeline) ImageConfig() dockerfile2llb.Image { return p.image } func (p *Pipeline) Computed() *compiler.Value { return p.computed } func isComponent(v *compiler.Value) bool {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
return v.Lookup("#up").Exists() } func ops(code *compiler.Value) ([]*compiler.Value, error) { ops := []*compiler.Value{} if isComponent(code) { xops, err := code.Lookup("#up").List() if err != nil { return nil, err } ops = append(ops, xops...) } else if _, err := code.Lookup("do").String(); err == nil { ops = append(ops, code) } else if xops, err := code.List(); err == nil { ops = append(ops, xops...) } else { source, err := code.Source() if err != nil { panic(err) } return nil, fmt.Errorf("not executable: %s (%s)", source, code.Path().String()) } return ops, nil } func Analyze(fn func(*compiler.Value) error, code *compiler.Value) error {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
ops, err := ops(code) if err != nil { return nil } for _, op := range ops { if err := analyzeOp(fn, op); err != nil { return err } } return nil } func analyzeOp(fn func(*compiler.Value) error, op *compiler.Value) error {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
if err := fn(op); err != nil { return err } do, err := op.Lookup("do").String() if err != nil { return err } switch do { case "load", "copy": return Analyze(fn, op.Lookup("from")) case "exec": fields, err := op.Lookup("mount").Fields() if err != nil { return err } for _, mnt := range fields { if from := mnt.Value.Lookup("from"); from.Exists() { return Analyze(fn, from) } } } return nil } func (p *Pipeline) Run(ctx context.Context) error { lg := log. Ctx(ctx). With(). Str("component", p.name). Logger()
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
start := time.Now() lg. Info(). Str("state", string(StateComputing)). Msg(string(StateComputing)) err := p.run(ctx) if err != nil { if strings.Contains(err.Error(), "context canceled") { lg. Error(). Dur("duration", time.Since(start)). Str("state", string(StateCanceled)). Msg(string(StateCanceled)) } else { lg. Error(). Dur("duration", time.Since(start)). Err(err). Str("state", string(StateFailed)). Msg(string(StateFailed)) } return err } lg. Info(). Dur("duration", time.Since(start)). Str("state", string(StateCompleted)). Msg(string(StateCompleted)) return nil
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
} func (p *Pipeline) run(ctx context.Context) error { ops, err := ops(p.code) if err != nil { return err } for idx, op := range ops { if err := op.IsConcreteR(); err != nil { log. Ctx(ctx). Warn(). Str("original_cue_error", err.Error()). Int("op", idx). Msg("pipeline was partially executed because of missing inputs") return nil } p.state, err = p.doOp(ctx, op, p.state) if err != nil { return err } p.result, err = p.s.Solve(ctx, p.state, p.platform) if err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
return err } } return nil } func (p *Pipeline) doOp(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) { do, err := op.Lookup("do").String() if err != nil { return st, err } log. Ctx(ctx). Debug(). Str("pipeline", p.name). Str("do", do). Msg("executing operation") switch do { case "copy": return p.Copy(ctx, op, st) case "exec": return p.Exec(ctx, op, st) case "export": return p.Export(ctx, op, st) case "docker-login": return p.DockerLogin(ctx, op, st) case "fetch-container": return p.FetchContainer(ctx, op, st) case "push-container":
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
return p.PushContainer(ctx, op, st) case "save-image": return p.SaveImage(ctx, op, st) case "fetch-git": return p.FetchGit(ctx, op, st) case "fetch-http": return p.FetchHTTP(ctx, op, st) case "local": return p.Local(ctx, op, st) case "load": return p.Load(ctx, op, st) case "workdir": return p.Workdir(ctx, op, st) case "subdir": return p.Subdir(ctx, op, st) case "docker-build": return p.DockerBuild(ctx, op, st) case "write-file": return p.WriteFile(ctx, op, st) case "mkdir": return p.Mkdir(ctx, op, st) default: return st, fmt.Errorf("invalid operation: %s", op.JSON()) } } func (p *Pipeline) vertexNamef(format string, a ...interface{}) string { prefix := fmt.Sprintf("@%s@", p.name) name := fmt.Sprintf(format, a...) return prefix + " " + name }
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
func (p *Pipeline) Workdir(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) { path, err := op.Lookup("path").String() if err != nil { return st, err } return st.Dir(path), nil } func (p *Pipeline) Subdir(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) { dir, err := op.Lookup("dir").String() if err != nil { return st, err } return llb.Scratch().File( llb.Copy( st, dir, "/", &llb.CopyInfo{ CopyDirContentsOnly: true, }, ), llb.WithCustomName(p.vertexNamef("Subdir %s", dir)), ), nil } func (p *Pipeline) Copy(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) { src, err := op.Lookup("src").String() if err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
return st, err } dest, err := op.Lookup("dest").String() if err != nil { return st, err } from := NewPipeline(op.Lookup("from"), p.s, p.platform) if err := from.Run(ctx); err != nil { return st, err } return st.File( llb.Copy( from.State(), src, dest, &llb.CopyInfo{ CopyDirContentsOnly: true, CreateDestPath: true, AllowWildcard: true, }, ), llb.WithCustomName(p.vertexNamef("Copy %s %s", src, dest)), ), nil } func (p *Pipeline) Local(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) { dir, err := op.Lookup("dir").String() if err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
return st, err } opts := []llb.LocalOption{ llb.WithCustomName(p.vertexNamef("Local %s", dir)), llb.SessionID(p.s.SessionID()), llb.SharedKeyHint(dir), } includes, err := op.Lookup("include").List() if err != nil { return st, err } if len(includes) > 0 { includePatterns := []string{} for _, i := range includes { pattern, err := i.String() if err != nil { return st, err } includePatterns = append(includePatterns, pattern) } opts = append(opts, llb.IncludePatterns(includePatterns)) } excludes, err := op.Lookup("exclude").List() if err != nil { return st, err } excludePatterns := []string{"**/.dagger/"}
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
if len(excludes) > 0 { for _, i := range excludes { pattern, err := i.String() if err != nil { return st, err } excludePatterns = append(excludePatterns, pattern) } } opts = append(opts, llb.ExcludePatterns(excludePatterns)) return st.File( llb.Copy( llb.Local( dir, opts..., ), "/", "/", ), llb.WithCustomName(p.vertexNamef("Local %s [copy]", dir)), ), nil } func (p *Pipeline) Exec(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) { opts := []llb.RunOption{} var cmd struct { Args []string
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
Dir string Always bool } if err := op.Decode(&cmd); err != nil { return st, err } opts = append(opts, llb.Args(cmd.Args)) opts = append(opts, llb.Dir(cmd.Dir)) if env := op.Lookup("env"); env.Exists() { envs, err := op.Lookup("env").Fields() if err != nil { return st, err } for _, env := range envs { v, err := env.Value.String() if err != nil { return st, err } opts = append(opts, llb.AddEnv(env.Label(), v)) } } if cmd.Always { opts = append(opts, llb.IgnoreCache) }
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
if hosts := op.Lookup("hosts"); hosts.Exists() { fields, err := hosts.Fields() if err != nil { return st, err } for _, host := range fields { s, err := host.Value.String() if err != nil { return st, err } if err != nil { return st, err } opts = append(opts, llb.AddExtraHost(host.Label(), net.ParseIP(s))) } } if user := op.Lookup("user"); user.Exists() { u, err := user.String() if err != nil { return st, err } opts = append(opts, llb.User(u)) } if mounts := op.Lookup("mount"); mounts.Exists() { mntOpts, err := p.mountAll(ctx, mounts) if err != nil { return st, err } opts = append(opts, mntOpts...)
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
} args := make([]string, 0, len(cmd.Args)) for _, a := range cmd.Args { args = append(args, fmt.Sprintf("%q", a)) } opts = append(opts, llb.WithCustomName(p.vertexNamef("Exec [%s]", strings.Join(args, ", ")))) return st.Run(opts...).Root(), nil } func (p *Pipeline) mountAll(ctx context.Context, mounts *compiler.Value) ([]llb.RunOption, error) { opts := []llb.RunOption{} fields, err := mounts.Fields() if err != nil { return nil, err } for _, mnt := range fields { o, err := p.mount(ctx, mnt.Label(), mnt.Value) if err != nil { return nil, err } opts = append(opts, o) } return opts, err } func (p *Pipeline) mount(ctx context.Context, dest string, mnt *compiler.Value) (llb.RunOption, error) { if s, err := mnt.String(); err == nil { switch s {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
case "cache": return llb.AddMount( dest, llb.Scratch().File( llb.Mkdir("/cache", fs.FileMode(0755)), llb.WithCustomName(p.vertexNamef("Mkdir /cache (cache mount %s)", dest)), ), ), nil case "tmpfs": return llb.AddMount( dest, llb.Scratch(), llb.Tmpfs(), ), nil default: return nil, fmt.Errorf("invalid mount source: %q", s) } } if secret := mnt.Lookup("secret"); secret.Exists() { id, err := getSecretID(secret) if err != nil { return nil, err }
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
return llb.AddSecret(dest, llb.SecretID(id), llb.SecretFileOpt(0, 0, 0400), ), nil } if stream := mnt.Lookup("stream"); stream.Exists() { if !stream.HasAttr("stream") { return nil, fmt.Errorf("invalid stream %q: not a stream", stream.Path().String()) } unixValue := stream.Lookup("unix") if !unixValue.Exists() { return nil, fmt.Errorf("invalid stream %q: not a unix socket", stream.Path().String()) } unix, err := unixValue.String() if err != nil { return nil, fmt.Errorf("invalid unix path id: %w", err) } return llb.AddSSHSocket( llb.SSHID(fmt.Sprintf("unix=%s", unix)), llb.SSHSocketTarget(dest), ), nil } if !mnt.Lookup("from").Exists() { return nil, fmt.Errorf("invalid mount: should have %s structure", "{from: _, path: string | *\"/\"}") } from := NewPipeline(mnt.Lookup("from"), p.s, p.platform) if err := from.Run(ctx); err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
return nil, err } var mo []llb.MountOption if mp := mnt.Lookup("path"); mp.Exists() { mps, err := mp.String() if err != nil { return nil, err } mo = append(mo, llb.SourcePath(mps)) } return llb.AddMount(dest, from.State(), mo...), nil } func (p *Pipeline) canonicalPath(v *compiler.Value) string { vPath := v.Path().Selectors() pipelinePath := p.code.Path().Selectors() _, ref := p.code.ReferencePath() if len(ref.Selectors()) == 0 { return v.Path().String() } canonicalPipelinePath := ref.Selectors() vPath = vPath[len(pipelinePath):] vPath = append(canonicalPipelinePath, vPath...)
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
return cue.MakePath(vPath...).String() } func (p *Pipeline) Export(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) { source, err := op.Lookup("source").String() if err != nil { return st, err } format, err := op.Lookup("format").String() if err != nil { return st, err } contents, err := fs.ReadFile(p.FS(), source) if err != nil { return st, fmt.Errorf("export %s: %w", source, err) } switch format { case "string": log. Ctx(ctx). Debug(). Bytes("contents", contents). Msg("exporting string") if err := p.computed.FillPath(cue.MakePath(), string(contents)); err != nil { return st, err } case "json": var o interface{} o, err := unmarshalAnything(contents, json.Unmarshal) if err != nil { return st, err
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
} log. Ctx(ctx). Debug(). Interface("contents", o). Msg("exporting json") if err := p.computed.FillPath(cue.MakePath(), o); err != nil { return st, err } case "yaml": var o interface{} o, err := unmarshalAnything(contents, yaml.Unmarshal) if err != nil { return st, err } log. Ctx(ctx). Debug(). Interface("contents", o). Msg("exporting yaml") if err := p.computed.FillPath(cue.MakePath(), o); err != nil { return st, err } default: return st, fmt.Errorf("unsupported export format: %q", format) } return st, nil } type unmarshaller func([]byte, interface{}) error func unmarshalAnything(data []byte, fn unmarshaller) (interface{}, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
var oMap map[string]interface{} if err := fn(data, &oMap); err == nil { return oMap, nil } var o interface{} err := fn(data, &o) return o, err } func parseStringOrSecret(ctx context.Context, ss solver.SecretsStore, v *compiler.Value) (string, error) { if value, err := v.String(); err == nil { return value, nil } id, err := getSecretID(v) if err != nil { return "", err } secretBytes, err := ss.GetSecret(ctx, id) if err != nil { return "", err } return string(secretBytes), nil }
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
func (p *Pipeline) Load(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) { from := NewPipeline(op.Lookup("from"), p.s, p.platform) if err := from.Run(ctx); err != nil { return st, err } p.image = from.ImageConfig() return from.State(), nil } func (p *Pipeline) DockerLogin(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) { username, err := op.Lookup("username").String() if err != nil { return st, err } secretValue, err := parseStringOrSecret(ctx, p.s.GetOptions().SecretsStore, op.Lookup("secret")) if err != nil { return st, err } target, err := op.Lookup("target").String() if err != nil { return st, err } p.s.AddCredentials(target, username, secretValue) log. Ctx(ctx). Debug().
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
Str("target", target). Msg("docker login to registry") return st, nil } func (p *Pipeline) FetchContainer(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) { rawRef, err := op.Lookup("ref").String() if err != nil { return st, err } ref, err := reference.ParseNormalizedNamed(rawRef) if err != nil { return st, fmt.Errorf("failed to parse ref %s: %w", rawRef, err) } ref = reference.TagNameOnly(ref) st = llb.Image( ref.String(), llb.WithCustomName(p.vertexNamef("FetchContainer %s", rawRef)), ) p.image, err = p.s.ResolveImageConfig(ctx, ref.String(), llb.ResolveImageConfigOpt{ LogName: p.vertexNamef("load metadata for %s", ref.String()), Platform: &p.platform, }) if err != nil { return st, err } return applyImageToState(p.image, st), nil } func applyImageToState(image dockerfile2llb.Image, st llb.State) llb.State {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
for _, env := range image.Config.Env { k, v := parseKeyValue(env) st = st.AddEnv(k, v) } if image.Config.WorkingDir != "" { st = st.Dir(image.Config.WorkingDir) } if image.Config.User != "" { st = st.User(image.Config.User) } return st } func parseKeyValue(env string) (string, string) { parts := strings.SplitN(env, "=", 2) v := "" if len(parts) > 1 { v = parts[1] } return parts[0], v
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
} func (p *Pipeline) PushContainer(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) { rawRef, err := op.Lookup("ref").String() if err != nil { return st, err } ref, err := reference.ParseNormalizedNamed(rawRef) if err != nil { return st, fmt.Errorf("failed to parse ref %s: %w", rawRef, err) } ref = reference.TagNameOnly(ref) resp, err := p.s.Export(ctx, p.State(), &p.image, bk.ExportEntry{ Type: bk.ExporterImage, Attrs: map[string]string{ "name": ref.String(), "push": "true", }, }, p.platform) if err != nil { return st, err } if dgst, ok := resp.ExporterResponse["containerimage.digest"]; ok { imageRef := fmt.Sprintf( "%s@%s", resp.ExporterResponse["image.name"], dgst, ) return st.File( llb.Mkdir("/dagger", fs.FileMode(0755)),
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
llb.WithCustomName(p.vertexNamef("Mkdir /dagger")), ).File( llb.Mkfile("/dagger/image_digest", fs.FileMode(0644), []byte(dgst)), llb.WithCustomName(p.vertexNamef("Storing image digest to /dagger/image_digest")), ).File( llb.Mkfile("/dagger/image_ref", fs.FileMode(0644), []byte(imageRef)), llb.WithCustomName(p.vertexNamef("Storing image ref to /dagger/image_ref")), ), nil } return st, err } func (p *Pipeline) SaveImage(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) { tag, err := op.Lookup("tag").String() if err != nil { return st, err } dest, err := op.Lookup("dest").String() if err != nil { return st, err } pipeR, pipeW := io.Pipe() var ( errCh = make(chan error) image []byte ) go func() { var err error image, err = io.ReadAll(pipeR) errCh <- err }()
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
resp, err := p.s.Export(ctx, p.State(), &p.image, bk.ExportEntry{ Type: bk.ExporterDocker, Attrs: map[string]string{ "name": tag, }, Output: func(_ map[string]string) (io.WriteCloser, error) { return pipeW, nil }, }, p.platform) if err != nil { return st, err } if err := <-errCh; err != nil { return st, err } if id, ok := resp.ExporterResponse["containerimage.config.digest"]; ok { st = st.File( llb.Mkdir("/dagger", fs.FileMode(0755)), llb.WithCustomName(p.vertexNamef("Mkdir /dagger")), ).File( llb.Mkfile("/dagger/image_id", fs.FileMode(0644), []byte(id)), llb.WithCustomName(p.vertexNamef("Storing image id to /dagger/image_id")), ) } return st.File( llb.Mkfile(dest, 0644, image), llb.WithCustomName(p.vertexNamef("SaveImage %s", dest)), ), nil } func getSecretID(secretField *compiler.Value) (string, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
if !secretField.HasAttr("secret") { return "", fmt.Errorf("invalid secret %q: not a secret", secretField.Path().String()) } idValue := secretField.Lookup("id") if !idValue.Exists() { return "", fmt.Errorf("invalid secret %q: no id field", secretField.Path().String()) } id, err := idValue.String() if err != nil { return "", fmt.Errorf("invalid secret id: %w", err) } return id, nil } func (p *Pipeline) FetchGit(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) { remote, err := op.Lookup("remote").String() if err != nil { return st, err } ref, err := op.Lookup("ref").String() if err != nil { return st, err } remoteRedacted := remote if u, err := url.Parse(remote); err == nil { remoteRedacted = u.Redacted() } gitOpts := []llb.GitOption{} var opts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
KeepGitDir bool } if err := op.Decode(&opts); err != nil { return st, err } if opts.KeepGitDir { gitOpts = append(gitOpts, llb.KeepGitDir()) } if authToken := op.Lookup("authToken"); authToken.Exists() { id, err := getSecretID(authToken)
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
if err != nil { return st, err } gitOpts = append(gitOpts, llb.AuthTokenSecret(id)) } if authHeader := op.Lookup("authHeader"); authHeader.Exists() { id, err := getSecretID(authHeader) if err != nil { return st, err } gitOpts = append(gitOpts, llb.AuthHeaderSecret(id)) } gitOpts = append(gitOpts, llb.WithCustomName(p.vertexNamef("FetchGit %s@%s", remoteRedacted, ref))) return llb.Git( remote, ref, gitOpts..., ), nil } func (p *Pipeline) FetchHTTP(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) { link, err := op.Lookup("url").String() if err != nil { return st, err } linkRedacted := link if u, err := url.Parse(link); err == nil { linkRedacted = u.Redacted() } httpOpts := []llb.HTTPOption{} var opts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
Checksum string Filename string Mode int64 UID int GID int } if err := op.Decode(&opts); err != nil { return st, err } if opts.Checksum != "" { dgst, err := digest.Parse(opts.Checksum) if err != nil { return st, err } httpOpts = append(httpOpts, llb.Checksum(dgst)) } if opts.Filename != "" { httpOpts = append(httpOpts, llb.Filename(opts.Filename)) } if opts.Mode != 0 { httpOpts = append(httpOpts, llb.Chmod(fs.FileMode(opts.Mode))) }
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
if opts.UID != 0 && opts.GID != 0 { httpOpts = append(httpOpts, llb.Chown(opts.UID, opts.GID)) } httpOpts = append(httpOpts, llb.WithCustomName(p.vertexNamef("FetchHTTP %s", linkRedacted))) return llb.HTTP( link, httpOpts..., ), nil } func (p *Pipeline) DockerBuild(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) { var ( dockerContext = op.Lookup("context") dockerfile = op.Lookup("dockerfile") contextDef *bkpb.Definition dockerfileDef *bkpb.Definition err error ) if !dockerContext.Exists() && !dockerfile.Exists() { return st, errors.New("context or dockerfile required") } if dockerContext.Exists() { from := NewPipeline(op.Lookup("context"), p.s, p.platform) if err := from.Run(ctx); err != nil { return st, err } contextDef, err = p.s.Marshal(ctx, from.State()) if err != nil { return st, err
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
} dockerfileDef = contextDef } if dockerfile.Exists() { content, err := dockerfile.String() if err != nil { return st, err } dockerfileDef, err = p.s.Marshal(ctx, llb.Scratch().File( llb.Mkfile("/Dockerfile", 0644, []byte(content)), ), ) if err != nil { return st, err } if contextDef == nil { contextDef = dockerfileDef } } opts, err := dockerBuildOpts(ctx, op, p.s.GetOptions().SecretsStore) if err != nil { return st, err } if p.s.NoCache() { opts["no-cache"] = "" } if opts["platform"] == "" {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
opts["platform"] = bkplatforms.Format(p.platform) } req := bkgw.SolveRequest{ Frontend: "dockerfile.v0", FrontendOpt: opts, FrontendInputs: map[string]*bkpb.Definition{ dockerfilebuilder.DefaultLocalNameContext: contextDef, dockerfilebuilder.DefaultLocalNameDockerfile: dockerfileDef, }, } res, err := p.s.SolveRequest(ctx, req) if err != nil { return st, err } if meta, ok := res.Metadata[exptypes.ExporterImageConfigKey]; ok { if err := json.Unmarshal(meta, &p.image); err != nil { return st, fmt.Errorf("failed to unmarshal image config: %w", err) } } ref, err := res.SingleRef() if err != nil { return st, err } st, err = ref.ToState() if err != nil { return st, err } return applyImageToState(p.image, st), nil } func dockerBuildOpts(ctx context.Context, op *compiler.Value, ss solver.SecretsStore) (map[string]string, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
opts := map[string]string{} if dockerfilePath := op.Lookup("dockerfilePath"); dockerfilePath.Exists() { filename, err := dockerfilePath.String() if err != nil { return nil, err } opts["filename"] = filename } if target := op.Lookup("target"); target.Exists() { tgr, err := target.String() if err != nil { return nil, err
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
} opts["target"] = tgr } if hosts := op.Lookup("hosts"); hosts.Exists() { p := []string{} fields, err := hosts.Fields() if err != nil { return nil, err } for _, host := range fields { s, err := host.Value.String() if err != nil { return nil, err } p = append(p, host.Label()+"="+s) } if len(p) > 0 { opts["add-hosts"] = strings.Join(p, ",") } } if buildArgs := op.Lookup("buildArg"); buildArgs.Exists() { fields, err := buildArgs.Fields() if err != nil { return nil, err } for _, buildArg := range fields { v, err := parseStringOrSecret(ctx, ss, buildArg.Value) if err != nil { return nil, err }
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
opts["build-arg:"+buildArg.Label()] = v } } if labels := op.Lookup("label"); labels.Exists() { fields, err := labels.Fields() if err != nil { return nil, err } for _, label := range fields { s, err := label.Value.String() if err != nil { return nil, err } opts["label:"+label.Label()] = s } } if platforms := op.Lookup("platforms"); platforms.Exists() { p := []string{} list, err := platforms.List() if err != nil { return nil, err } for _, platform := range list { s, err := platform.String() if err != nil { return nil, err } p = append(p, s) } if len(p) > 0 {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
opts["platform"] = strings.Join(p, ",") } if len(p) > 1 { opts["multi-platform"] = "true" } } return opts, nil } func (p *Pipeline) WriteFile(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) { var content []byte var err error switch kind := op.Lookup("content").Kind(); kind { case cue.BytesKind: content, err = op.Lookup("content").Bytes() case cue.StringKind: var str string str, err = op.Lookup("content").String() if err == nil { content = []byte(str) } case cue.BottomKind: err = fmt.Errorf("%s: WriteFile content is not set", p.canonicalPath(op)) default: err = fmt.Errorf("%s: unhandled data type in WriteFile: %s", p.canonicalPath(op), kind) } if err != nil { return st, err } dest, err := op.Lookup("dest").String() if err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
environment/pipeline.go
return st, err } mode, err := op.Lookup("mode").Int64() if err != nil { return st, err } return st.File( llb.Mkfile(dest, fs.FileMode(mode), content), llb.WithCustomName(p.vertexNamef("WriteFile %s", dest)), ), nil } func (p *Pipeline) Mkdir(ctx context.Context, op *compiler.Value, st llb.State) (llb.State, error) { pathString, err := op.Lookup("path").String() if err != nil { return st, err } dir, err := op.Lookup("dir").String() if err != nil { return st, err } mode, err := op.Lookup("mode").Int64() if err != nil { return st, err } return st.Dir(dir).File( llb.Mkdir(pathString, fs.FileMode(mode)), llb.WithCustomName(p.vertexNamef("Mkdir %s", pathString)), ), nil }
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
solver/socketprovider.go
package solver import ( "context" "fmt" "net" "strings" "time" "github.com/moby/buildkit/session" "github.com/moby/buildkit/session/sshforward" "google.golang.org/grpc" "google.golang.org/grpc/metadata" ) const ( unixPrefix = "unix=" ) type SocketProvider struct { } func NewDockerSocketProvider() session.Attachable { return &SocketProvider{} } func (sp *SocketProvider) Register(server *grpc.Server) {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
solver/socketprovider.go
sshforward.RegisterSSHServer(server, sp) } func (sp *SocketProvider) CheckAgent(ctx context.Context, req *sshforward.CheckAgentRequest) (*sshforward.CheckAgentResponse, error) { id := sshforward.DefaultID if req.ID != "" { id = req.ID } if !strings.HasPrefix(id, unixPrefix) { return &sshforward.CheckAgentResponse{}, fmt.Errorf("invalid socket forward key %s", id) } return &sshforward.CheckAgentResponse{}, nil } func (sp *SocketProvider) ForwardAgent(stream sshforward.SSH_ForwardAgentServer) error { id := sshforward.DefaultID opts, _ := metadata.FromIncomingContext(stream.Context()) if v, ok := opts[sshforward.KeySSHID]; ok && len(v) > 0 && v[0] != "" { id = v[0] } if !strings.HasPrefix(id, unixPrefix) { return fmt.Errorf("invalid socket forward key %s", id) } id = strings.TrimPrefix(id, unixPrefix) conn, err := net.DialTimeout("unix", id, time.Second) if err != nil { return fmt.Errorf("failed to connect to %s: %w", id, err) } defer conn.Close() return sshforward.Copy(context.TODO(), conn, stream, nil) }
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
state/input.go
package state import ( "crypto/sha256" "encoding/json" "fmt" "io/ioutil" "os" "path" "path/filepath" "strings" "cuelang.org/go/cue" "go.dagger.io/dagger/compiler" ) type Input struct { Dir *dirInput `yaml:"dir,omitempty"` Git *gitInput `yaml:"git,omitempty"` Docker *dockerInput `yaml:"docker,omitempty"` Secret *secretInput `yaml:"secret,omitempty"` Text *textInput `yaml:"text,omitempty"` JSON *jsonInput `yaml:"json,omitempty"` YAML *yamlInput `yaml:"yaml,omitempty"` File *fileInput `yaml:"file,omitempty"`
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
state/input.go
Bool *boolInput `yaml:"bool,omitempty"` Socket *socketInput `yaml:"socket,omitempty"` } func (i Input) Compile(key string, state *State) (*compiler.Value, error) { switch { case i.Dir != nil: return i.Dir.Compile(key, state) case i.Git != nil: return i.Git.Compile(key, state) case i.Docker != nil: return i.Docker.Compile(key, state) case i.Text != nil: return i.Text.Compile(key, state) case i.Secret != nil: return i.Secret.Compile(key, state) case i.JSON != nil: return i.JSON.Compile(key, state) case i.YAML != nil: return i.YAML.Compile(key, state) case i.File != nil: return i.File.Compile(key, state) case i.Bool != nil: return i.Bool.Compile(key, state) case i.Socket != nil: return i.Socket.Compile(key, state) default: return nil, fmt.Errorf("input has not been set") } } func DirInput(path string, include []string, exclude []string) Input {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
state/input.go
return Input{ Dir: &dirInput{ Path: path, Include: include, Exclude: exclude, }, } } type dirInput struct { Path string `yaml:"path,omitempty"` Include []string `yaml:"include,omitempty"` Exclude []string `yaml:"exclude,omitempty"` } func (dir dirInput) Compile(_ string, state *State) (*compiler.Value, error) { includeLLB := []byte("[]") if len(dir.Include) > 0 { var err error includeLLB, err = json.Marshal(dir.Include) if err != nil { return nil, err } } excludeLLB := []byte("[]") if len(dir.Exclude) > 0 {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
state/input.go
var err error excludeLLB, err = json.Marshal(dir.Exclude) if err != nil { return nil, err } } p := dir.Path if !filepath.IsAbs(p) { p = filepath.Clean(path.Join(state.Project, dir.Path)) } if !strings.HasPrefix(p, state.Project) { return nil, fmt.Errorf("%q is outside the project", dir.Path) } if _, err := os.Stat(p); os.IsNotExist(err) { return nil, fmt.Errorf("%q dir doesn't exist", dir.Path) } dirPath, err := json.Marshal(p) if err != nil { return nil, err } llb := fmt.Sprintf( `#up: [{do:"local",dir:%s, include:%s, exclude:%s}]`, dirPath, includeLLB, excludeLLB, ) return compiler.Compile("", llb) } type gitInput struct {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
state/input.go
Remote string `yaml:"remote,omitempty"` Ref string `yaml:"ref,omitempty"` Dir string `yaml:"dir,omitempty"` } func GitInput(remote, ref, dir string) Input { return Input{ Git: &gitInput{ Remote: remote, Ref: ref, Dir: dir, }, } } func (git gitInput) Compile(_ string, _ *State) (*compiler.Value, error) { ref := "HEAD" if git.Ref != "" { ref = git.Ref } dir := "" if git.Dir != "" { dir = fmt.Sprintf(`,{do:"subdir", dir:"%s"}`, git.Dir) } return compiler.Compile("", fmt.Sprintf( `#up: [{do:"fetch-git", remote:"%s", ref:"%s"}%s]`, git.Remote, ref, dir, )) } func DockerInput(ref string) Input {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
state/input.go
return Input{ Docker: &dockerInput{ Ref: ref, }, } } type dockerInput struct { Ref string `yaml:"ref,omitempty"` } func (i dockerInput) Compile(_ string, _ *State) (*compiler.Value, error) { panic("NOT IMPLEMENTED") } func TextInput(data string) Input { i := textInput(data) return Input{ Text: &i, } } type textInput string func (i textInput) Compile(_ string, _ *State) (*compiler.Value, error) { return compiler.Compile("", fmt.Sprintf("%q", i)) } func SecretInput(data string) Input {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
state/input.go
i := secretInput(data) return Input{ Secret: &i, } } type secretInput string func (i secretInput) Compile(key string, _ *State) (*compiler.Value, error) { hash := sha256.New() hash.Write([]byte(key)) checksum := hash.Sum([]byte(i.PlainText())) secretValue := fmt.Sprintf(`{id:"secret=%s;hash=%x"}`, key, checksum) return compiler.Compile("", secretValue) } func (i secretInput) PlainText() string { return string(i) } func BoolInput(data string) Input { i := boolInput(data) return Input{ Bool: &i, } } type boolInput string func (i boolInput) Compile(_ string, _ *State) (*compiler.Value, error) { s := map[boolInput]struct{}{
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
state/input.go
"true": {}, "false": {}, } if _, ok := s[i]; ok { return compiler.DecodeJSON("", []byte(i)) } return nil, fmt.Errorf("%q is not a valid boolean: <true|false>", i) } func JSONInput(data string) Input {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
state/input.go
i := jsonInput(data) return Input{ JSON: &i, } } type jsonInput string func (i jsonInput) Compile(_ string, _ *State) (*compiler.Value, error) { return compiler.DecodeJSON("", []byte(i)) } func YAMLInput(data string) Input { i := yamlInput(data) return Input{ YAML: &i, } } type yamlInput string func (i yamlInput) Compile(_ string, _ *State) (*compiler.Value, error) { return compiler.DecodeYAML("", []byte(i)) } func FileInput(data string) Input { return Input{ File: &fileInput{ Path: data, }, } } type fileInput struct {
closed
dagger/dagger
https://github.com/dagger/dagger
1,111
Support `input stream` on Windows
Currently, most examples work out of the box on Windows, unless the config requires access to the local docker socket (eg. "Getting started" from the docs). We need to implement npipe support for Windows so the client can proxy `\\.\pipe\docker_engine` (host) to `/var/run/docker.sock` (WSL). This last change should unblock all windows users with a decent support as soon as it's released. Assigning to myself.
https://github.com/dagger/dagger/issues/1111
https://github.com/dagger/dagger/pull/1112
2d371ca32b8ecf2569e6b10456be6252360e7cb1
8ffee8922eeff3de6b5faf6c4c51c96839890586
2021-11-08T23:10:41Z
go
2021-11-09T02:06:50Z
state/input.go
Path string `json:"data,omitempty"` } func (i fileInput) Compile(_ string, _ *State) (*compiler.Value, error) { data, err := ioutil.ReadFile(i.Path) if err != nil { return nil, err } value := compiler.NewValue() if err := value.FillPath(cue.MakePath(), data); err != nil { return nil, err } return value, nil } func SocketInput(data string) Input { i := socketInput{ Unix: data, } return Input{ Socket: &i, } } type socketInput struct { Unix string `json:"unix,omitempty"` } func (i socketInput) Compile(_ string, _ *State) (*compiler.Value, error) { socketValue := fmt.Sprintf(`{unix: %q}`, i.Unix) return compiler.Compile("", socketValue) }
closed
dagger/dagger
https://github.com/dagger/dagger
1,118
Broken dagger init
This is multiple problems, very possibly related, found by @kzap while following the getting started tutorial. ### Problem #1: no secret keys For some reason, the `keys.txt` file was corrupted (missing the key information): ``` $ dagger new local -p ./plans/local 9:16PM FTL system | failed to create environment: failed to parse input: no secret keys found $ cat ~/.config/dagger/keys.txt # created: 2021-11-09T21:03:15-05:00 ``` ### Problem #2: Panic on `dagger init` ``` $ dagger init panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10106481c] goroutine 12 [running]: go.dagger.io/dagger/cmd/dagger/cmd.getUniverseCurrentVersion(0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:237 +0x5c go.dagger.io/dagger/cmd/dagger/cmd.isUniverseVersionLatest(0x14000331e48, 0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:266 +0x20 go.dagger.io/dagger/cmd/dagger/cmd.checkVersion() /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:310 +0x2a8 created by go.dagger.io/dagger/cmd/dagger/cmd.init.11.func1 /home/runner/work/dagger/dagger/cmd/dagger/cmd/root.go:43 +0xa8 ``` ### Problem #3: Universe version checking is NOT done in dev For some reason the universe check code is bundled with the binary version checks, which is only performed on releases and not in dev versions (nor CI). This is the reason we never spotted Problem #2 before.
https://github.com/dagger/dagger/issues/1118
https://github.com/dagger/dagger/pull/1196
9b2746b2cb1e75bb8143b114527b4673a42aa598
bbc938ddd6cf9035e3170c8a7679a3a47846eed0
2021-11-10T02:52:01Z
go
2021-12-21T16:58:17Z
cmd/dagger/cmd/up.go
package cmd import ( "context"
closed
dagger/dagger
https://github.com/dagger/dagger
1,118
Broken dagger init
This is multiple problems, very possibly related, found by @kzap while following the getting started tutorial. ### Problem #1: no secret keys For some reason, the `keys.txt` file was corrupted (missing the key information): ``` $ dagger new local -p ./plans/local 9:16PM FTL system | failed to create environment: failed to parse input: no secret keys found $ cat ~/.config/dagger/keys.txt # created: 2021-11-09T21:03:15-05:00 ``` ### Problem #2: Panic on `dagger init` ``` $ dagger init panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10106481c] goroutine 12 [running]: go.dagger.io/dagger/cmd/dagger/cmd.getUniverseCurrentVersion(0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:237 +0x5c go.dagger.io/dagger/cmd/dagger/cmd.isUniverseVersionLatest(0x14000331e48, 0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:266 +0x20 go.dagger.io/dagger/cmd/dagger/cmd.checkVersion() /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:310 +0x2a8 created by go.dagger.io/dagger/cmd/dagger/cmd.init.11.func1 /home/runner/work/dagger/dagger/cmd/dagger/cmd/root.go:43 +0xa8 ``` ### Problem #3: Universe version checking is NOT done in dev For some reason the universe check code is bundled with the binary version checks, which is only performed on releases and not in dev versions (nor CI). This is the reason we never spotted Problem #2 before.
https://github.com/dagger/dagger/issues/1118
https://github.com/dagger/dagger/pull/1196
9b2746b2cb1e75bb8143b114527b4673a42aa598
bbc938ddd6cf9035e3170c8a7679a3a47846eed0
2021-11-10T02:52:01Z
go
2021-12-21T16:58:17Z
cmd/dagger/cmd/up.go
"errors" "os" "cuelang.org/go/cue" "go.dagger.io/dagger/client" "go.dagger.io/dagger/cmd/dagger/cmd/common" "go.dagger.io/dagger/cmd/dagger/cmd/output" "go.dagger.io/dagger/cmd/dagger/logger" "go.dagger.io/dagger/compiler" "go.dagger.io/dagger/environment" "go.dagger.io/dagger/plan" "go.dagger.io/dagger/plancontext" "go.dagger.io/dagger/solver" "golang.org/x/term" "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/spf13/viper" ) var upCmd = &cobra.Command{ Use: "up", Short: "Bring an environment online with latest plan and inputs", Args: cobra.MaximumNArgs(1), PreRun: func(cmd *cobra.Command, args []string) { if err := viper.BindPFlags(cmd.Flags()); err != nil { panic(err) } }, Run: func(cmd *cobra.Command, args []string) { var (
closed
dagger/dagger
https://github.com/dagger/dagger
1,118
Broken dagger init
This is multiple problems, very possibly related, found by @kzap while following the getting started tutorial. ### Problem #1: no secret keys For some reason, the `keys.txt` file was corrupted (missing the key information): ``` $ dagger new local -p ./plans/local 9:16PM FTL system | failed to create environment: failed to parse input: no secret keys found $ cat ~/.config/dagger/keys.txt # created: 2021-11-09T21:03:15-05:00 ``` ### Problem #2: Panic on `dagger init` ``` $ dagger init panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10106481c] goroutine 12 [running]: go.dagger.io/dagger/cmd/dagger/cmd.getUniverseCurrentVersion(0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:237 +0x5c go.dagger.io/dagger/cmd/dagger/cmd.isUniverseVersionLatest(0x14000331e48, 0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:266 +0x20 go.dagger.io/dagger/cmd/dagger/cmd.checkVersion() /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:310 +0x2a8 created by go.dagger.io/dagger/cmd/dagger/cmd.init.11.func1 /home/runner/work/dagger/dagger/cmd/dagger/cmd/root.go:43 +0xa8 ``` ### Problem #3: Universe version checking is NOT done in dev For some reason the universe check code is bundled with the binary version checks, which is only performed on releases and not in dev versions (nor CI). This is the reason we never spotted Problem #2 before.
https://github.com/dagger/dagger/issues/1118
https://github.com/dagger/dagger/pull/1196
9b2746b2cb1e75bb8143b114527b4673a42aa598
bbc938ddd6cf9035e3170c8a7679a3a47846eed0
2021-11-10T02:52:01Z
go
2021-12-21T16:58:17Z
cmd/dagger/cmd/up.go
lg = logger.New() tty *logger.TTYOutput err error ) if f := viper.GetString("log-format"); f == "tty" || f == "auto" && term.IsTerminal(int(os.Stdout.Fd())) { tty, err = logger.NewTTYOutput(os.Stderr) if err != nil { lg.Fatal().Err(err).Msg("failed to initialize TTY logger") } tty.Start() defer tty.Stop() lg = lg.Output(tty) } ctx := lg.WithContext(cmd.Context()) cl := common.NewClient(ctx) if viper.GetBool("europa") { err = europaUp(ctx, cl, args...) if err != nil { lg.Fatal().Err(err).Msg("failed to up environment") } return } project := common.CurrentProject(ctx) st := common.CurrentEnvironmentState(ctx, project) lg = lg.With(). Str("environment", st.Name). Logger() doneCh := common.TrackProjectCommand(ctx, cmd, project, st)
closed
dagger/dagger
https://github.com/dagger/dagger
1,118
Broken dagger init
This is multiple problems, very possibly related, found by @kzap while following the getting started tutorial. ### Problem #1: no secret keys For some reason, the `keys.txt` file was corrupted (missing the key information): ``` $ dagger new local -p ./plans/local 9:16PM FTL system | failed to create environment: failed to parse input: no secret keys found $ cat ~/.config/dagger/keys.txt # created: 2021-11-09T21:03:15-05:00 ``` ### Problem #2: Panic on `dagger init` ``` $ dagger init panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10106481c] goroutine 12 [running]: go.dagger.io/dagger/cmd/dagger/cmd.getUniverseCurrentVersion(0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:237 +0x5c go.dagger.io/dagger/cmd/dagger/cmd.isUniverseVersionLatest(0x14000331e48, 0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:266 +0x20 go.dagger.io/dagger/cmd/dagger/cmd.checkVersion() /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:310 +0x2a8 created by go.dagger.io/dagger/cmd/dagger/cmd.init.11.func1 /home/runner/work/dagger/dagger/cmd/dagger/cmd/root.go:43 +0xa8 ``` ### Problem #3: Universe version checking is NOT done in dev For some reason the universe check code is bundled with the binary version checks, which is only performed on releases and not in dev versions (nor CI). This is the reason we never spotted Problem #2 before.
https://github.com/dagger/dagger/issues/1118
https://github.com/dagger/dagger/pull/1196
9b2746b2cb1e75bb8143b114527b4673a42aa598
bbc938ddd6cf9035e3170c8a7679a3a47846eed0
2021-11-10T02:52:01Z
go
2021-12-21T16:58:17Z
cmd/dagger/cmd/up.go
env, err := environment.New(st) if err != nil { lg.Fatal().Err(err).Msg("unable to create environment") } err = cl.Do(ctx, env.Context(), func(ctx context.Context, s solver.Solver) error { if err := checkInputs(ctx, env); err != nil { return err } if err := env.Up(ctx, s); err != nil { return err } st.Computed = env.Computed().JSON().PrettyString() if err := project.Save(ctx, st); err != nil { return err } if tty != nil { tty.Stop() } return output.ListOutputs(ctx, env, term.IsTerminal(int(os.Stdout.Fd()))) }) <-doneCh if err != nil { lg.Fatal().Err(err).Msg("failed to up environment") } }, } func europaUp(ctx context.Context, cl *client.Client, args ...string) error {
closed
dagger/dagger
https://github.com/dagger/dagger
1,118
Broken dagger init
This is multiple problems, very possibly related, found by @kzap while following the getting started tutorial. ### Problem #1: no secret keys For some reason, the `keys.txt` file was corrupted (missing the key information): ``` $ dagger new local -p ./plans/local 9:16PM FTL system | failed to create environment: failed to parse input: no secret keys found $ cat ~/.config/dagger/keys.txt # created: 2021-11-09T21:03:15-05:00 ``` ### Problem #2: Panic on `dagger init` ``` $ dagger init panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10106481c] goroutine 12 [running]: go.dagger.io/dagger/cmd/dagger/cmd.getUniverseCurrentVersion(0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:237 +0x5c go.dagger.io/dagger/cmd/dagger/cmd.isUniverseVersionLatest(0x14000331e48, 0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:266 +0x20 go.dagger.io/dagger/cmd/dagger/cmd.checkVersion() /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:310 +0x2a8 created by go.dagger.io/dagger/cmd/dagger/cmd.init.11.func1 /home/runner/work/dagger/dagger/cmd/dagger/cmd/root.go:43 +0xa8 ``` ### Problem #3: Universe version checking is NOT done in dev For some reason the universe check code is bundled with the binary version checks, which is only performed on releases and not in dev versions (nor CI). This is the reason we never spotted Problem #2 before.
https://github.com/dagger/dagger/issues/1118
https://github.com/dagger/dagger/pull/1196
9b2746b2cb1e75bb8143b114527b4673a42aa598
bbc938ddd6cf9035e3170c8a7679a3a47846eed0
2021-11-10T02:52:01Z
go
2021-12-21T16:58:17Z
cmd/dagger/cmd/up.go
lg := log.Ctx(ctx) p, err := plan.Load(ctx, args...) if err != nil { lg.Fatal().Err(err).Msg("failed to load plan") } return cl.Do(ctx, p.Context(), func(ctx context.Context, s solver.Solver) error { if err := p.Up(ctx, s); err != nil { return err } return nil }) } func checkInputs(ctx context.Context, env *environment.Environment) error { lg := log.Ctx(ctx) warnOnly := viper.GetBool("force") notConcreteInputs := []*compiler.Value{} inputs, err := env.ScanInputs(ctx, true) if err != nil { lg.Error().Err(err).Msg("failed to scan inputs") return err } for _, i := range inputs { isConcrete := (i.IsConcreteR(cue.Optional(true)) == nil) switch { case plancontext.IsSecretValue(i): if _, err := env.Context().Secrets.FromValue(i); err != nil { isConcrete = false } case plancontext.IsFSValue(i): if _, err := env.Context().FS.FromValue(i); err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
1,118
Broken dagger init
This is multiple problems, very possibly related, found by @kzap while following the getting started tutorial. ### Problem #1: no secret keys For some reason, the `keys.txt` file was corrupted (missing the key information): ``` $ dagger new local -p ./plans/local 9:16PM FTL system | failed to create environment: failed to parse input: no secret keys found $ cat ~/.config/dagger/keys.txt # created: 2021-11-09T21:03:15-05:00 ``` ### Problem #2: Panic on `dagger init` ``` $ dagger init panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10106481c] goroutine 12 [running]: go.dagger.io/dagger/cmd/dagger/cmd.getUniverseCurrentVersion(0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:237 +0x5c go.dagger.io/dagger/cmd/dagger/cmd.isUniverseVersionLatest(0x14000331e48, 0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:266 +0x20 go.dagger.io/dagger/cmd/dagger/cmd.checkVersion() /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:310 +0x2a8 created by go.dagger.io/dagger/cmd/dagger/cmd.init.11.func1 /home/runner/work/dagger/dagger/cmd/dagger/cmd/root.go:43 +0xa8 ``` ### Problem #3: Universe version checking is NOT done in dev For some reason the universe check code is bundled with the binary version checks, which is only performed on releases and not in dev versions (nor CI). This is the reason we never spotted Problem #2 before.
https://github.com/dagger/dagger/issues/1118
https://github.com/dagger/dagger/pull/1196
9b2746b2cb1e75bb8143b114527b4673a42aa598
bbc938ddd6cf9035e3170c8a7679a3a47846eed0
2021-11-10T02:52:01Z
go
2021-12-21T16:58:17Z
cmd/dagger/cmd/up.go
isConcrete = false } case plancontext.IsServiceValue(i): if _, err := env.Context().Services.FromValue(i); err != nil { isConcrete = false } } if !isConcrete { notConcreteInputs = append(notConcreteInputs, i) } } for _, i := range notConcreteInputs { if warnOnly { lg.Warn().Str("input", i.Path().String()).Msg("required input is missing") } else { lg.Error().Str("input", i.Path().String()).Msg("required input is missing") } } if !warnOnly && len(notConcreteInputs) > 0 { return errors.New("some required inputs are not set, please re-run with `--force` if you think it's a mistake") } return nil } func init() { upCmd.Flags().BoolP("force", "f", false, "Force up, disable inputs check") if err := viper.BindPFlags(upCmd.Flags()); err != nil { panic(err) } }
closed
dagger/dagger
https://github.com/dagger/dagger
1,118
Broken dagger init
This is multiple problems, very possibly related, found by @kzap while following the getting started tutorial. ### Problem #1: no secret keys For some reason, the `keys.txt` file was corrupted (missing the key information): ``` $ dagger new local -p ./plans/local 9:16PM FTL system | failed to create environment: failed to parse input: no secret keys found $ cat ~/.config/dagger/keys.txt # created: 2021-11-09T21:03:15-05:00 ``` ### Problem #2: Panic on `dagger init` ``` $ dagger init panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10106481c] goroutine 12 [running]: go.dagger.io/dagger/cmd/dagger/cmd.getUniverseCurrentVersion(0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:237 +0x5c go.dagger.io/dagger/cmd/dagger/cmd.isUniverseVersionLatest(0x14000331e48, 0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:266 +0x20 go.dagger.io/dagger/cmd/dagger/cmd.checkVersion() /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:310 +0x2a8 created by go.dagger.io/dagger/cmd/dagger/cmd.init.11.func1 /home/runner/work/dagger/dagger/cmd/dagger/cmd/root.go:43 +0xa8 ``` ### Problem #3: Universe version checking is NOT done in dev For some reason the universe check code is bundled with the binary version checks, which is only performed on releases and not in dev versions (nor CI). This is the reason we never spotted Problem #2 before.
https://github.com/dagger/dagger/issues/1118
https://github.com/dagger/dagger/pull/1196
9b2746b2cb1e75bb8143b114527b4673a42aa598
bbc938ddd6cf9035e3170c8a7679a3a47846eed0
2021-11-10T02:52:01Z
go
2021-12-21T16:58:17Z
mod/mod.go
package mod import ( "context" "os" "path" "strings" "github.com/gofrs/flock" "github.com/rs/zerolog/log" "go.dagger.io/dagger/stdlib" ) const ( UniverseVersionConstraint = ">= 0.1.0, < 0.2" ) func isUniverse(repoName string) bool {
closed
dagger/dagger
https://github.com/dagger/dagger
1,118
Broken dagger init
This is multiple problems, very possibly related, found by @kzap while following the getting started tutorial. ### Problem #1: no secret keys For some reason, the `keys.txt` file was corrupted (missing the key information): ``` $ dagger new local -p ./plans/local 9:16PM FTL system | failed to create environment: failed to parse input: no secret keys found $ cat ~/.config/dagger/keys.txt # created: 2021-11-09T21:03:15-05:00 ``` ### Problem #2: Panic on `dagger init` ``` $ dagger init panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10106481c] goroutine 12 [running]: go.dagger.io/dagger/cmd/dagger/cmd.getUniverseCurrentVersion(0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:237 +0x5c go.dagger.io/dagger/cmd/dagger/cmd.isUniverseVersionLatest(0x14000331e48, 0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:266 +0x20 go.dagger.io/dagger/cmd/dagger/cmd.checkVersion() /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:310 +0x2a8 created by go.dagger.io/dagger/cmd/dagger/cmd.init.11.func1 /home/runner/work/dagger/dagger/cmd/dagger/cmd/root.go:43 +0xa8 ``` ### Problem #3: Universe version checking is NOT done in dev For some reason the universe check code is bundled with the binary version checks, which is only performed on releases and not in dev versions (nor CI). This is the reason we never spotted Problem #2 before.
https://github.com/dagger/dagger/issues/1118
https://github.com/dagger/dagger/pull/1196
9b2746b2cb1e75bb8143b114527b4673a42aa598
bbc938ddd6cf9035e3170c8a7679a3a47846eed0
2021-11-10T02:52:01Z
go
2021-12-21T16:58:17Z
mod/mod.go
return strings.HasPrefix(strings.ToLower(repoName), stdlib.ModuleName) } func Install(ctx context.Context, workspace, repoName, versionConstraint string) (*Require, error) { lg := log.Ctx(ctx) if isUniverse(repoName) { versionConstraint = UniverseVersionConstraint } lg.Debug().Str("name", repoName).Msg("installing module") require, err := newRequire(repoName, versionConstraint) if err != nil { return nil, err } modfile, err := readPath(workspace) if err != nil { return nil, err } fileLockPath := path.Join(workspace, lockFilePath) fileLock := flock.New(fileLockPath) if err := fileLock.Lock(); err != nil { return nil, err
closed
dagger/dagger
https://github.com/dagger/dagger
1,118
Broken dagger init
This is multiple problems, very possibly related, found by @kzap while following the getting started tutorial. ### Problem #1: no secret keys For some reason, the `keys.txt` file was corrupted (missing the key information): ``` $ dagger new local -p ./plans/local 9:16PM FTL system | failed to create environment: failed to parse input: no secret keys found $ cat ~/.config/dagger/keys.txt # created: 2021-11-09T21:03:15-05:00 ``` ### Problem #2: Panic on `dagger init` ``` $ dagger init panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10106481c] goroutine 12 [running]: go.dagger.io/dagger/cmd/dagger/cmd.getUniverseCurrentVersion(0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:237 +0x5c go.dagger.io/dagger/cmd/dagger/cmd.isUniverseVersionLatest(0x14000331e48, 0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:266 +0x20 go.dagger.io/dagger/cmd/dagger/cmd.checkVersion() /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:310 +0x2a8 created by go.dagger.io/dagger/cmd/dagger/cmd.init.11.func1 /home/runner/work/dagger/dagger/cmd/dagger/cmd/root.go:43 +0xa8 ``` ### Problem #3: Universe version checking is NOT done in dev For some reason the universe check code is bundled with the binary version checks, which is only performed on releases and not in dev versions (nor CI). This is the reason we never spotted Problem #2 before.
https://github.com/dagger/dagger/issues/1118
https://github.com/dagger/dagger/pull/1196
9b2746b2cb1e75bb8143b114527b4673a42aa598
bbc938ddd6cf9035e3170c8a7679a3a47846eed0
2021-11-10T02:52:01Z
go
2021-12-21T16:58:17Z
mod/mod.go
} defer func() { fileLock.Unlock() os.Remove(fileLockPath) }() err = modfile.install(ctx, require) if err != nil { return nil, err } if err = modfile.write(); err != nil { return nil, err } return require, nil } func InstallAll(ctx context.Context, workspace string, repoNames []string) ([]*Require, error) { installedRequires := make([]*Require, 0, len(repoNames)) var err error for _, repoName := range repoNames { var require *Require if require, err = Install(ctx, workspace, repoName, ""); err != nil { continue } installedRequires = append(installedRequires, require) } return installedRequires, err } func Update(ctx context.Context, workspace, repoName, versionConstraint string) (*Require, error) { lg := log.Ctx(ctx) if isUniverse(repoName) {
closed
dagger/dagger
https://github.com/dagger/dagger
1,118
Broken dagger init
This is multiple problems, very possibly related, found by @kzap while following the getting started tutorial. ### Problem #1: no secret keys For some reason, the `keys.txt` file was corrupted (missing the key information): ``` $ dagger new local -p ./plans/local 9:16PM FTL system | failed to create environment: failed to parse input: no secret keys found $ cat ~/.config/dagger/keys.txt # created: 2021-11-09T21:03:15-05:00 ``` ### Problem #2: Panic on `dagger init` ``` $ dagger init panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10106481c] goroutine 12 [running]: go.dagger.io/dagger/cmd/dagger/cmd.getUniverseCurrentVersion(0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:237 +0x5c go.dagger.io/dagger/cmd/dagger/cmd.isUniverseVersionLatest(0x14000331e48, 0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:266 +0x20 go.dagger.io/dagger/cmd/dagger/cmd.checkVersion() /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:310 +0x2a8 created by go.dagger.io/dagger/cmd/dagger/cmd.init.11.func1 /home/runner/work/dagger/dagger/cmd/dagger/cmd/root.go:43 +0xa8 ``` ### Problem #3: Universe version checking is NOT done in dev For some reason the universe check code is bundled with the binary version checks, which is only performed on releases and not in dev versions (nor CI). This is the reason we never spotted Problem #2 before.
https://github.com/dagger/dagger/issues/1118
https://github.com/dagger/dagger/pull/1196
9b2746b2cb1e75bb8143b114527b4673a42aa598
bbc938ddd6cf9035e3170c8a7679a3a47846eed0
2021-11-10T02:52:01Z
go
2021-12-21T16:58:17Z
mod/mod.go
versionConstraint = UniverseVersionConstraint } lg.Debug().Str("name", repoName).Msg("updating module") require, err := newRequire(repoName, versionConstraint) if err != nil { return nil, err } modfile, err := readPath(workspace) if err != nil { return nil, err } fileLockPath := path.Join(workspace, lockFilePath) fileLock := flock.New(fileLockPath) if err := fileLock.Lock(); err != nil { return nil, err } defer func() { fileLock.Unlock() os.Remove(fileLockPath) }() updatedRequire, err := modfile.updateToLatest(ctx, require) if err != nil { return nil, err } if err = modfile.write(); err != nil { return nil, err } return updatedRequire, nil } func UpdateAll(ctx context.Context, workspace string, repoNames []string) ([]*Require, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
1,118
Broken dagger init
This is multiple problems, very possibly related, found by @kzap while following the getting started tutorial. ### Problem #1: no secret keys For some reason, the `keys.txt` file was corrupted (missing the key information): ``` $ dagger new local -p ./plans/local 9:16PM FTL system | failed to create environment: failed to parse input: no secret keys found $ cat ~/.config/dagger/keys.txt # created: 2021-11-09T21:03:15-05:00 ``` ### Problem #2: Panic on `dagger init` ``` $ dagger init panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x2 addr=0x0 pc=0x10106481c] goroutine 12 [running]: go.dagger.io/dagger/cmd/dagger/cmd.getUniverseCurrentVersion(0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:237 +0x5c go.dagger.io/dagger/cmd/dagger/cmd.isUniverseVersionLatest(0x14000331e48, 0x0, 0x0, 0x0) /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:266 +0x20 go.dagger.io/dagger/cmd/dagger/cmd.checkVersion() /home/runner/work/dagger/dagger/cmd/dagger/cmd/version.go:310 +0x2a8 created by go.dagger.io/dagger/cmd/dagger/cmd.init.11.func1 /home/runner/work/dagger/dagger/cmd/dagger/cmd/root.go:43 +0xa8 ``` ### Problem #3: Universe version checking is NOT done in dev For some reason the universe check code is bundled with the binary version checks, which is only performed on releases and not in dev versions (nor CI). This is the reason we never spotted Problem #2 before.
https://github.com/dagger/dagger/issues/1118
https://github.com/dagger/dagger/pull/1196
9b2746b2cb1e75bb8143b114527b4673a42aa598
bbc938ddd6cf9035e3170c8a7679a3a47846eed0
2021-11-10T02:52:01Z
go
2021-12-21T16:58:17Z
mod/mod.go
updatedRequires := make([]*Require, 0, len(repoNames)) var err error for _, repoName := range repoNames { var require *Require if require, err = Update(ctx, workspace, repoName, ""); err != nil { continue } updatedRequires = append(updatedRequires, require) } return updatedRequires, err } func UpdateInstalled(ctx context.Context, workspace string) ([]*Require, error) { modfile, err := readPath(workspace) if err != nil { return nil, err } repoNames := make([]string, 0, len(modfile.requires)) for _, require := range modfile.requires { repoNames = append(repoNames, require.String()) } return UpdateAll(ctx, workspace, repoNames) } func Ensure(workspace string) error { modfile, err := readPath(workspace) if err != nil { return err } return modfile.ensure() }
closed
dagger/dagger
https://github.com/dagger/dagger
1,220
Europa: Stopgap implementation to output computed state
In Europa we're missing a way to retrieve state (e.g. `dagger query`). I don't know what the long term solution would look like, and maybe we don't need to figure that out for the Europa release. However, in the meantime, we do need **some** way to programmatically get the computed state back, at the very least for our integration tests. I propose this straw-man: `dagger up --output [path]`. The output file content would be the equivalent of `state/computed.json` in mainstream Europa. /cc @shykes @samalba @talentedmrjones
https://github.com/dagger/dagger/issues/1220
https://github.com/dagger/dagger/pull/1279
cbd141d019d48e839d6b647923f9563a2c2b09a6
f3caa342e8721541a5aa32a0020fd5d8b52d646f
2021-12-14T14:57:19Z
go
2021-12-21T17:48:04Z
cmd/dagger/cmd/up.go
package cmd import ( "context" "errors" "fmt" "os" "cuelang.org/go/cue" "go.dagger.io/dagger/client" "go.dagger.io/dagger/cmd/dagger/cmd/common" "go.dagger.io/dagger/cmd/dagger/cmd/output" "go.dagger.io/dagger/cmd/dagger/logger" "go.dagger.io/dagger/compiler" "go.dagger.io/dagger/environment" "go.dagger.io/dagger/mod" "go.dagger.io/dagger/plan" "go.dagger.io/dagger/plancontext" "go.dagger.io/dagger/solver" "golang.org/x/term" "github.com/rs/zerolog/log" "github.com/spf13/cobra" "github.com/spf13/viper" ) var upCmd = &cobra.Command{ Use: "up", Short: "Bring an environment online with latest plan and inputs", Args: cobra.MaximumNArgs(1),
closed
dagger/dagger
https://github.com/dagger/dagger
1,220
Europa: Stopgap implementation to output computed state
In Europa we're missing a way to retrieve state (e.g. `dagger query`). I don't know what the long term solution would look like, and maybe we don't need to figure that out for the Europa release. However, in the meantime, we do need **some** way to programmatically get the computed state back, at the very least for our integration tests. I propose this straw-man: `dagger up --output [path]`. The output file content would be the equivalent of `state/computed.json` in mainstream Europa. /cc @shykes @samalba @talentedmrjones
https://github.com/dagger/dagger/issues/1220
https://github.com/dagger/dagger/pull/1279
cbd141d019d48e839d6b647923f9563a2c2b09a6
f3caa342e8721541a5aa32a0020fd5d8b52d646f
2021-12-14T14:57:19Z
go
2021-12-21T17:48:04Z
cmd/dagger/cmd/up.go
PreRun: func(cmd *cobra.Command, args []string) { if err := viper.BindPFlags(cmd.Flags()); err != nil { panic(err) } }, Run: func(cmd *cobra.Command, args []string) { var ( lg = logger.New() tty *logger.TTYOutput err error ) if f := viper.GetString("log-format"); f == "tty" || f == "auto" && term.IsTerminal(int(os.Stdout.Fd())) { tty, err = logger.NewTTYOutput(os.Stderr) if err != nil { lg.Fatal().Err(err).Msg("failed to initialize TTY logger") } tty.Start() defer tty.Stop() lg = lg.Output(tty) } ctx := lg.WithContext(cmd.Context()) cl := common.NewClient(ctx) if viper.GetBool("europa") { err = europaUp(ctx, cl, args...) if err != nil { lg.Fatal().Err(err).Msg("failed to up environment")
closed
dagger/dagger
https://github.com/dagger/dagger
1,220
Europa: Stopgap implementation to output computed state
In Europa we're missing a way to retrieve state (e.g. `dagger query`). I don't know what the long term solution would look like, and maybe we don't need to figure that out for the Europa release. However, in the meantime, we do need **some** way to programmatically get the computed state back, at the very least for our integration tests. I propose this straw-man: `dagger up --output [path]`. The output file content would be the equivalent of `state/computed.json` in mainstream Europa. /cc @shykes @samalba @talentedmrjones
https://github.com/dagger/dagger/issues/1220
https://github.com/dagger/dagger/pull/1279
cbd141d019d48e839d6b647923f9563a2c2b09a6
f3caa342e8721541a5aa32a0020fd5d8b52d646f
2021-12-14T14:57:19Z
go
2021-12-21T17:48:04Z
cmd/dagger/cmd/up.go
} return } project := common.CurrentProject(ctx) st := common.CurrentEnvironmentState(ctx, project) lg = lg.With(). Str("environment", st.Name). Logger() universeUpdateCh := make(chan bool) go func() { universeUpdateCh <- checkUniverseVersion(ctx, project.Path) }() doneCh := common.TrackProjectCommand(ctx, cmd, project, st) env, err := environment.New(st) if err != nil { lg.Fatal().Err(err).Msg("unable to create environment") } err = cl.Do(ctx, env.Context(), func(ctx context.Context, s solver.Solver) error { if err := checkInputs(ctx, env); err != nil { return err } if err := env.Up(ctx, s); err != nil { return err } st.Computed = env.Computed().JSON().PrettyString() if err := project.Save(ctx, st); err != nil { return err }
closed
dagger/dagger
https://github.com/dagger/dagger
1,220
Europa: Stopgap implementation to output computed state
In Europa we're missing a way to retrieve state (e.g. `dagger query`). I don't know what the long term solution would look like, and maybe we don't need to figure that out for the Europa release. However, in the meantime, we do need **some** way to programmatically get the computed state back, at the very least for our integration tests. I propose this straw-man: `dagger up --output [path]`. The output file content would be the equivalent of `state/computed.json` in mainstream Europa. /cc @shykes @samalba @talentedmrjones
https://github.com/dagger/dagger/issues/1220
https://github.com/dagger/dagger/pull/1279
cbd141d019d48e839d6b647923f9563a2c2b09a6
f3caa342e8721541a5aa32a0020fd5d8b52d646f
2021-12-14T14:57:19Z
go
2021-12-21T17:48:04Z
cmd/dagger/cmd/up.go
if tty != nil { tty.Stop() } return output.ListOutputs(ctx, env, term.IsTerminal(int(os.Stdout.Fd()))) }) <-doneCh if err != nil { lg.Fatal().Err(err).Msg("failed to up environment") } if update := <-universeUpdateCh; update { fmt.Println("A new version of universe is available, please run 'dagger mod get alpha.dagger.io'") } }, } func checkUniverseVersion(ctx context.Context, projectPath string) bool { lg := log.Ctx(ctx) isLatest, err := mod.IsUniverseLatest(ctx, projectPath) if err != nil { lg.Debug().Err(err).Msg("failed to check universe version") return false } if !isLatest { return true } lg.Debug().Msg("universe is up to date") return false } func europaUp(ctx context.Context, cl *client.Client, args ...string) error {
closed
dagger/dagger
https://github.com/dagger/dagger
1,220
Europa: Stopgap implementation to output computed state
In Europa we're missing a way to retrieve state (e.g. `dagger query`). I don't know what the long term solution would look like, and maybe we don't need to figure that out for the Europa release. However, in the meantime, we do need **some** way to programmatically get the computed state back, at the very least for our integration tests. I propose this straw-man: `dagger up --output [path]`. The output file content would be the equivalent of `state/computed.json` in mainstream Europa. /cc @shykes @samalba @talentedmrjones
https://github.com/dagger/dagger/issues/1220
https://github.com/dagger/dagger/pull/1279
cbd141d019d48e839d6b647923f9563a2c2b09a6
f3caa342e8721541a5aa32a0020fd5d8b52d646f
2021-12-14T14:57:19Z
go
2021-12-21T17:48:04Z
cmd/dagger/cmd/up.go
lg := log.Ctx(ctx) p, err := plan.Load(ctx, args...) if err != nil { lg.Fatal().Err(err).Msg("failed to load plan") } return cl.Do(ctx, p.Context(), func(ctx context.Context, s solver.Solver) error { if err := p.Up(ctx, s); err != nil { return err } return nil }) } func checkInputs(ctx context.Context, env *environment.Environment) error { lg := log.Ctx(ctx) warnOnly := viper.GetBool("force") notConcreteInputs := []*compiler.Value{} inputs, err := env.ScanInputs(ctx, true) if err != nil { lg.Error().Err(err).Msg("failed to scan inputs") return err } for _, i := range inputs { isConcrete := (i.IsConcreteR(cue.Optional(true)) == nil) switch { case plancontext.IsSecretValue(i): if _, err := env.Context().Secrets.FromValue(i); err != nil { isConcrete = false } case plancontext.IsFSValue(i): if _, err := env.Context().FS.FromValue(i); err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
1,220
Europa: Stopgap implementation to output computed state
In Europa we're missing a way to retrieve state (e.g. `dagger query`). I don't know what the long term solution would look like, and maybe we don't need to figure that out for the Europa release. However, in the meantime, we do need **some** way to programmatically get the computed state back, at the very least for our integration tests. I propose this straw-man: `dagger up --output [path]`. The output file content would be the equivalent of `state/computed.json` in mainstream Europa. /cc @shykes @samalba @talentedmrjones
https://github.com/dagger/dagger/issues/1220
https://github.com/dagger/dagger/pull/1279
cbd141d019d48e839d6b647923f9563a2c2b09a6
f3caa342e8721541a5aa32a0020fd5d8b52d646f
2021-12-14T14:57:19Z
go
2021-12-21T17:48:04Z
cmd/dagger/cmd/up.go
isConcrete = false } case plancontext.IsServiceValue(i): if _, err := env.Context().Services.FromValue(i); err != nil { isConcrete = false } } if !isConcrete { notConcreteInputs = append(notConcreteInputs, i) } } for _, i := range notConcreteInputs { if warnOnly { lg.Warn().Str("input", i.Path().String()).Msg("required input is missing") } else { lg.Error().Str("input", i.Path().String()).Msg("required input is missing") } } if !warnOnly && len(notConcreteInputs) > 0 { return errors.New("some required inputs are not set, please re-run with `--force` if you think it's a mistake") } return nil } func init() { upCmd.Flags().BoolP("force", "f", false, "Force up, disable inputs check") if err := viper.BindPFlags(upCmd.Flags()); err != nil { panic(err) } }
closed
dagger/dagger
https://github.com/dagger/dagger
1,220
Europa: Stopgap implementation to output computed state
In Europa we're missing a way to retrieve state (e.g. `dagger query`). I don't know what the long term solution would look like, and maybe we don't need to figure that out for the Europa release. However, in the meantime, we do need **some** way to programmatically get the computed state back, at the very least for our integration tests. I propose this straw-man: `dagger up --output [path]`. The output file content would be the equivalent of `state/computed.json` in mainstream Europa. /cc @shykes @samalba @talentedmrjones
https://github.com/dagger/dagger/issues/1220
https://github.com/dagger/dagger/pull/1279
cbd141d019d48e839d6b647923f9563a2c2b09a6
f3caa342e8721541a5aa32a0020fd5d8b52d646f
2021-12-14T14:57:19Z
go
2021-12-21T17:48:04Z
plan/plan.go
package plan import ( "context" "errors" "fmt" "os" "path/filepath" "strings" "time" "cuelang.org/go/cue" cueflow "cuelang.org/go/tools/flow" "github.com/rs/zerolog/log" "go.dagger.io/dagger/compiler" "go.dagger.io/dagger/environment" "go.dagger.io/dagger/plan/task" "go.dagger.io/dagger/plancontext" "go.dagger.io/dagger/solver" "go.dagger.io/dagger/state" "go.opentelemetry.io/otel" ) type Plan struct {
closed
dagger/dagger
https://github.com/dagger/dagger
1,220
Europa: Stopgap implementation to output computed state
In Europa we're missing a way to retrieve state (e.g. `dagger query`). I don't know what the long term solution would look like, and maybe we don't need to figure that out for the Europa release. However, in the meantime, we do need **some** way to programmatically get the computed state back, at the very least for our integration tests. I propose this straw-man: `dagger up --output [path]`. The output file content would be the equivalent of `state/computed.json` in mainstream Europa. /cc @shykes @samalba @talentedmrjones
https://github.com/dagger/dagger/issues/1220
https://github.com/dagger/dagger/pull/1279
cbd141d019d48e839d6b647923f9563a2c2b09a6
f3caa342e8721541a5aa32a0020fd5d8b52d646f
2021-12-14T14:57:19Z
go
2021-12-21T17:48:04Z
plan/plan.go
context *plancontext.Context source *compiler.Value } func Load(ctx context.Context, args ...string) (*Plan, error) { log.Ctx(ctx).Debug().Interface("args", args).Msg("loading plan") if err := state.VendorUniverse(ctx, ""); err != nil { return nil, err } v, err := compiler.Build("", nil, args...) if err != nil { return nil, err } p := &Plan{
closed
dagger/dagger
https://github.com/dagger/dagger
1,220
Europa: Stopgap implementation to output computed state
In Europa we're missing a way to retrieve state (e.g. `dagger query`). I don't know what the long term solution would look like, and maybe we don't need to figure that out for the Europa release. However, in the meantime, we do need **some** way to programmatically get the computed state back, at the very least for our integration tests. I propose this straw-man: `dagger up --output [path]`. The output file content would be the equivalent of `state/computed.json` in mainstream Europa. /cc @shykes @samalba @talentedmrjones
https://github.com/dagger/dagger/issues/1220
https://github.com/dagger/dagger/pull/1279
cbd141d019d48e839d6b647923f9563a2c2b09a6
f3caa342e8721541a5aa32a0020fd5d8b52d646f
2021-12-14T14:57:19Z
go
2021-12-21T17:48:04Z
plan/plan.go
context: plancontext.New(), source: v, } if err := p.registerLocalDirs(); err != nil { return nil, err } return p, nil } func (p *Plan) Context() *plancontext.Context { return p.context } func (p *Plan) Source() *compiler.Value { return p.source } func (p *Plan) registerLocalDirs() error { imports, err := p.source.Lookup("inputs.directories").Fields() if err != nil { return err } for _, v := range imports { dir, err := v.Value.Lookup("path").String() if err != nil { return err } abs, err := filepath.Abs(dir) if err != nil { return err } if _, err := os.Stat(abs); errors.Is(err, os.ErrNotExist) { return fmt.Errorf("path %q does not exist", abs)
closed
dagger/dagger
https://github.com/dagger/dagger
1,220
Europa: Stopgap implementation to output computed state
In Europa we're missing a way to retrieve state (e.g. `dagger query`). I don't know what the long term solution would look like, and maybe we don't need to figure that out for the Europa release. However, in the meantime, we do need **some** way to programmatically get the computed state back, at the very least for our integration tests. I propose this straw-man: `dagger up --output [path]`. The output file content would be the equivalent of `state/computed.json` in mainstream Europa. /cc @shykes @samalba @talentedmrjones
https://github.com/dagger/dagger/issues/1220
https://github.com/dagger/dagger/pull/1279
cbd141d019d48e839d6b647923f9563a2c2b09a6
f3caa342e8721541a5aa32a0020fd5d8b52d646f
2021-12-14T14:57:19Z
go
2021-12-21T17:48:04Z
plan/plan.go
} p.context.LocalDirs.Add(dir) } return nil } func (p *Plan) Up(ctx context.Context, s solver.Solver) error { ctx, span := otel.Tracer("dagger").Start(ctx, "plan.Up") defer span.End() computed := compiler.NewValue() flow := cueflow.New( &cueflow.Config{}, p.source.Cue(), newRunner(p.context, s, computed), ) if err := flow.Run(ctx); err != nil { return err } if src, err := computed.Source(); err == nil { log.Ctx(ctx).Debug().Str("computed", string(src)).Msg("computed values") } select { case <-ctx.Done(): return ctx.Err() default: return nil } } func newRunner(pctx *plancontext.Context, s solver.Solver, computed *compiler.Value) cueflow.TaskFunc {
closed
dagger/dagger
https://github.com/dagger/dagger
1,220
Europa: Stopgap implementation to output computed state
In Europa we're missing a way to retrieve state (e.g. `dagger query`). I don't know what the long term solution would look like, and maybe we don't need to figure that out for the Europa release. However, in the meantime, we do need **some** way to programmatically get the computed state back, at the very least for our integration tests. I propose this straw-man: `dagger up --output [path]`. The output file content would be the equivalent of `state/computed.json` in mainstream Europa. /cc @shykes @samalba @talentedmrjones
https://github.com/dagger/dagger/issues/1220
https://github.com/dagger/dagger/pull/1279
cbd141d019d48e839d6b647923f9563a2c2b09a6
f3caa342e8721541a5aa32a0020fd5d8b52d646f
2021-12-14T14:57:19Z
go
2021-12-21T17:48:04Z
plan/plan.go
return func(flowVal cue.Value) (cueflow.Runner, error) { v := compiler.Wrap(flowVal) r, err := task.Lookup(v) if err != nil { if err == task.ErrNotTask { return nil, nil } return nil, err } return cueflow.RunnerFunc(func(t *cueflow.Task) error { ctx := t.Context() lg := log.Ctx(ctx).With().Str("task", t.Path().String()).Logger() ctx = lg.WithContext(ctx) ctx, span := otel.Tracer("dagger").Start(ctx, fmt.Sprintf("up: %s", t.Path().String())) defer span.End() lg.Info().Str("state", string(environment.StateComputing)).Msg(string(environment.StateComputing)) for _, dep := range t.Dependencies() { lg.Debug().Str("dependency", dep.Path().String()).Msg("dependency detected") } start := time.Now() result, err := r.Run(ctx, pctx, s, compiler.Wrap(t.Value())) if err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
1,220
Europa: Stopgap implementation to output computed state
In Europa we're missing a way to retrieve state (e.g. `dagger query`). I don't know what the long term solution would look like, and maybe we don't need to figure that out for the Europa release. However, in the meantime, we do need **some** way to programmatically get the computed state back, at the very least for our integration tests. I propose this straw-man: `dagger up --output [path]`. The output file content would be the equivalent of `state/computed.json` in mainstream Europa. /cc @shykes @samalba @talentedmrjones
https://github.com/dagger/dagger/issues/1220
https://github.com/dagger/dagger/pull/1279
cbd141d019d48e839d6b647923f9563a2c2b09a6
f3caa342e8721541a5aa32a0020fd5d8b52d646f
2021-12-14T14:57:19Z
go
2021-12-21T17:48:04Z
plan/plan.go
if strings.Contains(err.Error(), "context canceled") { lg.Error().Dur("duration", time.Since(start)).Str("state", string(environment.StateCanceled)).Msg(string(environment.StateCanceled)) } else { lg.Error().Dur("duration", time.Since(start)).Err(err).Str("state", string(environment.StateFailed)).Msg(string(environment.StateFailed)) } return err } lg.Info().Dur("duration", time.Since(start)).Str("state", string(environment.StateCompleted)).Msg(string(environment.StateCompleted)) if !result.IsConcrete() { return nil } if src, err := result.Source(); err == nil { lg.Debug().Str("result", string(src)).Msg("merging task result") } if err := t.Fill(result.Cue()); err != nil { lg.Error().Err(err).Msg("failed to fill task") return err } if err := computed.FillPath(t.Path(), result); err != nil { lg.Error().Err(err).Msg("failed to fill plan") return err } return nil }), nil } }
closed
dagger/dagger
https://github.com/dagger/dagger
1,305
Support loading secrets from actions
It's currently not possible to load new secrets from a plan -- secrets can only be passed as inputs. This led to secrets-generating packages to output `string`s instead, and have other packages arbitrarily support either strings or secrets which is messy. Proposal: `engine.#NewSecret` task with pretty much the same interface as `engine.#ReadFile`: ```cue #NewSecret: { // Filesystem tree holding the secret input: #FS // Path of the secret to read path: string // Whether to trim leading and trailing space characters from secret value trimSpace: *true | false // Contents of the secret output: #Secret } ```
https://github.com/dagger/dagger/issues/1305
https://github.com/dagger/dagger/pull/1307
4dec90a9624582ba0696e4cabff4357adcc40d11
c5126412b0f5543590185d606a944d37a65ffaa2
2021-12-23T16:14:11Z
go
2022-01-10T20:09:21Z
client/client.go
package client import ( "context" "fmt" "os" "strings" "sync" "github.com/containerd/containerd/platforms" "go.opentelemetry.io/otel/trace" "golang.org/x/sync/errgroup" "github.com/rs/zerolog/log" bk "github.com/moby/buildkit/client" _ "github.com/moby/buildkit/client/connhelper/dockercontainer" "github.com/moby/buildkit/client/llb" bkgw "github.com/moby/buildkit/frontend/gateway/client" "github.com/moby/buildkit/session" "go.dagger.io/dagger/plancontext" "go.dagger.io/dagger/util/buildkitd" "go.dagger.io/dagger/util/progressui" "go.dagger.io/dagger/compiler" "go.dagger.io/dagger/solver" ) type Client struct {
closed
dagger/dagger
https://github.com/dagger/dagger
1,305
Support loading secrets from actions
It's currently not possible to load new secrets from a plan -- secrets can only be passed as inputs. This led to secrets-generating packages to output `string`s instead, and have other packages arbitrarily support either strings or secrets which is messy. Proposal: `engine.#NewSecret` task with pretty much the same interface as `engine.#ReadFile`: ```cue #NewSecret: { // Filesystem tree holding the secret input: #FS // Path of the secret to read path: string // Whether to trim leading and trailing space characters from secret value trimSpace: *true | false // Contents of the secret output: #Secret } ```
https://github.com/dagger/dagger/issues/1305
https://github.com/dagger/dagger/pull/1307
4dec90a9624582ba0696e4cabff4357adcc40d11
c5126412b0f5543590185d606a944d37a65ffaa2
2021-12-23T16:14:11Z
go
2022-01-10T20:09:21Z
client/client.go
c *bk.Client cfg Config } type Config struct { NoCache bool CacheExports []bk.CacheOptionsEntry CacheImports []bk.CacheOptionsEntry } func New(ctx context.Context, host string, cfg Config) (*Client, error) { if host == "" { host = os.Getenv("BUILDKIT_HOST") } if host == "" { h, err := buildkitd.Start(ctx) if err != nil { return nil, err } host = h }
closed
dagger/dagger
https://github.com/dagger/dagger
1,305
Support loading secrets from actions
It's currently not possible to load new secrets from a plan -- secrets can only be passed as inputs. This led to secrets-generating packages to output `string`s instead, and have other packages arbitrarily support either strings or secrets which is messy. Proposal: `engine.#NewSecret` task with pretty much the same interface as `engine.#ReadFile`: ```cue #NewSecret: { // Filesystem tree holding the secret input: #FS // Path of the secret to read path: string // Whether to trim leading and trailing space characters from secret value trimSpace: *true | false // Contents of the secret output: #Secret } ```
https://github.com/dagger/dagger/issues/1305
https://github.com/dagger/dagger/pull/1307
4dec90a9624582ba0696e4cabff4357adcc40d11
c5126412b0f5543590185d606a944d37a65ffaa2
2021-12-23T16:14:11Z
go
2022-01-10T20:09:21Z
client/client.go
opts := []bk.ClientOpt{} if span := trace.SpanFromContext(ctx); span != nil { opts = append(opts, bk.WithTracerProvider(span.TracerProvider())) } c, err := bk.New(ctx, host, opts...) if err != nil { return nil, fmt.Errorf("buildkit client: %w", err) } return &Client{ c: c, cfg: cfg, }, nil } type DoFunc func(context.Context, solver.Solver) error func (c *Client) Do(ctx context.Context, pctx *plancontext.Context, fn DoFunc) error { lg := log.Ctx(ctx) eg, gctx := errgroup.WithContext(ctx) events := make(chan *bk.SolveStatus) eg.Go(func() error { dispCtx := lg.WithContext(context.Background()) return c.logSolveStatus(dispCtx, pctx, events) }) eg.Go(func() error { return c.buildfn(gctx, pctx, fn, events) }) return eg.Wait()
closed
dagger/dagger
https://github.com/dagger/dagger
1,305
Support loading secrets from actions
It's currently not possible to load new secrets from a plan -- secrets can only be passed as inputs. This led to secrets-generating packages to output `string`s instead, and have other packages arbitrarily support either strings or secrets which is messy. Proposal: `engine.#NewSecret` task with pretty much the same interface as `engine.#ReadFile`: ```cue #NewSecret: { // Filesystem tree holding the secret input: #FS // Path of the secret to read path: string // Whether to trim leading and trailing space characters from secret value trimSpace: *true | false // Contents of the secret output: #Secret } ```
https://github.com/dagger/dagger/issues/1305
https://github.com/dagger/dagger/pull/1307
4dec90a9624582ba0696e4cabff4357adcc40d11
c5126412b0f5543590185d606a944d37a65ffaa2
2021-12-23T16:14:11Z
go
2022-01-10T20:09:21Z
client/client.go
} func (c *Client) buildfn(ctx context.Context, pctx *plancontext.Context, fn DoFunc, ch chan *bk.SolveStatus) error { wg := sync.WaitGroup{} defer func() { wg.Wait() close(ch) }() lg := log.Ctx(ctx) auth := solver.NewRegistryAuthProvider() localdirs, err := pctx.LocalDirs.Paths() if err != nil { return err } opts := bk.SolveOpt{ LocalDirs: localdirs, Session: []session.Attachable{ auth, solver.NewSecretsStoreProvider(pctx), solver.NewDockerSocketProvider(pctx), }, CacheExports: c.cfg.CacheExports, CacheImports: c.cfg.CacheImports, } lg.Debug(). Interface("localdirs", opts.LocalDirs).
closed
dagger/dagger
https://github.com/dagger/dagger
1,305
Support loading secrets from actions
It's currently not possible to load new secrets from a plan -- secrets can only be passed as inputs. This led to secrets-generating packages to output `string`s instead, and have other packages arbitrarily support either strings or secrets which is messy. Proposal: `engine.#NewSecret` task with pretty much the same interface as `engine.#ReadFile`: ```cue #NewSecret: { // Filesystem tree holding the secret input: #FS // Path of the secret to read path: string // Whether to trim leading and trailing space characters from secret value trimSpace: *true | false // Contents of the secret output: #Secret } ```
https://github.com/dagger/dagger/issues/1305
https://github.com/dagger/dagger/pull/1307
4dec90a9624582ba0696e4cabff4357adcc40d11
c5126412b0f5543590185d606a944d37a65ffaa2
2021-12-23T16:14:11Z
go
2022-01-10T20:09:21Z
client/client.go
Interface("attrs", opts.FrontendAttrs). Msg("spawning buildkit job") catchOutput := func(inCh chan *bk.SolveStatus) { for e := range inCh { ch <- e } wg.Done() } eventsCh := make(chan *bk.SolveStatus) wg.Add(1) go catchOutput(eventsCh) buildCh := make(chan *bk.SolveStatus) wg.Add(1) go catchOutput(buildCh) resp, err := c.c.Build(ctx, opts, "", func(ctx context.Context, gw bkgw.Client) (*bkgw.Result, error) { s := solver.New(solver.Opts{ Control: c.c, Gateway: gw, Events: eventsCh, Auth: auth, NoCache: c.cfg.NoCache, }) defer s.Stop()
closed
dagger/dagger
https://github.com/dagger/dagger
1,305
Support loading secrets from actions
It's currently not possible to load new secrets from a plan -- secrets can only be passed as inputs. This led to secrets-generating packages to output `string`s instead, and have other packages arbitrarily support either strings or secrets which is messy. Proposal: `engine.#NewSecret` task with pretty much the same interface as `engine.#ReadFile`: ```cue #NewSecret: { // Filesystem tree holding the secret input: #FS // Path of the secret to read path: string // Whether to trim leading and trailing space characters from secret value trimSpace: *true | false // Contents of the secret output: #Secret } ```
https://github.com/dagger/dagger/issues/1305
https://github.com/dagger/dagger/pull/1307
4dec90a9624582ba0696e4cabff4357adcc40d11
c5126412b0f5543590185d606a944d37a65ffaa2
2021-12-23T16:14:11Z
go
2022-01-10T20:09:21Z
client/client.go
if fn != nil { if err := fn(ctx, s); err != nil { return nil, compiler.Err(err) } } ref, err := s.Solve(ctx, llb.Scratch(), platforms.DefaultSpec()) if err != nil { return nil, err } res := bkgw.NewResult() res.SetRef(ref) return res, nil }, buildCh) if err != nil { return solver.CleanError(err) } for k, v := range resp.ExporterResponse { lg. Debug(). Str("key", k). Str("value", v). Msg("exporter response") } return nil } func (c *Client) logSolveStatus(ctx context.Context, pctx *plancontext.Context, ch chan *bk.SolveStatus) error { parseName := func(v *bk.Vertex) (string, string) { if len(v.Name) < 2 || !strings.HasPrefix(v.Name, "@") {
closed
dagger/dagger
https://github.com/dagger/dagger
1,305
Support loading secrets from actions
It's currently not possible to load new secrets from a plan -- secrets can only be passed as inputs. This led to secrets-generating packages to output `string`s instead, and have other packages arbitrarily support either strings or secrets which is messy. Proposal: `engine.#NewSecret` task with pretty much the same interface as `engine.#ReadFile`: ```cue #NewSecret: { // Filesystem tree holding the secret input: #FS // Path of the secret to read path: string // Whether to trim leading and trailing space characters from secret value trimSpace: *true | false // Contents of the secret output: #Secret } ```
https://github.com/dagger/dagger/issues/1305
https://github.com/dagger/dagger/pull/1307
4dec90a9624582ba0696e4cabff4357adcc40d11
c5126412b0f5543590185d606a944d37a65ffaa2
2021-12-23T16:14:11Z
go
2022-01-10T20:09:21Z
client/client.go
return "", v.Name } prefixEndPos := strings.Index(v.Name[1:], "@") if prefixEndPos == -1 { return "", v.Name } component := v.Name[1 : prefixEndPos+1] return component, v.Name[prefixEndPos+3 : len(v.Name)] } secrets := pctx.Secrets.List() secureSprintf := func(format string, a ...interface{}) string { s := fmt.Sprintf(format, a...) for _, secret := range secrets { s = strings.ReplaceAll(s, secret.PlainText(), "***") } return s } return progressui.PrintSolveStatus(ctx, ch, func(v *bk.Vertex, index int) { component, name := parseName(v) lg := log. Ctx(ctx). With(). Str("task", component). Logger() lg. Debug(). Msg(secureSprintf("#%d %s\n", index, name)) lg.
closed
dagger/dagger
https://github.com/dagger/dagger
1,305
Support loading secrets from actions
It's currently not possible to load new secrets from a plan -- secrets can only be passed as inputs. This led to secrets-generating packages to output `string`s instead, and have other packages arbitrarily support either strings or secrets which is messy. Proposal: `engine.#NewSecret` task with pretty much the same interface as `engine.#ReadFile`: ```cue #NewSecret: { // Filesystem tree holding the secret input: #FS // Path of the secret to read path: string // Whether to trim leading and trailing space characters from secret value trimSpace: *true | false // Contents of the secret output: #Secret } ```
https://github.com/dagger/dagger/issues/1305
https://github.com/dagger/dagger/pull/1307
4dec90a9624582ba0696e4cabff4357adcc40d11
c5126412b0f5543590185d606a944d37a65ffaa2
2021-12-23T16:14:11Z
go
2022-01-10T20:09:21Z
client/client.go
Debug(). Msg(secureSprintf("#%d %s\n", index, v.Digest)) }, func(v *bk.Vertex, format string, a ...interface{}) { component, _ := parseName(v) lg := log. Ctx(ctx). With(). Str("task", component). Logger() msg := secureSprintf(format, a...) lg. Debug(). Msg(msg) }, func(v *bk.Vertex, stream int, partial bool, format string, a ...interface{}) { component, _ := parseName(v) lg := log. Ctx(ctx). With(). Str("task", component). Logger() msg := secureSprintf(format, a...) lg. Info(). Msg(msg) }, ) }
closed
dagger/dagger
https://github.com/dagger/dagger
1,256
Europa: actions in hidden fields
## Problem There may or may not be a problem, depending on whether the desired behavior is already supported. ## Desired behavior Dagger should support configuring actions in hidden fields. For example: ``` // Action configured in a regular field foo: docker.#Run & { script: “echo hello foo!” } // Action configured in a hidden field _bar: docker.#Run & { script: echo hello bar!” } ``` In this example, *BOTH* actions should be detected and executed.
https://github.com/dagger/dagger/issues/1256
https://github.com/dagger/dagger/pull/1403
f13c0fe1d8bd246ce4b690cc2c9c30cd96b7bb5c
9b81b46677eac098713927106bad74d1434a3c52
2021-12-17T19:57:39Z
go
2022-01-12T20:42:46Z
plan/plan.go
package plan import ( "context" "fmt" "strings" "time" "cuelang.org/go/cue" cueflow "cuelang.org/go/tools/flow" "github.com/rs/zerolog/log" "go.dagger.io/dagger/compiler" "go.dagger.io/dagger/environment" "go.dagger.io/dagger/pkg" "go.dagger.io/dagger/plan/task" "go.dagger.io/dagger/plancontext" "go.dagger.io/dagger/solver" "go.opentelemetry.io/otel" ) type Plan struct { config Config context *plancontext.Context source *compiler.Value } type Config struct {
closed
dagger/dagger
https://github.com/dagger/dagger
1,256
Europa: actions in hidden fields
## Problem There may or may not be a problem, depending on whether the desired behavior is already supported. ## Desired behavior Dagger should support configuring actions in hidden fields. For example: ``` // Action configured in a regular field foo: docker.#Run & { script: “echo hello foo!” } // Action configured in a hidden field _bar: docker.#Run & { script: echo hello bar!” } ``` In this example, *BOTH* actions should be detected and executed.
https://github.com/dagger/dagger/issues/1256
https://github.com/dagger/dagger/pull/1403
f13c0fe1d8bd246ce4b690cc2c9c30cd96b7bb5c
9b81b46677eac098713927106bad74d1434a3c52
2021-12-17T19:57:39Z
go
2022-01-12T20:42:46Z
plan/plan.go
Args []string With []string } func Load(ctx context.Context, cfg Config) (*Plan, error) { log.Ctx(ctx).Debug().Interface("args", cfg.Args).Msg("loading plan") if err := pkg.Vendor(ctx, ""); err != nil { return nil, err } v, err := compiler.Build("", nil, cfg.Args...) if err != nil { return nil, err } for i, param := range cfg.With { log.Ctx(ctx).Debug().Interface("with", param).Msg("compiling overlay") paramV, err := compiler.Compile(fmt.Sprintf("with%v", i), param) if err != nil { return nil, err } log.Ctx(ctx).Debug().Interface("with", param).Msg("filling overlay") fillErr := v.FillPath(cue.MakePath(), paramV) if fillErr != nil { return nil, fillErr } } p := &Plan{ config: cfg, context: plancontext.New(),
closed
dagger/dagger
https://github.com/dagger/dagger
1,256
Europa: actions in hidden fields
## Problem There may or may not be a problem, depending on whether the desired behavior is already supported. ## Desired behavior Dagger should support configuring actions in hidden fields. For example: ``` // Action configured in a regular field foo: docker.#Run & { script: “echo hello foo!” } // Action configured in a hidden field _bar: docker.#Run & { script: echo hello bar!” } ``` In this example, *BOTH* actions should be detected and executed.
https://github.com/dagger/dagger/issues/1256
https://github.com/dagger/dagger/pull/1403
f13c0fe1d8bd246ce4b690cc2c9c30cd96b7bb5c
9b81b46677eac098713927106bad74d1434a3c52
2021-12-17T19:57:39Z
go
2022-01-12T20:42:46Z
plan/plan.go
source: v, } if err := p.configPlatform(); err != nil { return nil, err } if err := p.prepare(ctx); err != nil { return nil, err } return p, nil } func (p *Plan) Context() *plancontext.Context { return p.context } func (p *Plan) Source() *compiler.Value { return p.source } func (p *Plan) configPlatform() error { platformField := p.source.Lookup("platform") if !platformField.Exists() { return nil } platform, err := platformField.String() if err != nil { return err } err = p.context.Platform.Set(platform) if err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
1,256
Europa: actions in hidden fields
## Problem There may or may not be a problem, depending on whether the desired behavior is already supported. ## Desired behavior Dagger should support configuring actions in hidden fields. For example: ``` // Action configured in a regular field foo: docker.#Run & { script: “echo hello foo!” } // Action configured in a hidden field _bar: docker.#Run & { script: echo hello bar!” } ``` In this example, *BOTH* actions should be detected and executed.
https://github.com/dagger/dagger/issues/1256
https://github.com/dagger/dagger/pull/1403
f13c0fe1d8bd246ce4b690cc2c9c30cd96b7bb5c
9b81b46677eac098713927106bad74d1434a3c52
2021-12-17T19:57:39Z
go
2022-01-12T20:42:46Z
plan/plan.go
return err } return nil } func (p *Plan) prepare(ctx context.Context) error { flow := cueflow.New( &cueflow.Config{}, p.source.Cue(), func(flowVal cue.Value) (cueflow.Runner, error) { v := compiler.Wrap(flowVal) t, err := task.Lookup(v) if err != nil { if err == task.ErrNotTask { return nil, nil } return nil, err } r, ok := t.(task.PreRunner) if !ok { return nil, nil } return cueflow.RunnerFunc(func(t *cueflow.Task) error { ctx := t.Context() lg := log.Ctx(ctx).With().Str("task", t.Path().String()).Logger() ctx = lg.WithContext(ctx) if err := r.PreRun(ctx, p.context, compiler.Wrap(t.Value())); err != nil { return fmt.Errorf("%s: %w", t.Path().String(), err) } return nil
closed
dagger/dagger
https://github.com/dagger/dagger
1,256
Europa: actions in hidden fields
## Problem There may or may not be a problem, depending on whether the desired behavior is already supported. ## Desired behavior Dagger should support configuring actions in hidden fields. For example: ``` // Action configured in a regular field foo: docker.#Run & { script: “echo hello foo!” } // Action configured in a hidden field _bar: docker.#Run & { script: echo hello bar!” } ``` In this example, *BOTH* actions should be detected and executed.
https://github.com/dagger/dagger/issues/1256
https://github.com/dagger/dagger/pull/1403
f13c0fe1d8bd246ce4b690cc2c9c30cd96b7bb5c
9b81b46677eac098713927106bad74d1434a3c52
2021-12-17T19:57:39Z
go
2022-01-12T20:42:46Z
plan/plan.go
}), nil }, ) return flow.Run(ctx) } func (p *Plan) Up(ctx context.Context, s solver.Solver) (*compiler.Value, error) { ctx, span := otel.Tracer("dagger").Start(ctx, "plan.Up") defer span.End() computed := compiler.NewValue() flow := cueflow.New( &cueflow.Config{}, p.source.Cue(), newRunner(p.context, s, computed), ) if err := flow.Run(ctx); err != nil { return nil, err } if src, err := computed.Source(); err == nil { log.Ctx(ctx).Debug().Str("computed", string(src)).Msg("computed values") } select { case <-ctx.Done(): return nil, ctx.Err() default: return computed, nil } } func newRunner(pctx *plancontext.Context, s solver.Solver, computed *compiler.Value) cueflow.TaskFunc {
closed
dagger/dagger
https://github.com/dagger/dagger
1,256
Europa: actions in hidden fields
## Problem There may or may not be a problem, depending on whether the desired behavior is already supported. ## Desired behavior Dagger should support configuring actions in hidden fields. For example: ``` // Action configured in a regular field foo: docker.#Run & { script: “echo hello foo!” } // Action configured in a hidden field _bar: docker.#Run & { script: echo hello bar!” } ``` In this example, *BOTH* actions should be detected and executed.
https://github.com/dagger/dagger/issues/1256
https://github.com/dagger/dagger/pull/1403
f13c0fe1d8bd246ce4b690cc2c9c30cd96b7bb5c
9b81b46677eac098713927106bad74d1434a3c52
2021-12-17T19:57:39Z
go
2022-01-12T20:42:46Z
plan/plan.go
return func(flowVal cue.Value) (cueflow.Runner, error) { v := compiler.Wrap(flowVal) r, err := task.Lookup(v) if err != nil { if err == task.ErrNotTask { return nil, nil } return nil, err } return cueflow.RunnerFunc(func(t *cueflow.Task) error { ctx := t.Context() lg := log.Ctx(ctx).With().Str("task", t.Path().String()).Logger() ctx = lg.WithContext(ctx) ctx, span := otel.Tracer("dagger").Start(ctx, fmt.Sprintf("up: %s", t.Path().String())) defer span.End() lg.Info().Str("state", string(environment.StateComputing)).Msg(string(environment.StateComputing)) for _, dep := range t.Dependencies() { lg.Debug().Str("dependency", dep.Path().String()).Msg("dependency detected") } start := time.Now() result, err := r.Run(ctx, pctx, s, compiler.Wrap(t.Value())) if err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
1,256
Europa: actions in hidden fields
## Problem There may or may not be a problem, depending on whether the desired behavior is already supported. ## Desired behavior Dagger should support configuring actions in hidden fields. For example: ``` // Action configured in a regular field foo: docker.#Run & { script: “echo hello foo!” } // Action configured in a hidden field _bar: docker.#Run & { script: echo hello bar!” } ``` In this example, *BOTH* actions should be detected and executed.
https://github.com/dagger/dagger/issues/1256
https://github.com/dagger/dagger/pull/1403
f13c0fe1d8bd246ce4b690cc2c9c30cd96b7bb5c
9b81b46677eac098713927106bad74d1434a3c52
2021-12-17T19:57:39Z
go
2022-01-12T20:42:46Z
plan/plan.go
if strings.Contains(err.Error(), "context canceled") { lg.Error().Dur("duration", time.Since(start)).Str("state", string(environment.StateCanceled)).Msg(string(environment.StateCanceled)) } else { lg.Error().Dur("duration", time.Since(start)).Err(err).Str("state", string(environment.StateFailed)).Msg(string(environment.StateFailed)) } return fmt.Errorf("%s: %w", t.Path().String(), err) } lg.Info().Dur("duration", time.Since(start)).Str("state", string(environment.StateCompleted)).Msg(string(environment.StateCompleted)) if !result.IsConcrete() { return nil } if src, err := result.Source(); err == nil { lg.Debug().Str("result", string(src)).Msg("merging task result") } if err := t.Fill(result.Cue()); err != nil { lg.Error().Err(err).Msg("failed to fill task") return err } if err := computed.FillPath(t.Path(), result); err != nil { lg.Error().Err(err).Msg("failed to fill plan") return err } return nil }), nil } }
closed
dagger/dagger
https://github.com/dagger/dagger
1,378
Inconsistencies in dagger mod get
Currently you are forced to use the .git suffix if the repository is not from github. The imported package keeps the suffix thus altering the import directive to be used, therefore the import will be different in the tests of the project containing the package compared to projects where dagger mod get is used. Moreover, the structure of a [package](https://github.com/grouville/dagger-serverless) is different from what is [documented](https://docs.dagger.io/1010/dev-cue-package/) Supposing we have a repository called gitlab.banana.org/wonderful with a tag called v0.1.0 and this repository contains a directory called poteto like the cue package name. In this case i have to do: `dagger mod get gitlab.banana.org/wonderful.git/[email protected]` The resulting package name will be gitlab.banana.org/wonderful.git/poteto It would be better to remove the .git suffix or just treat gitlab (or others) the same way as github, in other words, make this command work: `dagger mod get gitlab.banana.org/wonderful/[email protected]`
https://github.com/dagger/dagger/issues/1378
https://github.com/dagger/dagger/pull/1431
e60b9dc268e491623f1327c7652ccda0664ca25b
455beae7622e026e399b22ff02155e4b5b529b9a
2022-01-10T18:04:14Z
go
2022-01-18T09:11:21Z
mod/require.go
package mod import ( "fmt" "os" "path" "path/filepath" "regexp" "strings" "go.dagger.io/dagger/pkg" ) type Require struct {
closed
dagger/dagger
https://github.com/dagger/dagger
1,378
Inconsistencies in dagger mod get
Currently you are forced to use the .git suffix if the repository is not from github. The imported package keeps the suffix thus altering the import directive to be used, therefore the import will be different in the tests of the project containing the package compared to projects where dagger mod get is used. Moreover, the structure of a [package](https://github.com/grouville/dagger-serverless) is different from what is [documented](https://docs.dagger.io/1010/dev-cue-package/) Supposing we have a repository called gitlab.banana.org/wonderful with a tag called v0.1.0 and this repository contains a directory called poteto like the cue package name. In this case i have to do: `dagger mod get gitlab.banana.org/wonderful.git/[email protected]` The resulting package name will be gitlab.banana.org/wonderful.git/poteto It would be better to remove the .git suffix or just treat gitlab (or others) the same way as github, in other words, make this command work: `dagger mod get gitlab.banana.org/wonderful/[email protected]`
https://github.com/dagger/dagger/issues/1378
https://github.com/dagger/dagger/pull/1431
e60b9dc268e491623f1327c7652ccda0664ca25b
455beae7622e026e399b22ff02155e4b5b529b9a
2022-01-10T18:04:14Z
go
2022-01-18T09:11:21Z
mod/require.go
repo string path string cloneRepo string clonePath string version string versionConstraint string checksum string } func newRequire(repoName, versionConstraint string) (*Require, error) { switch { case strings.HasPrefix(repoName, "github.com"): return parseGithubRepoName(repoName, versionConstraint) case strings.HasPrefix(repoName, pkg.AlphaModule): return parseDaggerRepoName(repoName, versionConstraint) case strings.Contains(repoName, ".git"): return parseGitRepoName(repoName, versionConstraint) default: return nil, fmt.Errorf("repo name does not match suported providers") } } var githubRepoNameRegex = regexp.MustCompile(`(github.com/[a-zA-Z0-9_.-]+/[a-zA-Z0-9_.-]+)([a-zA-Z0-9/_.-]*)@?([0-9a-zA-Z.-]*)`) func parseGithubRepoName(repoName, versionConstraint string) (*Require, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
1,378
Inconsistencies in dagger mod get
Currently you are forced to use the .git suffix if the repository is not from github. The imported package keeps the suffix thus altering the import directive to be used, therefore the import will be different in the tests of the project containing the package compared to projects where dagger mod get is used. Moreover, the structure of a [package](https://github.com/grouville/dagger-serverless) is different from what is [documented](https://docs.dagger.io/1010/dev-cue-package/) Supposing we have a repository called gitlab.banana.org/wonderful with a tag called v0.1.0 and this repository contains a directory called poteto like the cue package name. In this case i have to do: `dagger mod get gitlab.banana.org/wonderful.git/[email protected]` The resulting package name will be gitlab.banana.org/wonderful.git/poteto It would be better to remove the .git suffix or just treat gitlab (or others) the same way as github, in other words, make this command work: `dagger mod get gitlab.banana.org/wonderful/[email protected]`
https://github.com/dagger/dagger/issues/1378
https://github.com/dagger/dagger/pull/1431
e60b9dc268e491623f1327c7652ccda0664ca25b
455beae7622e026e399b22ff02155e4b5b529b9a
2022-01-10T18:04:14Z
go
2022-01-18T09:11:21Z
mod/require.go
repoMatches := githubRepoNameRegex.FindStringSubmatch(repoName) if len(repoMatches) < 4 { return nil, fmt.Errorf("issue when parsing github repo") } return &Require{ repo: repoMatches[1], path: repoMatches[2], version: repoMatches[3], versionConstraint: versionConstraint, cloneRepo: repoMatches[1], clonePath: repoMatches[2], }, nil } var daggerRepoNameRegex = regexp.MustCompile(pkg.AlphaModule + `([a-zA-Z0-9/_.-]*)@?([0-9a-zA-Z.-]*)`) func parseDaggerRepoName(repoName, versionConstraint string) (*Require, error) { repoMatches := daggerRepoNameRegex.FindStringSubmatch(repoName) if len(repoMatches) < 3 { return nil, fmt.Errorf("issue when parsing dagger repo") } return &Require{ repo: pkg.AlphaModule, path: repoMatches[1], version: repoMatches[2], versionConstraint: versionConstraint, cloneRepo: "github.com/dagger/examples", clonePath: path.Join("/helloapp", repoMatches[1]), }, nil } var gitRepoNameRegex = regexp.MustCompile(`^([a-zA-Z0-9_.-]+\.[a-zA-Z0-9]+(?::\d*)?/[a-zA-Z0-9_.-/]+?\.git)([a-zA-Z0-9/_.-]*)?@?([0-9a-zA-Z.-]*)`) func parseGitRepoName(repoName, versionConstraint string) (*Require, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
1,378
Inconsistencies in dagger mod get
Currently you are forced to use the .git suffix if the repository is not from github. The imported package keeps the suffix thus altering the import directive to be used, therefore the import will be different in the tests of the project containing the package compared to projects where dagger mod get is used. Moreover, the structure of a [package](https://github.com/grouville/dagger-serverless) is different from what is [documented](https://docs.dagger.io/1010/dev-cue-package/) Supposing we have a repository called gitlab.banana.org/wonderful with a tag called v0.1.0 and this repository contains a directory called poteto like the cue package name. In this case i have to do: `dagger mod get gitlab.banana.org/wonderful.git/[email protected]` The resulting package name will be gitlab.banana.org/wonderful.git/poteto It would be better to remove the .git suffix or just treat gitlab (or others) the same way as github, in other words, make this command work: `dagger mod get gitlab.banana.org/wonderful/[email protected]`
https://github.com/dagger/dagger/issues/1378
https://github.com/dagger/dagger/pull/1431
e60b9dc268e491623f1327c7652ccda0664ca25b
455beae7622e026e399b22ff02155e4b5b529b9a
2022-01-10T18:04:14Z
go
2022-01-18T09:11:21Z
mod/require.go
repoMatches := gitRepoNameRegex.FindStringSubmatch(repoName) if len(repoMatches) < 3 { return nil, fmt.Errorf("issue when parsing git repo") } return &Require{ repo: repoMatches[1], path: repoMatches[2], version: repoMatches[3], versionConstraint: versionConstraint, cloneRepo: repoMatches[1], clonePath: repoMatches[2], }, nil } func (r *Require) String() string { return fmt.Sprintf("%s@%s", r.fullPath(), r.version) } func (r *Require) fullPath() string { return path.Join(r.repo, r.path) } func replace(r *Require, sourceRepoPath, destPath string) error {
closed
dagger/dagger
https://github.com/dagger/dagger
1,378
Inconsistencies in dagger mod get
Currently you are forced to use the .git suffix if the repository is not from github. The imported package keeps the suffix thus altering the import directive to be used, therefore the import will be different in the tests of the project containing the package compared to projects where dagger mod get is used. Moreover, the structure of a [package](https://github.com/grouville/dagger-serverless) is different from what is [documented](https://docs.dagger.io/1010/dev-cue-package/) Supposing we have a repository called gitlab.banana.org/wonderful with a tag called v0.1.0 and this repository contains a directory called poteto like the cue package name. In this case i have to do: `dagger mod get gitlab.banana.org/wonderful.git/[email protected]` The resulting package name will be gitlab.banana.org/wonderful.git/poteto It would be better to remove the .git suffix or just treat gitlab (or others) the same way as github, in other words, make this command work: `dagger mod get gitlab.banana.org/wonderful/[email protected]`
https://github.com/dagger/dagger/issues/1378
https://github.com/dagger/dagger/pull/1431
e60b9dc268e491623f1327c7652ccda0664ca25b
455beae7622e026e399b22ff02155e4b5b529b9a
2022-01-10T18:04:14Z
go
2022-01-18T09:11:21Z
mod/require.go
if err := os.RemoveAll(destPath); err != nil { return err } if err := os.MkdirAll(filepath.Dir(destPath), 0755); err != nil { return err } if err := os.Rename(path.Join(sourceRepoPath, r.clonePath), destPath); err != nil { return err } return nil }
closed
dagger/dagger
https://github.com/dagger/dagger
1,378
Inconsistencies in dagger mod get
Currently you are forced to use the .git suffix if the repository is not from github. The imported package keeps the suffix thus altering the import directive to be used, therefore the import will be different in the tests of the project containing the package compared to projects where dagger mod get is used. Moreover, the structure of a [package](https://github.com/grouville/dagger-serverless) is different from what is [documented](https://docs.dagger.io/1010/dev-cue-package/) Supposing we have a repository called gitlab.banana.org/wonderful with a tag called v0.1.0 and this repository contains a directory called poteto like the cue package name. In this case i have to do: `dagger mod get gitlab.banana.org/wonderful.git/[email protected]` The resulting package name will be gitlab.banana.org/wonderful.git/poteto It would be better to remove the .git suffix or just treat gitlab (or others) the same way as github, in other words, make this command work: `dagger mod get gitlab.banana.org/wonderful/[email protected]`
https://github.com/dagger/dagger/issues/1378
https://github.com/dagger/dagger/pull/1431
e60b9dc268e491623f1327c7652ccda0664ca25b
455beae7622e026e399b22ff02155e4b5b529b9a
2022-01-10T18:04:14Z
go
2022-01-18T09:11:21Z
mod/require_test.go
package mod import ( "testing" ) func TestParseArgument(t *testing.T) { cases := []struct { name string in string want *Require hasError bool }{ { name: "Random", in: "abcd/bla@:/xyz", hasError: true, }, { name: "Dagger repo", in: "github.com/dagger/dagger", want: &Require{
closed
dagger/dagger
https://github.com/dagger/dagger
1,378
Inconsistencies in dagger mod get
Currently you are forced to use the .git suffix if the repository is not from github. The imported package keeps the suffix thus altering the import directive to be used, therefore the import will be different in the tests of the project containing the package compared to projects where dagger mod get is used. Moreover, the structure of a [package](https://github.com/grouville/dagger-serverless) is different from what is [documented](https://docs.dagger.io/1010/dev-cue-package/) Supposing we have a repository called gitlab.banana.org/wonderful with a tag called v0.1.0 and this repository contains a directory called poteto like the cue package name. In this case i have to do: `dagger mod get gitlab.banana.org/wonderful.git/[email protected]` The resulting package name will be gitlab.banana.org/wonderful.git/poteto It would be better to remove the .git suffix or just treat gitlab (or others) the same way as github, in other words, make this command work: `dagger mod get gitlab.banana.org/wonderful/[email protected]`
https://github.com/dagger/dagger/issues/1378
https://github.com/dagger/dagger/pull/1431
e60b9dc268e491623f1327c7652ccda0664ca25b
455beae7622e026e399b22ff02155e4b5b529b9a
2022-01-10T18:04:14Z
go
2022-01-18T09:11:21Z
mod/require_test.go
repo: "github.com/dagger/dagger", path: "", version: "", }, }, { name: "Dagger repo with path", in: "github.com/dagger/dagger/stdlib", want: &Require{ repo: "github.com/dagger/dagger", path: "/stdlib", version: "", }, }, { name: "Dagger repo with longer path", in: "github.com/dagger/dagger/stdlib/test/test", want: &Require{ repo: "github.com/dagger/dagger", path: "/stdlib/test/test", version: "", }, }, { name: "Dagger repo with path and version", in: "github.com/dagger/dagger/[email protected]", want: &Require{ repo: "github.com/dagger/dagger", path: "/stdlib", version: "v0.1",
closed
dagger/dagger
https://github.com/dagger/dagger
1,378
Inconsistencies in dagger mod get
Currently you are forced to use the .git suffix if the repository is not from github. The imported package keeps the suffix thus altering the import directive to be used, therefore the import will be different in the tests of the project containing the package compared to projects where dagger mod get is used. Moreover, the structure of a [package](https://github.com/grouville/dagger-serverless) is different from what is [documented](https://docs.dagger.io/1010/dev-cue-package/) Supposing we have a repository called gitlab.banana.org/wonderful with a tag called v0.1.0 and this repository contains a directory called poteto like the cue package name. In this case i have to do: `dagger mod get gitlab.banana.org/wonderful.git/[email protected]` The resulting package name will be gitlab.banana.org/wonderful.git/poteto It would be better to remove the .git suffix or just treat gitlab (or others) the same way as github, in other words, make this command work: `dagger mod get gitlab.banana.org/wonderful/[email protected]`
https://github.com/dagger/dagger/issues/1378
https://github.com/dagger/dagger/pull/1431
e60b9dc268e491623f1327c7652ccda0664ca25b
455beae7622e026e399b22ff02155e4b5b529b9a
2022-01-10T18:04:14Z
go
2022-01-18T09:11:21Z
mod/require_test.go
}, }, { name: "Dagger repo with longer path and version tag", in: "github.com/dagger/dagger/stdlib/test/[email protected]", want: &Require{ repo: "github.com/dagger/dagger", path: "/stdlib/test/test", version: "v0.0.1", }, }, { name: "Alpha Dagger repo with path", in: "alpha.dagger.io/gcp/[email protected]", want: &Require{ repo: "alpha.dagger.io", path: "/gcp/gke", version: "v0.1.0-alpha.20", cloneRepo: "github.com/dagger/dagger", clonePath: "/stdlib/gcp/gke", }, }, { name: "Alpha Dagger repo", in: "[email protected]", want: &Require{ repo: "alpha.dagger.io", path: "", version: "v0.1.0-alpha.23", cloneRepo: "github.com/dagger/dagger",