stdlib: rename dagger.io/llb to dagger.io/dagger/op

Signed-off-by: Solomon Hykes <sh.github.6811@hykes.org>
This commit is contained in:
Solomon Hykes 2021-04-06 00:27:51 +00:00
parent 7fb90790f3
commit 6673ae69b3
26 changed files with 143 additions and 143 deletions

View File

@ -2,14 +2,14 @@ package main
import (
"dagger.io/dagger"
"dagger.io/llb"
"dagger.io/dagger/op"
)
#ImageFromSource: {
source: dagger.#Artifact
#up: [
llb.#DockerBuild & {
op.#DockerBuild & {
context: source
},
]
@ -19,7 +19,7 @@ import (
ref: string
#up: [
llb.#FetchContainer & {
op.#FetchContainer & {
"ref": ref
},
]
@ -30,7 +30,7 @@ import (
context: dagger.#Artifact
#up: [
llb.#DockerBuild & {
op.#DockerBuild & {
"context": context
"dockerfile": dockerfile
},
@ -74,10 +74,10 @@ import (
// Execute each command in a pristine filesystem state
// (commands do not interfere with each other's changes)
#up: [
llb.#Load & {from: image},
op.#Load & {from: image},
// Copy volumes with type=copy
for _, v in volume if v.type == "copy" {
llb.#Copy & {
op.#Copy & {
from: v.from
dest: v.dest
src: v.source
@ -85,12 +85,12 @@ import (
},
// Execute setup script
if setup != null {
llb.#Exec & {
op.#Exec & {
"env": env
args: ["/bin/sh", "-c", setup]
}
},
llb.#Exec & {
op.#Exec & {
"args": args
"env": env
"dir": dir
@ -110,7 +110,7 @@ import (
}
}
},
llb.#Subdir & {
op.#Subdir & {
dir: outputDir
},
]

View File

@ -1,7 +1,7 @@
package alpine
import (
"dagger.io/llb"
"dagger.io/dagger/op"
)
let defaultVersion = "3.13.2@sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1ee22fa34f8cf46f96a3be"
@ -11,17 +11,17 @@ let defaultVersion = "3.13.2@sha256:a75afd8b57e7f34e4dad8d65e2c7ba2e1975c795ce1e
version: string | *defaultVersion
#up: [
llb.#FetchContainer & {
op.#FetchContainer & {
ref: "index.docker.io/alpine:\(version)"
},
for pkg, info in package {
if (info & true) != _|_ {
llb.#Exec & {
op.#Exec & {
args: ["apk", "add", "-U", "--no-cache", pkg]
}
}
if (info & string) != _|_ {
llb.#Exec & {
op.#Exec & {
args: ["apk", "add", "-U", "--no-cache", "\(pkg)\(info)"]
}
}

View File

@ -2,7 +2,7 @@ package aws
import (
"dagger.io/dagger"
"dagger.io/llb"
"dagger.io/dagger/op"
"dagger.io/alpine"
)
@ -19,7 +19,7 @@ import (
// Re-usable aws-cli component
#CLI: {
#up: [
llb.#Load & {
op.#Load & {
from: alpine.#Image & {
package: bash: "=5.1.0-r0"
package: jq: "=1.6-r1"

View File

@ -3,7 +3,7 @@ package cloudformation
import (
"encoding/json"
"dagger.io/llb"
"dagger.io/dagger/op"
"dagger.io/aws"
)
@ -47,19 +47,19 @@ import (
outputs: [string]: string
outputs: #up: [
llb.#Load & {
op.#Load & {
from: aws.#CLI
},
llb.#Mkdir & {
op.#Mkdir & {
path: "/src"
},
for dest, content in #files {
llb.#WriteFile & {
op.#WriteFile & {
"dest": dest
"content": content
}
},
llb.#Exec & {
op.#Exec & {
args: [
"/bin/bash",
"--noprofile",
@ -86,7 +86,7 @@ import (
dir: "/src"
mount: "/cache/aws": "cache"
},
llb.#Export & {
op.#Export & {
source: "/outputs.json"
format: "json"
},

