From 5933620bb178a66f81e05f556010e7d75982bf49 Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Fri, 17 Dec 2021 18:41:25 +0000 Subject: [PATCH] Europa: remove implemented engine definitions from spec mock Signed-off-by: Solomon Hykes --- docs/reference/europa/dagger/README.md | 12 ------ docs/reference/europa/dagger/engine/README.md | 4 ++ .../europa/dagger/engine/spec/engine.md | 24 ++++------- stdlib/europa/dagger/engine/fs.cue | 27 +++++++++---- .../europa/dagger/engine/spec/engine/fs.cue | 26 ++---------- .../dagger/engine/spec/engine/image.cue | 40 +------------------ .../dagger/engine/spec/engine/secret.cue | 6 --- .../dagger/engine/spec/engine/service.cue | 7 ---- .../dagger/engine/spec/engine/stream.cue | 6 --- 9 files changed, 36 insertions(+), 116 deletions(-) delete mode 100644 stdlib/europa/dagger/engine/spec/engine/secret.cue delete mode 100644 stdlib/europa/dagger/engine/spec/engine/service.cue delete mode 100644 stdlib/europa/dagger/engine/spec/engine/stream.cue diff --git a/docs/reference/europa/dagger/README.md b/docs/reference/europa/dagger/README.md index dbec7284..3fea4de4 100644 --- a/docs/reference/europa/dagger/README.md +++ b/docs/reference/europa/dagger/README.md @@ -68,18 +68,6 @@ _No input._ _No output._ -## dagger.#Stream - -A stream of bytes - -### dagger.#Stream Inputs - -_No input._ - -### dagger.#Stream Outputs - -_No output._ - ## dagger.#Subdir Select a subdirectory from a filesystem tree diff --git a/docs/reference/europa/dagger/engine/README.md b/docs/reference/europa/dagger/engine/README.md index e77befb8..4e75f679 100644 --- a/docs/reference/europa/dagger/engine/README.md +++ b/docs/reference/europa/dagger/engine/README.md @@ -94,6 +94,8 @@ _No output._ ## engine.#ReadFile +Read a file from a filesystem tree + ### engine.#ReadFile Inputs _No input._ @@ -140,6 +142,8 @@ _No output._ ## engine.#WriteFile +Write a file to a filesystem tree, creating it if needed + ### engine.#WriteFile Inputs _No input._ diff --git a/docs/reference/europa/dagger/engine/spec/engine.md b/docs/reference/europa/dagger/engine/spec/engine.md index d4fe0d8f..df6f2351 100644 --- a/docs/reference/europa/dagger/engine/spec/engine.md +++ b/docs/reference/europa/dagger/engine/spec/engine.md @@ -80,7 +80,7 @@ _No output._ ## engine.#FS -A reference to a filesystem tree. For example: - The root filesystem of a container - A source code repository - A directory containing binary artifacts Rule of thumb: if it fits in a tar archive, it fits in a #FS. A filesystem state +A reference to a filesystem tree. For example: - The root filesystem of a container - A source code repository - A directory containing binary artifacts Rule of thumb: if it fits in a tar archive, it fits in a #FS. ### engine.#FS Inputs @@ -128,7 +128,7 @@ _No output._ ## engine.#ImageConfig -Container image config. See [OCI](https://www.opencontainers.org/). Spec left open on purpose to account for additional fields. [Image Spec](https://github.com/opencontainers/image-spec/blob/main/specs-go/v1/config.go) [Docker Superset](https://github.com/moby/buildkit/blob/master/frontend/dockerfile/dockerfile2llb/image.go) Container image config See [OCI](https://www.opencontainers.org) +Container image config. See [OCI](https://www.opencontainers.org/). Spec left open on purpose to account for additional fields. [Image Spec](https://github.com/opencontainers/image-spec/blob/main/specs-go/v1/config.go) [Docker Superset](https://github.com/moby/buildkit/blob/master/frontend/dockerfile/dockerfile2llb/image.go) ### engine.#ImageConfig Inputs @@ -210,6 +210,8 @@ _No output._ ## engine.#ReadFile +Read a file from a filesystem tree + ### engine.#ReadFile Inputs _No input._ @@ -232,7 +234,7 @@ _No output._ ## engine.#Secret -A reference to an external secret, for example: - A password - A SSH private key - An API token Secrets are never merged in the Cue tree. They can only be used by a special filesystem mount designed to minimize leak risk. An external secret +A reference to an external secret, for example: - A password - A SSH private key - An API token Secrets are never merged in the Cue tree. They can only be used by a special filesystem mount designed to minimize leak risk. ### engine.#Secret Inputs @@ -244,7 +246,7 @@ _No output._ ## engine.#Service -A reference to a network service endpoint, for example: - A TCP or UDP port - A unix or npipe socket - An HTTPS endpoint An external network service +A reference to a network service endpoint, for example: - A TCP or UDP port - A unix or npipe socket - An HTTPS endpoint ### engine.#Service Inputs @@ -254,18 +256,6 @@ _No input._ _No output._ -## engine.#Stream - -A stream of bytes - -### engine.#Stream Inputs - -_No input._ - -### engine.#Stream Outputs - -_No output._ - ## engine.#TempDir A temporary directory for command execution @@ -280,6 +270,8 @@ _No output._ ## engine.#WriteFile +Write a file to a filesystem tree, creating it if needed + ### engine.#WriteFile Inputs _No input._ diff --git a/stdlib/europa/dagger/engine/fs.cue b/stdlib/europa/dagger/engine/fs.cue index bb8f1209..1356ff73 100644 --- a/stdlib/europa/dagger/engine/fs.cue +++ b/stdlib/europa/dagger/engine/fs.cue @@ -1,20 +1,33 @@ package engine +// Read a file from a filesystem tree #ReadFile: { _type: "ReadFile" - input: #FS - path: string + // Filesystem tree holding the file + input: #FS + // Path of the file to read + path: string + // Contents of the file contents: string - output: #FS + // Output filesystem tree + // FIXME: this is a no-op. No output needed. + output: #FS } +// Write a file to a filesystem tree, creating it if needed #WriteFile: { _type: "WriteFile" - input: #FS - path: string + // Input filesystem tree + input: #FS + // Path of the file to write + path: string + // Contents to write contents: string - mode: int - output: #FS + // Permissions of the file + // FIXME: rename to 'permissions' for consistency + mode: int + // Output filesystem tree + output: #FS } diff --git a/stdlib/europa/dagger/engine/spec/engine/fs.cue b/stdlib/europa/dagger/engine/spec/engine/fs.cue index 7842a515..72a94d42 100644 --- a/stdlib/europa/dagger/engine/spec/engine/fs.cue +++ b/stdlib/europa/dagger/engine/spec/engine/fs.cue @@ -1,10 +1,5 @@ package engine -// A filesystem state -#FS: { - $dagger: fs: _id: string -} - // Produce an empty directory // FIXME: replace with a null value for #FS? #Scratch: { @@ -13,23 +8,9 @@ package engine output: #FS } -#ReadFile: { - $dagger: task: _name: "ReadFile" +#ReadFile: $dagger: task: _name: "ReadFile" - input: #FS - path: string - contents: string - output: #FS -} - -#WriteFile: { - $dagger: task: _name: "WriteFile" - - input: #FS - path: string - contents: string - output: #FS -} +#WriteFile: $dagger: task: _name: "WriteFile" // Create a directory #Mkdir: { @@ -39,8 +20,7 @@ package engine // Path of the directory path: string - // FIXME: this is not very dev friendly, as Cue does not support octal notation. - // What is a better option? + // FIXME: permissions? mode: int // Create parent directories as needed? parents: *true | false diff --git a/stdlib/europa/dagger/engine/spec/engine/image.cue b/stdlib/europa/dagger/engine/spec/engine/image.cue index d48b21e3..b10ccb88 100644 --- a/stdlib/europa/dagger/engine/spec/engine/image.cue +++ b/stdlib/europa/dagger/engine/spec/engine/image.cue @@ -1,14 +1,5 @@ package engine -// Container image config -// See [OCI](https://www.opencontainers.org) -#ImageConfig: { - env?: [...string] - user?: string - command?: [...string] - // FIXME -} - // Upload a container image to a remote repository #Push: { $dagger: task: _name: "Push" @@ -34,36 +25,7 @@ package engine } // Download a container image from a remote repository -#Pull: { - $dagger: task: _name: "Pull" - - // Repository source ref - source: #Ref - // Authentication - auth: [...{ - target: string - username: string - secret: string | #Secret - }] - - // Root filesystem of downloaded image - output: #FS - - // Complete ref of downloaded image (including digest) - result: #Ref - - // Downloaded container image config - config: #ImageConfig -} - -// A ref is an address for a remote container image -// -// Examples: -// - "index.docker.io/dagger" -// - "dagger" -// - "index.docker.io/dagger:latest" -// - "index.docker.io/dagger:latest@sha256:a89cb097693dd354de598d279c304a1c73ee550fbfff6d9ee515568e0c749cfe" -#Ref: string +#Pull: $dagger: task: _name: "Pull" // Build a container image using buildkit // FIXME: rename to #Dockerfile to clarify scope diff --git a/stdlib/europa/dagger/engine/spec/engine/secret.cue b/stdlib/europa/dagger/engine/spec/engine/secret.cue deleted file mode 100644 index b4977ebd..00000000 --- a/stdlib/europa/dagger/engine/spec/engine/secret.cue +++ /dev/null @@ -1,6 +0,0 @@ -package engine - -// An external secret -#Secret: { - $dagger: secret: _id: string -} diff --git a/stdlib/europa/dagger/engine/spec/engine/service.cue b/stdlib/europa/dagger/engine/spec/engine/service.cue deleted file mode 100644 index ca7f6d88..00000000 --- a/stdlib/europa/dagger/engine/spec/engine/service.cue +++ /dev/null @@ -1,7 +0,0 @@ -package engine - -// An external network service -// FIXME: rename to endpoint? -#Service: { - $dagger: service: _id: string -} diff --git a/stdlib/europa/dagger/engine/spec/engine/stream.cue b/stdlib/europa/dagger/engine/spec/engine/stream.cue deleted file mode 100644 index 64667b1f..00000000 --- a/stdlib/europa/dagger/engine/spec/engine/stream.cue +++ /dev/null @@ -1,6 +0,0 @@ -package engine - -// A stream of bytes -#Stream: { - $dagger: stream: _id: string -}