diff --git a/docs/learn/1213-api.md b/docs/learn/1213-api.md new file mode 100644 index 00000000..24b78093 --- /dev/null +++ b/docs/learn/1213-api.md @@ -0,0 +1,52 @@ +--- +slug: /1213/api +displayed_sidebar: europaSidebar +--- + +# Dagger CUE API (0.2+) + +As of Dagger 0.2 (codename Europa), the Dagger CUE API can be imported at `dagger.io/dagger`. + +The Dagger CUE API is the set of CUE packages released alongside the Dagger engine, to allow developers to access its features. + +### Plan definition + +`#Plan` defines the structure of a Dagger plan - a complete configuration executable by `dagger up`. + +### Core types + +Dagger extends the CUE type system with the following core types: + +* `#FS`: a reference to a filesystem tree +* `#Secret`: a secure reference to an external secret +* `#Service` a reference to a network service endpoints + +### Core actions + +Dagger works by executing actions in a certain order and passing data between actions in a certain layout. + +Developers can combine actions into higher-level actions, which in turn can be combined into even higher-level actions, +and so on at arbitrary levels of depth. At the bottom of this abstraction stack are *core actions*: these +are implemented by Dagger itself, and are always available. + +The following core actions are available: + +| Core action | File | Description | +| -- | -- | -- | +| `#Exec` | exec.cue | Execute a command in a docker-compatible container | +| `#HTTPFetch` | http.cue | Download an archive from an HTTP server | +| `#Push` | image.cue | Upload an image to a docker registry | +| `#Pull` | image.cue | Download an image from a docker registry | +| `#Dockerfile` | image.cue | Execute a Dockerfile | +| `#Set` | image.cue | Modify a docker image | +| `#GitPush` | git.cue | Upload a repository to a remote git server | +| `#GitPull` | git.cue | Download a repository from a remote git server | +| `#DecodeSecret` | secrets.cue | Decode a secret without leaking its contents | +| `#NewSecret` | secrets.cue | Dynamically create a new secret | +| `#Source` | fs.cue | Access the source for the current CUE package | +| `#Mkdir` | fs.cue | Create a directory in a filesystem tree | +| `#ReadFile` | fs.cue | Read a file from a tree | +| `#WriteFile` | fs.cue | Write a file to a tree | +| `#Scratch` | fs.cue | Create an empty tree | +| `#Copy` | fs.cue | Copy files between two trees | +| `#Subdir` | fs.cue | Read a subdirectory from a filesystem tree | diff --git a/pkg/alpha.dagger.io/dagger/dagger.cue b/pkg/alpha.dagger.io/dagger/dagger.cue index bc433c23..4ce15e66 100644 --- a/pkg/alpha.dagger.io/dagger/dagger.cue +++ b/pkg/alpha.dagger.io/dagger/dagger.cue @@ -3,7 +3,7 @@ package dagger import ( "alpha.dagger.io/dagger/op" - "dagger.io/dagger/engine" + dagger_0_2 "dagger.io/dagger" ) // An artifact such as source code checkout, container image, binary archive... @@ -16,7 +16,7 @@ import ( } // Dagger stream. Can be mounted as a UNIX socket. -#Stream: engine.#Service +#Stream: dagger_0_2.#Service // A reference to an external secret, for example: // - A password @@ -24,7 +24,7 @@ import ( // - 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. -#Secret: engine.#Secret +#Secret: dagger_0_2.#Secret #Input: { @dagger(input) diff --git a/pkg/dagger.io/README.md b/pkg/dagger.io/README.md deleted file mode 100644 index 50eec2fa..00000000 --- a/pkg/dagger.io/README.md +++ /dev/null @@ -1,41 +0,0 @@ -# Europa Core packages - -## About this directory - -`stdlib/europa/` holds the development version of the Core packages for the upcoming [Europa release](https://github.com/dagger/dagger/issues/1088). - -Once Europa is released, `stdlib/europa` will become the new `stdlib/` - -## What are Dagger core packages? - -Dagger core packages are CUE packages released alongside the Dagger engine, to allow developers to access its features. - -### Dagger Core API: `dagger.io/dagger` - -*Development import path: `alpha.dagger.io/europa/dagger`* - -The Dagger Core API defines core types and utilities for programming Dagger: - -* `#Plan`: a complete configuration executable by `dagger up` -* `#FS` to reference filesystem state -* `#Secret` to (securely) reference external secrets -* `#Service` to reference network service endpoints -* `#Stream` to reference byte streams - -### Low-level Engine API: `dagger.io/dagger/engine` - -* *Development import path (implemented subset): `alpha.dagger.io/europa/dagger/engine`* -* *Development import path (full spec): `alpha.dagger.io/dagger/europa/dagger/engine/spec/engine`* - -`engine` is a low-level API for accessing the raw capabilities of the Dagger Engine. Most developers should use the Dagger Core API instead (`dagger.io/dagger`), but experts and framework developers can target the engine API directly for maximum control. - -This API prioritizes robustness, consistency, and feature completeness. It does NOT prioritize developer convenience or leveraging Cue for composition. - -In Europa, `engine` will deprecate the following implicit API: -* Low-level operations defined in `alpha.dagger.io/dagger/op` -* Imperative DSL to assemble Dockerfile-like arrays as Cue arrays -* Convention to embed pipelines in the Cue lattice with the special nested definition `#up` -* Convention to reference filesystem state from the Cue lattice with `@dagger(artifact)` -* Convention to reference external secrets from the Cue lattice with `@dagger(secret)` -* Convention to reference external network endpoints from the Cue lattice with `@dagger(stream)` -* Convention that some operations (specifically `op.#Local`) are meant to be generated at runtime rather than authored manually. diff --git a/pkg/dagger.io/README.md b/pkg/dagger.io/README.md new file mode 120000 index 00000000..9f1ec3c2 --- /dev/null +++ b/pkg/dagger.io/README.md @@ -0,0 +1 @@ +../../docs/learn/1213-api.md \ No newline at end of file diff --git a/pkg/dagger.io/dagger/engine/plan.cue b/pkg/dagger.io/dagger/engine/plan.cue deleted file mode 100644 index fe31d0f0..00000000 --- a/pkg/dagger.io/dagger/engine/plan.cue +++ /dev/null @@ -1,156 +0,0 @@ -package engine - -// A special kind of program which `dagger` can execute. -#Plan: { - // Receive inputs from the client - inputs: { - // Receive directories - directories: [name=string]: _#inputDirectory - // Securely receive secrets - secrets: [name=string]: _#inputSecret - // Receive runtime parameters - params: [name=string]: _ - } - - // Send outputs to the client - outputs: { - // Export an #FS to the client - directories: [name=string]: _#outputDirectory - // Export a string to a file - files: [name=string]: _#outputFile - } - - // Forward network services to and from the client - proxy: [endpoint=string]: _#proxyEndpoint - - // Configure platform execution - platform?: string - - // Execute actions in containers - actions: { - ... - } -} - -_#inputDirectory: { - // FIXME: rename to "InputDirectory" for consistency - $dagger: task: _name: "InputDirectory" - - // Import from this path ON THE CLIENT MACHINE - // Example: "/Users/Alice/dev/todoapp/src" - path: string - - // Filename patterns to include - // Example: ["*.go", "Dockerfile"] - include?: [...string] - - // Filename patterns to exclude - // Example: ["node_modules"] - exclude?: [...string] - - // Imported filesystem contents - // Use this as input for actions requiring an #FS field - contents: #FS -} - -// Securely receive a secret from the client -_#inputSecret: { - _#inputSecretEnv | _#inputSecretFile | _#inputSecretExec - - // Reference to the secret contents - // Use this by securely mounting it into a container. - // See universe.dagger.io/docker.#Run.mounts - // FIXME: `contents` field name causes confusion (not actually the secret contents..) - contents: #Secret - - // Whether to trim leading and trailing space characters from secret value - trimSpace: *true | false -} - -// Read secret from an environment variable ON THE CLIENT MACHINE -_#inputSecretEnv: { - $dagger: task: _name: "InputSecretEnv" - - envvar: string - - contents: #Secret -} - -// Read secret from a file ON THE CLIENT MACHINE -_#inputSecretFile: { - $dagger: task: _name: "InputSecretFile" - - path: string - - contents: #Secret -} - -// Get secret by executing a command ON THE CLIENT MACHINE -_#inputSecretExec: { - $dagger: task: _name: "InputSecretExec" - - command: { - name: string - args: [...string] - interactive: true | *false @dagger(notimplemented) // FIXME: https://github.com/dagger/dagger/issues/1268 - } - - contents: #Secret -} - -_#outputDirectory: { - $dagger: task: _name: "OutputDirectory" - - // Filesystem contents to export - // Reference an #FS field produced by an action - contents: #FS - - // Export to this path ON THE CLIENT MACHINE - dest: string -} - -_#outputFile: { - $dagger: task: _name: "OutputFile" - - // File contents to export - contents: string - - // Export to this path ON THE CLIENT MACHINE - dest: string - - // Permissions of the file (defaults to 0o644) - permissions?: int -} - -// Forward a network endpoint to and from the client -_#proxyEndpoint: { - $dagger: task: _name: "ProxyEndpoint" - - // Service endpoint can be proxied to action containers as unix sockets - // FIXME: should #Service be renamed to #ServiceEndpoint or #Endpoint? Naming things is hard... - // FIXME: should be endpoint - service: #Service - endpoint: service - { - // FIXME: reconcile with spec - unix: string - } | { - // FIXME: reconcile with spec - npipe: string - } | { - // Listen for connections ON THE CLIENT MACHINE, proxy to actions - listen: #Address @dagger(notimplemented) - } | { - // Connect to a remote endpoint FROM THE CLIENT MACHINE, proxy to actions - connect: #Address @dagger(notimplemented) - } | { - // Proxy to/from the contents of a file ON THE CLIENT MACHINE - filepath: string @dagger(notimplemented) - } | { - // Proxy to/from standard input and output of a command ON THE CLIENT MACHINE - command: [string, ...string] | string @dagger(notimplemented) - } -} - -// A network service address -#Address: string & =~"^(tcp://|unix://|udp://).*" diff --git a/pkg/dagger.io/dagger/engine/secret.cue b/pkg/dagger.io/dagger/engine/secret.cue deleted file mode 100644 index 08e1c893..00000000 --- a/pkg/dagger.io/dagger/engine/secret.cue +++ /dev/null @@ -1,45 +0,0 @@ -package engine - -// Create a new a secret from a filesystem tree -#NewSecret: { - $dagger: task: _name: "NewSecret" - - // Filesystem tree holding the secret - input: #FS - // Path of the secret to read - path: string - // Whether to trim leading and trailing space characters from secret value - trimSpace: *true | false - // Contents of the secret - output: #Secret -} - -// Securely apply a CUE transformation on the contents of a secret -// FIXME: disabled due to data race associated with filling #function.input -// #TransformSecret: { -// $dagger: task: _name: "TransformSecret" -// // The original secret -// input: #Secret -// // A new secret or (map of secrets) with the transformation applied -// output: #Secret | {[string]: output} -// // Transformation function -// #function: { -// // Full contents of the input secret (only available to the function) -// input: string -// _functionOutput: string | {[string]: _functionOutput} -// // New contents of the output secret (must provided by the caller) -// output: _functionOutput -// } -// } - -#DecodeSecret: { - $dagger: task: _name: "DecodeSecret" - - // A #Secret whose plain text is a JSON or YAML string - input: #Secret - - format: "json" | "yaml" - - // A new secret or (map of secrets) derived from unmarshaling the input secret's plain text - output: #Secret | {[string]: output} -} diff --git a/pkg/dagger.io/dagger/engine/types.cue b/pkg/dagger.io/dagger/engine/types.cue deleted file mode 100644 index 4c13245c..00000000 --- a/pkg/dagger.io/dagger/engine/types.cue +++ /dev/null @@ -1,29 +0,0 @@ -package engine - -// 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. -#FS: { - $dagger: fs: _id: string | null -} - -// 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. -#Secret: { - $dagger: secret: _id: string -} - -// A reference to a network service endpoint, for example: -// - A TCP or UDP port -// - A unix or npipe socket -// - An HTTPS endpoint -#Service: { - $dagger: service: _id: string -} diff --git a/pkg/dagger.io/dagger/engine/exec.cue b/pkg/dagger.io/dagger/exec.cue similarity index 99% rename from pkg/dagger.io/dagger/engine/exec.cue rename to pkg/dagger.io/dagger/exec.cue index c6e107a3..ed3540e3 100644 --- a/pkg/dagger.io/dagger/engine/exec.cue +++ b/pkg/dagger.io/dagger/exec.cue @@ -1,4 +1,4 @@ -package engine +package dagger // Execute a command in a container #Exec: { diff --git a/pkg/dagger.io/dagger/engine/fs.cue b/pkg/dagger.io/dagger/fs.cue similarity index 84% rename from pkg/dagger.io/dagger/engine/fs.cue rename to pkg/dagger.io/dagger/fs.cue index 7efe1a37..e41e7541 100644 --- a/pkg/dagger.io/dagger/engine/fs.cue +++ b/pkg/dagger.io/dagger/fs.cue @@ -1,4 +1,4 @@ -package engine +package dagger // Access the source directory for the current CUE package // This may safely be called from any package @@ -63,9 +63,6 @@ package engine output: #FS } -// Produce an empty directory -#Scratch: #FS & {$dagger: fs: _id: null} - // Copy files from one FS tree to another #Copy: { $dagger: task: _name: "Copy" @@ -98,3 +95,24 @@ package engine layers: [...#CopyInfo] output: #FS } + +// Select a subdirectory from a filesystem tree +#Subdir: { + // Input tree + input: #FS + + // Path of the subdirectory + // Example: "/build" + path: string + + // Copy action + _copy: #Copy & { + "input": #Scratch + contents: input + source: path + dest: "/" + } + + // Subdirectory tree + output: #FS & _copy.output +} diff --git a/pkg/dagger.io/dagger/engine/git.cue b/pkg/dagger.io/dagger/git.cue similarity index 97% rename from pkg/dagger.io/dagger/engine/git.cue rename to pkg/dagger.io/dagger/git.cue index 034f16b0..28448f7d 100644 --- a/pkg/dagger.io/dagger/engine/git.cue +++ b/pkg/dagger.io/dagger/git.cue @@ -1,4 +1,4 @@ -package engine +package dagger // Push a directory to a git remote #GitPush: { diff --git a/pkg/dagger.io/dagger/engine/http.cue b/pkg/dagger.io/dagger/http.cue similarity index 98% rename from pkg/dagger.io/dagger/engine/http.cue rename to pkg/dagger.io/dagger/http.cue index b65cf7d7..1cb52b88 100644 --- a/pkg/dagger.io/dagger/engine/http.cue +++ b/pkg/dagger.io/dagger/http.cue @@ -1,4 +1,4 @@ -package engine +package dagger // HTTP operations diff --git a/pkg/dagger.io/dagger/engine/image.cue b/pkg/dagger.io/dagger/image.cue similarity index 99% rename from pkg/dagger.io/dagger/engine/image.cue rename to pkg/dagger.io/dagger/image.cue index f19c507d..d77efe2e 100644 --- a/pkg/dagger.io/dagger/engine/image.cue +++ b/pkg/dagger.io/dagger/image.cue @@ -1,4 +1,4 @@ -package engine +package dagger import ( "list" diff --git a/pkg/dagger.io/dagger/plan.cue b/pkg/dagger.io/dagger/plan.cue index d9b3f726..72e0a43d 100644 --- a/pkg/dagger.io/dagger/plan.cue +++ b/pkg/dagger.io/dagger/plan.cue @@ -1,8 +1,153 @@ package dagger -import ( - "dagger.io/dagger/engine" -) - // A special kind of program which `dagger` can execute. -#Plan: engine.#Plan +#Plan: { + // Receive inputs from the client + inputs: { + // Receive directories + directories: [name=string]: _#inputDirectory + // Securely receive secrets + secrets: [name=string]: _#inputSecret + // Receive runtime parameters + params: [name=string]: _ + } + + // Send outputs to the client + outputs: { + // Export an #FS to the client + directories: [name=string]: _#outputDirectory + // Export a string to a file + files: [name=string]: _#outputFile + } + + // Forward network services to and from the client + proxy: [endpoint=string]: _#proxyEndpoint + + // Configure platform execution + platform?: string + + // Execute actions in containers + actions: { + ... + } +} + +_#inputDirectory: { + // FIXME: rename to "InputDirectory" for consistency + $dagger: task: _name: "InputDirectory" + + // Import from this path ON THE CLIENT MACHINE + // Example: "/Users/Alice/dev/todoapp/src" + path: string + + // Filename patterns to include + // Example: ["*.go", "Dockerfile"] + include?: [...string] + + // Filename patterns to exclude + // Example: ["node_modules"] + exclude?: [...string] + + // Imported filesystem contents + // Use this as input for actions requiring an #FS field + contents: #FS +} + +// Securely receive a secret from the client +_#inputSecret: { + _#inputSecretEnv | _#inputSecretFile | _#inputSecretExec + + // Reference to the secret contents + // Use this by securely mounting it into a container. + // See universe.io/docker.#Run.mounts + // FIXME: `contents` field name causes confusion (not actually the secret contents..) + contents: #Secret + + // Whether to trim leading and trailing space characters from secret value + trimSpace: *true | false +} + +// Read secret from an environment variable ON THE CLIENT MACHINE +_#inputSecretEnv: { + $dagger: task: _name: "InputSecretEnv" + + envvar: string + + contents: #Secret +} + +// Read secret from a file ON THE CLIENT MACHINE +_#inputSecretFile: { + $dagger: task: _name: "InputSecretFile" + + path: string + + contents: #Secret +} + +// Get secret by executing a command ON THE CLIENT MACHINE +_#inputSecretExec: { + $dagger: task: _name: "InputSecretExec" + + command: { + name: string + args: [...string] + interactive: true | *false @dagger(notimplemented) // FIXME: https://github.com/dagger/dagger/issues/1268 + } + + contents: #Secret +} + +_#outputDirectory: { + $dagger: task: _name: "OutputDirectory" + + // Filesystem contents to export + // Reference an #FS field produced by an action + contents: #FS + + // Export to this path ON THE CLIENT MACHINE + dest: string +} + +_#outputFile: { + $dagger: task: _name: "OutputFile" + + // File contents to export + contents: string + + // Export to this path ON THE CLIENT MACHINE + dest: string + + // Permissions of the file (defaults to 0o644) + permissions?: int +} + +// Forward a network endpoint to and from the client +_#proxyEndpoint: { + $dagger: task: _name: "ProxyEndpoint" + + // Service endpoint can be proxied to action containers as unix sockets + // FIXME: should #Service be renamed to #ServiceEndpoint or #Endpoint? Naming things is hard... + // FIXME: should be endpoint + service: #Service + endpoint: service + { + // FIXME: reconcile with spec + unix: string + } | { + // FIXME: reconcile with spec + npipe: string + } | { + // Listen for connections ON THE CLIENT MACHINE, proxy to actions + listen: #Address @dagger(notimplemented) + } | { + // Connect to a remote endpoint FROM THE CLIENT MACHINE, proxy to actions + connect: #Address @dagger(notimplemented) + } | { + // Proxy to/from the contents of a file ON THE CLIENT MACHINE + filepath: string @dagger(notimplemented) + } | { + // Proxy to/from standard input and output of a command ON THE CLIENT MACHINE + command: [string, ...string] | string @dagger(notimplemented) + } +} diff --git a/pkg/dagger.io/dagger/secrets.cue b/pkg/dagger.io/dagger/secrets.cue new file mode 100644 index 00000000..3db760c5 --- /dev/null +++ b/pkg/dagger.io/dagger/secrets.cue @@ -0,0 +1,29 @@ +package dagger + +// Decode the contents of a secrets without leaking it. +// Supported formats: json, yaml +#DecodeSecret: { + $dagger: task: _name: "DecodeSecret" + + // A #Secret whose plain text is a JSON or YAML string + input: #Secret + + format: "json" | "yaml" + + // A new secret or (map of secrets) derived from unmarshaling the input secret's plain text + output: #Secret | {[string]: output} +} + +// Create a new a secret from a filesystem tree +#NewSecret: { + $dagger: task: _name: "NewSecret" + + // Filesystem tree holding the secret + input: #FS + // Path of the secret to read + path: string + // Whether to trim leading and trailing space characters from secret value + trimSpace: *true | false + // Contents of the secret + output: #Secret +} diff --git a/pkg/dagger.io/dagger/types.cue b/pkg/dagger.io/dagger/types.cue index 975feb30..0e54e442 100644 --- a/pkg/dagger.io/dagger/types.cue +++ b/pkg/dagger.io/dagger/types.cue @@ -1,16 +1,19 @@ package dagger -import ( - "dagger.io/dagger/engine" -) - // 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. -#FS: engine.#FS +#FS: { + $dagger: fs: _id: string | null +} + +// An empty directory +#Scratch: #FS & { + $dagger: fs: _id: null +} // A reference to an external secret, for example: // - A password @@ -18,13 +21,17 @@ import ( // - 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. -#Secret: engine.#Secret +#Secret: { + $dagger: secret: _id: string +} // A reference to a network service endpoint, for example: // - A TCP or UDP port // - A unix socket // - An HTTPS endpoint -#Service: engine.#Service +#Service: { + $dagger: service: _id: string +} // A network service address -#Address: engine.#Address +#Address: string & =~"^(tcp://|unix://|udp://).*" diff --git a/pkg/dagger.io/dagger/utils.cue b/pkg/dagger.io/dagger/utils.cue deleted file mode 100644 index b4aa8a76..00000000 --- a/pkg/dagger.io/dagger/utils.cue +++ /dev/null @@ -1,61 +0,0 @@ -package dagger - -import ( - // "encoding/json" - // "encoding/yaml" - "dagger.io/dagger/engine" -) - -// Access the source directory for the current CUE package -// This may safely be called from any package -#Source: engine.#Source - -// A (best effort) persistent cache dir -#CacheDir: engine.#CacheDir - -// A temporary directory for command execution -#TempDir: engine.#TempDir - -// Select a subdirectory from a filesystem tree -#Subdir: { - // Input tree - input: engine.#FS - - // Path of the subdirectory - // Example: "/build" - path: string - - // Copy action - _copy: engine.#Copy & { - "input": engine.#Scratch - contents: input - source: path - dest: "/" - } - - // Subdirectory tree - output: engine.#FS & _copy.output -} - -// DecodeSecret is a convenience wrapper around #TransformSecret. The plain text contents of input is expected to match the format -// #DecodeSecret: { -// { -// format: "json" -// engine.#TransformSecret & { -// #function: { -// input: _ -// output: json.Unmarshal(input) -// } -// } -// } | { -// format: "yaml" -// engine.#TransformSecret & { -// #function: { -// input: _ -// output: yaml.Unmarshal(input) -// } -// } -// } -// } - -#DecodeSecret: engine.#DecodeSecret diff --git a/pkg/pkg.go b/pkg/pkg.go index c3dd27b4..5c6b5f1c 100644 --- a/pkg/pkg.go +++ b/pkg/pkg.go @@ -32,7 +32,7 @@ var ( UniverseModule, } - EnginePackage = fmt.Sprintf("%s/dagger/engine", DaggerModule) + DaggerPackage = fmt.Sprintf("%s/dagger", DaggerModule) lockFilePath = "dagger.lock" ) diff --git a/pkg/universe.dagger.io/alpine/test/test.cue b/pkg/universe.dagger.io/alpine/test/test.cue index 510afc67..26831d38 100644 --- a/pkg/universe.dagger.io/alpine/test/test.cue +++ b/pkg/universe.dagger.io/alpine/test/test.cue @@ -2,7 +2,6 @@ package alpine import ( "dagger.io/dagger" - "dagger.io/dagger/engine" "universe.dagger.io/alpine" "universe.dagger.io/docker" @@ -17,7 +16,7 @@ dagger.#Plan & { version: "3.10.9" } - verify: engine.#Readfile & { + verify: dagger.#Readfile & { input: build.output.rootfs path: "/etc/alpine-release" contents: "3.10.9\n" diff --git a/pkg/universe.dagger.io/bash/bash.cue b/pkg/universe.dagger.io/bash/bash.cue index afd3d50f..117195b2 100644 --- a/pkg/universe.dagger.io/bash/bash.cue +++ b/pkg/universe.dagger.io/bash/bash.cue @@ -3,7 +3,6 @@ package bash import ( "dagger.io/dagger" - "dagger.io/dagger/engine" "universe.dagger.io/docker" ) @@ -27,8 +26,8 @@ import ( contents: string _filename: "run.sh" - _write: engine.#WriteFile & { - input: engine.#Scratch + _write: dagger.#WriteFile & { + input: dagger.#Scratch path: _filename "contents": contents } diff --git a/pkg/universe.dagger.io/cue.mod/pkg/dagger.io b/pkg/universe.dagger.io/cue.mod/pkg/dagger.io deleted file mode 120000 index cb095939..00000000 --- a/pkg/universe.dagger.io/cue.mod/pkg/dagger.io +++ /dev/null @@ -1 +0,0 @@ -../../../dagger.io \ No newline at end of file diff --git a/pkg/universe.dagger.io/docker/build.cue b/pkg/universe.dagger.io/docker/build.cue index 72c28814..9c272b28 100644 --- a/pkg/universe.dagger.io/docker/build.cue +++ b/pkg/universe.dagger.io/docker/build.cue @@ -2,7 +2,6 @@ package docker import ( "dagger.io/dagger" - "dagger.io/dagger/engine" ) // Modular build API for Docker containers @@ -47,7 +46,7 @@ import ( dest: string | *"/" // Execute copy operation - _copy: engine.#Copy & { + _copy: dagger.#Copy & { "input": input.rootfs "contents": contents "source": source diff --git a/pkg/universe.dagger.io/docker/image.cue b/pkg/universe.dagger.io/docker/image.cue index 472fe5e4..dbb46683 100644 --- a/pkg/universe.dagger.io/docker/image.cue +++ b/pkg/universe.dagger.io/docker/image.cue @@ -2,7 +2,6 @@ package docker import ( "dagger.io/dagger" - "dagger.io/dagger/engine" ) // A container image @@ -11,7 +10,7 @@ import ( rootfs: dagger.#FS // Image config - config: engine.#ImageConfig + config: dagger.#ImageConfig } // A ref is an address for a remote container image @@ -21,4 +20,4 @@ import ( // - "index.docker.io/dagger:latest" // - "index.docker.io/dagger:latest@sha256:a89cb097693dd354de598d279c304a1c73ee550fbfff6d9ee515568e0c749cfe" // FIXME: add formatting constraints -#Ref: engine.#Ref +#Ref: dagger.#Ref diff --git a/pkg/universe.dagger.io/docker/pull.cue b/pkg/universe.dagger.io/docker/pull.cue index 5a0b4d64..83044700 100644 --- a/pkg/universe.dagger.io/docker/pull.cue +++ b/pkg/universe.dagger.io/docker/pull.cue @@ -2,7 +2,6 @@ package docker import ( - "dagger.io/dagger/engine" "dagger.io/dagger" ) @@ -17,7 +16,7 @@ import ( secret: dagger.#Secret } - _op: engine.#Pull & { + _op: dagger.#Pull & { "source": source if auth != _|_ { "auth": auth diff --git a/pkg/universe.dagger.io/docker/push.cue b/pkg/universe.dagger.io/docker/push.cue index 9d29cf9f..a8076a72 100644 --- a/pkg/universe.dagger.io/docker/push.cue +++ b/pkg/universe.dagger.io/docker/push.cue @@ -2,7 +2,6 @@ package docker import ( "dagger.io/dagger" - "dagger.io/dagger/engine" ) // Upload an image to a remote repository @@ -22,7 +21,7 @@ import ( // Image to push image: #Image - _push: engine.#Push & { + _push: dagger.#Push & { "dest": dest if auth != _|_ { "auth": auth diff --git a/pkg/universe.dagger.io/docker/run.cue b/pkg/universe.dagger.io/docker/run.cue index d1525971..dfbb58c1 100644 --- a/pkg/universe.dagger.io/docker/run.cue +++ b/pkg/universe.dagger.io/docker/run.cue @@ -4,7 +4,6 @@ import ( "list" "dagger.io/dagger" - "dagger.io/dagger/engine" ) // Run a command in a container @@ -15,7 +14,7 @@ import ( always: bool | *false // Filesystem mounts - mounts: [name=string]: engine.#Mount + mounts: [name=string]: dagger.#Mount // Expose network ports // FIXME: investigate feasibility @@ -55,7 +54,7 @@ import ( // Environment variables // Example: {"DEBUG": "1"} - env: [string]: string | engine.#Secret + env: [string]: string | dagger.#Secret // Working directory for the command // Example: "/src" @@ -87,7 +86,7 @@ import ( rootfs: dagger.#FS & _exec.output files: [path=string]: { contents: string & _read.contents - _read: engine.#ReadFile & { + _read: dagger.#ReadFile & { input: _exec.output "path": path } @@ -109,7 +108,7 @@ import ( } // Actually execute the command - _exec: engine.#Exec & { + _exec: dagger.#Exec & { "input": input.rootfs "always": always "mounts": mounts diff --git a/pkg/universe.dagger.io/docker/set.cue b/pkg/universe.dagger.io/docker/set.cue index 3902dbd7..491d36fb 100644 --- a/pkg/universe.dagger.io/docker/set.cue +++ b/pkg/universe.dagger.io/docker/set.cue @@ -1,7 +1,7 @@ package docker import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) // Change image config @@ -10,9 +10,9 @@ import ( input: #Image // The image config to change - config: engine.#ImageConfig + config: dagger.#ImageConfig - _set: engine.#Set & { + _set: dagger.#Set & { "input": input.config "config": config } diff --git a/pkg/universe.dagger.io/docker/test/build.cue b/pkg/universe.dagger.io/docker/test/build.cue index 061c605c..d2dbda36 100644 --- a/pkg/universe.dagger.io/docker/test/build.cue +++ b/pkg/universe.dagger.io/docker/test/build.cue @@ -2,7 +2,6 @@ package docker import ( "dagger.io/dagger" - "dagger.io/dagger/engine" "universe.dagger.io/alpine" "universe.dagger.io/docker" @@ -27,7 +26,7 @@ dagger.#Plan & { ] } - verify: engine.#ReadFile & { + verify: dagger.#ReadFile & { input: image.output.rootfs path: "/test.txt" } @@ -60,7 +59,7 @@ dagger.#Plan & { ] } - verify: engine.#ReadFile & { + verify: dagger.#ReadFile & { input: image.output.rootfs path: "/test.txt" } diff --git a/pkg/universe.dagger.io/docker/test/image.cue b/pkg/universe.dagger.io/docker/test/image.cue index 8eacb05a..818ba1ac 100644 --- a/pkg/universe.dagger.io/docker/test/image.cue +++ b/pkg/universe.dagger.io/docker/test/image.cue @@ -2,7 +2,6 @@ package docker import ( "dagger.io/dagger" - "dagger.io/dagger/engine" "universe.dagger.io/docker" ) @@ -13,7 +12,7 @@ dagger.#Plan & { // Test: change image config with docker.#Set set: { image: output: docker.#Image & { - rootfs: engine.#Scratch + rootfs: dagger.#Scratch config: { cmd: ["/bin/sh"] env: PATH: "/sbin:/bin" @@ -44,8 +43,8 @@ dagger.#Plan & { // Test: image config behavior is correct config: { - build: engine.#Dockerfile & { - source: engine.#Scratch + build: dagger.#Dockerfile & { + source: dagger.#Scratch dockerfile: contents: """ FROM alpine:3.15.0 RUN echo -n 'not hello from dagger' > /dagger.txt diff --git a/pkg/universe.dagger.io/docker/test/run.cue b/pkg/universe.dagger.io/docker/test/run.cue index ad9d7af5..7354d4bc 100644 --- a/pkg/universe.dagger.io/docker/test/run.cue +++ b/pkg/universe.dagger.io/docker/test/run.cue @@ -2,7 +2,6 @@ package docker import ( "dagger.io/dagger" - "dagger.io/dagger/engine" "universe.dagger.io/docker" "universe.dagger.io/alpine" @@ -25,7 +24,7 @@ dagger.#Plan & { } } - verify: engine.#ReadFile & { + verify: dagger.#ReadFile & { input: run.output.rootfs path: "/output.txt" } @@ -61,7 +60,7 @@ dagger.#Plan & { export: directories: "/test": _ } - verify: engine.#ReadFile & { + verify: dagger.#ReadFile & { input: run.export.directories."/test".contents path: "/output.txt" } diff --git a/pkg/universe.dagger.io/examples/changelog.com/_prototypes/joel/main.cue b/pkg/universe.dagger.io/examples/changelog.com/_prototypes/joel/main.cue index 273de6d9..a4148635 100644 --- a/pkg/universe.dagger.io/examples/changelog.com/_prototypes/joel/main.cue +++ b/pkg/universe.dagger.io/examples/changelog.com/_prototypes/joel/main.cue @@ -1,12 +1,11 @@ package main import ( - "dagger.io/dagger/engine" ) runtime_image_ref: string | *"thechangelog/runtime:2021-05-29T10.17.12Z" -engine.#Plan & { +dagger.#Plan & { inputs: directories: app: { path: "." exclude: [ @@ -57,11 +56,11 @@ engine.#Plan & { } actions: { - runtimeImage: engine.#Pull & { + runtimeImage: dagger.#Pull & { source: runtime_image_ref } - depsCache: engine.#CacheDir & { + depsCache: dagger.#CacheDir & { id: "depsCache" } @@ -70,7 +69,7 @@ engine.#Plan & { contents: depsCache } - buildCacheTest: engine.#CacheDir & { + buildCacheTest: dagger.#CacheDir & { id: "buildCacheTest" } @@ -79,7 +78,7 @@ engine.#Plan & { contents: buildCacheTest } - buildCacheProd: engine.#CacheDir & { + buildCacheProd: dagger.#CacheDir & { id: "buildCacheProd" } @@ -88,7 +87,7 @@ engine.#Plan & { contents: buildCacheProd } - nodeModulesCache: engine.#CacheDir & { + nodeModulesCache: dagger.#CacheDir & { id: "nodeModulesCache" } @@ -97,20 +96,20 @@ engine.#Plan & { contents: nodeModulesCache } - appImage: engine.#Copy & { + appImage: dagger.#Copy & { input: runtimeImage.output contents: inputs.directories.app.contents dest: "/app" } - deps: engine.#Exec & { + deps: dagger.#Exec & { input: appImage.output mounts: depsCacheMount workdir: "/app" args: ["bash", "-c", " mix deps.get"] } - assetsCompile: engine.#Exec & { + assetsCompile: dagger.#Exec & { input: depsCompileProd.output mounts: depsCacheMount & nodeModulesCacheMount workdir: "/app/assets" @@ -118,7 +117,7 @@ engine.#Plan & { args: ["bash", "-c", "yarn install --frozen-lockfile && yarn run compile"] } - #depsCompile: engine.#Exec & { + #depsCompile: dagger.#Exec & { input: deps.output mounts: depsCacheMount workdir: "/app" @@ -135,7 +134,7 @@ engine.#Plan & { mounts: buildCacheProdMount } - assetsDigest: engine.#Exec & { + assetsDigest: dagger.#Exec & { input: assetsCompile.output mounts: depsCacheMount & buildCacheProdMount & nodeModulesCacheMount env: MIX_ENV: "prod" @@ -143,20 +142,20 @@ engine.#Plan & { args: ["bash", "-c", "mix phx.digest"] } - imageProdCacheCopy: engine.#Exec & { + imageProdCacheCopy: dagger.#Exec & { input: assetsDigest.output mounts: (depsCacheMount & {depsCache: dest: "/mnt/app/deps/"} ) mounts: (buildCacheProdMount & {buildCacheProd: dest: "/mnt/app/_build/prod"} ) args: ["bash", "-c", "cp -Rp /mnt/app/deps/* /app/deps/ && cp -Rp /mnt/app/_build/prod/* /app/_build/prod/"] } - imageProdDockerCopy: engine.#Copy & { + imageProdDockerCopy: dagger.#Copy & { input: imageProdCacheCopy.output source: root: inputs.directories.docker.contents dest: "/" } - imageProd: engine.#Build & { + imageProd: dagger.#Build & { source: imageProdDockerCopy.output dockerfile: path: "/docker/Dockerfile.production" buildArg: { diff --git a/pkg/universe.dagger.io/examples/changelog.com/commented.cue b/pkg/universe.dagger.io/examples/changelog.com/commented.cue index 22227a07..5045e67a 100644 --- a/pkg/universe.dagger.io/examples/changelog.com/commented.cue +++ b/pkg/universe.dagger.io/examples/changelog.com/commented.cue @@ -19,7 +19,7 @@ actions: { // workdir: _ // // FIXME: remove copy-pasta // mounts: nodeModules: { - // contents: engine.#CacheDir & { + // contents: dagger.#CacheDir & { // // FIXME: do we need an ID here? // id: "\(mix.app)_assets_node_modules" // // FIXME: does this command need write access to node_modules cache? @@ -55,7 +55,7 @@ actions: { // } // // FIXME: move this to a reusable def (yarn package? or private?) // mounts: nodeModules: { - // contents: engine.#CacheDir & { + // contents: dagger.#CacheDir & { // // FIXME: do we need an ID here? // id: "\(mix.app)_assets_node_modules" // // FIXME: will there be multiple writers? diff --git a/pkg/universe.dagger.io/examples/changelog.com/elixir/mix/mix.cue b/pkg/universe.dagger.io/examples/changelog.com/elixir/mix/mix.cue index 9216ba0d..5a397a6a 100644 --- a/pkg/universe.dagger.io/examples/changelog.com/elixir/mix/mix.cue +++ b/pkg/universe.dagger.io/examples/changelog.com/elixir/mix/mix.cue @@ -2,7 +2,6 @@ package mix import ( "dagger.io/dagger" - "dagger.io/dagger/engine" "universe.dagger.io/docker" ) @@ -68,7 +67,7 @@ import ( } if cache.deps != null { mounts: deps: { - contents: engine.#CacheDir & { + contents: dagger.#CacheDir & { id: "\(app.name)_deps" concurrency: cache.deps } @@ -77,7 +76,7 @@ import ( } if cache.build != null { mounts: buildCache: { - contents: engine.#CacheDir & { + contents: dagger.#CacheDir & { id: "\(app.name)_build_\(env)" concurrency: cache.build } diff --git a/pkg/universe.dagger.io/git/git.cue b/pkg/universe.dagger.io/git/git.cue index d8e01f1f..36dbb06f 100644 --- a/pkg/universe.dagger.io/git/git.cue +++ b/pkg/universe.dagger.io/git/git.cue @@ -1,8 +1,7 @@ package git import ( - "dagger.io/dagger/engine" ) -#Pull: engine.#GitPull -#Push: engine.#GitPush +#Pull: dagger.#GitPull +#Push: dagger.#GitPush diff --git a/pkg/universe.dagger.io/netlify/netlify.cue b/pkg/universe.dagger.io/netlify/netlify.cue index efa04beb..a6df38b2 100644 --- a/pkg/universe.dagger.io/netlify/netlify.cue +++ b/pkg/universe.dagger.io/netlify/netlify.cue @@ -4,7 +4,6 @@ package netlify import ( "dagger.io/dagger" - "dagger.io/dagger/engine" "universe.dagger.io/alpine" "universe.dagger.io/docker" @@ -61,7 +60,7 @@ import ( container: bash.#Run & { input: *_build.output | docker.#Image script: { - _load: engine.#Source & { + _load: dagger.#Source & { path: "." include: ["*.sh"] } diff --git a/pkg/universe.dagger.io/netlify/test/test.cue b/pkg/universe.dagger.io/netlify/test/test.cue index dbe892fa..1a27cb3e 100644 --- a/pkg/universe.dagger.io/netlify/test/test.cue +++ b/pkg/universe.dagger.io/netlify/test/test.cue @@ -2,7 +2,6 @@ package netlify import ( "dagger.io/dagger" - "dagger.io/dagger/engine" "universe.dagger.io/docker" "universe.dagger.io/netlify" @@ -29,8 +28,8 @@ dagger.#Plan & { marker: "hello world" - data: engine.#WriteFile & { - input: engine.#Scratch + data: dagger.#WriteFile & { + input: dagger.#Scratch path: "index.html" contents: marker } diff --git a/pkg/universe.dagger.io/yarn/test/test.cue b/pkg/universe.dagger.io/yarn/test/test.cue index dea868f7..574523d5 100644 --- a/pkg/universe.dagger.io/yarn/test/test.cue +++ b/pkg/universe.dagger.io/yarn/test/test.cue @@ -2,7 +2,6 @@ package yarn import ( "dagger.io/dagger" - "dagger.io/dagger/engine" "universe.dagger.io/docker" "universe.dagger.io/yarn" @@ -79,7 +78,7 @@ dagger.#Plan & { path: string contents: string - _read: engine.#ReadFile & { + _read: dagger.#ReadFile & { "input": input "path": path } diff --git a/pkg/universe.dagger.io/yarn/yarn.cue b/pkg/universe.dagger.io/yarn/yarn.cue index 2cc5bc19..94f861bf 100644 --- a/pkg/universe.dagger.io/yarn/yarn.cue +++ b/pkg/universe.dagger.io/yarn/yarn.cue @@ -5,7 +5,6 @@ import ( "strings" "dagger.io/dagger" - "dagger.io/dagger/engine" "universe.dagger.io/alpine" "universe.dagger.io/bash" @@ -77,7 +76,7 @@ import ( mounts: { "yarn cache": { dest: "/cache/yarn" - contents: engine.#CacheDir & { + contents: dagger.#CacheDir & { // FIXME: are there character limitations in cache ID? id: "universe.dagger.io/yarn.#Build \(name)" } diff --git a/plan/task/task.go b/plan/task/task.go index 9296668f..dfccd762 100644 --- a/plan/task/task.go +++ b/plan/task/task.go @@ -20,7 +20,7 @@ var ( typePath = cue.MakePath( cue.Str("$dagger"), cue.Str("task"), - cue.Hid("_name", pkg.EnginePackage)) + cue.Hid("_name", pkg.DaggerPackage)) ) type NewFunc func() Task diff --git a/plancontext/fs.go b/plancontext/fs.go index 70b3ec0d..6740c73b 100644 --- a/plancontext/fs.go +++ b/plancontext/fs.go @@ -16,7 +16,7 @@ var ( fsIDPath = cue.MakePath( cue.Str("$dagger"), cue.Str("fs"), - cue.Hid("_id", pkg.EnginePackage), + cue.Hid("_id", pkg.DaggerPackage), ) ) diff --git a/plancontext/secret.go b/plancontext/secret.go index c0ab648c..45ec58fd 100644 --- a/plancontext/secret.go +++ b/plancontext/secret.go @@ -13,7 +13,7 @@ var ( secretIDPath = cue.MakePath( cue.Str("$dagger"), cue.Str("secret"), - cue.Hid("_id", pkg.EnginePackage), + cue.Hid("_id", pkg.DaggerPackage), ) ) diff --git a/plancontext/service.go b/plancontext/service.go index 2cc2a85b..6b9967de 100644 --- a/plancontext/service.go +++ b/plancontext/service.go @@ -13,7 +13,7 @@ var ( serviceIDPath = cue.MakePath( cue.Str("$dagger"), cue.Str("service"), - cue.Hid("_id", pkg.EnginePackage), + cue.Hid("_id", pkg.DaggerPackage), ) ) diff --git a/tests/core/secrets/invalid/env/cue.mod/pkg/.gitignore b/tests/core/secrets/invalid/env/cue.mod/pkg/.gitignore index a572e9ee..7280417b 100644 --- a/tests/core/secrets/invalid/env/cue.mod/pkg/.gitignore +++ b/tests/core/secrets/invalid/env/cue.mod/pkg/.gitignore @@ -1,2 +1,4 @@ # dagger universe alpha.dagger.io +dagger.io +universe.dagger.io diff --git a/tests/core/secrets/invalid/string/cue.mod/pkg/.gitignore b/tests/core/secrets/invalid/string/cue.mod/pkg/.gitignore index a572e9ee..7280417b 100644 --- a/tests/core/secrets/invalid/string/cue.mod/pkg/.gitignore +++ b/tests/core/secrets/invalid/string/cue.mod/pkg/.gitignore @@ -1,2 +1,4 @@ # dagger universe alpha.dagger.io +dagger.io +universe.dagger.io diff --git a/tests/core/secrets/simple/cue.mod/pkg/.gitignore b/tests/core/secrets/simple/cue.mod/pkg/.gitignore index a572e9ee..7280417b 100644 --- a/tests/core/secrets/simple/cue.mod/pkg/.gitignore +++ b/tests/core/secrets/simple/cue.mod/pkg/.gitignore @@ -1,2 +1,4 @@ # dagger universe alpha.dagger.io +dagger.io +universe.dagger.io diff --git a/tests/plan/hello-europa/main.cue b/tests/plan/hello-europa/main.cue index 1609a66b..b7ca0ac3 100644 --- a/tests/plan/hello-europa/main.cue +++ b/tests/plan/hello-europa/main.cue @@ -1,11 +1,11 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" "alpha.dagger.io/os" ) -engine.#Plan & { +dagger.#Plan & { actions: { sayHello: os.#Container & { command: "echo Hello Europa! > /out.txt" diff --git a/tests/plan/inputs/directories/conflicting_values.cue b/tests/plan/inputs/directories/conflicting_values.cue index 761d4d22..46da76e6 100644 --- a/tests/plan/inputs/directories/conflicting_values.cue +++ b/tests/plan/inputs/directories/conflicting_values.cue @@ -1,12 +1,12 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { inputs: directories: test: path: "." - actions: verify: engine.#ReadFile & { + actions: verify: dagger.#ReadFile & { input: inputs.directories.test.contents path: "test.txt" } & { diff --git a/tests/plan/inputs/directories/exists.cue b/tests/plan/inputs/directories/exists.cue index 302cb8af..0b061e48 100644 --- a/tests/plan/inputs/directories/exists.cue +++ b/tests/plan/inputs/directories/exists.cue @@ -1,12 +1,12 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { inputs: directories: test: path: "." - actions: verify: engine.#ReadFile & { + actions: verify: dagger.#ReadFile & { input: inputs.directories.test.contents path: "test.txt" } & { diff --git a/tests/plan/inputs/directories/not_exists.cue b/tests/plan/inputs/directories/not_exists.cue index ab6422d3..02eb1b97 100644 --- a/tests/plan/inputs/directories/not_exists.cue +++ b/tests/plan/inputs/directories/not_exists.cue @@ -1,13 +1,13 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { // should fail because path does not exist locally inputs: directories: test: path: "./fasdfsdfs" - actions: verify: engine.#ReadFile & { + actions: verify: dagger.#ReadFile & { input: inputs.directories.test.contents path: "test.txt" } & { diff --git a/tests/plan/inputs/secrets/exec.cue b/tests/plan/inputs/secrets/exec.cue index e98251b7..c083f489 100644 --- a/tests/plan/inputs/secrets/exec.cue +++ b/tests/plan/inputs/secrets/exec.cue @@ -1,10 +1,10 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { inputs: secrets: echo: command: { name: "echo" args: ["hello europa"] @@ -12,11 +12,11 @@ engine.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: image.output mounts: secret: { dest: "/run/secrets/test" diff --git a/tests/plan/inputs/secrets/exec_relative.cue b/tests/plan/inputs/secrets/exec_relative.cue index 094835eb..8e961a01 100644 --- a/tests/plan/inputs/secrets/exec_relative.cue +++ b/tests/plan/inputs/secrets/exec_relative.cue @@ -1,10 +1,10 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { inputs: secrets: echo: command: { name: "cat" args: ["./test.txt"] @@ -12,11 +12,11 @@ engine.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: image.output mounts: secret: { dest: "/run/secrets/test" diff --git a/tests/plan/inputs/secrets/invalid_command.cue b/tests/plan/inputs/secrets/invalid_command.cue index ba1a1837..f6012906 100644 --- a/tests/plan/inputs/secrets/invalid_command.cue +++ b/tests/plan/inputs/secrets/invalid_command.cue @@ -1,10 +1,10 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { inputs: secrets: echo: command: { name: "rtyet" // should fail because command doesn't exist args: ["hello europa"] @@ -12,11 +12,11 @@ engine.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: image.output mounts: secret: { dest: "/run/secrets/test" diff --git a/tests/plan/inputs/secrets/invalid_command_options.cue b/tests/plan/inputs/secrets/invalid_command_options.cue index 1ada80df..040ed80a 100644 --- a/tests/plan/inputs/secrets/invalid_command_options.cue +++ b/tests/plan/inputs/secrets/invalid_command_options.cue @@ -1,10 +1,9 @@ package main import ( - "dagger.io/dagger/engine" ) -engine.#Plan & { +dagger.#Plan & { inputs: secrets: echo: command: { name: "cat" args: ["--sfgjkhf"] // // should fail because invalid option @@ -12,11 +11,11 @@ engine.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: image.output mounts: secret: { dest: "/run/secrets/test" diff --git a/tests/plan/outputs/directories/outputs.cue b/tests/plan/outputs/directories/outputs.cue index 5a9aa3fa..a46ceaf7 100644 --- a/tests/plan/outputs/directories/outputs.cue +++ b/tests/plan/outputs/directories/outputs.cue @@ -1,10 +1,12 @@ package main -import "dagger.io/dagger/engine" +import ( + "dagger.io/dagger" +) -engine.#Plan & { - actions: data: engine.#WriteFile & { - input: engine.#Scratch +dagger.#Plan & { + actions: data: dagger.#WriteFile & { + input: dagger.#Scratch path: "/test" permissions: 0o600 contents: "foobar" diff --git a/tests/plan/platform/config_platform_failure_invalid_platform.cue b/tests/plan/platform/config_platform_failure_invalid_platform.cue index 7dbaa63e..bce5b75e 100644 --- a/tests/plan/platform/config_platform_failure_invalid_platform.cue +++ b/tests/plan/platform/config_platform_failure_invalid_platform.cue @@ -1,18 +1,17 @@ package main import ( - "dagger.io/dagger/engine" ) -engine.#Plan & { +dagger.#Plan & { platform: "linux/unknown" actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0" } - writeArch: engine.#Exec & { + writeArch: dagger.#Exec & { input: image.output always: true args: [ @@ -22,7 +21,7 @@ engine.#Plan & { ] } - verify: engine.#ReadFile & { + verify: dagger.#ReadFile & { input: writeArch.output path: "/arch.txt" } & { diff --git a/tests/plan/platform/config_platform_linux_amd64.cue b/tests/plan/platform/config_platform_linux_amd64.cue index 2960890f..bf98009f 100644 --- a/tests/plan/platform/config_platform_linux_amd64.cue +++ b/tests/plan/platform/config_platform_linux_amd64.cue @@ -1,18 +1,17 @@ package main import ( - "dagger.io/dagger/engine" ) -engine.#Plan & { +dagger.#Plan & { platform: "linux/amd64" actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0" } - writeArch: engine.#Exec & { + writeArch: dagger.#Exec & { input: image.output always: true args: [ @@ -22,7 +21,7 @@ engine.#Plan & { ] } - verify: engine.#ReadFile & { + verify: dagger.#ReadFile & { input: writeArch.output path: "/arch.txt" } & { diff --git a/tests/plan/platform/config_platform_linux_arm64.cue b/tests/plan/platform/config_platform_linux_arm64.cue index d53cf340..45a4156f 100644 --- a/tests/plan/platform/config_platform_linux_arm64.cue +++ b/tests/plan/platform/config_platform_linux_arm64.cue @@ -1,18 +1,17 @@ package main import ( - "dagger.io/dagger/engine" ) -engine.#Plan & { +dagger.#Plan & { platform: "linux/arm64" actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0" } - writeArch: engine.#Exec & { + writeArch: dagger.#Exec & { input: image.output always: true args: [ @@ -22,7 +21,7 @@ engine.#Plan & { ] } - verify: engine.#ReadFile & { + verify: dagger.#ReadFile & { input: writeArch.output path: "/arch.txt" } & { diff --git a/tests/plan/proxy/incomplete_service.cue b/tests/plan/proxy/incomplete_service.cue index 61470502..42be4e8b 100644 --- a/tests/plan/proxy/incomplete_service.cue +++ b/tests/plan/proxy/incomplete_service.cue @@ -1,12 +1,13 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" + "alpha.dagger.io/dagger/op" "alpha.dagger.io/alpine" ) -engine.#Plan & { +dagger.#Plan & { // should fail due to incomplete service proxy: dockerSocket: {} diff --git a/tests/plan/proxy/incomplete_unix.cue b/tests/plan/proxy/incomplete_unix.cue index 2c6f2ad3..39fca4e6 100644 --- a/tests/plan/proxy/incomplete_unix.cue +++ b/tests/plan/proxy/incomplete_unix.cue @@ -1,12 +1,11 @@ package main import ( - "dagger.io/dagger/engine" "alpha.dagger.io/dagger/op" "alpha.dagger.io/alpine" ) -engine.#Plan & { +dagger.#Plan & { // should fail because incomplete value proxy: dockerSocket: unix: string diff --git a/tests/plan/proxy/invalid_schema.cue b/tests/plan/proxy/invalid_schema.cue index 7033eb62..7f631aef 100644 --- a/tests/plan/proxy/invalid_schema.cue +++ b/tests/plan/proxy/invalid_schema.cue @@ -1,12 +1,11 @@ package main import ( - "dagger.io/dagger/engine" "alpha.dagger.io/dagger/op" "alpha.dagger.io/alpine" ) -engine.#Plan & { +dagger.#Plan & { // should fail because of misspelled key proxy: dockerSocket: unx: "/var/run/docker.sock" diff --git a/tests/plan/proxy/invalid_value.cue b/tests/plan/proxy/invalid_value.cue index 9fb25504..7383938e 100644 --- a/tests/plan/proxy/invalid_value.cue +++ b/tests/plan/proxy/invalid_value.cue @@ -1,12 +1,11 @@ package main import ( - "dagger.io/dagger/engine" "alpha.dagger.io/dagger/op" "alpha.dagger.io/alpine" ) -engine.#Plan & { +dagger.#Plan & { // should fail because of misspelled value proxy: dockerSocket: unix: "/var/run/docker.soc" diff --git a/tests/plan/proxy/unix.cue b/tests/plan/proxy/unix.cue index 3952e6cf..01c5b76d 100644 --- a/tests/plan/proxy/unix.cue +++ b/tests/plan/proxy/unix.cue @@ -1,12 +1,12 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" "alpha.dagger.io/dagger/op" "alpha.dagger.io/alpine" ) -engine.#Plan & { +dagger.#Plan & { // should succeed proxy: dockerSocket: unix: "/var/run/docker.sock" diff --git a/tests/plan/with/actions.cue b/tests/plan/with/actions.cue index cf01b33e..34e45b34 100644 --- a/tests/plan/with/actions.cue +++ b/tests/plan/with/actions.cue @@ -1,17 +1,17 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: image.output env: FOO: string args: [ diff --git a/tests/plan/with/params.cue b/tests/plan/with/params.cue index 7b3d9f8a..fc4317a9 100644 --- a/tests/plan/with/params.cue +++ b/tests/plan/with/params.cue @@ -1,18 +1,18 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { inputs: params: foo: string actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: image.output env: FOO: inputs.params.foo args: [ diff --git a/tests/tasks/copy/copy_exec.cue b/tests/tasks/copy/copy_exec.cue index 97cc1bf6..72ece6b4 100644 --- a/tests/tasks/copy/copy_exec.cue +++ b/tests/tasks/copy/copy_exec.cue @@ -1,16 +1,16 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - exec: engine.#Exec & { + exec: dagger.#Exec & { input: image.output args: [ "sh", "-c", @@ -20,7 +20,7 @@ engine.#Plan & { ] } - verify_file: engine.#ReadFile & { + verify_file: dagger.#ReadFile & { input: exec.output path: "/output.txt" } & { @@ -28,14 +28,14 @@ engine.#Plan & { contents: "hello world" } - copy: engine.#Copy & { + copy: dagger.#Copy & { input: image.output contents: exec.output source: "/output.txt" dest: "/output.txt" } - verify_copy: engine.#ReadFile & { + verify_copy: dagger.#ReadFile & { input: copy.output path: "/output.txt" } & { diff --git a/tests/tasks/copy/copy_exec_invalid.cue b/tests/tasks/copy/copy_exec_invalid.cue index f5754dc5..56cc2ece 100644 --- a/tests/tasks/copy/copy_exec_invalid.cue +++ b/tests/tasks/copy/copy_exec_invalid.cue @@ -1,16 +1,16 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - exec: engine.#Exec & { + exec: dagger.#Exec & { input: image.output args: [ "sh", "-c", @@ -20,7 +20,7 @@ engine.#Plan & { ] } - verify_file: engine.#ReadFile & { + verify_file: dagger.#ReadFile & { input: exec.output path: "/output.txt" } & { @@ -28,13 +28,13 @@ engine.#Plan & { contents: "hello world from dagger" } - copy: engine.#Copy & { + copy: dagger.#Copy & { input: image.output contents: exec.output source: "/output.txt" dest: "/output.txt" } - verify_copy: engine.#ReadFile & { + verify_copy: dagger.#ReadFile & { input: copy.output path: "/output.txt" } & { diff --git a/tests/tasks/copy/copy_file.cue b/tests/tasks/copy/copy_file.cue index 6a08c10b..2fca47e2 100644 --- a/tests/tasks/copy/copy_file.cue +++ b/tests/tasks/copy/copy_file.cue @@ -1,20 +1,20 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - alpine3_15_0: engine.#Pull & { + alpine3_15_0: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - busybox1_34_1: engine.#Pull & { + busybox1_34_1: dagger.#Pull & { source: "busybox:1.34.1-glibc@sha256:ec98391b8f0911db08be2ee6c46813eeac17b9625b402ea1ce45dcfcd05d78d6" } - verify_alpine_3_15_0: engine.#ReadFile & { + verify_alpine_3_15_0: dagger.#ReadFile & { input: alpine3_15_0.output path: "/etc/alpine-release" } & { @@ -22,14 +22,14 @@ engine.#Plan & { contents: "3.15.0\n" } - copy: engine.#Copy & { + copy: dagger.#Copy & { input: busybox1_34_1.output contents: alpine3_15_0.output source: "/etc/alpine-release" dest: "/alpine3_15_0_release" } - verify_copy: engine.#ReadFile & { + verify_copy: dagger.#ReadFile & { input: copy.output path: "/alpine3_15_0_release" } & { diff --git a/tests/tasks/dockerfile/build_args.cue b/tests/tasks/dockerfile/build_args.cue index 7a0fa1df..0b430e9e 100644 --- a/tests/tasks/dockerfile/build_args.cue +++ b/tests/tasks/dockerfile/build_args.cue @@ -1,13 +1,13 @@ package testing import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { inputs: directories: testdata: path: "./testdata" - actions: build: engine.#Dockerfile & { + actions: build: dagger.#Dockerfile & { source: inputs.directories.testdata.contents dockerfile: contents: """ FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d diff --git a/tests/tasks/dockerfile/build_auth.cue b/tests/tasks/dockerfile/build_auth.cue index 897deebc..4807b3d2 100644 --- a/tests/tasks/dockerfile/build_auth.cue +++ b/tests/tasks/dockerfile/build_auth.cue @@ -2,10 +2,9 @@ package testing import ( "dagger.io/dagger" - "dagger.io/dagger/engine" ) -engine.#Plan & { +dagger.#Plan & { inputs: { directories: testdata: path: "./testdata" secrets: sops: command: { @@ -20,7 +19,7 @@ engine.#Plan & { input: inputs.secrets.sops.contents } - build: engine.#Dockerfile & { + build: dagger.#Dockerfile & { source: inputs.directories.testdata.contents auth: "daggerio/ci-test:private-pull": { username: "daggertest" diff --git a/tests/tasks/dockerfile/dockerfile.cue b/tests/tasks/dockerfile/dockerfile.cue index cdaa6cf9..137f0d0c 100644 --- a/tests/tasks/dockerfile/dockerfile.cue +++ b/tests/tasks/dockerfile/dockerfile.cue @@ -1,18 +1,18 @@ package testing import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { inputs: directories: testdata: path: "./testdata" actions: { - build: engine.#Dockerfile & { + build: dagger.#Dockerfile & { source: inputs.directories.testdata.contents } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: build.output args: ["sh", "-c", "test $(cat /dir/foo) = foobar"] } diff --git a/tests/tasks/dockerfile/dockerfile_path.cue b/tests/tasks/dockerfile/dockerfile_path.cue index c15a12fc..a240309a 100644 --- a/tests/tasks/dockerfile/dockerfile_path.cue +++ b/tests/tasks/dockerfile/dockerfile_path.cue @@ -1,19 +1,19 @@ package testing import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { inputs: directories: testdata: path: "./testdata" actions: { - build: engine.#Dockerfile & { + build: dagger.#Dockerfile & { source: inputs.directories.testdata.contents dockerfile: path: "./dockerfilepath/Dockerfile.custom" } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: build.output args: ["sh", "-c", "test $(cat /test) = dockerfilePath"] } diff --git a/tests/tasks/dockerfile/image_config.cue b/tests/tasks/dockerfile/image_config.cue index 65519d51..2075130d 100644 --- a/tests/tasks/dockerfile/image_config.cue +++ b/tests/tasks/dockerfile/image_config.cue @@ -1,15 +1,15 @@ package testing import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { inputs: directories: testdata: path: "./testdata" actions: { // FIXME: this doesn't test anything beside not crashing - build: engine.#Dockerfile & { + build: dagger.#Dockerfile & { source: inputs.directories.testdata.contents dockerfile: contents: """ FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d diff --git a/tests/tasks/dockerfile/inlined_dockerfile.cue b/tests/tasks/dockerfile/inlined_dockerfile.cue index c14771fc..7596ed2b 100644 --- a/tests/tasks/dockerfile/inlined_dockerfile.cue +++ b/tests/tasks/dockerfile/inlined_dockerfile.cue @@ -1,14 +1,14 @@ package testing import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { inputs: directories: testdata: path: "./testdata" actions: { - build: engine.#Dockerfile & { + build: dagger.#Dockerfile & { source: inputs.directories.testdata.contents dockerfile: contents: """ FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d @@ -16,7 +16,7 @@ engine.#Plan & { """ } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: build.output args: ["sh", "-c", "test $(cat /output) = foobar"] } diff --git a/tests/tasks/dockerfile/inlined_dockerfile_heredoc.cue b/tests/tasks/dockerfile/inlined_dockerfile_heredoc.cue index b3e5ba06..b4d341f8 100644 --- a/tests/tasks/dockerfile/inlined_dockerfile_heredoc.cue +++ b/tests/tasks/dockerfile/inlined_dockerfile_heredoc.cue @@ -1,14 +1,14 @@ package testing import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { inputs: directories: testdata: path: "./testdata" actions: { - build: engine.#Dockerfile & { + build: dagger.#Dockerfile & { source: inputs.directories.testdata.contents dockerfile: contents: """ # syntax = docker/dockerfile:1.3 @@ -17,7 +17,7 @@ engine.#Plan & { """ } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: build.output args: ["sh", "-c", "test $(cat /output) = foobar"] } diff --git a/tests/tasks/dockerfile/labels.cue b/tests/tasks/dockerfile/labels.cue index 403314f9..f7549a2d 100644 --- a/tests/tasks/dockerfile/labels.cue +++ b/tests/tasks/dockerfile/labels.cue @@ -1,15 +1,15 @@ package testing import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { inputs: directories: testdata: path: "./testdata" actions: { // FIXME: this doesn't test anything beside not crashing - build: engine.#Dockerfile & { + build: dagger.#Dockerfile & { source: inputs.directories.testdata.contents dockerfile: contents: """ FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d diff --git a/tests/tasks/dockerfile/platform.cue b/tests/tasks/dockerfile/platform.cue index eeddcb38..8d944249 100644 --- a/tests/tasks/dockerfile/platform.cue +++ b/tests/tasks/dockerfile/platform.cue @@ -1,15 +1,15 @@ package testing import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { inputs: directories: testdata: path: "./testdata" actions: { // FIXME: this doesn't test anything beside not crashing - build: engine.#Dockerfile & { + build: dagger.#Dockerfile & { source: inputs.directories.testdata.contents dockerfile: contents: """ FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d diff --git a/tests/tasks/exec/args.cue b/tests/tasks/exec/args.cue index 661100b7..befe4ea8 100644 --- a/tests/tasks/exec/args.cue +++ b/tests/tasks/exec/args.cue @@ -1,21 +1,21 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - exec: engine.#Exec & { + exec: dagger.#Exec & { input: image.output args: ["sh", "-c", "echo -n hello world > /output.txt"] } - verify: engine.#ReadFile & { + verify: dagger.#ReadFile & { input: exec.output path: "/output.txt" } & { diff --git a/tests/tasks/exec/env.cue b/tests/tasks/exec/env.cue index 313691f9..e74a2c7c 100644 --- a/tests/tasks/exec/env.cue +++ b/tests/tasks/exec/env.cue @@ -1,16 +1,16 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: image.output env: TEST: "hello world" args: [ diff --git a/tests/tasks/exec/env_secret.cue b/tests/tasks/exec/env_secret.cue index 9e394527..f7e92c9a 100644 --- a/tests/tasks/exec/env_secret.cue +++ b/tests/tasks/exec/env_secret.cue @@ -1,17 +1,17 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { inputs: secrets: testSecret: path: "secret.txt" actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: image.output env: TEST: inputs.secrets.testSecret.contents args: [ diff --git a/tests/tasks/exec/hosts.cue b/tests/tasks/exec/hosts.cue index 14c782cc..428fbeb4 100644 --- a/tests/tasks/exec/hosts.cue +++ b/tests/tasks/exec/hosts.cue @@ -1,16 +1,16 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: image.output hosts: "unit.test": "1.2.3.4" args: [ diff --git a/tests/tasks/exec/mount_cache.cue b/tests/tasks/exec/mount_cache.cue index ec2bcb6d..06706897 100644 --- a/tests/tasks/exec/mount_cache.cue +++ b/tests/tasks/exec/mount_cache.cue @@ -1,20 +1,20 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - sharedCache: engine.#CacheDir & { + sharedCache: dagger.#CacheDir & { id: "mycache" } - exec: engine.#Exec & { + exec: dagger.#Exec & { input: image.output mounts: cache: { dest: "/cache" @@ -28,7 +28,7 @@ engine.#Plan & { ] } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: image.output mounts: cache: { dest: "/cache" @@ -43,10 +43,10 @@ engine.#Plan & { ] } - otherCache: engine.#CacheDir & { + otherCache: dagger.#CacheDir & { id: "othercache" } - verifyOtherCache: engine.#Exec & { + verifyOtherCache: dagger.#Exec & { input: image.output mounts: cache: { dest: "/cache" diff --git a/tests/tasks/exec/mount_fs.cue b/tests/tasks/exec/mount_fs.cue index 79671d27..0296e820 100644 --- a/tests/tasks/exec/mount_fs.cue +++ b/tests/tasks/exec/mount_fs.cue @@ -1,16 +1,16 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - exec: engine.#Exec & { + exec: dagger.#Exec & { input: image.output args: [ "sh", "-c", @@ -20,7 +20,7 @@ engine.#Plan & { ] } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: image.output mounts: fs: { dest: "/target" @@ -35,7 +35,7 @@ engine.#Plan & { ] } - verifyRO: engine.#Exec & { + verifyRO: dagger.#Exec & { input: image.output mounts: fs: { dest: "/target" @@ -53,7 +53,7 @@ engine.#Plan & { ] } - verifySource: engine.#Exec & { + verifySource: dagger.#Exec & { input: image.output mounts: fs: { dest: "/target.txt" diff --git a/tests/tasks/exec/mount_secret.cue b/tests/tasks/exec/mount_secret.cue index 3d0df74b..4968dc6c 100644 --- a/tests/tasks/exec/mount_secret.cue +++ b/tests/tasks/exec/mount_secret.cue @@ -1,17 +1,17 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { inputs: secrets: testSecret: envvar: "TESTSECRET" actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: image.output mounts: secret: { dest: "/run/secrets/test" @@ -26,7 +26,7 @@ engine.#Plan & { ] } - verifyPerm: engine.#Exec & { + verifyPerm: dagger.#Exec & { input: image.output mounts: secret: { dest: "/run/secrets/test" diff --git a/tests/tasks/exec/mount_service.cue b/tests/tasks/exec/mount_service.cue index 2be6922c..52a4267e 100644 --- a/tests/tasks/exec/mount_service.cue +++ b/tests/tasks/exec/mount_service.cue @@ -1,23 +1,23 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { proxy: dockerSocket: unix: "/var/run/docker.sock" actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - imageWithDocker: engine.#Exec & { + imageWithDocker: dagger.#Exec & { input: image.output args: ["apk", "add", "--no-cache", "docker-cli"] } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: imageWithDocker.output mounts: docker: { dest: "/var/run/docker.sock" diff --git a/tests/tasks/exec/mount_tmp.cue b/tests/tasks/exec/mount_tmp.cue index 446000dd..50f1bb48 100644 --- a/tests/tasks/exec/mount_tmp.cue +++ b/tests/tasks/exec/mount_tmp.cue @@ -1,20 +1,20 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - exec: engine.#Exec & { + exec: dagger.#Exec & { input: image.output mounts: temp: { dest: "/temp" - contents: engine.#TempDir + contents: dagger.#TempDir } args: [ "sh", "-c", @@ -24,7 +24,7 @@ engine.#Plan & { ] } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: exec.output args: [ "sh", "-c", diff --git a/tests/tasks/exec/user.cue b/tests/tasks/exec/user.cue index 83c5b48b..0c9f5429 100644 --- a/tests/tasks/exec/user.cue +++ b/tests/tasks/exec/user.cue @@ -1,21 +1,21 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - addUser: engine.#Exec & { + addUser: dagger.#Exec & { input: image.output args: ["adduser", "-D", "test"] } - verifyUsername: engine.#Exec & { + verifyUsername: dagger.#Exec & { input: addUser.output user: "test" args: [ @@ -26,7 +26,7 @@ engine.#Plan & { ] } - verifyUserID: engine.#Exec & { + verifyUserID: dagger.#Exec & { input: addUser.output user: "1000" args: [ diff --git a/tests/tasks/exec/workdir.cue b/tests/tasks/exec/workdir.cue index 7b813c37..bd3ddd1d 100644 --- a/tests/tasks/exec/workdir.cue +++ b/tests/tasks/exec/workdir.cue @@ -1,16 +1,16 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: image.output workdir: "/tmp" args: [ diff --git a/tests/tasks/gitpull/bad_ref.cue b/tests/tasks/gitpull/bad_ref.cue index ff46a770..f13c1d48 100644 --- a/tests/tasks/gitpull/bad_ref.cue +++ b/tests/tasks/gitpull/bad_ref.cue @@ -1,9 +1,11 @@ package main -import "dagger.io/dagger/engine" +import ( + "dagger.io/dagger" +) -engine.#Plan & { - actions: badref: engine.#GitPull & { +dagger.#Plan & { + actions: badref: dagger.#GitPull & { remote: "https://github.com/blocklayerhq/acme-clothing.git" ref: "lalalalal" } diff --git a/tests/tasks/gitpull/bad_remote.cue b/tests/tasks/gitpull/bad_remote.cue index a2c3f2a3..e11cbd61 100644 --- a/tests/tasks/gitpull/bad_remote.cue +++ b/tests/tasks/gitpull/bad_remote.cue @@ -1,9 +1,11 @@ package main -import "dagger.io/dagger/engine" +import ( + "dagger.io/dagger" +) -engine.#Plan & { - actions: badremote: engine.#GitPull & { +dagger.#Plan & { + actions: badremote: dagger.#GitPull & { remote: "https://github.com/blocklayerhq/lalalala.git" ref: "master" } diff --git a/tests/tasks/gitpull/exists.cue b/tests/tasks/gitpull/exists.cue index 5ebcd2cb..c852fa6f 100644 --- a/tests/tasks/gitpull/exists.cue +++ b/tests/tasks/gitpull/exists.cue @@ -1,9 +1,11 @@ package main -import "dagger.io/dagger/engine" +import ( + "dagger.io/dagger" +) -engine.#Plan & { - actions: gitPull: engine.#GitPull & { +dagger.#Plan & { + actions: gitPull: dagger.#GitPull & { remote: "https://github.com/blocklayerhq/acme-clothing.git" ref: "master" } diff --git a/tests/tasks/gitpull/git_dir.cue b/tests/tasks/gitpull/git_dir.cue index 4272a01a..68f184e6 100644 --- a/tests/tasks/gitpull/git_dir.cue +++ b/tests/tasks/gitpull/git_dir.cue @@ -1,25 +1,27 @@ package testing -import "dagger.io/dagger/engine" +import ( + "dagger.io/dagger" +) -engine.#Plan & { +dagger.#Plan & { actions: { - repo1: engine.#GitPull & { + repo1: dagger.#GitPull & { remote: "https://github.com/blocklayerhq/acme-clothing.git" ref: "master" } - repo2: engine.#GitPull & { + repo2: dagger.#GitPull & { remote: "https://github.com/blocklayerhq/acme-clothing.git" ref: "master" keepGitDir: true } - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0" } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: image.output args: ["sh", "-c", """ set -eu diff --git a/tests/tasks/gitpull/invalid.cue b/tests/tasks/gitpull/invalid.cue index fd669f1b..726016e9 100644 --- a/tests/tasks/gitpull/invalid.cue +++ b/tests/tasks/gitpull/invalid.cue @@ -1,7 +1,9 @@ package main -import "dagger.io/dagger/engine" +import ( + "dagger.io/dagger" +) -engine.#Plan & { - actions: invalid: engine.#GitPull & {} +dagger.#Plan & { + actions: invalid: dagger.#GitPull & {} } diff --git a/tests/tasks/gitpull/private_repo.cue b/tests/tasks/gitpull/private_repo.cue index d2581a42..a65ad4e2 100644 --- a/tests/tasks/gitpull/private_repo.cue +++ b/tests/tasks/gitpull/private_repo.cue @@ -2,10 +2,9 @@ package main import ( "dagger.io/dagger" - "dagger.io/dagger/engine" ) -engine.#Plan & { +dagger.#Plan & { inputs: secrets: sops: command: { name: "sops" args: ["-d", "../../secrets_sops.yaml"] @@ -13,7 +12,7 @@ engine.#Plan & { actions: { - alpine: engine.#Pull & { + alpine: dagger.#Pull & { source: "alpine:3.15.0" } @@ -22,7 +21,7 @@ engine.#Plan & { input: inputs.secrets.sops.contents } - testRepo: engine.#GitPull & { + testRepo: dagger.#GitPull & { remote: "https://github.com/dagger/dagger.git" ref: "main" auth: { @@ -31,7 +30,7 @@ engine.#Plan & { } } - testContent: engine.#Exec & { + testContent: dagger.#Exec & { input: alpine.output always: true args: ["ls", "-l", "/repo/README.md"] diff --git a/tests/tasks/hidden/cue.mod/usr/testing.dagger.io/hidden/hidden.cue b/tests/tasks/hidden/cue.mod/usr/testing.dagger.io/hidden/hidden.cue index d831be5c..454bcea0 100644 --- a/tests/tasks/hidden/cue.mod/usr/testing.dagger.io/hidden/hidden.cue +++ b/tests/tasks/hidden/cue.mod/usr/testing.dagger.io/hidden/hidden.cue @@ -1,20 +1,19 @@ package hidden import ( - "dagger.io/dagger/engine" ) #Hidden: { - _pull: engine.#Pull & { + _pull: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - _write: engine.#WriteFile & { + _write: dagger.#WriteFile & { input: _pull.output path: "/testing" contents: "1,2,3" permissions: 700 } - _readfile: engine.#ReadFile & { + _readfile: dagger.#ReadFile & { input: _write.output path: "/testing" } & { diff --git a/tests/tasks/hidden/hidden.cue b/tests/tasks/hidden/hidden.cue index dca1daa1..0e790bcd 100644 --- a/tests/tasks/hidden/hidden.cue +++ b/tests/tasks/hidden/hidden.cue @@ -1,22 +1,22 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" "testing.dagger.io/hidden" ) -engine.#Plan & { +dagger.#Plan & { actions: { - pull: engine.#Pull & { + pull: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - _write: engine.#WriteFile & { + _write: dagger.#WriteFile & { input: pull.output path: "/testing" contents: "1,2,3" permissions: 700 } - readfile: engine.#ReadFile & { + readfile: dagger.#ReadFile & { input: _write.output path: "/testing" } & { diff --git a/tests/tasks/httpfetch/exist.cue b/tests/tasks/httpfetch/exist.cue index f80a0644..c30ed955 100644 --- a/tests/tasks/httpfetch/exist.cue +++ b/tests/tasks/httpfetch/exist.cue @@ -1,9 +1,11 @@ package main -import "dagger.io/dagger/engine" +import ( + "dagger.io/dagger" +) -engine.#Plan & { - actions: fetch: engine.#HTTPFetch & { +dagger.#Plan & { + actions: fetch: dagger.#HTTPFetch & { source: "https://releases.dagger.io/dagger/latest_version" dest: "/latest.html" } diff --git a/tests/tasks/httpfetch/not_exist.cue b/tests/tasks/httpfetch/not_exist.cue index 52e008e1..94cfaeb5 100644 --- a/tests/tasks/httpfetch/not_exist.cue +++ b/tests/tasks/httpfetch/not_exist.cue @@ -1,9 +1,11 @@ package main -import "dagger.io/dagger/engine" +import ( + "dagger.io/dagger" +) -engine.#Plan & { - actions: fetch: engine.#HTTPFetch & { +dagger.#Plan & { + actions: fetch: dagger.#HTTPFetch & { source: "https://releases.dagger.io/dagger/asfgdsfg" dest: "/latest.html" } diff --git a/tests/tasks/mkdir/mkdir.cue b/tests/tasks/mkdir/mkdir.cue index 15c07a51..e2e296dd 100644 --- a/tests/tasks/mkdir/mkdir.cue +++ b/tests/tasks/mkdir/mkdir.cue @@ -1,28 +1,28 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - mkdir: engine.#Mkdir & { + mkdir: dagger.#Mkdir & { input: image.output path: "/test" } - writeChecker: engine.#WriteFile & { + writeChecker: dagger.#WriteFile & { input: mkdir.output path: "/test/foo" contents: "bar" permissions: 700 } - readChecker: engine.#ReadFile & { + readChecker: dagger.#ReadFile & { input: writeChecker.output path: "/test/foo" } & { diff --git a/tests/tasks/mkdir/mkdir_failure_disable_parents.cue b/tests/tasks/mkdir/mkdir_failure_disable_parents.cue index 2be6b131..e0952a7a 100644 --- a/tests/tasks/mkdir/mkdir_failure_disable_parents.cue +++ b/tests/tasks/mkdir/mkdir_failure_disable_parents.cue @@ -1,29 +1,29 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - mkdir: engine.#Mkdir & { + mkdir: dagger.#Mkdir & { input: image.output path: "/test/baz" parents: false } - writeChecker: engine.#WriteFile & { + writeChecker: dagger.#WriteFile & { input: mkdir.output path: "/test/baz/foo" contents: "bar" permissions: 700 } - readChecker: engine.#ReadFile & { + readChecker: dagger.#ReadFile & { input: writeChecker.output path: "/test/baz/foo" } & { diff --git a/tests/tasks/mkdir/mkdir_parents.cue b/tests/tasks/mkdir/mkdir_parents.cue index 77dfaf95..d4604787 100644 --- a/tests/tasks/mkdir/mkdir_parents.cue +++ b/tests/tasks/mkdir/mkdir_parents.cue @@ -1,28 +1,28 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - mkdir: engine.#Mkdir & { + mkdir: dagger.#Mkdir & { input: image.output path: "/test/baz" } - writeChecker: engine.#WriteFile & { + writeChecker: dagger.#WriteFile & { input: mkdir.output path: "/test/baz/foo" contents: "bar" permissions: 700 } - readChecker: engine.#ReadFile & { + readChecker: dagger.#ReadFile & { input: writeChecker.output path: "/test/baz/foo" } & { diff --git a/tests/tasks/newsecret/newsecret.cue b/tests/tasks/newsecret/newsecret.cue index 357c27bb..f97edfdb 100644 --- a/tests/tasks/newsecret/newsecret.cue +++ b/tests/tasks/newsecret/newsecret.cue @@ -1,26 +1,26 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - generate: engine.#Exec & { + generate: dagger.#Exec & { input: image.output args: ["sh", "-c", "echo test > /secret"] } - load: engine.#NewSecret & { + load: dagger.#NewSecret & { input: generate.output path: "/secret" } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: image.output mounts: secret: { dest: "/run/secrets/test" diff --git a/tests/tasks/pull/pull.cue b/tests/tasks/pull/pull.cue index d53080e4..9a733a2f 100644 --- a/tests/tasks/pull/pull.cue +++ b/tests/tasks/pull/pull.cue @@ -1,11 +1,11 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { - actions: pull: engine.#Pull & { +dagger.#Plan & { + actions: pull: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } & { // assert result diff --git a/tests/tasks/pull/pull_auth.cue b/tests/tasks/pull/pull_auth.cue index 5b9c44fa..0d319373 100644 --- a/tests/tasks/pull/pull_auth.cue +++ b/tests/tasks/pull/pull_auth.cue @@ -2,10 +2,9 @@ package main import ( "dagger.io/dagger" - "dagger.io/dagger/engine" ) -engine.#Plan & { +dagger.#Plan & { inputs: secrets: sops: command: { name: "sops" args: ["-d", "../../secrets_sops.yaml"] @@ -17,7 +16,7 @@ engine.#Plan & { input: inputs.secrets.sops.contents } - pull: engine.#Pull & { + pull: dagger.#Pull & { source: "daggerio/ci-test:private-pull@sha256:c74f1b1166784193ea6c8f9440263b9be6cae07dfe35e32a5df7a31358ac2060" auth: { username: "daggertest" diff --git a/tests/tasks/push/push.cue b/tests/tasks/push/push.cue index 27641a18..c6c6355d 100644 --- a/tests/tasks/push/push.cue +++ b/tests/tasks/push/push.cue @@ -3,10 +3,9 @@ package main import ( "strings" "dagger.io/dagger" - "dagger.io/dagger/engine" ) -engine.#Plan & { +dagger.#Plan & { inputs: secrets: sops: command: { name: "sops" args: ["-d", "../../secrets_sops.yaml"] @@ -25,18 +24,18 @@ engine.#Plan & { } randomString: { - baseImage: engine.#Pull & { + baseImage: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - image: engine.#Exec & { + image: dagger.#Exec & { input: baseImage.output args: [ "sh", "-c", "echo -n $RANDOM > /output.txt", ] } - outputFile: engine.#ReadFile & { + outputFile: dagger.#ReadFile & { input: image.output path: "/output.txt" } @@ -45,7 +44,7 @@ engine.#Plan & { } // Push image with random content - push: engine.#Push & { + push: dagger.#Push & { dest: "daggerio/ci-test:\(randomString.output)" input: randomString.image.output config: env: FOO: randomString.output @@ -53,7 +52,7 @@ engine.#Plan & { } // Pull same image and check the content - pull: engine.#Pull & { + pull: dagger.#Pull & { source: "daggerio/ci-test:\(randomString.output)" auth: #auth } & { @@ -63,7 +62,7 @@ engine.#Plan & { config: env: FOO: randomString.output } - pullOutputFile: engine.#ReadFile & { + pullOutputFile: dagger.#ReadFile & { input: pull.output path: "/output.txt" } diff --git a/tests/tasks/readfile/readfile.cue b/tests/tasks/readfile/readfile.cue index 75562181..befb075b 100644 --- a/tests/tasks/readfile/readfile.cue +++ b/tests/tasks/readfile/readfile.cue @@ -1,16 +1,16 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - readfile: engine.#ReadFile & { + readfile: dagger.#ReadFile & { input: image.output path: "/etc/alpine-release" } & { diff --git a/tests/tasks/scratch/scratch.cue b/tests/tasks/scratch/scratch.cue index bafc7fa0..76e4d94f 100644 --- a/tests/tasks/scratch/scratch.cue +++ b/tests/tasks/scratch/scratch.cue @@ -1,20 +1,20 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - exec: engine.#Exec & { + exec: dagger.#Exec & { input: image.output mounts: fs: { dest: "/scratch" - contents: engine.#Scratch + contents: dagger.#Scratch } workdir: "/" args: [ diff --git a/tests/tasks/scratch/scratch_build_scratch.cue b/tests/tasks/scratch/scratch_build_scratch.cue index ede7662a..cbbcb0f1 100644 --- a/tests/tasks/scratch/scratch_build_scratch.cue +++ b/tests/tasks/scratch/scratch_build_scratch.cue @@ -1,14 +1,14 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { - actions: build: engine.#Build & { - source: engine.#Scratch +dagger.#Plan & { + actions: build: dagger.#Build & { + source: dagger.#Scratch dockerfile: contents: "FROM scratch" - // Assert that output is engine.#Scratch - output: engine.#Scratch + // Assert that output is dagger.#Scratch + output: dagger.#Scratch } } diff --git a/tests/tasks/scratch/scratch_writefile.cue b/tests/tasks/scratch/scratch_writefile.cue index de17f19c..b2432b17 100644 --- a/tests/tasks/scratch/scratch_writefile.cue +++ b/tests/tasks/scratch/scratch_writefile.cue @@ -1,18 +1,18 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - write: engine.#WriteFile & { - input: engine.#Scratch + write: dagger.#WriteFile & { + input: dagger.#Scratch path: "/testing" contents: "1,2,3" permissions: 700 } - readfile: engine.#ReadFile & { + readfile: dagger.#ReadFile & { input: write.output path: "/testing" } & { diff --git a/tests/tasks/source/source.cue b/tests/tasks/source/source.cue index 45c8d395..76988b7f 100644 --- a/tests/tasks/source/source.cue +++ b/tests/tasks/source/source.cue @@ -1,20 +1,20 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - source: engine.#Source & { + source: dagger.#Source & { path: "." } - exec: engine.#Exec & { + exec: dagger.#Exec & { input: image.output mounts: code: { dest: "/src" @@ -23,7 +23,7 @@ engine.#Plan & { args: ["/src/test.sh"] } - verifyHello: engine.#ReadFile & { + verifyHello: dagger.#ReadFile & { input: source.output path: "/world.txt" } & { @@ -31,7 +31,7 @@ engine.#Plan & { contents: "world\n" } - verifyWorld: engine.#ReadFile & { + verifyWorld: dagger.#ReadFile & { input: exec.output path: "/test.txt" } & { diff --git a/tests/tasks/source/source_include_exclude.cue b/tests/tasks/source/source_include_exclude.cue index 38e696e6..cf89d75f 100644 --- a/tests/tasks/source/source_include_exclude.cue +++ b/tests/tasks/source/source_include_exclude.cue @@ -1,26 +1,26 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - sourceInclude: engine.#Source & { + sourceInclude: dagger.#Source & { path: "." include: ["hello.txt"] } - sourceExclude: engine.#Source & { + sourceExclude: dagger.#Source & { path: "." exclude: ["hello.txt"] } - test: engine.#Exec & { + test: dagger.#Exec & { input: image.output mounts: { include: { diff --git a/tests/tasks/source/source_invalid_path.cue b/tests/tasks/source/source_invalid_path.cue index 39fe5bf4..539605f0 100644 --- a/tests/tasks/source/source_invalid_path.cue +++ b/tests/tasks/source/source_invalid_path.cue @@ -1,16 +1,16 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - source: engine.#Source & { + source: dagger.#Source & { path: "testdata/../.." } } diff --git a/tests/tasks/source/source_not_exist.cue b/tests/tasks/source/source_not_exist.cue index 4102d239..2069f219 100644 --- a/tests/tasks/source/source_not_exist.cue +++ b/tests/tasks/source/source_not_exist.cue @@ -1,16 +1,15 @@ package main import ( - "dagger.io/dagger/engine" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - source: engine.#Source & { + source: dagger.#Source & { path: "not/exist" } } diff --git a/tests/tasks/source/source_relative.cue b/tests/tasks/source/source_relative.cue index a6b662bc..3d88db14 100644 --- a/tests/tasks/source/source_relative.cue +++ b/tests/tasks/source/source_relative.cue @@ -1,20 +1,20 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - source: engine.#Source & { + source: dagger.#Source & { path: "./testdata" } - verifyHello: engine.#ReadFile & { + verifyHello: dagger.#ReadFile & { input: source.output path: "/world.txt" } & { diff --git a/tests/tasks/subdir/subdir_invalid_exec.cue b/tests/tasks/subdir/subdir_invalid_exec.cue index 84cfc328..d2d85891 100644 --- a/tests/tasks/subdir/subdir_invalid_exec.cue +++ b/tests/tasks/subdir/subdir_invalid_exec.cue @@ -1,22 +1,21 @@ package main import ( - "dagger.io/dagger/engine" "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - mkdir: engine.#Mkdir & { + mkdir: dagger.#Mkdir & { input: image.output path: "/test/foo" } - writeChecker: engine.#WriteFile & { + writeChecker: dagger.#WriteFile & { input: mkdir.output path: "/test/foo/hello" contents: "world" @@ -28,7 +27,7 @@ engine.#Plan & { path: "/test/foo" } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: subdir.output args: [ "sh", "-c", diff --git a/tests/tasks/subdir/subdir_invalid_path.cue b/tests/tasks/subdir/subdir_invalid_path.cue index 1edbeb92..99155973 100644 --- a/tests/tasks/subdir/subdir_invalid_path.cue +++ b/tests/tasks/subdir/subdir_invalid_path.cue @@ -1,22 +1,21 @@ package main import ( - "dagger.io/dagger/engine" "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - mkdir: engine.#Mkdir & { + mkdir: dagger.#Mkdir & { input: image.output path: "/test/foo" } - writeChecker: engine.#WriteFile & { + writeChecker: dagger.#WriteFile & { input: mkdir.output path: "/test/foo/hello" contents: "world" @@ -28,7 +27,7 @@ engine.#Plan & { path: "/directorynotfound" } - verify: engine.#Exec & { + verify: dagger.#Exec & { input: image.output mounts: fs: { dest: "/target" diff --git a/tests/tasks/subdir/subdir_simple.cue b/tests/tasks/subdir/subdir_simple.cue index 5cbb578f..7ad42239 100644 --- a/tests/tasks/subdir/subdir_simple.cue +++ b/tests/tasks/subdir/subdir_simple.cue @@ -1,22 +1,21 @@ package main import ( - "dagger.io/dagger/engine" "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - image: engine.#Pull & { + image: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - mkdir: engine.#Mkdir & { + mkdir: dagger.#Mkdir & { input: image.output path: "/test/foo" } - writeChecker: engine.#WriteFile & { + writeChecker: dagger.#WriteFile & { input: mkdir.output path: "/test/foo/hello" contents: "world" @@ -28,7 +27,7 @@ engine.#Plan & { path: "/test/foo" } - verify: engine.#ReadFile & { + verify: dagger.#ReadFile & { input: subdir.output path: "/hello" } & { diff --git a/tests/tasks/writefile/writefile.cue b/tests/tasks/writefile/writefile.cue index 3d8fd447..cfc2b67c 100644 --- a/tests/tasks/writefile/writefile.cue +++ b/tests/tasks/writefile/writefile.cue @@ -1,21 +1,21 @@ package main import ( - "dagger.io/dagger/engine" + "dagger.io/dagger" ) -engine.#Plan & { +dagger.#Plan & { actions: { - pull: engine.#Pull & { + pull: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - write: engine.#WriteFile & { + write: dagger.#WriteFile & { input: pull.output path: "/testing" contents: "1,2,3" permissions: 700 } - readfile: engine.#ReadFile & { + readfile: dagger.#ReadFile & { input: write.output path: "/testing" } & { diff --git a/tests/tasks/writefile/writefile_failure_diff_contents.cue b/tests/tasks/writefile/writefile_failure_diff_contents.cue index d1c38172..078da995 100644 --- a/tests/tasks/writefile/writefile_failure_diff_contents.cue +++ b/tests/tasks/writefile/writefile_failure_diff_contents.cue @@ -1,21 +1,20 @@ package main import ( - "dagger.io/dagger/engine" ) -engine.#Plan & { +dagger.#Plan & { actions: { - pull: engine.#Pull & { + pull: dagger.#Pull & { source: "alpine:3.15.0@sha256:e7d88de73db3d3fd9b2d63aa7f447a10fd0220b7cbf39803c803f2af9ba256b3" } - write: engine.#WriteFile & { + write: dagger.#WriteFile & { input: pull.output path: "/testing" contents: "1,2,3,4" permissions: 700 } - readfile: engine.#ReadFile & { + readfile: dagger.#ReadFile & { input: write.output path: "/testing" } & {