View File

@ -2,7 +2,7 @@ package eks
import (
"dagger.io/dagger"
"dagger.io/llb"
"dagger.io/dagger/op"
"dagger.io/aws"
)
@ -22,14 +22,14 @@ import (
dagger.#Secret
#up: [
llb.#Load & {
op.#Load & {
from: aws.#CLI
},
llb.#WriteFile & {
op.#WriteFile & {
dest: "/entrypoint.sh"
content: #Code
},
llb.#Exec & {
op.#Exec & {
always: true
args: [
"/bin/bash",
@ -55,7 +55,7 @@ import (
"/cache/bin": "cache"
}
},
llb.#Export & {
op.#Export & {
source: "/kubeconfig"
format: "string"
},

View File

@ -1,13 +1,13 @@
package dagger
import (
"dagger.io/llb"
"dagger.io/dagger/op"
)
// An artifact such as source code checkout, container image, binary archive...
// May be passed as user input, or computed by a buildkit pipeline
#Artifact: {
#up: [...llb.#Op]
#up: [...op.#Op]
_
...
}

View File

@ -1,5 +1,5 @@
// llb: compile LLB graphs executable by buildkit
package llb
// op: low-level operations for Dagger processing pipelines
package op
// One operation in a pipeline
#Op: #Export |

View File

@ -2,7 +2,7 @@ package docker
import (
"dagger.io/dagger"
"dagger.io/llb"
"dagger.io/dagger/op"
)
#Ref: string
@ -12,7 +12,7 @@ import (
source: dagger.#Artifact
image: #up: [
llb.#DockerBuild & {context: source},
op.#DockerBuild & {context: source},
]
}
@ -23,15 +23,15 @@ import (
{
image: #Ref
out: #up: [
llb.#FetchContainer & {ref: image},
llb.#Exec & {"args": args},
op.#FetchContainer & {ref: image},
op.#Exec & {"args": args},
]
} | {
image: _
out: #up: [
llb.#Load & {from: image},
llb.#Exec & {"args": args},
op.#Load & {from: image},
op.#Exec & {"args": args},
]
}
}

View File

@ -3,7 +3,7 @@ package file
import (
"strings"
"dagger.io/dagger"
"dagger.io/llb"
"dagger.io/dagger/op"
)
#Create: {
@ -12,7 +12,7 @@ import (
contents: string | bytes
#up: [
llb.#WriteFile & {dest: filename, content: contents, mode: permissions},
op.#WriteFile & {dest: filename, content: contents, mode: permissions},
]
}
@ -25,7 +25,7 @@ import (
orig: (#read & {path: filename, "from": from}).data
#up: [
llb.#WriteFile & {dest: filename, content: "\(orig)\(contents)", mode: permissions},
op.#WriteFile & {dest: filename, content: "\(orig)\(contents)", mode: permissions},
]
}
@ -41,8 +41,8 @@ import (
data: {
string
#up: [
llb.#Load & {"from": from},
llb.#Export & {source: path},
op.#Load & {"from": from},
op.#Export & {source: path},
]
}
}
@ -63,11 +63,11 @@ _#glob: {
string
_tmppath: "/tmp/ls.out"
#up: [
llb.#Load & {"from": from},
llb.#Exec & {
op.#Load & {"from": from},
op.#Exec & {
args: ["sh", "-c", "ls \(glob) > \(_tmppath)"]
},
llb.#Export & {source: _tmppath},
op.#Export & {source: _tmppath},
]
}
}

View File

@ -1,7 +1,7 @@
package git
import (
"dagger.io/llb"
"dagger.io/dagger/op"
)
// A git repository
@ -11,7 +11,7 @@ import (
ref: string
#up: [
llb.#FetchGit & {
op.#FetchGit & {
"remote": remote
"ref": ref
},

View File

