From eb86b0778c3b7d1ad0be479af28a9e59558c66b2 Mon Sep 17 00:00:00 2001 From: Solomon Hykes Date: Thu, 16 Dec 2021 01:26:54 +0000 Subject: [PATCH] Europa: use `$dagger` field to mark CUE types for engine recognition Signed-off-by: Solomon Hykes --- stdlib/europa/dagger/engine/spec/engine/exec.cue | 2 +- stdlib/europa/dagger/engine/spec/engine/fs.cue | 14 +++++++------- stdlib/europa/dagger/engine/spec/engine/git.cue | 4 ++-- stdlib/europa/dagger/engine/spec/engine/image.cue | 7 ++++--- stdlib/europa/dagger/engine/spec/engine/secret.cue | 2 +- .../europa/dagger/engine/spec/engine/service.cue | 3 ++- stdlib/europa/dagger/engine/spec/engine/stream.cue | 2 +- 7 files changed, 18 insertions(+), 16 deletions(-) diff --git a/stdlib/europa/dagger/engine/spec/engine/exec.cue b/stdlib/europa/dagger/engine/spec/engine/exec.cue index bed70340..8d369018 100644 --- a/stdlib/europa/dagger/engine/spec/engine/exec.cue +++ b/stdlib/europa/dagger/engine/spec/engine/exec.cue @@ -2,7 +2,7 @@ package engine // Execute a command in a container #Exec: { - _exec: {} + $dagger: task: _name: "Exec" // Container filesystem input: #FS diff --git a/stdlib/europa/dagger/engine/spec/engine/fs.cue b/stdlib/europa/dagger/engine/spec/engine/fs.cue index e261ac75..7842a515 100644 --- a/stdlib/europa/dagger/engine/spec/engine/fs.cue +++ b/stdlib/europa/dagger/engine/spec/engine/fs.cue @@ -2,19 +2,19 @@ package engine // A filesystem state #FS: { - _fs: ID: string + $dagger: fs: _id: string } // Produce an empty directory // FIXME: replace with a null value for #FS? #Scratch: { - _scratch: {} + $dagger: task: _name: "Scratch" output: #FS } #ReadFile: { - _readFile: {} + $dagger: task: _name: "ReadFile" input: #FS path: string @@ -23,7 +23,7 @@ package engine } #WriteFile: { - _writeFile: {} + $dagger: task: _name: "WriteFile" input: #FS path: string @@ -33,7 +33,7 @@ package engine // Create a directory #Mkdir: { - _mkdir: {} + $dagger: task: _name: "Mkdir" input: #FS @@ -49,7 +49,7 @@ package engine } #Copy: { - _copy: {} + $dagger: task: _name: "Copy" input: #FS #CopyInfo @@ -65,7 +65,7 @@ package engine } #Merge: { - _merge: {} + $dagger: task: _name: "Merge" input: #FS layers: [...#CopyInfo] diff --git a/stdlib/europa/dagger/engine/spec/engine/git.cue b/stdlib/europa/dagger/engine/spec/engine/git.cue index 6a0e95c8..f08ef290 100644 --- a/stdlib/europa/dagger/engine/spec/engine/git.cue +++ b/stdlib/europa/dagger/engine/spec/engine/git.cue @@ -2,7 +2,7 @@ package engine // Push a directory to a git remote #GitPush: { - gitPush: {} + $dagger: task: _name: "GitPush" input: #FS remote: string @@ -11,7 +11,7 @@ package engine // Pull a directory from a git remote #GitPull: { - gitPull: {} + $dagger: task: _name: "GitPull" remote: string ref: string diff --git a/stdlib/europa/dagger/engine/spec/engine/image.cue b/stdlib/europa/dagger/engine/spec/engine/image.cue index be8c1a37..d48b21e3 100644 --- a/stdlib/europa/dagger/engine/spec/engine/image.cue +++ b/stdlib/europa/dagger/engine/spec/engine/image.cue @@ -11,7 +11,7 @@ package engine // Upload a container image to a remote repository #Push: { - push: {} + $dagger: task: _name: "Push" // Target repository address dest: #Ref @@ -35,7 +35,7 @@ package engine // Download a container image from a remote repository #Pull: { - pull: {} + $dagger: task: _name: "Pull" // Repository source ref source: #Ref @@ -66,8 +66,9 @@ package engine #Ref: string // Build a container image using buildkit +// FIXME: rename to #Dockerfile to clarify scope #Build: { - build: {} + $dagger: task: _name: "Build" // Source directory to build source: #FS diff --git a/stdlib/europa/dagger/engine/spec/engine/secret.cue b/stdlib/europa/dagger/engine/spec/engine/secret.cue index c6bd8e04..b4977ebd 100644 --- a/stdlib/europa/dagger/engine/spec/engine/secret.cue +++ b/stdlib/europa/dagger/engine/spec/engine/secret.cue @@ -2,5 +2,5 @@ package engine // An external secret #Secret: { - _secret: ID: string + $dagger: secret: _id: string } diff --git a/stdlib/europa/dagger/engine/spec/engine/service.cue b/stdlib/europa/dagger/engine/spec/engine/service.cue index aede2d71..ca7f6d88 100644 --- a/stdlib/europa/dagger/engine/spec/engine/service.cue +++ b/stdlib/europa/dagger/engine/spec/engine/service.cue @@ -1,6 +1,7 @@ package engine // An external network service +// FIXME: rename to endpoint? #Service: { - _service: ID: string + $dagger: service: _id: string } diff --git a/stdlib/europa/dagger/engine/spec/engine/stream.cue b/stdlib/europa/dagger/engine/spec/engine/stream.cue index 865ded97..64667b1f 100644 --- a/stdlib/europa/dagger/engine/spec/engine/stream.cue +++ b/stdlib/europa/dagger/engine/spec/engine/stream.cue @@ -2,5 +2,5 @@ package engine // A stream of bytes #Stream: { - _stream: ID: string + $dagger: stream: _id: string }