diff --git a/cmd/dagger/cmd/common/common.go b/cmd/dagger/cmd/common/common.go index 05114deb..b68e16db 100644 --- a/cmd/dagger/cmd/common/common.go +++ b/cmd/dagger/cmd/common/common.go @@ -24,7 +24,7 @@ func FormatValue(val *compiler.Value) string { case plancontext.IsFSValue(val): return "dagger.#FS" case plancontext.IsServiceValue(val): - return "dagger.#Service" + return "dagger.#Socket" } if val.IsConcreteR() != nil { diff --git a/docs/drafts/plans/docker-cli-load/local.cue b/docs/drafts/plans/docker-cli-load/local.cue index a7c1c854..16078868 100644 --- a/docs/drafts/plans/docker-cli-load/local.cue +++ b/docs/drafts/plans/docker-cli-load/local.cue @@ -7,7 +7,7 @@ import ( ) dagger.#Plan & { - client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Service + client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Socket actions: { build: docker.#Build & { diff --git a/docs/drafts/plans/docker-cli-run/local.cue b/docs/drafts/plans/docker-cli-run/local.cue index 2df6e6ba..756624b4 100644 --- a/docs/drafts/plans/docker-cli-run/local.cue +++ b/docs/drafts/plans/docker-cli-run/local.cue @@ -6,7 +6,7 @@ import ( ) dagger.#Plan & { - client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Service + client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Socket actions: run: cli.#Run & { host: client.filesystem."/var/run/docker.sock".read.contents diff --git a/docs/tests/core-concepts/client/plans/unix.cue b/docs/tests/core-concepts/client/plans/unix.cue index d82d7cd7..7a808673 100644 --- a/docs/tests/core-concepts/client/plans/unix.cue +++ b/docs/tests/core-concepts/client/plans/unix.cue @@ -1,5 +1,5 @@ dagger.#Plan & { - client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Service + client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Socket actions: { image: alpine.#Build & { diff --git a/docs/tests/core-concepts/client/plans/windows.cue b/docs/tests/core-concepts/client/plans/windows.cue index 85ab64e1..bfb25842 100644 --- a/docs/tests/core-concepts/client/plans/windows.cue +++ b/docs/tests/core-concepts/client/plans/windows.cue @@ -1,6 +1,6 @@ dagger.#Plan & { client: filesystem: "//./pipe/docker_engine": read: { - contents: dagger.#Service + contents: dagger.#Socket type: "npipe" } diff --git a/pkg/dagger.io/dagger/compat.cue b/pkg/dagger.io/dagger/compat.cue new file mode 100644 index 00000000..8e786044 --- /dev/null +++ b/pkg/dagger.io/dagger/compat.cue @@ -0,0 +1,4 @@ +package dagger + +// DEPRECATED: Use #Socket instead +#Service: #Socket diff --git a/pkg/dagger.io/dagger/core/exec.cue b/pkg/dagger.io/dagger/core/exec.cue index 3bcdfc3d..55f42d24 100644 --- a/pkg/dagger.io/dagger/core/exec.cue +++ b/pkg/dagger.io/dagger/core/exec.cue @@ -55,8 +55,8 @@ import "dagger.io/dagger" type: "tmp" contents: #TempDir } | { - type: "service" - contents: dagger.#Service + type: "socket" + contents: dagger.#Socket } | { type: "fs" contents: dagger.#FS diff --git a/pkg/dagger.io/dagger/plan.cue b/pkg/dagger.io/dagger/plan.cue index f85400bf..f678e0f8 100644 --- a/pkg/dagger.io/dagger/plan.cue +++ b/pkg/dagger.io/dagger/plan.cue @@ -67,8 +67,8 @@ _#clientFilesystemRead: { exclude?: [...string] } | { // CUE type defines expected content: - // #Service: unix socket or npipe - contents: #Service + // #Socket: unix socket or npipe + contents: #Socket // Type of service type: *"unix" | "npipe" diff --git a/pkg/dagger.io/dagger/types.cue b/pkg/dagger.io/dagger/types.cue index 0e54e442..ba9f992b 100644 --- a/pkg/dagger.io/dagger/types.cue +++ b/pkg/dagger.io/dagger/types.cue @@ -26,10 +26,10 @@ package dagger } // A reference to a network service endpoint, for example: -// - A TCP or UDP port // - A unix socket +// - A TCP or UDP port // - An HTTPS endpoint -#Service: { +#Socket: { $dagger: service: _id: string } diff --git a/pkg/universe.dagger.io/docker/cli/client.cue b/pkg/universe.dagger.io/docker/cli/client.cue index 3cb7aba6..f64a77e3 100644 --- a/pkg/universe.dagger.io/docker/cli/client.cue +++ b/pkg/universe.dagger.io/docker/cli/client.cue @@ -20,7 +20,7 @@ import ( // Connect via local docker socket #RunSocket: { - host: dagger.#Service + host: dagger.#Socket docker.#Run & { mounts: docker: { diff --git a/pkg/universe.dagger.io/docker/cli/test/load.cue b/pkg/universe.dagger.io/docker/cli/test/load.cue index 46e3629b..43eeb301 100644 --- a/pkg/universe.dagger.io/docker/cli/test/load.cue +++ b/pkg/universe.dagger.io/docker/cli/test/load.cue @@ -10,7 +10,7 @@ import ( ) dagger.#Plan & { - client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Service + client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Socket actions: test: { _cli: alpine.#Build & { diff --git a/pkg/universe.dagger.io/docker/cli/test/run.cue b/pkg/universe.dagger.io/docker/cli/test/run.cue index e29a043a..7f0b0e45 100644 --- a/pkg/universe.dagger.io/docker/cli/test/run.cue +++ b/pkg/universe.dagger.io/docker/cli/test/run.cue @@ -8,7 +8,7 @@ import ( ) dagger.#Plan & { - client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Service + client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Socket actions: test: { run: cli.#Run & { diff --git a/pkg/universe.dagger.io/docker/run.cue b/pkg/universe.dagger.io/docker/run.cue index a6723ab3..32d70d42 100644 --- a/pkg/universe.dagger.io/docker/run.cue +++ b/pkg/universe.dagger.io/docker/run.cue @@ -20,7 +20,7 @@ import ( // Expose network ports // FIXME: investigate feasibility ports: [name=string]: { - frontend: dagger.#Service + frontend: dagger.#Socket backend: { protocol: *"tcp" | "udp" address: string diff --git a/plan/task/clientfilesystemread.go b/plan/task/clientfilesystemread.go index d019be15..bbc0f931 100644 --- a/plan/task/clientfilesystemread.go +++ b/plan/task/clientfilesystemread.go @@ -170,7 +170,7 @@ func (t clientFilesystemReadTask) readService(pctx *plancontext.Context, v *comp case "npipe": npipe = path default: - return nil, fmt.Errorf("invalid service type %q", typ) + return nil, fmt.Errorf("invalid socket type %q", typ) } service := pctx.Services.New(unix, npipe) diff --git a/plan/task/exec.go b/plan/task/exec.go index b4d7fd77..c5e3f16e 100644 --- a/plan/task/exec.go +++ b/plan/task/exec.go @@ -175,7 +175,7 @@ func (t execTask) mount(pctx *plancontext.Context, dest string, mnt *compiler.Va return t.mountCache(pctx, dest, mnt) case "tmp": return t.mountTmp(pctx, dest, mnt) - case "service": + case "socket": return t.mountService(pctx, dest, mnt) case "fs": return t.mountFS(pctx, dest, mnt) diff --git a/tests/plan/client/filesystem/read/service/invalid.cue b/tests/plan/client/filesystem/read/service/invalid.cue index 39000fa9..40e14d1d 100644 --- a/tests/plan/client/filesystem/read/service/invalid.cue +++ b/tests/plan/client/filesystem/read/service/invalid.cue @@ -6,7 +6,7 @@ import ( ) dagger.#Plan & { - client: filesystem: "/var/run/docker.soc": read: contents: dagger.#Service + client: filesystem: "/var/run/docker.soc": read: contents: dagger.#Socket actions: { image: core.#Pull & { diff --git a/tests/plan/client/filesystem/read/service/valid.cue b/tests/plan/client/filesystem/read/service/valid.cue index cf218c47..f2d8982f 100644 --- a/tests/plan/client/filesystem/read/service/valid.cue +++ b/tests/plan/client/filesystem/read/service/valid.cue @@ -6,7 +6,7 @@ import ( ) dagger.#Plan & { - client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Service + client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Socket actions: { image: core.#Pull & { diff --git a/tests/plan/client/filesystem/read/service/windows.cue b/tests/plan/client/filesystem/read/service/windows.cue index 129de88d..0c47e368 100644 --- a/tests/plan/client/filesystem/read/service/windows.cue +++ b/tests/plan/client/filesystem/read/service/windows.cue @@ -6,7 +6,7 @@ import ( ) dagger.#Plan & { - client: filesystem: "//./pipe/docker_engine": read: contents: dagger.#Service + client: filesystem: "//./pipe/docker_engine": read: contents: dagger.#Socket actions: { image: core.#Pull & { diff --git a/tests/tasks/exec/mount_service.cue b/tests/tasks/exec/mount_service.cue index 1c5beca9..85c39483 100644 --- a/tests/tasks/exec/mount_service.cue +++ b/tests/tasks/exec/mount_service.cue @@ -6,7 +6,7 @@ import ( ) dagger.#Plan & { - client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Service + client: filesystem: "/var/run/docker.sock": read: contents: dagger.#Socket actions: { image: core.#Pull & {