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
3,733
Building shim can cause rate limit errors from dockerhub
We build our shim binary on the fly, which requires we pull an image. We currently pull from dockerhub, which can result in 429 throttling errors, which is surprising to users since they never even requested that image be pulled. Two options: 1. Pull the image from a different registry that doesn't have the same ratelimiting 2. Don't build the shim like that anymore; maybe pre-build it and include it in our engine image now that that's an option Current preference is 2. That approach would: 1. save us from managing another image. 2. make it easier for users to customize the engine image in the future or to mirror it on their own registries (i.e. an internal company one) 3. be more performant (pull everything at once) --- Option 2 is easier said than done unfortunately. There's not really a built-in way to just mount a binary from the **buildkitd's host filesystem** into arbitrary execs. Execs are supposed to be fully specified by LLB and LLB alone, and LLB can only include references to the **client's** host filesystem (which is not the same buildkitd's). There are bunch of possible approaches, but there's one that sticks out to me as being not that hacky and also *relatively* easy: hook into the runc executor. Right now, our buildkitd uses `runc` to start containers. We can use oci runtime hooks to modify the spec of those containers to include a mount of our shim binary into each container. * I know of [this existing tool](https://github.com/awslabs/oci-add-hooks) for accomplishing this pretty easily, but it's also not even that hard to roll our own if a compelling need arises. In the future if we decide to switch to the containerd backend then that same approach will probably still work because the default containerd runtime uses runc. But at that point we could also have our own runtime (containerd coincidentally also uses the terminology "shim"...) too, so there will be lots of options. Pros: 1. Fairly easy 2. Robust enough - just reuses existing well defined mechanisms for hooking into container runtimes 3. Doesn't require any upstream changes to buildkitd afaict 4. A nice re-usable mechanism in the future in case we ever need to mount anything else from the buildkitd host direct into the container Cons: 1. The shim binary will no longer be part of LLB and thus won't count towards the cache key. Changing the shim won't invalidate cache * Actually, as I write this, that might just make sense... the shim is a component of the runner, so just like changing buildkitd doesn't invalidate cache, neither should the shim? Sort of a gray area, but this isn't actually an obvious con I suppose.
https://github.com/dagger/dagger/issues/3733
https://github.com/dagger/dagger/pull/3913
9443adaa8f5bafe062eb757ac596c198391c9b61
32c1d82fa2c715a32e7d7d0c95d6a50e96c09fae
2022-11-08T19:17:23Z
go
2022-11-18T03:37:21Z
internal/mage/util/util.go
buildkitBase.FS().WithFile("/usr/bin/"+engineSessionBin+"-"+os+"-"+arch, builtBin), ) } } platformVariants = append(platformVariants, buildkitBase) } return platformVariants } var devEngineOnce sync.Once var devEngineContainerName string var devEngineErr error func DevEngine(ctx context.Context, c *dagger.Client) (string, error) { devEngineOnce.Do(func() { tmpfile, err := os.CreateTemp("", "dagger-engine-export") if err != nil { devEngineErr = err return } defer os.Remove(tmpfile.Name()) _, err = c.Container().Export(ctx, tmpfile.Name(), dagger.ContainerExportOpts{ PlatformVariants: DevEngineContainer(c, []string{runtime.GOARCH}, []string{runtime.GOOS}), }) if err != nil { devEngineErr = err return } containerName := "test-dagger-engine" volumeName := "test-dagger-engine" imageName := "localhost/test-dagger-engine:latest"
closed
dagger/dagger
https://github.com/dagger/dagger
3,733
Building shim can cause rate limit errors from dockerhub
We build our shim binary on the fly, which requires we pull an image. We currently pull from dockerhub, which can result in 429 throttling errors, which is surprising to users since they never even requested that image be pulled. Two options: 1. Pull the image from a different registry that doesn't have the same ratelimiting 2. Don't build the shim like that anymore; maybe pre-build it and include it in our engine image now that that's an option Current preference is 2. That approach would: 1. save us from managing another image. 2. make it easier for users to customize the engine image in the future or to mirror it on their own registries (i.e. an internal company one) 3. be more performant (pull everything at once) --- Option 2 is easier said than done unfortunately. There's not really a built-in way to just mount a binary from the **buildkitd's host filesystem** into arbitrary execs. Execs are supposed to be fully specified by LLB and LLB alone, and LLB can only include references to the **client's** host filesystem (which is not the same buildkitd's). There are bunch of possible approaches, but there's one that sticks out to me as being not that hacky and also *relatively* easy: hook into the runc executor. Right now, our buildkitd uses `runc` to start containers. We can use oci runtime hooks to modify the spec of those containers to include a mount of our shim binary into each container. * I know of [this existing tool](https://github.com/awslabs/oci-add-hooks) for accomplishing this pretty easily, but it's also not even that hard to roll our own if a compelling need arises. In the future if we decide to switch to the containerd backend then that same approach will probably still work because the default containerd runtime uses runc. But at that point we could also have our own runtime (containerd coincidentally also uses the terminology "shim"...) too, so there will be lots of options. Pros: 1. Fairly easy 2. Robust enough - just reuses existing well defined mechanisms for hooking into container runtimes 3. Doesn't require any upstream changes to buildkitd afaict 4. A nice re-usable mechanism in the future in case we ever need to mount anything else from the buildkitd host direct into the container Cons: 1. The shim binary will no longer be part of LLB and thus won't count towards the cache key. Changing the shim won't invalidate cache * Actually, as I write this, that might just make sense... the shim is a component of the runner, so just like changing buildkitd doesn't invalidate cache, neither should the shim? Sort of a gray area, but this isn't actually an obvious con I suppose.
https://github.com/dagger/dagger/issues/3733
https://github.com/dagger/dagger/pull/3913
9443adaa8f5bafe062eb757ac596c198391c9b61
32c1d82fa2c715a32e7d7d0c95d6a50e96c09fae
2022-11-08T19:17:23Z
go
2022-11-18T03:37:21Z
internal/mage/util/util.go
loadCmd := exec.CommandContext(ctx, "docker", "load", "-i", tmpfile.Name()) output, err := loadCmd.CombinedOutput() if err != nil { devEngineErr = fmt.Errorf("docker load failed: %w: %s", err, output) return } _, imageID, ok := strings.Cut(string(output), "sha256:") if !ok { devEngineErr = fmt.Errorf("unexpected output from docker load: %s", output) return } imageID = strings.TrimSpace(imageID) if output, err := exec.CommandContext(ctx, "docker", "tag", imageID, imageName, ).CombinedOutput(); err != nil { devEngineErr = fmt.Errorf("docker tag: %w: %s", err, output) return } if output, err := exec.CommandContext(ctx, "docker", "rm", "-fv", containerName, ).CombinedOutput(); err != nil { devEngineErr = fmt.Errorf("docker rm: %w: %s", err, output) return } if output, err := exec.CommandContext(ctx, "docker", "run",
closed
dagger/dagger
https://github.com/dagger/dagger
3,733
Building shim can cause rate limit errors from dockerhub
We build our shim binary on the fly, which requires we pull an image. We currently pull from dockerhub, which can result in 429 throttling errors, which is surprising to users since they never even requested that image be pulled. Two options: 1. Pull the image from a different registry that doesn't have the same ratelimiting 2. Don't build the shim like that anymore; maybe pre-build it and include it in our engine image now that that's an option Current preference is 2. That approach would: 1. save us from managing another image. 2. make it easier for users to customize the engine image in the future or to mirror it on their own registries (i.e. an internal company one) 3. be more performant (pull everything at once) --- Option 2 is easier said than done unfortunately. There's not really a built-in way to just mount a binary from the **buildkitd's host filesystem** into arbitrary execs. Execs are supposed to be fully specified by LLB and LLB alone, and LLB can only include references to the **client's** host filesystem (which is not the same buildkitd's). There are bunch of possible approaches, but there's one that sticks out to me as being not that hacky and also *relatively* easy: hook into the runc executor. Right now, our buildkitd uses `runc` to start containers. We can use oci runtime hooks to modify the spec of those containers to include a mount of our shim binary into each container. * I know of [this existing tool](https://github.com/awslabs/oci-add-hooks) for accomplishing this pretty easily, but it's also not even that hard to roll our own if a compelling need arises. In the future if we decide to switch to the containerd backend then that same approach will probably still work because the default containerd runtime uses runc. But at that point we could also have our own runtime (containerd coincidentally also uses the terminology "shim"...) too, so there will be lots of options. Pros: 1. Fairly easy 2. Robust enough - just reuses existing well defined mechanisms for hooking into container runtimes 3. Doesn't require any upstream changes to buildkitd afaict 4. A nice re-usable mechanism in the future in case we ever need to mount anything else from the buildkitd host direct into the container Cons: 1. The shim binary will no longer be part of LLB and thus won't count towards the cache key. Changing the shim won't invalidate cache * Actually, as I write this, that might just make sense... the shim is a component of the runner, so just like changing buildkitd doesn't invalidate cache, neither should the shim? Sort of a gray area, but this isn't actually an obvious con I suppose.
https://github.com/dagger/dagger/issues/3733
https://github.com/dagger/dagger/pull/3913
9443adaa8f5bafe062eb757ac596c198391c9b61
32c1d82fa2c715a32e7d7d0c95d6a50e96c09fae
2022-11-08T19:17:23Z
go
2022-11-18T03:37:21Z
internal/mage/util/util.go
"-d", "--rm", "-v", volumeName+":/var/lib/buildkit", "--name", containerName, "--privileged", imageName, "--debug", ).CombinedOutput(); err != nil { devEngineErr = fmt.Errorf("docker run: %w: %s", err, output) return } devEngineContainerName = containerName }) return devEngineContainerName, devEngineErr } func WithDevEngine(ctx context.Context, c *dagger.Client, cb func(context.Context, *dagger.Client) error) error { containerName, err := DevEngine(ctx, c) if err != nil { return err } os.Setenv("DAGGER_HOST", "docker-container:"+containerName) defer os.Unsetenv("DAGGER_HOST") otherClient, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr)) if err != nil { return err } return cb(ctx, otherClient) }
closed
dagger/dagger
https://github.com/dagger/dagger
3,950
🐞 Can't run mage on macos
### What is the issue? Running mage tasks locally in macos fails because, I suppose, the `test-dagger-engine` container has a binary for my host (`dagger-engine-session-darwin-arm64`) but not for running inside a container (linux in dagger-in-dagger). Examples: ```shell $ ./hack/make sdk:python:test $ ./hack/make sdk:go:lint ``` ### Log output ``` #0 0.056 container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/usr/bin/dagger-engine-session-linux-arm64" to rootfs at "/.dagger_engine_session" caused: stat /usr/bin/dagger-engine-session-linux-arm64: no such file or directory ``` \cc @sipsma
https://github.com/dagger/dagger/issues/3950
https://github.com/dagger/dagger/pull/3954
9e4aac59a0e6e99c58c046ccc0c61ea6e2e82b95
eb9ef56fc4958bf5e1ac781533cdf0cb92da4401
2022-11-22T13:20:15Z
go
2022-11-22T17:13:25Z
internal/mage/util/util.go
package util import ( "context" "fmt" "os" "os/exec" "path/filepath" "runtime" "strings" "sync" "dagger.io/dagger" ) func Repository(c *dagger.Client) *dagger.Directory { return c.Host().Directory(".", dagger.HostDirectoryOpts{ Exclude: []string{ "**/node_modules", "**/__pycache__", "**/.venv", "**/.mypy_cache", "**/.pytest_cache", }, }) } func RepositoryGoCodeOnly(c *dagger.Client) *dagger.Directory {
closed
dagger/dagger
https://github.com/dagger/dagger
3,950
🐞 Can't run mage on macos
### What is the issue? Running mage tasks locally in macos fails because, I suppose, the `test-dagger-engine` container has a binary for my host (`dagger-engine-session-darwin-arm64`) but not for running inside a container (linux in dagger-in-dagger). Examples: ```shell $ ./hack/make sdk:python:test $ ./hack/make sdk:go:lint ``` ### Log output ``` #0 0.056 container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/usr/bin/dagger-engine-session-linux-arm64" to rootfs at "/.dagger_engine_session" caused: stat /usr/bin/dagger-engine-session-linux-arm64: no such file or directory ``` \cc @sipsma
https://github.com/dagger/dagger/issues/3950
https://github.com/dagger/dagger/pull/3954
9e4aac59a0e6e99c58c046ccc0c61ea6e2e82b95
eb9ef56fc4958bf5e1ac781533cdf0cb92da4401
2022-11-22T13:20:15Z
go
2022-11-22T17:13:25Z
internal/mage/util/util.go
return c.Directory().WithDirectory("/", Repository(c), dagger.DirectoryWithDirectoryOpts{ Include: []string{ "**/*.go", ".git", "**/go.mod", "**/go.sum", "**/*.go.tmpl", "**/*.ts.tmpl", "**/*.graphqls", "**/*.graphql", ".golangci.yml", "**/Dockerfile", "**/README.md", }, }) } func GoBase(c *dagger.Client) *dagger.Container {
closed
dagger/dagger
https://github.com/dagger/dagger
3,950
🐞 Can't run mage on macos
### What is the issue? Running mage tasks locally in macos fails because, I suppose, the `test-dagger-engine` container has a binary for my host (`dagger-engine-session-darwin-arm64`) but not for running inside a container (linux in dagger-in-dagger). Examples: ```shell $ ./hack/make sdk:python:test $ ./hack/make sdk:go:lint ``` ### Log output ``` #0 0.056 container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/usr/bin/dagger-engine-session-linux-arm64" to rootfs at "/.dagger_engine_session" caused: stat /usr/bin/dagger-engine-session-linux-arm64: no such file or directory ``` \cc @sipsma
https://github.com/dagger/dagger/issues/3950
https://github.com/dagger/dagger/pull/3954
9e4aac59a0e6e99c58c046ccc0c61ea6e2e82b95
eb9ef56fc4958bf5e1ac781533cdf0cb92da4401
2022-11-22T13:20:15Z
go
2022-11-22T17:13:25Z
internal/mage/util/util.go
repo := RepositoryGoCodeOnly(c) goMods := c.Directory() for _, f := range []string{"go.mod", "go.sum", "sdk/go/go.mod", "sdk/go/go.sum"} { goMods = goMods.WithFile(f, repo.File(f)) } return c.Container(). From("golang:1.19-alpine"). Exec(dagger.ContainerExecOpts{Args: []string{"apk", "add", "build-base"}}). WithEnvVariable("CGO_ENABLED", "0"). Exec(dagger.ContainerExecOpts{ Args: []string{"apk", "add", "git"}, }). WithWorkdir("/app"). WithMountedDirectory("/app", goMods). Exec(dagger.ContainerExecOpts{Args: []string{"go", "mod", "download"}}). WithMountedDirectory("/app", repo) } func DaggerBinary(c *dagger.Client) *dagger.File {
closed
dagger/dagger
https://github.com/dagger/dagger
3,950
🐞 Can't run mage on macos
### What is the issue? Running mage tasks locally in macos fails because, I suppose, the `test-dagger-engine` container has a binary for my host (`dagger-engine-session-darwin-arm64`) but not for running inside a container (linux in dagger-in-dagger). Examples: ```shell $ ./hack/make sdk:python:test $ ./hack/make sdk:go:lint ``` ### Log output ``` #0 0.056 container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/usr/bin/dagger-engine-session-linux-arm64" to rootfs at "/.dagger_engine_session" caused: stat /usr/bin/dagger-engine-session-linux-arm64: no such file or directory ``` \cc @sipsma
https://github.com/dagger/dagger/issues/3950
https://github.com/dagger/dagger/pull/3954
9e4aac59a0e6e99c58c046ccc0c61ea6e2e82b95
eb9ef56fc4958bf5e1ac781533cdf0cb92da4401
2022-11-22T13:20:15Z
go
2022-11-22T17:13:25Z
internal/mage/util/util.go
return GoBase(c). WithExec([]string{"go", "build", "-o", "./bin/dagger", "-ldflags", "-s -w", "./cmd/dagger"}). File("./bin/dagger") } func ClientGenBinary(c *dagger.Client) *dagger.File {
closed
dagger/dagger
https://github.com/dagger/dagger
3,950
🐞 Can't run mage on macos
### What is the issue? Running mage tasks locally in macos fails because, I suppose, the `test-dagger-engine` container has a binary for my host (`dagger-engine-session-darwin-arm64`) but not for running inside a container (linux in dagger-in-dagger). Examples: ```shell $ ./hack/make sdk:python:test $ ./hack/make sdk:go:lint ``` ### Log output ``` #0 0.056 container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/usr/bin/dagger-engine-session-linux-arm64" to rootfs at "/.dagger_engine_session" caused: stat /usr/bin/dagger-engine-session-linux-arm64: no such file or directory ``` \cc @sipsma
https://github.com/dagger/dagger/issues/3950
https://github.com/dagger/dagger/pull/3954
9e4aac59a0e6e99c58c046ccc0c61ea6e2e82b95
eb9ef56fc4958bf5e1ac781533cdf0cb92da4401
2022-11-22T13:20:15Z
go
2022-11-22T17:13:25Z
internal/mage/util/util.go
return GoBase(c). WithExec([]string{"go", "build", "-o", "./bin/client-gen", "-ldflags", "-s -w", "./cmd/client-gen"}). File("./bin/client-gen") } func EngineSessionBinary(c *dagger.Client) *dagger.File { return GoBase(c). WithExec([]string{"go", "build", "-o", "./bin/dagger-engine-session", "-ldflags", "-s -w", "./cmd/engine-session"}). File("./bin/dagger-engine-session") } func HostDockerDir(c *dagger.Client) *dagger.Directory { home, err := os.UserHomeDir() if err != nil { return c.Directory() } path := filepath.Join(home, ".docker") if _, err := os.Stat(path); err != nil { return c.Directory() } return c.Host().Directory(path) } const ( engineSessionBinName = "dagger-engine-session" shimBinName = "dagger-shim" buildkitRepo = "github.com/moby/buildkit" buildkitBranch = "v0.10.5" ) func DevEngineContainer(c *dagger.Client, arches, oses []string) []*dagger.Container {
closed
dagger/dagger
https://github.com/dagger/dagger
3,950
🐞 Can't run mage on macos
### What is the issue? Running mage tasks locally in macos fails because, I suppose, the `test-dagger-engine` container has a binary for my host (`dagger-engine-session-darwin-arm64`) but not for running inside a container (linux in dagger-in-dagger). Examples: ```shell $ ./hack/make sdk:python:test $ ./hack/make sdk:go:lint ``` ### Log output ``` #0 0.056 container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/usr/bin/dagger-engine-session-linux-arm64" to rootfs at "/.dagger_engine_session" caused: stat /usr/bin/dagger-engine-session-linux-arm64: no such file or directory ``` \cc @sipsma
https://github.com/dagger/dagger/issues/3950
https://github.com/dagger/dagger/pull/3954
9e4aac59a0e6e99c58c046ccc0c61ea6e2e82b95
eb9ef56fc4958bf5e1ac781533cdf0cb92da4401
2022-11-22T13:20:15Z
go
2022-11-22T17:13:25Z
internal/mage/util/util.go
buildkitRepo := c.Git(buildkitRepo).Branch(buildkitBranch).Tree() platformVariants := make([]*dagger.Container, 0, len(arches)) for _, arch := range arches { buildkitBase := c.Container(dagger.ContainerOpts{ Platform: dagger.Platform("linux/" + arch), }).Build(buildkitRepo) for _, os := range oses { for _, arch := range arches { builtBin := GoBase(c). WithEnvVariable("GOOS", os). WithEnvVariable("GOARCH", arch). Exec(dagger.ContainerExecOpts{ Args: []string{"go", "build", "-o", "./bin/" + engineSessionBinName, "-ldflags", "-s -w", "/app/cmd/engine-session"}, }). File("./bin/" + engineSessionBinName) buildkitBase = buildkitBase.WithFS( buildkitBase.FS().WithFile("/usr/bin/"+engineSessionBinName+"-"+os+"-"+arch, builtBin), ) }
closed
dagger/dagger
https://github.com/dagger/dagger
3,950
🐞 Can't run mage on macos
### What is the issue? Running mage tasks locally in macos fails because, I suppose, the `test-dagger-engine` container has a binary for my host (`dagger-engine-session-darwin-arm64`) but not for running inside a container (linux in dagger-in-dagger). Examples: ```shell $ ./hack/make sdk:python:test $ ./hack/make sdk:go:lint ``` ### Log output ``` #0 0.056 container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/usr/bin/dagger-engine-session-linux-arm64" to rootfs at "/.dagger_engine_session" caused: stat /usr/bin/dagger-engine-session-linux-arm64: no such file or directory ``` \cc @sipsma
https://github.com/dagger/dagger/issues/3950
https://github.com/dagger/dagger/pull/3954
9e4aac59a0e6e99c58c046ccc0c61ea6e2e82b95
eb9ef56fc4958bf5e1ac781533cdf0cb92da4401
2022-11-22T13:20:15Z
go
2022-11-22T17:13:25Z
internal/mage/util/util.go
} shimBin := GoBase(c). WithEnvVariable("GOOS", "linux"). WithEnvVariable("GOARCH", arch). Exec(dagger.ContainerExecOpts{ Args: []string{"go", "build", "-o", "./bin/" + shimBinName, "-ldflags", "-s -w", "/app/cmd/shim"}, }). File("./bin/" + shimBinName) buildkitBase = buildkitBase.WithFS( buildkitBase.FS().WithFile("/usr/bin/"+shimBinName, shimBin), ) buildkitBase = buildkitBase.WithEntrypoint([]string{ "buildkitd", "--oci-worker-binary", "/usr/bin/" + shimBinName, }) platformVariants = append(platformVariants, buildkitBase) } return platformVariants } var ( devEngineOnce sync.Once devEngineContainerName string devEngineErr error ) func DevEngine(ctx context.Context, c *dagger.Client) (string, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
3,950
🐞 Can't run mage on macos
### What is the issue? Running mage tasks locally in macos fails because, I suppose, the `test-dagger-engine` container has a binary for my host (`dagger-engine-session-darwin-arm64`) but not for running inside a container (linux in dagger-in-dagger). Examples: ```shell $ ./hack/make sdk:python:test $ ./hack/make sdk:go:lint ``` ### Log output ``` #0 0.056 container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/usr/bin/dagger-engine-session-linux-arm64" to rootfs at "/.dagger_engine_session" caused: stat /usr/bin/dagger-engine-session-linux-arm64: no such file or directory ``` \cc @sipsma
https://github.com/dagger/dagger/issues/3950
https://github.com/dagger/dagger/pull/3954
9e4aac59a0e6e99c58c046ccc0c61ea6e2e82b95
eb9ef56fc4958bf5e1ac781533cdf0cb92da4401
2022-11-22T13:20:15Z
go
2022-11-22T17:13:25Z
internal/mage/util/util.go
devEngineOnce.Do(func() { tmpfile, err := os.CreateTemp("", "dagger-engine-export") if err != nil { devEngineErr = err return } defer os.Remove(tmpfile.Name()) _, err = c.Container().Export(ctx, tmpfile.Name(), dagger.ContainerExportOpts{ PlatformVariants: DevEngineContainer(c, []string{runtime.GOARCH}, []string{runtime.GOOS}), }) if err != nil { devEngineErr = err return } containerName := "test-dagger-engine" volumeName := "test-dagger-engine" imageName := "localhost/test-dagger-engine:latest" loadCmd := exec.CommandContext(ctx, "docker", "load", "-i", tmpfile.Name()) output, err := loadCmd.CombinedOutput()
closed
dagger/dagger
https://github.com/dagger/dagger
3,950
🐞 Can't run mage on macos
### What is the issue? Running mage tasks locally in macos fails because, I suppose, the `test-dagger-engine` container has a binary for my host (`dagger-engine-session-darwin-arm64`) but not for running inside a container (linux in dagger-in-dagger). Examples: ```shell $ ./hack/make sdk:python:test $ ./hack/make sdk:go:lint ``` ### Log output ``` #0 0.056 container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/usr/bin/dagger-engine-session-linux-arm64" to rootfs at "/.dagger_engine_session" caused: stat /usr/bin/dagger-engine-session-linux-arm64: no such file or directory ``` \cc @sipsma
https://github.com/dagger/dagger/issues/3950
https://github.com/dagger/dagger/pull/3954
9e4aac59a0e6e99c58c046ccc0c61ea6e2e82b95
eb9ef56fc4958bf5e1ac781533cdf0cb92da4401
2022-11-22T13:20:15Z
go
2022-11-22T17:13:25Z
internal/mage/util/util.go
if err != nil { devEngineErr = fmt.Errorf("docker load failed: %w: %s", err, output) return } _, imageID, ok := strings.Cut(string(output), "sha256:") if !ok { devEngineErr = fmt.Errorf("unexpected output from docker load: %s", output) return } imageID = strings.TrimSpace(imageID) if output, err := exec.CommandContext(ctx, "docker", "tag", imageID, imageName, ).CombinedOutput(); err != nil { devEngineErr = fmt.Errorf("docker tag: %w: %s", err, output) return } if output, err := exec.CommandContext(ctx, "docker", "rm", "-fv", containerName, ).CombinedOutput(); err != nil { devEngineErr = fmt.Errorf("docker rm: %w: %s", err, output) return } if output, err := exec.CommandContext(ctx, "docker", "run", "-d", "--rm",
closed
dagger/dagger
https://github.com/dagger/dagger
3,950
🐞 Can't run mage on macos
### What is the issue? Running mage tasks locally in macos fails because, I suppose, the `test-dagger-engine` container has a binary for my host (`dagger-engine-session-darwin-arm64`) but not for running inside a container (linux in dagger-in-dagger). Examples: ```shell $ ./hack/make sdk:python:test $ ./hack/make sdk:go:lint ``` ### Log output ``` #0 0.056 container_linux.go:380: starting container process caused: process_linux.go:545: container init caused: rootfs_linux.go:76: mounting "/usr/bin/dagger-engine-session-linux-arm64" to rootfs at "/.dagger_engine_session" caused: stat /usr/bin/dagger-engine-session-linux-arm64: no such file or directory ``` \cc @sipsma
https://github.com/dagger/dagger/issues/3950
https://github.com/dagger/dagger/pull/3954
9e4aac59a0e6e99c58c046ccc0c61ea6e2e82b95
eb9ef56fc4958bf5e1ac781533cdf0cb92da4401
2022-11-22T13:20:15Z
go
2022-11-22T17:13:25Z
internal/mage/util/util.go
"-v", volumeName+":/var/lib/buildkit", "--name", containerName, "--privileged", imageName, "--debug", ).CombinedOutput(); err != nil { devEngineErr = fmt.Errorf("docker run: %w: %s", err, output) return } devEngineContainerName = containerName }) return devEngineContainerName, devEngineErr } func WithDevEngine(ctx context.Context, c *dagger.Client, cb func(context.Context, *dagger.Client) error) error { containerName, err := DevEngine(ctx, c) if err != nil { return err } os.Setenv("DAGGER_HOST", "docker-container:"+containerName) defer os.Unsetenv("DAGGER_HOST") os.Setenv("DAGGER_RUNNER_HOST", "docker-container:"+containerName) defer os.Unsetenv("DAGGER_RUNNER_HOST") otherClient, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr)) if err != nil { return err } return cb(ctx, otherClient) }
closed
dagger/dagger
https://github.com/dagger/dagger
3,225
Automated tests on macos
There's a lot of tricky details to get right when starting dagger on macos: need to create buildkit running on a VM somewhere (w/ docker desktop by default for now), need to ensure LLB is using the right platform, etc. It's very easy to miss issues when you don't have a macos machine readily available to test on. While it's not trivial, we should find a way to run our CI on macos. GHA does have mac os runners, so that's an obvious possible option.
https://github.com/dagger/dagger/issues/3225
https://github.com/dagger/dagger/pull/3774
565ab02881e209372932e1b6dac86552f41b116c
571c8ae24b913fe00089062d3f918db229505a96
2022-10-04T04:53:25Z
go
2022-11-29T20:04:42Z
sdk/go/internal/engineconn/dockerprovision/image.go
package dockerprovision import ( "context" "fmt" "io" "net" "net/http" "net/url" "os" "path/filepath" "runtime" "strings" "dagger.io/dagger/internal/engineconn" "dagger.io/dagger/internal/engineconn/bin" "github.com/adrg/xdg" "github.com/opencontainers/go-digest" exec "golang.org/x/sys/execabs" ) var _ engineconn.EngineConn = &DockerImage{} func NewDockerImage(u *url.URL) (engineconn.EngineConn, error) { return &DockerImage{ imageRef: u.Host + u.Path, }, nil } type DockerImage struct {
closed
dagger/dagger
https://github.com/dagger/dagger
3,225
Automated tests on macos
There's a lot of tricky details to get right when starting dagger on macos: need to create buildkit running on a VM somewhere (w/ docker desktop by default for now), need to ensure LLB is using the right platform, etc. It's very easy to miss issues when you don't have a macos machine readily available to test on. While it's not trivial, we should find a way to run our CI on macos. GHA does have mac os runners, so that's an obvious possible option.
https://github.com/dagger/dagger/issues/3225
https://github.com/dagger/dagger/pull/3774
565ab02881e209372932e1b6dac86552f41b116c
571c8ae24b913fe00089062d3f918db229505a96
2022-10-04T04:53:25Z
go
2022-11-29T20:04:42Z
sdk/go/internal/engineconn/dockerprovision/image.go
imageRef string childStdin io.Closer } func (c *DockerImage) Connect(ctx context.Context, cfg *engineconn.Config) (*http.Client, error) { cacheDir := filepath.Join(xdg.CacheHome, "dagger") if err := os.MkdirAll(cacheDir, 0o700); err != nil { return nil, err } var id string _, dgst, ok := strings.Cut(c.imageRef, "@sha256:") if !ok { return nil, fmt.Errorf("invalid image reference %q", c.imageRef) } if err := digest.Digest("sha256:" + dgst).Validate(); err != nil { return nil, fmt.Errorf("invalid digest: %w", err) } id = dgst id = id[:hashLen] engineSessionBinName := engineSessionBinPrefix + id if runtime.GOOS == "windows" {
closed
dagger/dagger
https://github.com/dagger/dagger
3,225
Automated tests on macos
There's a lot of tricky details to get right when starting dagger on macos: need to create buildkit running on a VM somewhere (w/ docker desktop by default for now), need to ensure LLB is using the right platform, etc. It's very easy to miss issues when you don't have a macos machine readily available to test on. While it's not trivial, we should find a way to run our CI on macos. GHA does have mac os runners, so that's an obvious possible option.
https://github.com/dagger/dagger/issues/3225
https://github.com/dagger/dagger/pull/3774
565ab02881e209372932e1b6dac86552f41b116c
571c8ae24b913fe00089062d3f918db229505a96
2022-10-04T04:53:25Z
go
2022-11-29T20:04:42Z
sdk/go/internal/engineconn/dockerprovision/image.go
engineSessionBinName += ".exe" } engineSessionBinPath := filepath.Join(cacheDir, engineSessionBinName) if _, err := os.Stat(engineSessionBinPath); os.IsNotExist(err) { tmpbin, err := os.CreateTemp(cacheDir, "temp-"+engineSessionBinName) if err != nil { return nil, err } defer tmpbin.Close() defer os.Remove(tmpbin.Name()) dockerRunArgs := []string{ "docker", "run", "--rm", "--entrypoint", "/bin/cat", c.imageRef, containerEngineSessionBinPrefix + runtime.GOOS + "-" + runtime.GOARCH, } cmd := exec.CommandContext(ctx, dockerRunArgs[0], dockerRunArgs[1:]...) cmd.Stdout = tmpbin if cfg.LogOutput != nil { cmd.Stderr = cfg.LogOutput } if err := cmd.Run(); err != nil { return nil, fmt.Errorf("failed to transfer dagger-engine-session bin with command %q: %w", strings.Join(dockerRunArgs, " "), err) } if err := tmpbin.Chmod(0o700); err != nil { return nil, err } if err := tmpbin.Close(); err != nil {
closed
dagger/dagger
https://github.com/dagger/dagger
3,225
Automated tests on macos
There's a lot of tricky details to get right when starting dagger on macos: need to create buildkit running on a VM somewhere (w/ docker desktop by default for now), need to ensure LLB is using the right platform, etc. It's very easy to miss issues when you don't have a macos machine readily available to test on. While it's not trivial, we should find a way to run our CI on macos. GHA does have mac os runners, so that's an obvious possible option.
https://github.com/dagger/dagger/issues/3225
https://github.com/dagger/dagger/pull/3774
565ab02881e209372932e1b6dac86552f41b116c
571c8ae24b913fe00089062d3f918db229505a96
2022-10-04T04:53:25Z
go
2022-11-29T20:04:42Z
sdk/go/internal/engineconn/dockerprovision/image.go
return nil, err } if err := os.Rename(tmpbin.Name(), engineSessionBinPath); err != nil { return nil, err } } else if err != nil { return nil, err } entries, err := os.ReadDir(cacheDir) if err != nil { if cfg.LogOutput != nil { fmt.Fprintf(cfg.LogOutput, "failed to list cache dir: %v", err) } } else { for _, entry := range entries { if entry.Name() == engineSessionBinName { continue } if strings.HasPrefix(entry.Name(), engineSessionBinPrefix) { if err := os.Remove(filepath.Join(cacheDir, entry.Name())); err != nil { if cfg.LogOutput != nil { fmt.Fprintf(cfg.LogOutput, "failed to remove old engine session bin: %v", err) } } } } } args := []string{}
closed
dagger/dagger
https://github.com/dagger/dagger
3,225
Automated tests on macos
There's a lot of tricky details to get right when starting dagger on macos: need to create buildkit running on a VM somewhere (w/ docker desktop by default for now), need to ensure LLB is using the right platform, etc. It's very easy to miss issues when you don't have a macos machine readily available to test on. While it's not trivial, we should find a way to run our CI on macos. GHA does have mac os runners, so that's an obvious possible option.
https://github.com/dagger/dagger/issues/3225
https://github.com/dagger/dagger/pull/3774
565ab02881e209372932e1b6dac86552f41b116c
571c8ae24b913fe00089062d3f918db229505a96
2022-10-04T04:53:25Z
go
2022-11-29T20:04:42Z
sdk/go/internal/engineconn/dockerprovision/image.go
if cfg.Workdir != "" { args = append(args, "--workdir", cfg.Workdir) } if cfg.ConfigPath != "" { args = append(args, "--project", cfg.ConfigPath) } defaultDaggerRunnerHost := "docker-image://" + c.imageRef addr, childStdin, err := bin.StartEngineSession(ctx, cfg.LogOutput, defaultDaggerRunnerHost, engineSessionBinPath, args...) if err != nil { return nil, err } c.childStdin = childStdin return &http.Client{ Transport: &http.Transport{ DialContext: func(_ context.Context, _, _ string) (net.Conn, error) { return net.Dial("tcp", addr) }, }, }, nil } func (c *DockerImage) Addr() string { return "http://dagger" } func (c *DockerImage) Close() error { if c.childStdin != nil { return c.childStdin.Close() } return nil }
closed
dagger/dagger
https://github.com/dagger/dagger
3,225
Automated tests on macos
There's a lot of tricky details to get right when starting dagger on macos: need to create buildkit running on a VM somewhere (w/ docker desktop by default for now), need to ensure LLB is using the right platform, etc. It's very easy to miss issues when you don't have a macos machine readily available to test on. While it's not trivial, we should find a way to run our CI on macos. GHA does have mac os runners, so that's an obvious possible option.
https://github.com/dagger/dagger/issues/3225
https://github.com/dagger/dagger/pull/3774
565ab02881e209372932e1b6dac86552f41b116c
571c8ae24b913fe00089062d3f918db229505a96
2022-10-04T04:53:25Z
go
2022-11-29T20:04:42Z
sdk/go/provision_test.go
package dagger import ( "context" "os" "os/exec" "path/filepath" "strconv" "strings" "testing" "time" "dagger.io/dagger/internal/engineconn/dockerprovision" "github.com/adrg/xdg" "github.com/stretchr/testify/require" "golang.org/x/sync/errgroup" ) func TestImageProvision(t *testing.T) { ctx, cancel := context.WithCancel(context.Background()) defer cancel()
closed
dagger/dagger
https://github.com/dagger/dagger
3,225
Automated tests on macos
There's a lot of tricky details to get right when starting dagger on macos: need to create buildkit running on a VM somewhere (w/ docker desktop by default for now), need to ensure LLB is using the right platform, etc. It's very easy to miss issues when you don't have a macos machine readily available to test on. While it's not trivial, we should find a way to run our CI on macos. GHA does have mac os runners, so that's an obvious possible option.
https://github.com/dagger/dagger/issues/3225
https://github.com/dagger/dagger/pull/3774
565ab02881e209372932e1b6dac86552f41b116c
571c8ae24b913fe00089062d3f918db229505a96
2022-10-04T04:53:25Z
go
2022-11-29T20:04:42Z
sdk/go/provision_test.go
daggerHost, ok := os.LookupEnv("DAGGER_HOST") if ok { if !strings.HasPrefix(daggerHost, dockerprovision.DockerImageConnName+"://") { t.Skip("DAGGER_HOST is not set to docker-image://") } } tmpdir := t.TempDir() os.Setenv("XDG_CACHE_HOME", tmpdir) defer os.Unsetenv("XDG_CACHE_HOME") xdg.Reload() cacheDir := filepath.Join(tmpdir, "dagger") err := os.MkdirAll(cacheDir, 0700) require.NoError(t, err) f, err := os.Create(filepath.Join(cacheDir, "dagger-engine-session-gcme")) require.NoError(t, err) f.Close() tmpContainerName := "dagger-engine-gcme-" + strconv.Itoa(int(time.Now().UnixNano())) if output, err := exec.CommandContext(ctx, "docker", "run", "--rm", "--detach", "--name", tmpContainerName, "busybox", "sleep", "120", ).CombinedOutput(); err != nil { t.Fatalf("failed to create container: %s", output) } parallelism := 30 start := make(chan struct{})
closed
dagger/dagger
https://github.com/dagger/dagger
3,225
Automated tests on macos
There's a lot of tricky details to get right when starting dagger on macos: need to create buildkit running on a VM somewhere (w/ docker desktop by default for now), need to ensure LLB is using the right platform, etc. It's very easy to miss issues when you don't have a macos machine readily available to test on. While it's not trivial, we should find a way to run our CI on macos. GHA does have mac os runners, so that's an obvious possible option.
https://github.com/dagger/dagger/issues/3225
https://github.com/dagger/dagger/pull/3774
565ab02881e209372932e1b6dac86552f41b116c
571c8ae24b913fe00089062d3f918db229505a96
2022-10-04T04:53:25Z
go
2022-11-29T20:04:42Z
sdk/go/provision_test.go
var eg errgroup.Group for i := 0; i < parallelism; i++ { eg.Go(func() error { <-start c, err := Connect(ctx) if err != nil { return err } defer c.Close() _, err = c.Container().From("alpine:3.16").ID(ctx) return err }) }
closed
dagger/dagger
https://github.com/dagger/dagger
3,225
Automated tests on macos
There's a lot of tricky details to get right when starting dagger on macos: need to create buildkit running on a VM somewhere (w/ docker desktop by default for now), need to ensure LLB is using the right platform, etc. It's very easy to miss issues when you don't have a macos machine readily available to test on. While it's not trivial, we should find a way to run our CI on macos. GHA does have mac os runners, so that's an obvious possible option.
https://github.com/dagger/dagger/issues/3225
https://github.com/dagger/dagger/pull/3774
565ab02881e209372932e1b6dac86552f41b116c
571c8ae24b913fe00089062d3f918db229505a96
2022-10-04T04:53:25Z
go
2022-11-29T20:04:42Z
sdk/go/provision_test.go
close(start) require.NoError(t, eg.Wait()) entries, err := os.ReadDir(cacheDir) require.NoError(t, err) require.Len(t, entries, 1) entry := entries[0] require.True(t, entry.Type().IsRegular()) require.True(t, strings.HasPrefix(entry.Name(), "dagger-engine-session-")) shortSha := entry.Name()[len("dagger-engine-session-"):] require.Len(t, shortSha, 16) output, err := exec.CommandContext(ctx, "docker", "ps", "-a", "--no-trunc", ).CombinedOutput() require.NoError(t, err) var found bool for _, line := range strings.Split(string(output), "\n") { if line == "" { continue } require.NotContains(t, line, tmpContainerName) if strings.Contains(line, shortSha) { found = true break } } require.True(t, found, "container with sha %s not found in docker ps output: %s", shortSha, output) }
closed
dagger/dagger
https://github.com/dagger/dagger
4,002
CLI release test
Issue to track progress on the CLI release. - [x] `curl -L https://dl.dagger.io/dagger/install.sh DAGGER_VERSION=? | sh` - [x] `brew install dagger/tap/dagger` - for [our tap formula](https://github.com/dagger/homebrew-tap) - Move the existing `dagger.rb` to `[email protected]` - [x] `brew install dagger` - for [bottled formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/dagger.rb) - Move the existing `dagger.rb` to `[email protected]`
https://github.com/dagger/dagger/issues/4002
https://github.com/dagger/dagger/pull/4012
064879cb6b4fcaa50bf28bbcdb6d40d60dd25cba
5d18d9f5e56d704f95242304661ae9656ae85780
2022-11-28T14:30:21Z
go
2022-11-29T21:52:29Z
internal/mage/cli.go
package mage import ( "context" "os" "dagger.io/dagger" "github.com/dagger/dagger/internal/mage/util"
closed
dagger/dagger
https://github.com/dagger/dagger
4,002
CLI release test
Issue to track progress on the CLI release. - [x] `curl -L https://dl.dagger.io/dagger/install.sh DAGGER_VERSION=? | sh` - [x] `brew install dagger/tap/dagger` - for [our tap formula](https://github.com/dagger/homebrew-tap) - Move the existing `dagger.rb` to `[email protected]` - [x] `brew install dagger` - for [bottled formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/dagger.rb) - Move the existing `dagger.rb` to `[email protected]`
https://github.com/dagger/dagger/issues/4002
https://github.com/dagger/dagger/pull/4012
064879cb6b4fcaa50bf28bbcdb6d40d60dd25cba
5d18d9f5e56d704f95242304661ae9656ae85780
2022-11-28T14:30:21Z
go
2022-11-29T21:52:29Z
internal/mage/cli.go
"github.com/magefile/mage/mg" ) type Cli mg.Namespace func (cl Cli) Publish(ctx context.Context) error { c, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr)) if err != nil { return err } defer c.Close() wd := c.Host().Directory(".") container := c.Container(). From("ghcr.io/goreleaser/goreleaser:v1.12.3"). WithEntrypoint([]string{}). WithExec([]string{"apk", "add", "aws-cli"}). WithEntrypoint([]string{"/sbin/tini", "--", "/entrypoint.sh"}). WithWorkdir("/app"). WithMountedDirectory("/app", wd). WithSecretVariable("GITHUB_TOKEN", util.WithSetHostVar(ctx, c.Host(), "GITHUB_TOKEN").Secret()). WithSecretVariable("AWS_ACCESS_KEY_ID", util.WithSetHostVar(ctx, c.Host(), "AWS_ACCESS_KEY_ID").Secret()). WithSecretVariable("AWS_SECRET_ACCESS_KEY", util.WithSetHostVar(ctx, c.Host(), "AWS_SECRET_ACCESS_KEY").Secret()). WithSecretVariable("AWS_REGION", util.WithSetHostVar(ctx, c.Host(), "AWS_REGION").Secret()). WithSecretVariable("AWS_BUCKET", util.WithSetHostVar(ctx, c.Host(), "AWS_BUCKET").Secret()). WithSecretVariable("ARTEFACTS_FQDN", util.WithSetHostVar(ctx, c.Host(), "ARTEFACTS_FQDN").Secret()). WithSecretVariable("HOMEBREW_TAP_OWNER", util.WithSetHostVar(ctx, c.Host(), "HOMEBREW_TAP_OWNER").Secret()) _, err = container. WithExec([]string{"release", "--rm-dist", "--debug"}). ExitCode(ctx) return err }
closed
dagger/dagger
https://github.com/dagger/dagger
4,002
CLI release test
Issue to track progress on the CLI release. - [x] `curl -L https://dl.dagger.io/dagger/install.sh DAGGER_VERSION=? | sh` - [x] `brew install dagger/tap/dagger` - for [our tap formula](https://github.com/dagger/homebrew-tap) - Move the existing `dagger.rb` to `[email protected]` - [x] `brew install dagger` - for [bottled formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/dagger.rb) - Move the existing `dagger.rb` to `[email protected]`
https://github.com/dagger/dagger/issues/4002
https://github.com/dagger/dagger/pull/4012
064879cb6b4fcaa50bf28bbcdb6d40d60dd25cba
5d18d9f5e56d704f95242304661ae9656ae85780
2022-11-28T14:30:21Z
go
2022-11-29T21:52:29Z
internal/mage/engine.go
package mage import ( "context" "fmt" "os" "os/exec" "runtime" "strings" "time" "dagger.io/dagger" "github.com/dagger/dagger/internal/mage/sdk" "github.com/dagger/dagger/internal/mage/util" "github.com/magefile/mage/mg" "golang.org/x/mod/semver" ) const ( testContainerName = "test-dagger-engine" engineSessionBinName = "dagger-engine-session" shimBinName = "dagger-shim" buildkitRepo = "github.com/moby/buildkit" buildkitBranch = "v0.10.5" engineImage = "ghcr.io/dagger/engine" ) func parseRef(tag string) error {
closed
dagger/dagger
https://github.com/dagger/dagger
4,002
CLI release test
Issue to track progress on the CLI release. - [x] `curl -L https://dl.dagger.io/dagger/install.sh DAGGER_VERSION=? | sh` - [x] `brew install dagger/tap/dagger` - for [our tap formula](https://github.com/dagger/homebrew-tap) - Move the existing `dagger.rb` to `[email protected]` - [x] `brew install dagger` - for [bottled formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/dagger.rb) - Move the existing `dagger.rb` to `[email protected]`
https://github.com/dagger/dagger/issues/4002
https://github.com/dagger/dagger/pull/4012
064879cb6b4fcaa50bf28bbcdb6d40d60dd25cba
5d18d9f5e56d704f95242304661ae9656ae85780
2022-11-28T14:30:21Z
go
2022-11-29T21:52:29Z
internal/mage/engine.go
if tag == "main" { return nil } if ok := semver.IsValid(tag); !ok { return fmt.Errorf("invalid semver tag: %s", tag) } return nil } type Engine mg.Namespace func (t Engine) Build(ctx context.Context) error { c, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr)) if err != nil { return err }
closed
dagger/dagger
https://github.com/dagger/dagger
4,002
CLI release test
Issue to track progress on the CLI release. - [x] `curl -L https://dl.dagger.io/dagger/install.sh DAGGER_VERSION=? | sh` - [x] `brew install dagger/tap/dagger` - for [our tap formula](https://github.com/dagger/homebrew-tap) - Move the existing `dagger.rb` to `[email protected]` - [x] `brew install dagger` - for [bottled formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/dagger.rb) - Move the existing `dagger.rb` to `[email protected]`
https://github.com/dagger/dagger/issues/4002
https://github.com/dagger/dagger/pull/4012
064879cb6b4fcaa50bf28bbcdb6d40d60dd25cba
5d18d9f5e56d704f95242304661ae9656ae85780
2022-11-28T14:30:21Z
go
2022-11-29T21:52:29Z
internal/mage/engine.go
defer c.Close() build := util.GoBase(c). WithEnvVariable("GOOS", runtime.GOOS). WithEnvVariable("GOARCH", runtime.GOARCH). WithExec([]string{"go", "build", "-o", "./bin/dagger", "-ldflags", "-s -w", "/app/cmd/dagger"}) _, err = build.Directory("./bin").Export(ctx, "./bin") return err } func (t Engine) Lint(ctx context.Context) error { c, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr)) if err != nil { return err } defer c.Close() _, err = c.Container(). From("golangci/golangci-lint:v1.48"). WithMountedDirectory("/app", util.RepositoryGoCodeOnly(c)). WithWorkdir("/app"). WithExec([]string{"golangci-lint", "run", "-v", "--timeout", "5m"}). ExitCode(ctx) return err } func (t Engine) Publish(ctx context.Context, version string) error { if err := parseRef(version); err != nil { return err } ref := fmt.Sprintf("%s:%s", engineImage, version) c, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr)) if err != nil { return err
closed
dagger/dagger
https://github.com/dagger/dagger
4,002
CLI release test
Issue to track progress on the CLI release. - [x] `curl -L https://dl.dagger.io/dagger/install.sh DAGGER_VERSION=? | sh` - [x] `brew install dagger/tap/dagger` - for [our tap formula](https://github.com/dagger/homebrew-tap) - Move the existing `dagger.rb` to `[email protected]` - [x] `brew install dagger` - for [bottled formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/dagger.rb) - Move the existing `dagger.rb` to `[email protected]`
https://github.com/dagger/dagger/issues/4002
https://github.com/dagger/dagger/pull/4012
064879cb6b4fcaa50bf28bbcdb6d40d60dd25cba
5d18d9f5e56d704f95242304661ae9656ae85780
2022-11-28T14:30:21Z
go
2022-11-29T21:52:29Z
internal/mage/engine.go
} defer c.Close() arches := []string{"amd64", "arm64"} oses := []string{"linux", "darwin", "windows"} digest, err := c.Container().Publish(ctx, ref, dagger.ContainerPublishOpts{ PlatformVariants: devEngineContainer(c, arches, oses), }) if err != nil { return err } if semver.IsValid(version) { sdks := sdk.All{} if err := sdks.Bump(ctx, digest); err != nil { return err } } time.Sleep(3 * time.Second) fmt.Println("PUBLISHED IMAGE REF:", digest) return nil } func (t Engine) test(ctx context.Context, race bool) error { c, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr)) if err != nil { return err } defer c.Close() cgoEnabledEnv := "0" args := []string{"go", "test", "-p", "16", "-v", "-count=1"} if race { args = append(args, "-race", "-timeout=1h")
closed
dagger/dagger
https://github.com/dagger/dagger
4,002
CLI release test
Issue to track progress on the CLI release. - [x] `curl -L https://dl.dagger.io/dagger/install.sh DAGGER_VERSION=? | sh` - [x] `brew install dagger/tap/dagger` - for [our tap formula](https://github.com/dagger/homebrew-tap) - Move the existing `dagger.rb` to `[email protected]` - [x] `brew install dagger` - for [bottled formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/dagger.rb) - Move the existing `dagger.rb` to `[email protected]`
https://github.com/dagger/dagger/issues/4002
https://github.com/dagger/dagger/pull/4012
064879cb6b4fcaa50bf28bbcdb6d40d60dd25cba
5d18d9f5e56d704f95242304661ae9656ae85780
2022-11-28T14:30:21Z
go
2022-11-29T21:52:29Z
internal/mage/engine.go
cgoEnabledEnv = "1" } args = append(args, "./...") output, err := util.GoBase(c). WithMountedDirectory("/app", util.Repository(c)). WithWorkdir("/app"). WithEnvVariable("CGO_ENABLED", cgoEnabledEnv). WithMountedDirectory("/root/.docker", util.HostDockerDir(c)). WithExec(args, dagger.ContainerWithExecOpts{ ExperimentalPrivilegedNesting: true, }). Stdout(ctx) if err != nil { return err } fmt.Println(output) return nil } func (t Engine) Test(ctx context.Context) error { return t.test(ctx, false) } func (t Engine) TestRace(ctx context.Context) error { return t.test(ctx, true) } func (t Engine) Dev(ctx context.Context) error { c, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr)) if err != nil { return err } defer c.Close()
closed
dagger/dagger
https://github.com/dagger/dagger
4,002
CLI release test
Issue to track progress on the CLI release. - [x] `curl -L https://dl.dagger.io/dagger/install.sh DAGGER_VERSION=? | sh` - [x] `brew install dagger/tap/dagger` - for [our tap formula](https://github.com/dagger/homebrew-tap) - Move the existing `dagger.rb` to `[email protected]` - [x] `brew install dagger` - for [bottled formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/dagger.rb) - Move the existing `dagger.rb` to `[email protected]`
https://github.com/dagger/dagger/issues/4002
https://github.com/dagger/dagger/pull/4012
064879cb6b4fcaa50bf28bbcdb6d40d60dd25cba
5d18d9f5e56d704f95242304661ae9656ae85780
2022-11-28T14:30:21Z
go
2022-11-29T21:52:29Z
internal/mage/engine.go
tmpfile, err := os.CreateTemp("", "dagger-engine-export") if err != nil { return err } defer os.Remove(tmpfile.Name()) arches := []string{runtime.GOARCH} oses := []string{runtime.GOOS} if runtime.GOOS != "linux" { oses = append(oses, "linux") } _, err = c.Container().Export(ctx, tmpfile.Name(), dagger.ContainerExportOpts{ PlatformVariants: devEngineContainer(c, arches, oses), }) if err != nil { return err } volumeName := "test-dagger-engine" imageName := "localhost/test-dagger-engine:latest" loadCmd := exec.CommandContext(ctx, "docker", "load", "-i", tmpfile.Name()) output, err := loadCmd.CombinedOutput() if err != nil { return fmt.Errorf("docker load failed: %w: %s", err, output) } _, imageID, ok := strings.Cut(string(output), "sha256:") if !ok { return fmt.Errorf("unexpected output from docker load: %s", output) } imageID = strings.TrimSpace(imageID) if output, err := exec.CommandContext(ctx, "docker",
closed
dagger/dagger
https://github.com/dagger/dagger
4,002
CLI release test
Issue to track progress on the CLI release. - [x] `curl -L https://dl.dagger.io/dagger/install.sh DAGGER_VERSION=? | sh` - [x] `brew install dagger/tap/dagger` - for [our tap formula](https://github.com/dagger/homebrew-tap) - Move the existing `dagger.rb` to `[email protected]` - [x] `brew install dagger` - for [bottled formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/dagger.rb) - Move the existing `dagger.rb` to `[email protected]`
https://github.com/dagger/dagger/issues/4002
https://github.com/dagger/dagger/pull/4012
064879cb6b4fcaa50bf28bbcdb6d40d60dd25cba
5d18d9f5e56d704f95242304661ae9656ae85780
2022-11-28T14:30:21Z
go
2022-11-29T21:52:29Z
internal/mage/engine.go
"tag", imageID, imageName, ).CombinedOutput(); err != nil { return fmt.Errorf("docker tag: %w: %s", err, output) } if output, err := exec.CommandContext(ctx, "docker", "rm", "-fv", testContainerName, ).CombinedOutput(); err != nil { return fmt.Errorf("docker rm: %w: %s", err, output) } if output, err := exec.CommandContext(ctx, "docker", "run", "-d", "--rm", "-v", volumeName+":/var/lib/buildkit", "--name", testContainerName, "--privileged", imageName, "--debug", ).CombinedOutput(); err != nil { return fmt.Errorf("docker run: %w: %s", err, output) } fmt.Println("export DAGGER_HOST=docker-container://" + testContainerName) fmt.Println("export DAGGER_RUNNER_HOST=docker-container://" + testContainerName) return nil } func devEngineContainer(c *dagger.Client, arches, oses []string) []*dagger.Container {
closed
dagger/dagger
https://github.com/dagger/dagger
4,002
CLI release test
Issue to track progress on the CLI release. - [x] `curl -L https://dl.dagger.io/dagger/install.sh DAGGER_VERSION=? | sh` - [x] `brew install dagger/tap/dagger` - for [our tap formula](https://github.com/dagger/homebrew-tap) - Move the existing `dagger.rb` to `[email protected]` - [x] `brew install dagger` - for [bottled formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/dagger.rb) - Move the existing `dagger.rb` to `[email protected]`
https://github.com/dagger/dagger/issues/4002
https://github.com/dagger/dagger/pull/4012
064879cb6b4fcaa50bf28bbcdb6d40d60dd25cba
5d18d9f5e56d704f95242304661ae9656ae85780
2022-11-28T14:30:21Z
go
2022-11-29T21:52:29Z
internal/mage/engine.go
buildkitRepo := c.Git(buildkitRepo, dagger.GitOpts{KeepGitDir: true}).Branch(buildkitBranch).Tree() platformVariants := make([]*dagger.Container, 0, len(arches)) for _, arch := range arches { buildkitBase := c.Container(dagger.ContainerOpts{ Platform: dagger.Platform("linux/" + arch), }).Build(buildkitRepo) for _, os := range oses { for _, arch := range arches { builtBin := util.GoBase(c). WithEnvVariable("GOOS", os). WithEnvVariable("GOARCH", arch). WithExec([]string{ "go", "build", "-o", "./bin/" + engineSessionBinName, "-ldflags", "-s -w", "/app/cmd/engine-session", }). File("./bin/" + engineSessionBinName)
closed
dagger/dagger
https://github.com/dagger/dagger
4,002
CLI release test
Issue to track progress on the CLI release. - [x] `curl -L https://dl.dagger.io/dagger/install.sh DAGGER_VERSION=? | sh` - [x] `brew install dagger/tap/dagger` - for [our tap formula](https://github.com/dagger/homebrew-tap) - Move the existing `dagger.rb` to `[email protected]` - [x] `brew install dagger` - for [bottled formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/dagger.rb) - Move the existing `dagger.rb` to `[email protected]`
https://github.com/dagger/dagger/issues/4002
https://github.com/dagger/dagger/pull/4012
064879cb6b4fcaa50bf28bbcdb6d40d60dd25cba
5d18d9f5e56d704f95242304661ae9656ae85780
2022-11-28T14:30:21Z
go
2022-11-29T21:52:29Z
internal/mage/engine.go
buildkitBase = buildkitBase.WithRootfs( buildkitBase.Rootfs().WithFile("/usr/bin/"+engineSessionBinName+"-"+os+"-"+arch, builtBin), ) } } shimBin := util.GoBase(c). WithEnvVariable("GOOS", "linux"). WithEnvVariable("GOARCH", arch). WithExec([]string{ "go", "build", "-o", "./bin/" + shimBinName, "-ldflags", "-s -w", "/app/cmd/shim", }). File("./bin/" + shimBinName) buildkitBase = buildkitBase.WithRootfs( buildkitBase.Rootfs().WithFile("/usr/bin/"+shimBinName, shimBin), ) buildkitBase = buildkitBase.WithEntrypoint([]string{ "buildkitd", "--oci-worker-binary", "/usr/bin/" + shimBinName, }) platformVariants = append(platformVariants, buildkitBase) } return platformVariants }
closed
dagger/dagger
https://github.com/dagger/dagger
4,002
CLI release test
Issue to track progress on the CLI release. - [x] `curl -L https://dl.dagger.io/dagger/install.sh DAGGER_VERSION=? | sh` - [x] `brew install dagger/tap/dagger` - for [our tap formula](https://github.com/dagger/homebrew-tap) - Move the existing `dagger.rb` to `[email protected]` - [x] `brew install dagger` - for [bottled formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/dagger.rb) - Move the existing `dagger.rb` to `[email protected]`
https://github.com/dagger/dagger/issues/4002
https://github.com/dagger/dagger/pull/4012
064879cb6b4fcaa50bf28bbcdb6d40d60dd25cba
5d18d9f5e56d704f95242304661ae9656ae85780
2022-11-28T14:30:21Z
go
2022-11-29T21:52:29Z
internal/mage/util/util.go
package util import ( "context" "fmt" "os" "path/filepath" "runtime" "dagger.io/dagger" ) func Repository(c *dagger.Client) *dagger.Directory { return c.Host().Directory(".", dagger.HostDirectoryOpts{ Exclude: []string{ "**/node_modules", "**/__pycache__", "**/.venv", "**/.mypy_cache", "**/.pytest_cache", }, }) } func RepositoryGoCodeOnly(c *dagger.Client) *dagger.Directory {
closed
dagger/dagger
https://github.com/dagger/dagger
4,002
CLI release test
Issue to track progress on the CLI release. - [x] `curl -L https://dl.dagger.io/dagger/install.sh DAGGER_VERSION=? | sh` - [x] `brew install dagger/tap/dagger` - for [our tap formula](https://github.com/dagger/homebrew-tap) - Move the existing `dagger.rb` to `[email protected]` - [x] `brew install dagger` - for [bottled formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/dagger.rb) - Move the existing `dagger.rb` to `[email protected]`
https://github.com/dagger/dagger/issues/4002
https://github.com/dagger/dagger/pull/4012
064879cb6b4fcaa50bf28bbcdb6d40d60dd25cba
5d18d9f5e56d704f95242304661ae9656ae85780
2022-11-28T14:30:21Z
go
2022-11-29T21:52:29Z
internal/mage/util/util.go
return c.Directory().WithDirectory("/", Repository(c), dagger.DirectoryWithDirectoryOpts{ Include: []string{ "**/*.go", ".git", "**/go.mod", "**/go.sum", "**/go.work", "**/go.work.sum", "**/*.go.tmpl", "**/*.ts.tmpl", "**/*.graphqls", "**/*.graphql", ".golangci.yml", "**/Dockerfile", "**/README.md", }, }) } func GoBase(c *dagger.Client) *dagger.Container {
closed
dagger/dagger
https://github.com/dagger/dagger
4,002
CLI release test
Issue to track progress on the CLI release. - [x] `curl -L https://dl.dagger.io/dagger/install.sh DAGGER_VERSION=? | sh` - [x] `brew install dagger/tap/dagger` - for [our tap formula](https://github.com/dagger/homebrew-tap) - Move the existing `dagger.rb` to `[email protected]` - [x] `brew install dagger` - for [bottled formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/dagger.rb) - Move the existing `dagger.rb` to `[email protected]`
https://github.com/dagger/dagger/issues/4002
https://github.com/dagger/dagger/pull/4012
064879cb6b4fcaa50bf28bbcdb6d40d60dd25cba
5d18d9f5e56d704f95242304661ae9656ae85780
2022-11-28T14:30:21Z
go
2022-11-29T21:52:29Z
internal/mage/util/util.go
repo := RepositoryGoCodeOnly(c) goMods := c.Directory() for _, f := range []string{"go.mod", "go.sum", "sdk/go/go.mod", "sdk/go/go.sum"} { goMods = goMods.WithFile(f, repo.File(f)) } return c.Container(). From("golang:1.19-alpine"). Exec(dagger.ContainerExecOpts{Args: []string{"apk", "add", "build-base"}}). WithEnvVariable("CGO_ENABLED", "0"). Exec(dagger.ContainerExecOpts{ Args: []string{"apk", "add", "git"}, }). WithWorkdir("/app"). WithMountedDirectory("/app", goMods). Exec(dagger.ContainerExecOpts{Args: []string{"go", "mod", "download"}}). WithMountedDirectory("/app", repo) } func DaggerBinary(c *dagger.Client) *dagger.File {
closed
dagger/dagger
https://github.com/dagger/dagger
4,002
CLI release test
Issue to track progress on the CLI release. - [x] `curl -L https://dl.dagger.io/dagger/install.sh DAGGER_VERSION=? | sh` - [x] `brew install dagger/tap/dagger` - for [our tap formula](https://github.com/dagger/homebrew-tap) - Move the existing `dagger.rb` to `[email protected]` - [x] `brew install dagger` - for [bottled formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/dagger.rb) - Move the existing `dagger.rb` to `[email protected]`
https://github.com/dagger/dagger/issues/4002
https://github.com/dagger/dagger/pull/4012
064879cb6b4fcaa50bf28bbcdb6d40d60dd25cba
5d18d9f5e56d704f95242304661ae9656ae85780
2022-11-28T14:30:21Z
go
2022-11-29T21:52:29Z
internal/mage/util/util.go
return GoBase(c). WithExec([]string{"go", "build", "-o", "./bin/dagger", "-ldflags", "-s -w", "./cmd/dagger"}). File("./bin/dagger") } func ClientGenBinary(c *dagger.Client) *dagger.File { return GoBase(c). WithExec([]string{"go", "build", "-o", "./bin/client-gen", "-ldflags", "-s -w", "./cmd/client-gen"}). File("./bin/client-gen") } func EngineSessionBinary(c *dagger.Client) *dagger.File {
closed
dagger/dagger
https://github.com/dagger/dagger
4,002
CLI release test
Issue to track progress on the CLI release. - [x] `curl -L https://dl.dagger.io/dagger/install.sh DAGGER_VERSION=? | sh` - [x] `brew install dagger/tap/dagger` - for [our tap formula](https://github.com/dagger/homebrew-tap) - Move the existing `dagger.rb` to `[email protected]` - [x] `brew install dagger` - for [bottled formula](https://github.com/Homebrew/homebrew-core/blob/master/Formula/dagger.rb) - Move the existing `dagger.rb` to `[email protected]`
https://github.com/dagger/dagger/issues/4002
https://github.com/dagger/dagger/pull/4012
064879cb6b4fcaa50bf28bbcdb6d40d60dd25cba
5d18d9f5e56d704f95242304661ae9656ae85780
2022-11-28T14:30:21Z
go
2022-11-29T21:52:29Z
internal/mage/util/util.go
return GoBase(c). WithExec([]string{"go", "build", "-o", "./bin/dagger-engine-session", "-ldflags", "-s -w", "./cmd/engine-session"}). File("./bin/dagger-engine-session") } func HostDockerDir(c *dagger.Client) *dagger.Directory { if runtime.GOOS != "linux" { return c.Directory() } home, err := os.UserHomeDir() if err != nil { return c.Directory() } path := filepath.Join(home, ".docker") if _, err := os.Stat(path); err != nil { return c.Directory() } return c.Host().Directory(path) } func WithSetHostVar(ctx context.Context, h *dagger.Host, varName string) *dagger.HostVariable { hv := h.EnvVariable(varName) if val, err := hv.Secret().Plaintext(ctx); err != nil || val == "" { fmt.Fprintf(os.Stderr, "env var %s is empty", varName) os.Exit(1) } return hv }
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/integration/directory_test.go
package core import ( "context" "testing" "dagger.io/dagger" "github.com/dagger/dagger/core" "github.com/dagger/dagger/internal/testutil" "github.com/stretchr/testify/require" ) func TestEmptyDirectory(t *testing.T) { t.Parallel() var res struct { Directory struct { ID core.DirectoryID Entries []string } } err := testutil.Query( `{ directory { id entries } }`, &res, nil) require.NoError(t, err) require.Empty(t, res.Directory.ID) require.Empty(t, res.Directory.Entries) } func TestDirectoryWithNewFile(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/integration/directory_test.go
t.Parallel() var res struct { Directory struct { WithNewFile struct { ID core.DirectoryID Entries []string } } } err := testutil.Query( `{ directory { withNewFile(path: "some-file", contents: "some-content") { id entries } } }`, &res, nil) require.NoError(t, err) require.NotEmpty(t, res.Directory.WithNewFile.ID) require.Equal(t, []string{"some-file"}, res.Directory.WithNewFile.Entries) } func TestDirectoryEntries(t *testing.T) { t.Parallel() var res struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/integration/directory_test.go
Directory struct { WithNewFile struct { WithNewFile struct { Entries []string } } } } err := testutil.Query( `{ directory { withNewFile(path: "some-file", contents: "some-content") { withNewFile(path: "some-dir/sub-file", contents: "some-content") { entries } } } }`, &res, nil) require.NoError(t, err) require.ElementsMatch(t, []string{"some-file", "some-dir"}, res.Directory.WithNewFile.WithNewFile.Entries) } func TestDirectoryEntriesOfPath(t *testing.T) { t.Parallel() var res struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/integration/directory_test.go
Directory struct { WithNewFile struct { WithNewFile struct { Entries []string } } } } err := testutil.Query( `{ directory { withNewFile(path: "some-file", contents: "some-content") { withNewFile(path: "some-dir/sub-file", contents: "some-content") { entries(path: "some-dir") } } } }`, &res, nil) require.NoError(t, err) require.Equal(t, []string{"sub-file"}, res.Directory.WithNewFile.WithNewFile.Entries) } func TestDirectoryDirectory(t *testing.T) { t.Parallel() var res struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/integration/directory_test.go
Directory struct { WithNewFile struct { WithNewFile struct { Directory struct { Entries []string } } } } } err := testutil.Query( `{ directory { withNewFile(path: "some-file", contents: "some-content") { withNewFile(path: "some-dir/sub-file", contents: "some-content") { directory(path: "some-dir") { entries } } } } }`, &res, nil) require.NoError(t, err) require.Equal(t, []string{"sub-file"}, res.Directory.WithNewFile.WithNewFile.Directory.Entries) } func TestDirectoryDirectoryWithNewFile(t *testing.T) { t.Parallel() var res struct { Directory struct { WithNewFile struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/integration/directory_test.go
WithNewFile struct { Directory struct { WithNewFile struct { Entries []string } } } } } } err := testutil.Query( `{ directory { withNewFile(path: "some-file", contents: "some-content") { withNewFile(path: "some-dir/sub-file", contents: "some-content") { directory(path: "some-dir") { withNewFile(path: "another-file", contents: "more-content") { entries } } } } } }`, &res, nil) require.NoError(t, err) require.ElementsMatch(t, []string{"sub-file", "another-file"}, res.Directory.WithNewFile.WithNewFile.Directory.WithNewFile.Entries) } func TestDirectoryWithDirectory(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/integration/directory_test.go
t.Parallel() c, ctx := connect(t) defer c.Close() dir := c.Directory(). WithNewFile("some-file", "some-content"). WithNewFile("some-dir/sub-file", "sub-content"). Directory("some-dir") entries, err := c.Directory().WithDirectory("with-dir", dir).Entries(ctx, dagger.DirectoryEntriesOpts{ Path: "with-dir", }) require.NoError(t, err) require.Equal(t, []string{"sub-file"}, entries) entries, err = c.Directory().WithDirectory("sub-dir/sub-sub-dir/with-dir", dir).Entries(ctx, dagger.DirectoryEntriesOpts{ Path: "sub-dir/sub-sub-dir/with-dir", }) require.NoError(t, err) require.Equal(t, []string{"sub-file"}, entries) t.Run("copies directory contents to .", func(t *testing.T) { entries, err := c.Directory().WithDirectory(".", dir).Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"sub-file"}, entries) }) } func TestDirectoryWithDirectoryIncludeExclude(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/integration/directory_test.go
t.Parallel() c, ctx := connect(t) defer c.Close() dir := c.Directory(). WithNewFile("a.txt", ""). WithNewFile("b.txt", ""). WithNewFile("c.txt.rar", ""). WithNewFile("subdir/d.txt", ""). WithNewFile("subdir/e.txt", ""). WithNewFile("subdir/f.txt.rar", "") t.Run("exclude", func(t *testing.T) { entries, err := c.Directory().WithDirectory(".", dir, dagger.DirectoryWithDirectoryOpts{ Exclude: []string{"*.rar"}, }).Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"a.txt", "b.txt", "subdir"}, entries) }) t.Run("include", func(t *testing.T) { entries, err := c.Directory().WithDirectory(".", dir, dagger.DirectoryWithDirectoryOpts{ Include: []string{"*.rar"},
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/integration/directory_test.go
}).Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"c.txt.rar"}, entries) }) t.Run("exclude overrides include", func(t *testing.T) { entries, err := c.Directory().WithDirectory(".", dir, dagger.DirectoryWithDirectoryOpts{ Include: []string{"*.txt"}, Exclude: []string{"b.txt"}, }).Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"a.txt"}, entries) }) t.Run("include does not override exclude", func(t *testing.T) { entries, err := c.Directory().WithDirectory(".", dir, dagger.DirectoryWithDirectoryOpts{ Include: []string{"a.txt"}, Exclude: []string{"*.txt"}, }).Entries(ctx) require.NoError(t, err) require.Equal(t, []string{}, entries) }) subdir := dir.Directory("subdir") t.Run("exclude respects subdir", func(t *testing.T) { entries, err := c.Directory().WithDirectory(".", subdir, dagger.DirectoryWithDirectoryOpts{ Exclude: []string{"*.rar"}, }).Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"d.txt", "e.txt"}, entries) }) } func TestDirectoryWithNewDirectory(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/integration/directory_test.go
ctx := context.Background() c, err := dagger.Connect(ctx) require.NoError(t, err) defer c.Close() dir := c.Directory(). WithNewDirectory("a"). WithNewDirectory("b/c") entries, err := dir.Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"a", "b"}, entries) entries, err = dir.Entries(ctx, dagger.DirectoryEntriesOpts{ Path: "b", }) require.NoError(t, err) require.Equal(t, []string{"c"}, entries) t.Run("does not permit creating directory outside of root", func(t *testing.T) { _, err := dir.Directory("b").WithNewDirectory("../c").ID(ctx) require.Error(t, err) }) } func TestDirectoryWithFile(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/integration/directory_test.go
ctx := context.Background() c, err := dagger.Connect(ctx) require.NoError(t, err) defer c.Close() file := c.Directory(). WithNewFile("some-file", "some-content"). File("some-file") content, err := c.Directory(). WithFile("target-file", file). File("target-file").Contents(ctx) require.NoError(t, err) require.Equal(t, "some-content", content) content, err = c.Directory(). WithFile("sub-dir/target-file", file). File("sub-dir/target-file").Contents(ctx) require.NoError(t, err) require.Equal(t, "some-content", content) } func TestDirectoryWithoutDirectoryWithoutFile(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/integration/directory_test.go
t.Parallel() ctx := context.Background() c, err := dagger.Connect(ctx) require.NoError(t, err) defer c.Close() dir1 := c.Directory(). WithNewFile("some-file", "some-content"). WithNewFile("some-dir/sub-file", "sub-content") entries, err := dir1. WithoutDirectory("some-dir"). Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"some-file"}, entries) dir := c.Directory(). WithNewFile("foo.txt", "foo"). WithNewFile("a/bar.txt", "bar"). WithNewFile("a/data.json", "{\"datum\": 10}"). WithNewFile("b/foo.txt", "foo"). WithNewFile("b/bar.txt", "bar"). WithNewFile("b/data.json", "{\"datum\": 10}"). WithNewFile("c/file-a1.txt", "file-a1.txt"). WithNewFile("c/file-a1.json", "file-a1.json"). WithNewFile("c/file-b1.txt", "file-b1.txt"). WithNewFile("c/file-b1.json", "file-b1.json") entries, err = dir.Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"a", "b", "c", "foo.txt"}, entries) entries, err = dir. WithoutDirectory("a"). Entries(ctx)
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/integration/directory_test.go
require.NoError(t, err) require.Equal(t, []string{"b", "c", "foo.txt"}, entries) entries, err = dir. WithoutFile("b/*.txt"). Entries(ctx, dagger.DirectoryEntriesOpts{Path: "b"}) require.NoError(t, err) require.Equal(t, []string{"data.json"}, entries) entries, err = dir. WithoutFile("c/*a1*"). Entries(ctx, dagger.DirectoryEntriesOpts{Path: "c"}) require.NoError(t, err) require.Equal(t, []string{"file-b1.json", "file-b1.txt"}, entries) dirDir := c.Directory(). WithNewFile("foo.txt", "foo"). WithNewFile("a1/a1-file", "a1-file"). WithNewFile("a2/a2-file", "a2-file"). WithNewFile("b1/b1-file", "b1-file") entries, err = dirDir.WithoutDirectory("a*").Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"b1", "foo.txt"}, entries) filesDir := c.Directory(). WithNewFile("some-file", "some-content"). WithNewFile("some-dir/sub-file", "sub-content"). WithoutFile("some-file") entries, err = filesDir.Entries(ctx) require.NoError(t, err) require.Equal(t, []string{"some-dir"}, entries) } func TestDirectoryDiff(t *testing.T) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/integration/directory_test.go
t.Parallel() aID := newDirWithFile(t, "a-file", "a-content") bID := newDirWithFile(t, "b-file", "b-content") var res struct { Directory struct { Diff struct { Entries []string } } } diff := `query Diff($id: DirectoryID!, $other: DirectoryID!) { directory(id: $id) { diff(other: $other) { entries } } }` err := testutil.Query(diff, &res, &testutil.QueryOptions{ Variables: map[string]any{
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/integration/directory_test.go
"id": aID, "other": bID, }, }) require.NoError(t, err) require.Equal(t, []string{"b-file"}, res.Directory.Diff.Entries) err = testutil.Query(diff, &res, &testutil.QueryOptions{ Variables: map[string]any{ "id": bID, "other": aID, }, }) require.NoError(t, err) require.Equal(t, []string{"a-file"}, res.Directory.Diff.Entries) /* This triggers a nil panic in Buildkit! Issue: https://github.com/dagger/dagger/issues/3337 This might be fixed once we update Buildkit. err = testutil.Query(diff, &res, &testutil.QueryOptions{ Variables: map[string]any{ "id": aID, "other": aID, }, }) require.NoError(t, err) require.Empty(t, res.Directory.Diff.Entries) */ } func TestDirectoryExport(t *testing.T) { t.Parallel()
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/integration/directory_test.go
ctx := context.Background() wd := t.TempDir() dest := t.TempDir() c, err := dagger.Connect(ctx, dagger.WithWorkdir(wd)) require.NoError(t, err) defer c.Close() dir := c.Container().From("alpine:3.16.2").Directory("/etc/profile.d") t.Run("to absolute dir", func(t *testing.T) { ok, err := dir.Export(ctx, dest) require.NoError(t, err) require.True(t, ok) entries, err := ls(dest) require.NoError(t, err) require.Equal(t, []string{"README", "color_prompt.sh.disabled", "locale.sh"}, entries) }) t.Run("to workdir", func(t *testing.T) { ok, err := dir.Export(ctx, ".") require.NoError(t, err) require.True(t, ok) entries, err := ls(wd) require.NoError(t, err) require.Equal(t, []string{"README", "color_prompt.sh.disabled", "locale.sh"}, entries) }) t.Run("to outer dir", func(t *testing.T) { ok, err := dir.Export(ctx, "../") require.Error(t, err) require.False(t, ok) }) }
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/schema/directory.go
package schema import ( "github.com/dagger/dagger/core" "github.com/dagger/dagger/router" ) type directorySchema struct { *baseSchema host *core.Host } var _ router.ExecutableSchema = &directorySchema{} func (s *directorySchema) Name() string { return "directory"
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/schema/directory.go
} func (s *directorySchema) Schema() string { return Directory } var directoryIDResolver = stringResolver(core.DirectoryID("")) func (s *directorySchema) Resolvers() router.Resolvers { return router.Resolvers{ "DirectoryID": directoryIDResolver, "Query": router.ObjectResolver{ "directory": router.ToResolver(s.directory), }, "Directory": router.ObjectResolver{ "entries": router.ToResolver(s.entries), "file": router.ToResolver(s.file), "withFile": router.ToResolver(s.withFile), "withNewFile": router.ToResolver(s.withNewFile), "withoutFile": router.ToResolver(s.withoutFile), "directory": router.ToResolver(s.subdirectory), "withDirectory": router.ToResolver(s.withDirectory), "withNewDirectory": router.ToResolver(s.withNewDirectory), "withoutDirectory": router.ToResolver(s.withoutDirectory), "diff": router.ToResolver(s.diff), "export": router.ToResolver(s.export), }, } } func (s *directorySchema) Dependencies() []router.ExecutableSchema { return nil } type directoryArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/schema/directory.go
ID core.DirectoryID } func (s *directorySchema) directory(ctx *router.Context, parent any, args directoryArgs) (*core.Directory, error) { return &core.Directory{ ID: args.ID, }, nil } type subdirectoryArgs struct { Path string } func (s *directorySchema) subdirectory(ctx *router.Context, parent *core.Directory, args subdirectoryArgs) (*core.Directory, error) { return parent.Directory(ctx, args.Path) } type withNewDirectoryArgs struct { Path string } func (s *directorySchema) withNewDirectory(ctx *router.Context, parent *core.Directory, args withNewDirectoryArgs) (*core.Directory, error) { return parent.WithNewDirectory(ctx, s.gw, args.Path) } type withDirectoryArgs struct { Path string Directory core.DirectoryID core.CopyFilter } func (s *directorySchema) withDirectory(ctx *router.Context, parent *core.Directory, args withDirectoryArgs) (*core.Directory, error) { return parent.WithDirectory(ctx, args.Path, &core.Directory{ID: args.Directory}, args.CopyFilter) } type entriesArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/schema/directory.go
Path string } func (s *directorySchema) entries(ctx *router.Context, parent *core.Directory, args entriesArgs) ([]string, error) { return parent.Entries(ctx, s.gw, args.Path) } type dirFileArgs struct { Path string } func (s *directorySchema) file(ctx *router.Context, parent *core.Directory, args dirFileArgs) (*core.File, error) { return parent.File(ctx, args.Path) } type withNewFileArgs struct { Path string Contents string } func (s *directorySchema) withNewFile(ctx *router.Context, parent *core.Directory, args withNewFileArgs) (*core.Directory, error) { return parent.WithNewFile(ctx, s.gw, args.Path, []byte(args.Contents)) } type withFileArgs struct { Path string Source core.FileID } func (s *directorySchema) withFile(ctx *router.Context, parent *core.Directory, args withFileArgs) (*core.Directory, error) { return parent.WithFile(ctx, args.Path, &core.File{ID: args.Source}) } type withoutDirectoryArgs struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
core/schema/directory.go
Path string } func (s *directorySchema) withoutDirectory(ctx *router.Context, parent *core.Directory, args withoutDirectoryArgs) (*core.Directory, error) { return parent.Without(ctx, args.Path) } type withoutFileArgs struct { Path string } func (s *directorySchema) withoutFile(ctx *router.Context, parent *core.Directory, args withoutFileArgs) (*core.Directory, error) { return parent.Without(ctx, args.Path) } type diffArgs struct { Other core.DirectoryID } func (s *directorySchema) diff(ctx *router.Context, parent *core.Directory, args diffArgs) (*core.Directory, error) { return parent.Diff(ctx, &core.Directory{ID: args.Other}) } type dirExportArgs struct { Path string } func (s *directorySchema) export(ctx *router.Context, parent *core.Directory, args dirExportArgs) (bool, error) { err := parent.Export(ctx, s.host, args.Path, s.bkClient, s.solveOpts, s.solveCh) if err != nil { return false, err } return true, nil }
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
package dagger import ( "context" "dagger.io/dagger/internal/querybuilder" "github.com/Khan/genqlient/graphql" ) type CacheID string type ContainerID string type DirectoryID string type FileID string type Platform string type SecretID string type SocketID string type CacheVolume struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
q *querybuilder.Selection c graphql.Client } func (r *CacheVolume) ID(ctx context.Context) (CacheID, error) { q := r.q.Select("id") var response CacheID q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *CacheVolume) XXX_GraphQLType() string { return "CacheVolume" } func (r *CacheVolume) XXX_GraphQLID(ctx context.Context) (string, error) { id, err := r.ID(ctx) if err != nil { return "", err } return string(id), nil } type Container struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
q *querybuilder.Selection c graphql.Client } type ContainerBuildOpts struct { Dockerfile string } func (r *Container) Build(context *Directory, opts ...ContainerBuildOpts) *Container { q := r.q.Select("build") q = q.Arg("context", context) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Dockerfile) { q = q.Arg("dockerfile", opts[i].Dockerfile) break } } return &Container{ q: q, c: r.c, } } func (r *Container) DefaultArgs(ctx context.Context) ([]string, error) { q := r.q.Select("defaultArgs") var response []string q = q.Bind(&response)
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
return response, q.Execute(ctx, r.c) } func (r *Container) Directory(path string) *Directory { q := r.q.Select("directory") q = q.Arg("path", path) return &Directory{ q: q, c: r.c, } } func (r *Container) Entrypoint(ctx context.Context) ([]string, error) { q := r.q.Select("entrypoint") var response []string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) EnvVariable(ctx context.Context, name string) (string, error) { q := r.q.Select("envVariable") q = q.Arg("name", name) var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) EnvVariables(ctx context.Context) ([]EnvVariable, error) { q := r.q.Select("envVariables") var response []EnvVariable q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type ContainerExecOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
Args []string Stdin string RedirectStdout string RedirectStderr string ExperimentalPrivilegedNesting bool } func (r *Container) Exec(opts ...ContainerExecOpts) *Container { q := r.q.Select("exec") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Args) { q = q.Arg("args", opts[i].Args) break } }
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Stdin) { q = q.Arg("stdin", opts[i].Stdin) break } } for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].RedirectStdout) { q = q.Arg("redirectStdout", opts[i].RedirectStdout) break } } for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].RedirectStderr) { q = q.Arg("redirectStderr", opts[i].RedirectStderr) break } } for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].ExperimentalPrivilegedNesting) { q = q.Arg("experimentalPrivilegedNesting", opts[i].ExperimentalPrivilegedNesting) break } } return &Container{ q: q,
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
c: r.c, } } func (r *Container) ExitCode(ctx context.Context) (int, error) { q := r.q.Select("exitCode") var response int q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type ContainerExportOpts struct { PlatformVariants []*Container } func (r *Container) Export(ctx context.Context, path string, opts ...ContainerExportOpts) (bool, error) { q := r.q.Select("export") q = q.Arg("path", path) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].PlatformVariants) { q = q.Arg("platformVariants", opts[i].PlatformVariants) break } } var response bool q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) File(path string) *File { q := r.q.Select("file") q = q.Arg("path", path) return &File{
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
q: q, c: r.c, } } func (r *Container) From(address string) *Container { q := r.q.Select("from") q = q.Arg("address", address) return &Container{ q: q, c: r.c, } } func (r *Container) FS() *Directory { q := r.q.Select("fs") return &Directory{ q: q, c: r.c, } } func (r *Container) ID(ctx context.Context) (ContainerID, error) { q := r.q.Select("id") var response ContainerID q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) XXX_GraphQLType() string { return "Container" } func (r *Container) XXX_GraphQLID(ctx context.Context) (string, error) { id, err := r.ID(ctx)
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
if err != nil { return "", err } return string(id), nil } func (r *Container) Mounts(ctx context.Context) ([]string, error) { q := r.q.Select("mounts") var response []string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) Platform(ctx context.Context) (Platform, error) { q := r.q.Select("platform") var response Platform q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type ContainerPublishOpts struct { PlatformVariants []*Container } func (r *Container) Publish(ctx context.Context, address string, opts ...ContainerPublishOpts) (string, error) { q := r.q.Select("publish") q = q.Arg("address", address) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].PlatformVariants) { q = q.Arg("platformVariants", opts[i].PlatformVariants) break } }
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) Rootfs() *Directory { q := r.q.Select("rootfs") return &Directory{ q: q, c: r.c, } } func (r *Container) Stderr(ctx context.Context) (string, error) { q := r.q.Select("stderr") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) Stdout(ctx context.Context) (string, error) { q := r.q.Select("stdout") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Container) User(ctx context.Context) (string, error) { q := r.q.Select("user") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type ContainerWithDefaultArgsOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
Args []string } func (r *Container) WithDefaultArgs(opts ...ContainerWithDefaultArgsOpts) *Container { q := r.q.Select("withDefaultArgs") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Args) { q = q.Arg("args", opts[i].Args) break } } return &Container{ q: q, c: r.c, } } func (r *Container) WithEntrypoint(args []string) *Container { q := r.q.Select("withEntrypoint") q = q.Arg("args", args) return &Container{ q: q, c: r.c, } } func (r *Container) WithEnvVariable(name string, value string) *Container { q := r.q.Select("withEnvVariable") q = q.Arg("name", name) q = q.Arg("value", value) return &Container{ q: q,
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
c: r.c, } } type ContainerWithExecOpts struct { Stdin string RedirectStdout string RedirectStderr string ExperimentalPrivilegedNesting bool } func (r *Container) WithExec(args []string, opts ...ContainerWithExecOpts) *Container { q := r.q.Select("withExec") q = q.Arg("args", args) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Stdin) { q = q.Arg("stdin", opts[i].Stdin) break } } for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].RedirectStdout) { q = q.Arg("redirectStdout", opts[i].RedirectStdout) break
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
} } for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].RedirectStderr) { q = q.Arg("redirectStderr", opts[i].RedirectStderr) break } } for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].ExperimentalPrivilegedNesting) { q = q.Arg("experimentalPrivilegedNesting", opts[i].ExperimentalPrivilegedNesting) break } } return &Container{ q: q, c: r.c, } } func (r *Container) WithFS(id *Directory) *Container { q := r.q.Select("withFS") q = q.Arg("id", id) return &Container{ q: q, c: r.c, } } type ContainerWithMountedCacheOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
Source *Directory } func (r *Container) WithMountedCache(path string, cache *CacheVolume, opts ...ContainerWithMountedCacheOpts) *Container { q := r.q.Select("withMountedCache") q = q.Arg("path", path) q = q.Arg("cache", cache) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Source) { q = q.Arg("source", opts[i].Source) break } } return &Container{ q: q, c: r.c, } } func (r *Container) WithMountedDirectory(path string, source *Directory) *Container { q := r.q.Select("withMountedDirectory") q = q.Arg("path", path) q = q.Arg("source", source) return &Container{ q: q, c: r.c, }
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
} func (r *Container) WithMountedFile(path string, source *File) *Container { q := r.q.Select("withMountedFile") q = q.Arg("path", path) q = q.Arg("source", source) return &Container{ q: q, c: r.c, } } func (r *Container) WithMountedSecret(path string, source *Secret) *Container { q := r.q.Select("withMountedSecret") q = q.Arg("path", path) q = q.Arg("source", source) return &Container{ q: q, c: r.c, } } func (r *Container) WithMountedTemp(path string) *Container { q := r.q.Select("withMountedTemp") q = q.Arg("path", path) return &Container{ q: q, c: r.c, } } func (r *Container) WithRootfs(id *Directory) *Container { q := r.q.Select("withRootfs") q = q.Arg("id", id)
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
return &Container{ q: q, c: r.c, } } func (r *Container) WithSecretVariable(name string, secret *Secret) *Container { q := r.q.Select("withSecretVariable") q = q.Arg("name", name) q = q.Arg("secret", secret) return &Container{ q: q, c: r.c, } } func (r *Container) WithUnixSocket(path string, source *Socket) *Container { q := r.q.Select("withUnixSocket") q = q.Arg("path", path) q = q.Arg("source", source) return &Container{ q: q, c: r.c, } } func (r *Container) WithUser(name string) *Container { q := r.q.Select("withUser") q = q.Arg("name", name) return &Container{ q: q, c: r.c, }
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
} func (r *Container) WithWorkdir(path string) *Container { q := r.q.Select("withWorkdir") q = q.Arg("path", path) return &Container{ q: q, c: r.c, } } func (r *Container) WithoutEnvVariable(name string) *Container { q := r.q.Select("withoutEnvVariable") q = q.Arg("name", name) return &Container{ q: q, c: r.c, } } func (r *Container) WithoutMount(path string) *Container { q := r.q.Select("withoutMount") q = q.Arg("path", path) return &Container{ q: q, c: r.c, } } func (r *Container) WithoutUnixSocket(path string) *Container { q := r.q.Select("withoutUnixSocket") q = q.Arg("path", path) return &Container{ q: q,
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
c: r.c, } } func (r *Container) Workdir(ctx context.Context) (string, error) { q := r.q.Select("workdir") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type Directory struct { q *querybuilder.Selection c graphql.Client } func (r *Directory) Diff(other *Directory) *Directory { q := r.q.Select("diff") q = q.Arg("other", other) return &Directory{ q: q, c: r.c, } } func (r *Directory) Directory(path string) *Directory { q := r.q.Select("directory") q = q.Arg("path", path) return &Directory{ q: q, c: r.c, } } type DirectoryEntriesOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
Path string } func (r *Directory) Entries(ctx context.Context, opts ...DirectoryEntriesOpts) ([]string, error) { q := r.q.Select("entries") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Path) { q = q.Arg("path", opts[i].Path) break } } var response []string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Directory) Export(ctx context.Context, path string) (bool, error) { q := r.q.Select("export") q = q.Arg("path", path) var response bool q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Directory) File(path string) *File { q := r.q.Select("file") q = q.Arg("path", path)
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
return &File{ q: q, c: r.c, } } func (r *Directory) ID(ctx context.Context) (DirectoryID, error) { q := r.q.Select("id") var response DirectoryID q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Directory) XXX_GraphQLType() string { return "Directory" } func (r *Directory) XXX_GraphQLID(ctx context.Context) (string, error) { id, err := r.ID(ctx) if err != nil { return "", err } return string(id), nil } func (r *Directory) LoadProject(configPath string) *Project { q := r.q.Select("loadProject") q = q.Arg("configPath", configPath) return &Project{ q: q, c: r.c, } } type DirectoryWithDirectoryOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
Exclude []string Include []string } func (r *Directory) WithDirectory(path string, directory *Directory, opts ...DirectoryWithDirectoryOpts) *Directory { q := r.q.Select("withDirectory") q = q.Arg("path", path) q = q.Arg("directory", directory) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Exclude) { q = q.Arg("exclude", opts[i].Exclude) break } } for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Include) { q = q.Arg("include", opts[i].Include) break } } return &Directory{ q: q, c: r.c, }
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
} func (r *Directory) WithFile(path string, source *File) *Directory { q := r.q.Select("withFile") q = q.Arg("path", path) q = q.Arg("source", source) return &Directory{ q: q, c: r.c, } } func (r *Directory) WithNewDirectory(path string) *Directory { q := r.q.Select("withNewDirectory") q = q.Arg("path", path) return &Directory{ q: q, c: r.c, } } func (r *Directory) WithNewFile(path string, contents string) *Directory { q := r.q.Select("withNewFile") q = q.Arg("path", path) q = q.Arg("contents", contents) return &Directory{ q: q, c: r.c, } } func (r *Directory) WithoutDirectory(path string) *Directory { q := r.q.Select("withoutDirectory") q = q.Arg("path", path)
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
return &Directory{ q: q, c: r.c, } } func (r *Directory) WithoutFile(path string) *Directory { q := r.q.Select("withoutFile") q = q.Arg("path", path) return &Directory{ q: q, c: r.c, } } type EnvVariable struct { q *querybuilder.Selection c graphql.Client } func (r *EnvVariable) Name(ctx context.Context) (string, error) { q := r.q.Select("name") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *EnvVariable) Value(ctx context.Context) (string, error) { q := r.q.Select("value") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type File struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
q *querybuilder.Selection c graphql.Client } func (r *File) Contents(ctx context.Context) (string, error) { q := r.q.Select("contents") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *File) Export(ctx context.Context, path string) (bool, error) { q := r.q.Select("export") q = q.Arg("path", path) var response bool q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *File) ID(ctx context.Context) (FileID, error) { q := r.q.Select("id") var response FileID q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *File) XXX_GraphQLType() string { return "File" } func (r *File) XXX_GraphQLID(ctx context.Context) (string, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
id, err := r.ID(ctx) if err != nil { return "", err } return string(id), nil } func (r *File) Secret() *Secret { q := r.q.Select("secret") return &Secret{ q: q, c: r.c, } } func (r *File) Size(ctx context.Context) (int, error) { q := r.q.Select("size") var response int q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type GitRef struct { q *querybuilder.Selection c graphql.Client } func (r *GitRef) Digest(ctx context.Context) (string, error) { q := r.q.Select("digest") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type GitRefTreeOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
SSHKnownHosts string SSHAuthSocket *Socket } func (r *GitRef) Tree(opts ...GitRefTreeOpts) *Directory { q := r.q.Select("tree") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].SSHKnownHosts) { q = q.Arg("sshKnownHosts", opts[i].SSHKnownHosts) break } } for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].SSHAuthSocket) { q = q.Arg("sshAuthSocket", opts[i].SSHAuthSocket) break } } return &Directory{ q: q, c: r.c, } } type GitRepository struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
q *querybuilder.Selection c graphql.Client } func (r *GitRepository) Branch(name string) *GitRef { q := r.q.Select("branch") q = q.Arg("name", name) return &GitRef{ q: q, c: r.c, } } func (r *GitRepository) Branches(ctx context.Context) ([]string, error) { q := r.q.Select("branches") var response []string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *GitRepository) Commit(id string) *GitRef { q := r.q.Select("commit") q = q.Arg("id", id) return &GitRef{ q: q, c: r.c, } } func (r *GitRepository) Tag(name string) *GitRef {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
q := r.q.Select("tag") q = q.Arg("name", name) return &GitRef{ q: q, c: r.c, } } func (r *GitRepository) Tags(ctx context.Context) ([]string, error) { q := r.q.Select("tags") var response []string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type Host struct { q *querybuilder.Selection c graphql.Client } type HostDirectoryOpts struct { Exclude []string Include []string } func (r *Host) Directory(path string, opts ...HostDirectoryOpts) *Directory { q := r.q.Select("directory") q = q.Arg("path", path) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Exclude) { q = q.Arg("exclude", opts[i].Exclude) break }
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
} for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Include) { q = q.Arg("include", opts[i].Include) break } } return &Directory{ q: q, c: r.c, } } func (r *Host) EnvVariable(name string) *HostVariable { q := r.q.Select("envVariable") q = q.Arg("name", name) return &HostVariable{ q: q, c: r.c, } } func (r *Host) UnixSocket(path string) *Socket { q := r.q.Select("unixSocket") q = q.Arg("path", path) return &Socket{ q: q, c: r.c, } } type HostWorkdirOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
Exclude []string Include []string } func (r *Host) Workdir(opts ...HostWorkdirOpts) *Directory { q := r.q.Select("workdir") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Exclude) { q = q.Arg("exclude", opts[i].Exclude) break } } for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Include) { q = q.Arg("include", opts[i].Include) break } } return &Directory{ q: q, c: r.c, } } type HostVariable struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
q *querybuilder.Selection c graphql.Client } func (r *HostVariable) Secret() *Secret { q := r.q.Select("secret") return &Secret{ q: q, c: r.c, } } func (r *HostVariable) Value(ctx context.Context) (string, error) { q := r.q.Select("value") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type Project struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
q *querybuilder.Selection c graphql.Client } func (r *Project) Extensions(ctx context.Context) ([]Project, error) { q := r.q.Select("extensions") var response []Project q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Project) GeneratedCode() *Directory { q := r.q.Select("generatedCode") return &Directory{ q: q, c: r.c, } } func (r *Project) Install(ctx context.Context) (bool, error) { q := r.q.Select("install") var response bool q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Project) Name(ctx context.Context) (string, error) {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
q := r.q.Select("name") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Project) Schema(ctx context.Context) (string, error) { q := r.q.Select("schema") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Project) SDK(ctx context.Context) (string, error) { q := r.q.Select("sdk") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type Query struct { q *querybuilder.Selection c graphql.Client } func (r *Query) CacheVolume(key string) *CacheVolume { q := r.q.Select("cacheVolume") q = q.Arg("key", key) return &CacheVolume{ q: q, c: r.c, } } type ContainerOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
ID ContainerID Platform Platform } func (r *Query) Container(opts ...ContainerOpts) *Container { q := r.q.Select("container") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].ID) { q = q.Arg("id", opts[i].ID) break } } for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].Platform) { q = q.Arg("platform", opts[i].Platform) break } } return &Container{ q: q, c: r.c, } } func (r *Query) DefaultPlatform(ctx context.Context) (Platform, error) { q := r.q.Select("defaultPlatform")
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
var response Platform q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type DirectoryOpts struct { ID DirectoryID } func (r *Query) Directory(opts ...DirectoryOpts) *Directory { q := r.q.Select("directory") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].ID) { q = q.Arg("id", opts[i].ID) break } } return &Directory{ q: q, c: r.c, } } func (r *Query) File(id FileID) *File { q := r.q.Select("file") q = q.Arg("id", id) return &File{ q: q, c: r.c, } } type GitOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
KeepGitDir bool } func (r *Query) Git(url string, opts ...GitOpts) *GitRepository { q := r.q.Select("git") q = q.Arg("url", url) for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].KeepGitDir) { q = q.Arg("keepGitDir", opts[i].KeepGitDir) break } } return &GitRepository{ q: q, c: r.c, } } func (r *Query) Host() *Host { q := r.q.Select("host")
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
return &Host{ q: q, c: r.c, } } func (r *Query) HTTP(url string) *File { q := r.q.Select("http") q = q.Arg("url", url) return &File{ q: q, c: r.c, } } func (r *Query) Project(name string) *Project { q := r.q.Select("project") q = q.Arg("name", name) return &Project{ q: q, c: r.c, } } func (r *Query) Secret(id SecretID) *Secret { q := r.q.Select("secret") q = q.Arg("id", id) return &Secret{ q: q, c: r.c, } } type SocketOpts struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
ID SocketID } func (r *Query) Socket(opts ...SocketOpts) *Socket { q := r.q.Select("socket") for i := len(opts) - 1; i >= 0; i-- { if !querybuilder.IsZeroValue(opts[i].ID) { q = q.Arg("id", opts[i].ID) break } } return &Socket{ q: q, c: r.c, } } type Secret struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
q *querybuilder.Selection c graphql.Client } func (r *Secret) ID(ctx context.Context) (SecretID, error) { q := r.q.Select("id") var response SecretID q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Secret) XXX_GraphQLType() string { return "Secret" } func (r *Secret) XXX_GraphQLID(ctx context.Context) (string, error) { id, err := r.ID(ctx) if err != nil { return "", err } return string(id), nil } func (r *Secret) Plaintext(ctx context.Context) (string, error) { q := r.q.Select("plaintext") var response string q = q.Bind(&response) return response, q.Execute(ctx, r.c) } type Socket struct {
closed
dagger/dagger
https://github.com/dagger/dagger
4,015
API: directory { dockerBuild }
## Problem The Dagger API already supports native docker build with `container { build }`. This makes for a perfectly fine DX in native SDKs, I have no complaints. **But** it is less pleasant in the context of a raw GraphQL query, because of limitations in the GraphQL language: stitching must be done manually by querying an ID in one query and copy-pasting it into the other. This is not a problem when developing "real" pipelines, since stitching is trivially available. But it is problem when using the API playground to evaluate what the Dagger API can do. Chaining a docker build from a directory would allow for much cooler demos, for example `git { directory { dockerBuild } }` for a trivial monorepo build example; etc. ## Solution Implement `directory { dockerBuild }` as an alias to `container { build }`. Yes, I am aware that I am contradicting my own argument for cutting `container { build }`. My worry at the time was crossing a one-way door and setting a precedent for extensions. Now that our understanding of the extension design has evolved, I am no longer worried about that (each set of extensions results in a unique graphql schema which in turn will produce a unique set of generated native clients. Whatever namespacing / extension points issues we have, they will be caught at generation and will be specific to each code generation project, which is acceptable). TLDR: @aluzzardi you were right ;)
https://github.com/dagger/dagger/issues/4015
https://github.com/dagger/dagger/pull/4016
39327ce003e55b79ca55a5d84aef97e5036a5924
c0e8bb1511524f1a372b3aa3def5621e6f4eb9d1
2022-11-29T08:34:10Z
go
2022-12-01T07:39:20Z
sdk/go/api.gen.go
q *querybuilder.Selection c graphql.Client } func (r *Socket) ID(ctx context.Context) (SocketID, error) { q := r.q.Select("id") var response SocketID q = q.Bind(&response) return response, q.Execute(ctx, r.c) } func (r *Socket) XXX_GraphQLType() string { return "Socket" } func (r *Socket) XXX_GraphQLID(ctx context.Context) (string, error) { id, err := r.ID(ctx) if err != nil { return "", err } return string(id), nil }
closed
dagger/dagger
https://github.com/dagger/dagger
4,051
Fix lint errors on nodejs engine bump
The automatic engine bump PR seems to generate code that the nodejs linter disagrees with, requiring manual updates to the PR whenever it's opened, e.g. https://github.com/dagger/dagger/actions/runs/3586757292/jobs/6036336215
https://github.com/dagger/dagger/issues/4051
https://github.com/dagger/dagger/pull/4072
ec51da155e85ecda92ba6c14812d567f37269f8a
bec73f147a6901d77aca780b5386434b27863cdf
2022-11-30T20:20:05Z
go
2022-12-01T23:00:13Z
internal/mage/sdk/nodejs.go
package sdk import ( "context" "fmt" "os" "strings" "dagger.io/dagger" "github.com/dagger/dagger/internal/mage/util" "github.com/magefile/mage/mg" ) var nodejsGeneratedAPIPath = "sdk/nodejs/api/client.gen.ts" var _ SDK = Nodejs{} type Nodejs mg.Namespace func (t Nodejs) Lint(ctx context.Context) error { c, err := dagger.Connect(ctx, dagger.WithLogOutput(os.Stderr)) if err != nil { return err } defer c.Close() _, err = nodeJsBase(c). WithExec([]string{"yarn", "lint"}, dagger.ContainerWithExecOpts{ ExperimentalPrivilegedNesting: true, }). ExitCode(ctx) if err != nil { return err } return lintGeneratedCode(func() error { return t.Generate(ctx) }, nodejsGeneratedAPIPath)