Merge dagger.io/dagger/engine into dagger.io/dagger

Signed-off-by: Solomon Hykes <solomon@dagger.io>
This commit is contained in:
Solomon Hykes 2022-02-16 18:37:16 +00:00
parent bf6d463833
commit c2766c265b
116 changed files with 658 additions and 750 deletions

52
docs/learn/1213-api.md Normal file
View File

@ -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 |

View File

@ -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)

View File

@ -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.

1
pkg/dagger.io/README.md Symbolic link
View File

@ -0,0 +1 @@
../../docs/learn/1213-api.md

View File

@ -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://).*"

View File

@ -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}
}

View File

@ -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
}

View File

@ -1,4 +1,4 @@
package engine
package dagger
// Execute a command in a container
#Exec: {

View File

@ -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
}

View File

@ -1,4 +1,4 @@
package engine
package dagger
// Push a directory to a git remote
#GitPush: {

View File

@ -1,4 +1,4 @@
package engine
package dagger
// HTTP operations

View File

@ -1,4 +1,4 @@
package engine
package dagger
import (
"list"

View File

@ -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)
}
}

View File

@ -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
}

View File

@ -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://).*"

View File

@ -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

View File

@ -32,7 +32,7 @@ var (
UniverseModule,
}
EnginePackage = fmt.Sprintf("%s/dagger/engine", DaggerModule)
DaggerPackage = fmt.Sprintf("%s/dagger", DaggerModule)
lockFilePath = "dagger.lock"
)

View File

@ -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"

View File

@ -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
}

View File

@ -1 +0,0 @@
../../../dagger.io

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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
}

View File

@ -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"
}

View File

@ -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

View File

@ -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"
}

View File

@ -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: {

View File

@ -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?

View File

@ -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
}

View File

@ -1,8 +1,7 @@
package git
import (
"dagger.io/dagger/engine"
)
#Pull: engine.#GitPull
#Push: engine.#GitPush
#Pull: dagger.#GitPull
#Push: dagger.#GitPush

View File

@ -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"]
}

View File

@ -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
}

View File

@ -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
}

View File

@ -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)"
}

View File

@ -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

View File

@ -16,7 +16,7 @@ var (
fsIDPath = cue.MakePath(
cue.Str("$dagger"),
cue.Str("fs"),
cue.Hid("_id", pkg.EnginePackage),
cue.Hid("_id", pkg.DaggerPackage),
)
)

View File

@ -13,7 +13,7 @@ var (
secretIDPath = cue.MakePath(
cue.Str("$dagger"),
cue.Str("secret"),
cue.Hid("_id", pkg.EnginePackage),
cue.Hid("_id", pkg.DaggerPackage),
)
)

View File

@ -13,7 +13,7 @@ var (
serviceIDPath = cue.MakePath(
cue.Str("$dagger"),
cue.Str("service"),
cue.Hid("_id", pkg.EnginePackage),
cue.Hid("_id", pkg.DaggerPackage),
)
)

View File

@ -1,2 +1,4 @@
# dagger universe
alpha.dagger.io
dagger.io
universe.dagger.io

View File

@ -1,2 +1,4 @@
# dagger universe
alpha.dagger.io
dagger.io
universe.dagger.io

View File

@ -1,2 +1,4 @@
# dagger universe
alpha.dagger.io
dagger.io
universe.dagger.io

View File

@ -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"

View File

@ -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"
} & {

View File

@ -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"
} & {

View File

@ -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"
} & {

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"
} & {

View File

@ -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"
} & {

View File

@ -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"
} & {

View File

@ -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: {}

View File

@ -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

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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: [

View File

@ -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: [

View File

@ -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"
} & {

View File

@ -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"
} & {

View File

@ -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"
} & {

View File

@ -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

View File

@ -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"

View File

@ -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"]
}

View File

@ -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"]
}

View File

@ -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

View File

@ -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"]
}

View File

@ -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"]
}

View File

@ -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

View File

@ -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

View File

@ -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"
} & {

View File

@ -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: [

View File

@ -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: [

View File

@ -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: [

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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"

View File

@ -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",

View File

@ -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: [

View File

@ -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: [

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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

View File

@ -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 & {}
}

View File

@ -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"]

View File

@ -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"
} & {

View File

@ -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"
} & {

View File

@ -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"
}

View File

@ -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"
}

View File

@ -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"
} & {

View File

@ -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"
} & {

View File

@ -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"
} & {

View File

@ -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"

Some files were not shown because too many files have changed in this diff Show More