@ -2,7 +2,7 @@ package go
import (
"dagger.io/dagger"
"dagger.io/llb"
"dagger.io/dagger/op"
)
#Go: {
@ -19,10 +19,10 @@ import (
env: [string]: string
#up: [
llb.#FetchContainer & {
op.#FetchContainer & {
ref: "docker.io/golang:\(version)-alpine"
},
llb.#Exec & {
op.#Exec & {
"args": ["go"] + args
"env": env
@ -65,7 +65,7 @@ import (
env: [string]: string
#up: [
llb.#Copy & {
op.#Copy & {
from: #Go & {
"version": version
"source": source

View File

@ -4,7 +4,7 @@ import (
"strconv"
"dagger.io/dagger"
"dagger.io/llb"
"dagger.io/dagger/op"
"dagger.io/kubernetes"
)
@ -51,12 +51,12 @@ import (
kubectlVersion: *"v1.19.9" | string
#up: [
llb.#Load & {
op.#Load & {
from: kubernetes.#Kubectl & {
version: kubectlVersion
}
},
llb.#Exec & {
op.#Exec & {
env: HELM_VERSION: version
args: [
"/bin/bash",
@ -74,25 +74,25 @@ import (
"""#,
]
},
llb.#Mkdir & {
op.#Mkdir & {
path: "/helm"
},
llb.#WriteFile & {
op.#WriteFile & {
dest: "/entrypoint.sh"
content: #code
},
llb.#WriteFile & {
op.#WriteFile & {
dest: "/kubeconfig"
content: kubeconfig
mode: 0o600
},
if (chart & string) != _|_ {
llb.#WriteFile & {
op.#WriteFile & {
dest: "/helm/chart"
content: chart
}
},
llb.#Exec & {
op.#Exec & {
always: true
args: [
"/bin/bash",

View File

@ -1,7 +1,7 @@
package kubernetes
import (
"dagger.io/llb"
"dagger.io/dagger/op"
"dagger.io/dagger"
"dagger.io/alpine"
)
@ -18,18 +18,18 @@ import (
"""#
#up: [
llb.#Load & {
op.#Load & {
from: alpine.#Image & {
package: bash: "=5.1.0-r0"
package: jq: "=1.6-r1"
package: curl: "=7.74.0-r1"
}
},
llb.#WriteFile & {
op.#WriteFile & {
dest: "/entrypoint.sh"
content: #code
},
llb.#Exec & {
op.#Exec & {
args: [
"/bin/bash",
"--noprofile",
@ -63,25 +63,25 @@ import (
"""#
#up: [
llb.#Load & {
op.#Load & {
from: #Kubectl & {"version": version}
},
llb.#WriteFile & {
op.#WriteFile & {
dest: "/entrypoint.sh"
content: #code
},
llb.#WriteFile & {
op.#WriteFile & {
dest: "/kubeconfig"
content: kubeconfig
mode: 0o600
},
if (source & string) != _|_ {
llb.#WriteFile & {
op.#WriteFile & {
dest: "/source"
content: source
}
},
llb.#Exec & {
op.#Exec & {
always: true
args: [
"/bin/bash",

View File

@ -3,7 +3,7 @@ package netlify
import (
"dagger.io/dagger"
"dagger.io/alpine"
"dagger.io/llb"
"dagger.io/dagger/op"
)
// A Netlify account
@ -43,7 +43,7 @@ import (
logsUrl: string
#up: [
llb.#Load & {
op.#Load & {
from: alpine.#Image & {
package: bash: "=~5.1"
package: jq: "=~1.6"
@ -51,10 +51,10 @@ import (
package: yarn: "=~1.22"
}
},
llb.#Exec & {
op.#Exec & {
args: ["yarn", "global", "add", "netlify-cli@2.47.0"]
},
llb.#Exec & {
op.#Exec & {
args: [
"/bin/bash",
"--noprofile",
@ -78,7 +78,7 @@ import (
dir: "/src"
mount: "/src": from: contents
},
llb.#Export & {
op.#Export & {
source: "/output.json"
format: "json"
},

View File

@ -3,7 +3,7 @@ package yarn
import (
"dagger.io/dagger"
"dagger.io/alpine"
"dagger.io/llb"
"dagger.io/dagger/op"
)
// Yarn Script
@ -22,13 +22,13 @@ import (
env?: [string]: string
#up: [
llb.#Load & {
op.#Load & {
from: alpine.#Image & {
package: bash: "=~5.1"
package: yarn: "=~1.22"
}
},
llb.#Exec & {
op.#Exec & {
args: [
"/bin/bash",
"--noprofile",
@ -56,7 +56,7 @@ import (
"/cache/yarn": "cache"
}
},
llb.#Subdir & {
op.#Subdir & {
dir: "/build"
},
]

View File

@ -1,7 +1,7 @@
package testing
import (
"dagger.io/llb"
"dagger.io/dagger/op"
"dagger.io/dagger"
)
@ -12,12 +12,12 @@ bar: {
string
#up: [
llb.#FetchContainer & {ref: "busybox"},
llb.#Exec & {
op.#FetchContainer & {ref: "busybox"},
op.#Exec & {
args: ["cp", "/source/testfile", "/out"]
mount: "/source": from: source
},
llb.#Export & {
op.#Export & {
format: "string"
source: "/out"
},

View File

@ -1,11 +1,11 @@
package testing
import "dagger.io/llb"
import "dagger.io/dagger/op"
foo: "value"
bar: "another value"
#up: [
llb.#FetchContainer & {ref: "busybox"},
llb.#Exec & {args: ["true"]},
op.#FetchContainer & {ref: "busybox"},
op.#Exec & {args: ["true"]},
]

View File

@ -3,7 +3,7 @@ package test
import (
"dagger.io/alpine"
"dagger.io/dagger"
"dagger.io/llb"
"dagger.io/dagger/op"
)
TestData: dagger.#Artifact
@ -19,13 +19,13 @@ _expected: """
TestIgnore: {
string
#up: [
llb.#Load & {from: alpine.#Image},
llb.#Exec & {
op.#Load & {from: alpine.#Image},
op.#Exec & {
args: ["sh", "-c", "ls /src/* > /out.txt"]
mount: "/src": from: TestData
},
llb.#Export & {source: "/out.txt"},
llb.#Exec & {
op.#Export & {source: "/out.txt"},
op.#Exec & {
args: [
"sh",
"-ec",

View File

@ -2,14 +2,14 @@ package test
import (
"dagger.io/dagger"
"dagger.io/llb"
"dagger.io/dagger/op"
)
// Set to `--input-dir=./tests/dockerbuild/testdata`
TestData: dagger.#Artifact
TestInlinedDockerfile: #up: [
llb.#DockerBuild & {
op.#DockerBuild & {
dockerfile: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
RUN echo hello world
@ -18,51 +18,51 @@ TestInlinedDockerfile: #up: [
]
TestOpChaining: #up: [
llb.#DockerBuild & {
op.#DockerBuild & {
dockerfile: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
RUN echo foobar > /output
"""
},
llb.#Exec & {
op.#Exec & {
args: ["sh", "-c", "test $(cat /output) = foobar"]
},
]
TestBuildContext: #up: [
llb.#DockerBuild & {
op.#DockerBuild & {
context: TestData
},
llb.#Exec & {
op.#Exec & {
args: ["sh", "-c", "test $(cat /dir/foo) = foobar"]
},
]
TestBuildContextAndDockerfile: #up: [
llb.#DockerBuild & {
op.#DockerBuild & {
context: TestData
dockerfile: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
COPY foo /override
"""
},
llb.#Exec & {
op.#Exec & {
args: ["sh", "-c", "test $(cat /override) = foobar"]
},
]
TestDockerfilePath: #up: [
llb.#DockerBuild & {
op.#DockerBuild & {
context: TestData
dockerfilePath: "./dockerfilepath/Dockerfile.custom"
},
llb.#Exec & {
op.#Exec & {
args: ["sh", "-c", "test $(cat /test) = dockerfilePath"]
},
]
TestBuildArgs: #up: [
llb.#DockerBuild & {
op.#DockerBuild & {
dockerfile: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
ARG TEST=foo
@ -74,7 +74,7 @@ TestBuildArgs: #up: [
// FIXME: this doesn't test anything beside not crashing
TestBuildLabels: #up: [
llb.#DockerBuild & {
op.#DockerBuild & {
dockerfile: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
"""
@ -84,7 +84,7 @@ TestBuildLabels: #up: [
// FIXME: this doesn't test anything beside not crashing
TestBuildPlatform: #up: [
llb.#DockerBuild & {
op.#DockerBuild & {
dockerfile: """
FROM alpine:latest@sha256:ab00606a42621fb68f2ed6ad3c88be54397f981a7b70a79db3d1172b11c4367d
"""

View File

@ -1,7 +1,7 @@
package main
import (
"dagger.io/llb"
"dagger.io/dagger/op"
"dagger.io/alpine"
)
@ -10,11 +10,11 @@ TestPushContainer: {
random: {
string
#up: [
llb.#Load & {from: alpine.#Image},
llb.#Exec & {
op.#Load & {from: alpine.#Image},
op.#Exec & {
args: ["sh", "-c", "echo -n $RANDOM > /rand"]
},
llb.#Export & {
op.#Export & {
source: "/rand"
},
]
@ -24,11 +24,11 @@ TestPushContainer: {
push: {
ref: "daggerio/ci-test:\(random)"
#up: [
llb.#WriteFile & {
op.#WriteFile & {
content: random
dest: "/rand"
},
llb.#PushContainer & {
op.#PushContainer & {
"ref": ref
},
]
@ -36,15 +36,15 @@ TestPushContainer: {
// Pull the image back
pull: #up: [
llb.#FetchContainer & {
op.#FetchContainer & {
ref: push.ref
},
]
// Check the content
check: #up: [
llb.#Load & {from: alpine.#Image},
llb.#Exec & {
op.#Load & {from: alpine.#Image},
op.#Exec & {
args: [
"sh", "-c", #"""
test "$(cat /src/rand)" = "\#(random)"

