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

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