DX: change "#dagger: compute: " to "#compute: "

Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
Solomon Hykes 2021-02-12 23:22:41 +00:00
parent 3f445f2421
commit 7a77466a66
81 changed files with 176 additions and 229 deletions

View File

@ -8,13 +8,13 @@ import (
func TestLocalDirs(t *testing.T) { func TestLocalDirs(t *testing.T) {
env := mkEnv(t, env := mkEnv(t,
`#dagger: compute: [ `#compute: [
{ {
do: "local" do: "local"
dir: "bar" dir: "bar"
} }
]`, ]`,
`dir: #dagger: compute: [ `dir: #compute: [
{ {
do: "local" do: "local"
dir: "foo" dir: "foo"

View File

@ -149,7 +149,7 @@ func (env *Env) LocalDirs() map[string]string {
flow := cueflow.New(&cueflow.Config{}, inst, newDummyTaskFunc(inst)) flow := cueflow.New(&cueflow.Config{}, inst, newDummyTaskFunc(inst))
for _, t := range flow.Tasks() { for _, t := range flow.Tasks() {
v := compiler.Wrap(t.Value(), inst) v := compiler.Wrap(t.Value(), inst)
localdirs(v.Get("#dagger.compute")) localdirs(v.Get("#compute"))
} }
// 2. Scan the environment updater // 2. Scan the environment updater
localdirs(env.Updater()) localdirs(env.Updater())

View File

@ -102,7 +102,7 @@ func (f dirFlag) Set(s string) error {
return nil, err return nil, err
} }
return compiler.Compile("", fmt.Sprintf( return compiler.Compile("", fmt.Sprintf(
`#dagger: compute: [{do:"local",dir:"%s", include:%s}]`, `#compute: [{do:"local",dir:"%s", include:%s}]`,
s, s,
include, include,
)) ))
@ -140,7 +140,7 @@ func (f gitFlag) Set(s string) error {
remote := u.String() remote := u.String()
return compiler.Compile("", fmt.Sprintf( return compiler.Compile("", fmt.Sprintf(
`#dagger: compute: [{do:"fetch-git", remote:"%s", ref:"%s"}]`, `#compute: [{do:"fetch-git", remote:"%s", ref:"%s"}]`,
remote, remote,
ref, ref,
)) ))

View File

@ -41,7 +41,7 @@ func (p *Pipeline) FS() FS {
} }
func isComponent(v *compiler.Value) bool { func isComponent(v *compiler.Value) bool {
return v.Get("#dagger.compute").Exists() return v.Get("#compute").Exists()
} }
func ops(code ...*compiler.Value) ([]*compiler.Value, error) { func ops(code ...*compiler.Value) ([]*compiler.Value, error) {
@ -50,7 +50,7 @@ func ops(code ...*compiler.Value) ([]*compiler.Value, error) {
for _, x := range code { for _, x := range code {
// 1. attachment array // 1. attachment array
if isComponent(x) { if isComponent(x) {
xops, err := x.Get("#dagger.compute").List() xops, err := x.Get("#compute").List()
if err != nil { if err != nil {
return nil, err return nil, err
} }

View File

@ -20,20 +20,20 @@ test: go.#Test & {
} }
// Run a command with the binary we just built // Run a command with the binary we just built
help: #dagger: compute: [ help: #compute: [
dagger.#Load & {from: build}, dagger.#Load & {from: build},
dagger.#Exec & {args: ["dagger", "-h"]}, dagger.#Exec & {args: ["dagger", "-h"]},
] ]
// Build dagger using the (included) Dockerfile // Build dagger using the (included) Dockerfile
buildWithDocker: #dagger: compute: [ buildWithDocker: #compute: [
dagger.#DockerBuild & { dagger.#DockerBuild & {
context: repository context: repository
}, },
] ]
// Run a command in the docker image we just built // Run a command in the docker image we just built
helpFromDocker: #dagger: compute: [ helpFromDocker: #compute: [
dagger.#Load & {from: buildWithDocker}, dagger.#Load & {from: buildWithDocker},
dagger.#Exec & {args: ["dagger", "-h"]}, dagger.#Exec & {args: ["dagger", "-h"]},
] ]

View File

@ -6,7 +6,7 @@ import (
"dagger.io/yarn" "dagger.io/yarn"
) )
repository: #dagger: compute: [ repository: #compute: [
dagger.#FetchGit & { dagger.#FetchGit & {
remote: "https://github.com/kabirbaidhya/react-todo-app.git" remote: "https://github.com/kabirbaidhya/react-todo-app.git"
ref: "624041b17bd62292143f99bce474a0e3c2d2dd61" ref: "624041b17bd62292143f99bce474a0e3c2d2dd61"

View File

@ -7,7 +7,7 @@ import (
let alpine = { let alpine = {
digest: "sha256:3c7497bf0c7af93428242d6176e8f7905f2201d8fc5861f45be7a346b5f23436" digest: "sha256:3c7497bf0c7af93428242d6176e8f7905f2201d8fc5861f45be7a346b5f23436"
package: [string]: true | false | string package: [string]: true | false | string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "index.docker.io/alpine@\(digest)" ref: "index.docker.io/alpine@\(digest)"
@ -33,7 +33,7 @@ www: {
listing: { listing: {
string string
#dagger: compute: [ #compute: [
dagger.#Load & { dagger.#Load & {
from: alpine from: alpine
}, },
@ -52,7 +52,7 @@ www: {
url: { url: {
string string
#dagger: compute: [ #compute: [
{ {
do: "load" do: "load"
from: alpine from: alpine

View File

@ -10,7 +10,7 @@ let defaultVersion = "3.13.2@sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1e
package: [string]: true | false | string package: [string]: true | false | string
version: string | *defaultVersion version: string | *defaultVersion
#dagger: compute: [ #compute: [
dagger.#FetchContainer & { dagger.#FetchContainer & {
ref: "index.docker.io/alpine:\(version)" ref: "index.docker.io/alpine:\(version)"
}, },

View File

@ -2,7 +2,7 @@ package dagger
// Any component can be referenced as a directory, since // Any component can be referenced as a directory, since
// every dagger script outputs a filesystem state (aka a directory) // every dagger script outputs a filesystem state (aka a directory)
#Dir: #dagger: compute: [...#Op] #Dir: #compute: [...#Op]
// One operation in a script // One operation in a script
#Op: #FetchContainer | #FetchGit | #Export | #Exec | #Local | #Copy | #Load | #Subdir #Op: #FetchContainer | #FetchGit | #Export | #Exec | #Local | #Copy | #Load | #Subdir

View File

@ -17,7 +17,7 @@ import (
// Environment variables // Environment variables
env: [string]: string env: [string]: string
#dagger: compute: [ #compute: [
dagger.#FetchContainer & { dagger.#FetchContainer & {
ref: "docker.io/golang:\(version)-alpine" ref: "docker.io/golang:\(version)-alpine"
}, },
@ -62,7 +62,7 @@ import (
env: [string]: string env: [string]: string
#dagger: compute: [ #compute: [
dagger.#Copy & { dagger.#Copy & {
from: #Go & { from: #Go & {
"version": version "version": version

View File

@ -36,7 +36,7 @@ import (
url: { url: {
string string
#dagger: compute: [ #compute: [
dagger.#Load & { dagger.#Load & {
from: alpine.#Image & { from: alpine.#Image & {
package: bash: "=~5.1" package: bash: "=~5.1"

View File

@ -20,7 +20,7 @@ import (
// Set these environment variables during the build // Set these environment variables during the build
env?: [string]: string env?: [string]: string
#dagger: compute: [ #compute: [
dagger.#Load & { dagger.#Load & {
from: alpine.#Image & { from: alpine.#Image & {
package: bash: "=~5.1" package: bash: "=~5.1"

View File

@ -1,3 +1,3 @@
package testing package testing
#dagger: compute: true #compute: true

View File

@ -1,3 +1,3 @@
package testing package testing
#dagger: compute: 123 #compute: 123

View File

@ -1,16 +0,0 @@
package testing
bar: #dagger: {
#new_def: "lala"
compute: [{
do: "fetch-container"
ref: "busybox"
},
{
do: "exec"
args: ["true"]
dir: "/"
}]
}

View File

@ -1,16 +0,0 @@
package testing
bar: #dagger: {
new_prop: "lala"
compute: [{
do: "fetch-container"
ref: "busybox"
},
{
do: "exec"
args: ["true"]
dir: "/"
}]
}

View File

@ -1,3 +1,3 @@
package testing package testing
#dagger: compute: "whatever" #compute: "whatever"

View File

@ -1,3 +1,3 @@
package testing package testing
#dagger: compute: whatever: "wrong" #compute: whatever: "wrong"

View File

@ -1,11 +1,6 @@
package testing package testing
// no-op, should not error
realempty: {
#dagger: {}
}
// no-op, should not error // no-op, should not error
empty: { empty: {
#dagger: compute: [] #compute: []
} }

View File

@ -6,7 +6,7 @@ new_prop: "lala"
new_prop_too: string new_prop_too: string
#new_def_too: string #new_def_too: string
#dagger: compute: [{ #compute: [{
do: "fetch-container" do: "fetch-container"
ref: "busybox" ref: "busybox"
}, },

View File

@ -7,7 +7,7 @@ foo: {
new_prop_too: string new_prop_too: string
#new_def_too: string #new_def_too: string
#dagger: compute: [{ #compute: [{
do: "fetch-container" do: "fetch-container"
ref: "busybox" ref: "busybox"
}, },

View File

@ -1,6 +1,6 @@
package testing package testing
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "busybox" ref: "busybox"

View File

@ -3,7 +3,7 @@ package testing
test1: { test1: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "busybox" ref: "busybox"
@ -25,7 +25,7 @@ test1: {
test2: { test2: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "busybox" ref: "busybox"

View File

@ -1,6 +1,6 @@
package testing package testing
component: #dagger: compute: [{ component: #compute: [{
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"
}, { }, {
@ -14,7 +14,7 @@ component: #dagger: compute: [{
test1: { test1: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "busybox" ref: "busybox"
@ -36,14 +36,14 @@ test1: {
test2: { test2: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "busybox" ref: "busybox"
}, },
{ {
do: "copy" do: "copy"
from: #dagger: compute: [{ from: #compute: [{
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"
}, { }, {

View File

@ -3,7 +3,7 @@ package testing
test: { test: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "busybox" ref: "busybox"

View File

@ -3,7 +3,7 @@ package testing
A: { A: {
result: string result: string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"
@ -28,7 +28,7 @@ A: {
B: { B: {
result: string result: string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -3,7 +3,7 @@ package testing
A: { A: {
result: string result: string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"
@ -28,7 +28,7 @@ A: {
B: { B: {
result: string result: string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -5,7 +5,7 @@ import "encoding/json"
A: { A: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"
@ -32,7 +32,7 @@ unmarshalled: json.Unmarshal(A)
B: { B: {
result: string result: string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -5,7 +5,7 @@ import "dagger.io/dagger"
// Set to `--input-dir=./tests/dockerbuild/testdata` // Set to `--input-dir=./tests/dockerbuild/testdata`
TestData: dagger.#Dir TestData: dagger.#Dir
TestInlinedDockerfile: #dagger: compute: [ TestInlinedDockerfile: #compute: [
dagger.#DockerBuild & { dagger.#DockerBuild & {
dockerfile: """ dockerfile: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
@ -14,7 +14,7 @@ TestInlinedDockerfile: #dagger: compute: [
}, },
] ]
TestOpChaining: #dagger: compute: [ TestOpChaining: #compute: [
dagger.#DockerBuild & { dagger.#DockerBuild & {
dockerfile: """ dockerfile: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
@ -26,7 +26,7 @@ TestOpChaining: #dagger: compute: [
} }
] ]
TestBuildContext: #dagger: compute: [ TestBuildContext: #compute: [
dagger.#DockerBuild & { dagger.#DockerBuild & {
context: TestData context: TestData
}, },
@ -35,7 +35,7 @@ TestBuildContext: #dagger: compute: [
} }
] ]
TestBuildContextAndDockerfile: #dagger: compute: [ TestBuildContextAndDockerfile: #compute: [
dagger.#DockerBuild & { dagger.#DockerBuild & {
context: TestData context: TestData
dockerfile: """ dockerfile: """
@ -48,7 +48,7 @@ TestBuildContextAndDockerfile: #dagger: compute: [
} }
] ]
TestDockerfilePath: #dagger: compute: [ TestDockerfilePath: #compute: [
dagger.#DockerBuild & { dagger.#DockerBuild & {
context: TestData context: TestData
dockerfilePath: "./dockerfilepath/Dockerfile.custom" dockerfilePath: "./dockerfilepath/Dockerfile.custom"
@ -58,7 +58,7 @@ TestDockerfilePath: #dagger: compute: [
} }
] ]
TestBuildArgs: #dagger: compute: [ TestBuildArgs: #compute: [
dagger.#DockerBuild & { dagger.#DockerBuild & {
dockerfile: """ dockerfile: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
@ -70,7 +70,7 @@ TestBuildArgs: #dagger: compute: [
] ]
// FIXME: this doesn't test anything beside not crashing // FIXME: this doesn't test anything beside not crashing
TestBuildLabels: #dagger: compute: [ TestBuildLabels: #compute: [
dagger.#DockerBuild & { dagger.#DockerBuild & {
dockerfile: """ dockerfile: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
@ -80,7 +80,7 @@ TestBuildLabels: #dagger: compute: [
] ]
// FIXME: this doesn't test anything beside not crashing // FIXME: this doesn't test anything beside not crashing
TestBuildPlatform: #dagger: compute: [ TestBuildPlatform: #compute: [
dagger.#DockerBuild & { dagger.#DockerBuild & {
dockerfile: """ dockerfile: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d

View File

@ -1,6 +1,6 @@
package testing package testing
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -1,6 +1,6 @@
package testing package testing
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -1,6 +1,6 @@
package testing package testing
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -1,6 +1,6 @@
package testing package testing
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -2,7 +2,7 @@ package testing
bar: string bar: string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -1,6 +1,6 @@
package testing package testing
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -1,6 +1,6 @@
package testing package testing
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -1,6 +1,6 @@
package testing package testing
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -1,6 +1,6 @@
package testing package testing
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -1,6 +1,6 @@
package testing package testing
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -3,7 +3,7 @@ package testing
hello: "world" hello: "world"
bar: string bar: string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -3,7 +3,7 @@ package testing
hello: "world" hello: "world"
bar: string bar: string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -2,18 +2,16 @@ package def
#dang: string #dang: string
#dagger: { #compute: [
compute: [ {
{ do: "fetch-container"
do: "fetch-container" ref: "alpine"
ref: "alpine" },
}, {
{ do: "exec"
do: "exec" dir: "/"
dir: "/" args: ["sh", "-c", """
args: ["sh", "-c", """ echo success
echo success """]
"""] },
}, ]
]
}

View File

@ -4,11 +4,9 @@ import (
"dagger.io/def" "dagger.io/def"
) )
#dagger: { #compute: [
compute: [ {
{ do: "load",
do: "load", from: def
from: def },
}, ]
]
}

View File

@ -2,19 +2,17 @@ package nonoptional
dang: string dang: string
#dagger: { #compute: [
compute: [ {
{ do: "fetch-container"
do: "fetch-container" ref: "alpine"
ref: "alpine" },
}, {
{ do: "exec"
do: "exec" dir: "/"
dir: "/" args: ["sh", "-c", """
args: ["sh", "-c", """ echo "This test SHOULD fail, because this SHOULD be executed"
echo "This test SHOULD fail, because this SHOULD be executed" exit 1
exit 1 """]
"""] },
}, ]
]
}

View File

@ -4,11 +4,9 @@ import (
"dagger.io/nonoptional" "dagger.io/nonoptional"
) )
#dagger: { #compute: [
compute: [ {
{ do: "load",
do: "load", from: nonoptional
from: nonoptional },
}, ]
]
}

View File

@ -2,18 +2,16 @@ package optional
dang?: string dang?: string
#dagger: { #compute: [
compute: [ {
{ do: "fetch-container"
do: "fetch-container" ref: "alpine"
ref: "alpine" },
}, {
{ do: "exec"
do: "exec" dir: "/"
dir: "/" args: ["sh", "-c", """
args: ["sh", "-c", """ echo success
echo success """]
"""] },
}, ]
]
}

View File

@ -4,11 +4,9 @@ import (
"dagger.io/optional" "dagger.io/optional"
) )
#dagger: { #compute: [
compute: [ {
{ do: "load",
do: "load", from: optional
from: optional },
}, ]
]
}

View File

@ -3,7 +3,7 @@ package testing
test: { test: {
bool bool
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -3,7 +3,7 @@ package testing
test1: { test1: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"
@ -27,7 +27,7 @@ test1: {
test2: { test2: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"
@ -51,7 +51,7 @@ test2: {
test3: { test3: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"
@ -75,7 +75,7 @@ test3: {
test4: { test4: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"
@ -99,7 +99,7 @@ test4: {
test5: { test5: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"
@ -123,7 +123,7 @@ test5: {
test6: { test6: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"
@ -147,7 +147,7 @@ test6: {
test7: { test7: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"
@ -171,7 +171,7 @@ test7: {
test8: { test8: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"
@ -195,7 +195,7 @@ test8: {
test9: { test9: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"
@ -219,7 +219,7 @@ test9: {
test10: { test10: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -3,7 +3,7 @@ package testing
test: { test: {
float float
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -3,7 +3,7 @@ package testing
teststring: { teststring: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -3,7 +3,7 @@ package testing
teststring: { teststring: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -4,7 +4,7 @@ test: {
string string
=~"^NAAAA.+" =~"^NAAAA.+"
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -3,7 +3,7 @@ package testing
testScalar: { testScalar: {
bool bool
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"
@ -25,7 +25,7 @@ testScalar: {
] ]
} }
testMap: #dagger: compute: [ testMap: #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"
@ -50,7 +50,7 @@ testMap: #dagger: compute: [
// testList: { // testList: {
// [...string] // [...string]
// #dagger: compute: [ // #compute: [
// { // {
// do: "fetch-container" // do: "fetch-container"
// ref: "alpine" // ref: "alpine"

View File

@ -3,7 +3,7 @@ package testing
test: { test: {
number number
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -3,7 +3,7 @@ package testing
test: { test: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -4,7 +4,7 @@ test: {
string string
=~"^some.+" =~"^some.+"
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -3,7 +3,7 @@ package testing
testScalar: { testScalar: {
bool bool
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"
@ -30,7 +30,7 @@ testScalar: {
// testList: { // testList: {
// [...string] // [...string]
// #dagger: compute: [ // #compute: [
// { // {
// do: "fetch-container" // do: "fetch-container"
// ref: "alpine" // ref: "alpine"
@ -54,7 +54,7 @@ testScalar: {
// ] // ]
// } // }
testMap: #dagger: compute: [ testMap: #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -1,34 +1,34 @@
package testing package testing
busybox1: #dagger: compute: [ busybox1: #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "busybox" ref: "busybox"
}, },
] ]
busybox2: #dagger: compute: [ busybox2: #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "busybox:latest" ref: "busybox:latest"
}, },
] ]
busybox3: #dagger: compute: [ busybox3: #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "busybox:1.33-musl" ref: "busybox:1.33-musl"
}, },
] ]
busybox4: #dagger: compute: [ busybox4: #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "busybox@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7" ref: "busybox@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7"
}, },
] ]
busybox5: #dagger: compute: [ busybox5: #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "busybox:1.33-musl@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7" ref: "busybox:1.33-musl@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7"

View File

@ -1,6 +1,6 @@
package testing package testing
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
}, },

View File

@ -1,6 +1,6 @@
package testing package testing
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine@sha256:c6c7524e2111f22a9f7577211232d89a9e68cf5b9ed4a41ba77957c9771380a5" ref: "alpine@sha256:c6c7524e2111f22a9f7577211232d89a9e68cf5b9ed4a41ba77957c9771380a5"

View File

@ -2,7 +2,7 @@ package testing
// XXX WATCHOUT // XXX WATCHOUT
// Once buildkit has pulled that digest, it will stay cached and happily succeed WHATEVER the image name then is // Once buildkit has pulled that digest, it will stay cached and happily succeed WHATEVER the image name then is
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "busyboxaaa@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7" ref: "busyboxaaa@sha256:e2af53705b841ace3ab3a44998663d4251d33ee8a9acaf71b66df4ae01c3bbe7"

View File

@ -1,6 +1,6 @@
package testing package testing
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "doesnotexist" ref: "doesnotexist"

View File

@ -1,6 +1,6 @@
package testing package testing
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine:doesnotexist" ref: "alpine:doesnotexist"

View File

@ -1,6 +1,6 @@
package testing package testing
#dagger: compute: [ #compute: [
{ {
do: "fetch-git" do: "fetch-git"
remote: "https://github.com/blocklayerhq/acme-clothing.git" remote: "https://github.com/blocklayerhq/acme-clothing.git"

View File

@ -1,6 +1,6 @@
package testing package testing
#dagger: compute: [ #compute: [
{ {
do: "fetch-git" do: "fetch-git"
}, },

View File

@ -1,6 +1,6 @@
package testing package testing
#dagger: compute: [ #compute: [
{ {
do: "fetch-git" do: "fetch-git"
remote: "pork://pork" remote: "pork://pork"

View File

@ -1,6 +1,6 @@
package testing package testing
#dagger: compute: [ #compute: [
{ {
do: "fetch-git" do: "fetch-git"
remote: "https://github.com/blocklayerhq/acme-clothing.git" remote: "https://github.com/blocklayerhq/acme-clothing.git"

View File

@ -1,6 +1,6 @@
package testing package testing
#dagger: compute: [ #compute: [
{ {
do: "fetch-git" do: "fetch-git"
remote: "https://github.com/blocklayerhq/lalalala.git" remote: "https://github.com/blocklayerhq/lalalala.git"

View File

@ -5,7 +5,7 @@ X1=in: string | *"default input"
test: { test: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -5,7 +5,7 @@ X1=in: string
test: { test: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -3,7 +3,7 @@ package testing
test1: { test1: {
string string
#dagger: compute: [ #compute: [
{ {
do: "load" do: "load"
from: [{do: "fetch-container", ref: "alpine"}] from: [{do: "fetch-container", ref: "alpine"}]
@ -19,7 +19,7 @@ test1: {
test2: { test2: {
string string
#dagger: compute: [ #compute: [
{ {
do: "load" do: "load"
from: [{do: "fetch-container", ref: "busybox"}] from: [{do: "fetch-container", ref: "busybox"}]

View File

@ -1,6 +1,6 @@
package testing package testing
component: #dagger: compute: [{ component: #compute: [{
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"
}, { }, {
@ -14,7 +14,7 @@ component: #dagger: compute: [{
test1: { test1: {
string string
#dagger: compute: [ #compute: [
{ {
do: "load" do: "load"
from: component from: component
@ -30,10 +30,10 @@ test1: {
test2: { test2: {
string string
#dagger: compute: [ #compute: [
{ {
do: "load" do: "load"
from: #dagger: compute: [{ from: #compute: [{
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"
}, { }, {

View File

@ -3,7 +3,7 @@ package testing
test: { test: {
string string
#dagger: compute: [ #compute: [
{ {
do: "load" do: "load"
from: [{do: "fetch-container", ref: "alpine"}] from: [{do: "fetch-container", ref: "alpine"}]

View File

@ -3,7 +3,7 @@ package testing
test: { test: {
string string
#dagger: compute: [ #compute: [
{ {
do: "load" do: "load"
from: [{do: "fetch-container", ref: "alpine"}] from: [{do: "fetch-container", ref: "alpine"}]

View File

@ -3,7 +3,7 @@ package testing
test: { test: {
string string
#dagger: compute: [ #compute: [
{ {
do: "load" do: "load"
from: [{do: "fetch-container", ref: "alpine"}] from: [{do: "fetch-container", ref: "alpine"}]
@ -13,8 +13,8 @@ test: {
args: ["sh", "-c", """ args: ["sh", "-c", """
cat /mnt/test/lol > /out cat /mnt/test/lol > /out
"""] """]
mount: "/mnt/test": { mount: "/mnt/test": from: {
from: #dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -3,7 +3,7 @@ package testing
test: { test: {
string string
#dagger: compute: [ #compute: [
{ {
do: "load" do: "load"
from: [{do: "fetch-container", ref: "alpine"}] from: [{do: "fetch-container", ref: "alpine"}]

View File

@ -3,7 +3,7 @@ package testing
test: { test: {
string string
#dagger: compute: [ #compute: [
{ {
do: "load" do: "load"
from: [{do: "fetch-container", ref: "alpine"}] from: [{do: "fetch-container", ref: "alpine"}]

View File

@ -1,6 +1,6 @@
package test package test
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "busybox" ref: "busybox"

View File

@ -3,7 +3,7 @@ package main
hello: { hello: {
string string
#dagger: compute: [ #compute: [
{ {
do: "fetch-container" do: "fetch-container"
ref: "alpine" ref: "alpine"

View File

@ -43,13 +43,9 @@ test::compute(){
"$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/compute/invalid/int "$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/compute/invalid/int
test::one "Compute: invalid struct should fail" --exit=1 --stdout= \ test::one "Compute: invalid struct should fail" --exit=1 --stdout= \
"$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/compute/invalid/struct "$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/compute/invalid/struct
disable test::one "Compute: overloading #ComponentScript with new prop should fail (FIXME: unauthorized fields are not checked)" --exit=1 \
"$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/compute/invalid/overload/new_prop
test::one "Compute: overloading #ComponentScript with new def should succeed" --exit=0 \
"$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/compute/invalid/overload/new_def
# Compute: success # Compute: success
test::one "Compute: noop should succeed" --exit=0 --stdout='{"empty":{},"realempty":{}}' \ test::one "Compute: noop should succeed" --exit=0 --stdout='{"empty":{}}' \
"$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/compute/success/noop "$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/compute/success/noop
test::one "Compute: simple should succeed" --exit=0 --stdout="{}" \ test::one "Compute: simple should succeed" --exit=0 --stdout="{}" \
"$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/compute/success/simple "$dagger" "${DAGGER_BINARY_ARGS[@]}" compute "$d"/compute/success/simple