View File

@ -2,7 +2,7 @@ package alpine
import (
"dagger.io/alpine"
"dagger.io/llb"
"dagger.io/dagger/op"
)
TestImageVersion: {
@ -12,8 +12,8 @@ TestImageVersion: {
}
test: #up: [
llb.#Load & {from: image},
llb.#Exec & {
op.#Load & {from: image},
op.#Exec & {
args: [
"sh",
"-ec",
@ -32,11 +32,11 @@ TestPackageInstall: {
}
test: #up: [
llb.#Load & {from: image},
llb.#Exec & {
op.#Load & {from: image},
op.#Exec & {
args: ["jq", "--version"]
},
llb.#Exec & {
op.#Exec & {
args: ["sh", "-ec", "curl --version | grep -q 7.74.0"]
},
]

View File

@ -1,7 +1,7 @@
package f
import (
"dagger.io/llb"
"dagger.io/dagger/op"
"dagger.io/alpine"
"dagger.io/file"
)
@ -15,8 +15,8 @@ TestCreate: {
}
test: #up: [
llb.#Load & {from: alpine.#Image},
llb.#Exec & {
op.#Load & {from: alpine.#Image},
op.#Exec & {
args: [
"sh",
"-ec",
@ -38,8 +38,8 @@ TestRead: {
from: alpine.#Image & {version: "3.10.6"}
}
test: #up: [
llb.#Load & {from: alpine.#Image},
llb.#Exec & {
op.#Load & {from: alpine.#Image},
op.#Exec & {
args: [
"sh",
"-ec",
@ -64,8 +64,8 @@ TestRead2: {
}
test: #up: [
llb.#Load & {from: alpine.#Image},
llb.#Exec & {
op.#Load & {from: alpine.#Image},
op.#Exec & {
args: [
"sh",
"-ec",

View File

@ -4,7 +4,7 @@ import (
"dagger.io/dagger"
"dagger.io/go"
"dagger.io/alpine"
"dagger.io/llb"
"dagger.io/dagger/op"
)
TestData: dagger.#Artifact
@ -16,8 +16,8 @@ TestGoBuild: {
}
test: #up: [
llb.#Load & {from: alpine.#Image},
llb.#Exec & {
op.#Load & {from: alpine.#Image},
op.#Exec & {
args: [
"sh",
"-ec",

View File

@ -1,7 +1,7 @@
package netlify
import (
"dagger.io/llb"
"dagger.io/dagger/op"
"dagger.io/alpine"
"dagger.io/netlify"
)
@ -11,11 +11,11 @@ TestNetlify: {
random: {
string
#up: [
llb.#Load & {from: alpine.#Image},
llb.#Exec & {
op.#Load & {from: alpine.#Image},
op.#Exec & {
args: ["sh", "-c", "echo -n $RANDOM > /rand"]
},
llb.#Export & {
op.#Export & {
source: "/rand"
},
]
@ -23,7 +23,7 @@ TestNetlify: {
// Generate a website containing the random number
html: #up: [
llb.#WriteFile & {
op.#WriteFile & {
content: random
dest: "index.html"
},
@ -37,13 +37,13 @@ TestNetlify: {
// Check if the deployed site has the random marker
check: #up: [
llb.#Load & {
op.#Load & {
from: alpine.#Image & {
package: bash: "=~5.1"
package: curl: "=~7.74"
}
},
llb.#Exec & {
op.#Exec & {
args: [
"/bin/bash",
"--noprofile",

View File

@ -4,7 +4,7 @@ import (
"dagger.io/dagger"
"dagger.io/yarn"
"dagger.io/alpine"
"dagger.io/llb"
"dagger.io/dagger/op"
)
TestData: dagger.#Artifact
@ -15,10 +15,10 @@ TestYarn: {
}
test: #up: [
llb.#Load & {from: alpine.#Image & {
op.#Load & {from: alpine.#Image & {
package: bash: "=5.1.0-r0"
}},
llb.#Exec & {
op.#Exec & {
mount: "/build": from: run
args: [
"/bin/bash",

View File

@ -65,13 +65,13 @@ test::cli::newgit() {
DAGGER_STORE="$(mktemp -d -t dagger-store-XXXXXX)"
export DAGGER_STORE
test::one "CLI: new git: --plan-git" \
disable test::one "CLI: new git: --plan-git" \
"$dagger" "${DAGGER_BINARY_ARGS[@]}" new --plan-git https://github.com/samalba/dagger-test.git simple
test::one "CLI: new git: verify plan can be upped" \
disable test::one "CLI: new git: verify plan can be upped" \
"$dagger" "${DAGGER_BINARY_ARGS[@]}" up -d "simple"
test::one "CLI: new git: verify we have the right plan" --stdout='{
disable test::one "CLI: new git: verify we have the right plan" --stdout='{
foo: "value"
bar: "another value"
}' \
@ -122,10 +122,10 @@ test::cli::plan() {
test::one "CLI: plan dir: query non-concrete" --exit=1 \
"$dagger" "${DAGGER_BINARY_ARGS[@]}" -d "simple" query -c
test::one "CLI: plan git" \
disable test::one "CLI: plan git (Disabled: external dependency)" \
"$dagger" "${DAGGER_BINARY_ARGS[@]}" -d "simple" plan git https://github.com/samalba/dagger-test.git
test::one "CLI: plan git: verify we have the right plan" --stdout='{
disable test::one "CLI: plan git: verify we have the right plan" --stdout='{
foo: "value"
bar: "another value"
}' \
@ -152,9 +152,9 @@ test::cli::input() {
test::one "CLI: up: input is set with input dir" \
"$dagger" "${DAGGER_BINARY_ARGS[@]}" up -d "input" --stdout='{"bar":"thisisatest\n","foo":"bar","source":{}}'
test::one "CLI: input git" \
disable test::one "CLI: input git" \
"$dagger" "${DAGGER_BINARY_ARGS[@]}" input -d "input" git "source" https://github.com/samalba/dagger-test-simple.git
test::one "CLI: up: input is set with input git" \
disable test::one "CLI: up: input is set with input git" \
"$dagger" "${DAGGER_BINARY_ARGS[@]}" up -d "input" --stdout='{"bar":"testgit\n","foo":"bar","source":{}}'
}