From f1e0487df43ead97f59c995b9e2444fe45fd7c81 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Tue, 11 Jan 2022 16:34:35 -0800 Subject: [PATCH 1/4] move alpha.dagger.io/europa to dagger.io Signed-off-by: Andrea Luzzardi --- pkg/{alpha.dagger.io/europa => dagger.io}/README.md | 0 pkg/{alpha.dagger.io/europa => dagger.io}/dagger/engine/exec.cue | 0 pkg/{alpha.dagger.io/europa => dagger.io}/dagger/engine/fs.cue | 0 pkg/{alpha.dagger.io/europa => dagger.io}/dagger/engine/git.cue | 0 pkg/{alpha.dagger.io/europa => dagger.io}/dagger/engine/http.cue | 0 pkg/{alpha.dagger.io/europa => dagger.io}/dagger/engine/image.cue | 0 pkg/{alpha.dagger.io/europa => dagger.io}/dagger/engine/plan.cue | 0 .../europa => dagger.io}/dagger/engine/secret.cue | 0 pkg/{alpha.dagger.io/europa => dagger.io}/dagger/engine/types.cue | 0 pkg/{alpha.dagger.io/europa => dagger.io}/dagger/plan.cue | 0 pkg/{alpha.dagger.io/europa => dagger.io}/dagger/types.cue | 0 pkg/{alpha.dagger.io/europa => dagger.io}/dagger/utils.cue | 0 12 files changed, 0 insertions(+), 0 deletions(-) rename pkg/{alpha.dagger.io/europa => dagger.io}/README.md (100%) rename pkg/{alpha.dagger.io/europa => dagger.io}/dagger/engine/exec.cue (100%) rename pkg/{alpha.dagger.io/europa => dagger.io}/dagger/engine/fs.cue (100%) rename pkg/{alpha.dagger.io/europa => dagger.io}/dagger/engine/git.cue (100%) rename pkg/{alpha.dagger.io/europa => dagger.io}/dagger/engine/http.cue (100%) rename pkg/{alpha.dagger.io/europa => dagger.io}/dagger/engine/image.cue (100%) rename pkg/{alpha.dagger.io/europa => dagger.io}/dagger/engine/plan.cue (100%) rename pkg/{alpha.dagger.io/europa => dagger.io}/dagger/engine/secret.cue (100%) rename pkg/{alpha.dagger.io/europa => dagger.io}/dagger/engine/types.cue (100%) rename pkg/{alpha.dagger.io/europa => dagger.io}/dagger/plan.cue (100%) rename pkg/{alpha.dagger.io/europa => dagger.io}/dagger/types.cue (100%) rename pkg/{alpha.dagger.io/europa => dagger.io}/dagger/utils.cue (100%) diff --git a/pkg/alpha.dagger.io/europa/README.md b/pkg/dagger.io/README.md similarity index 100% rename from pkg/alpha.dagger.io/europa/README.md rename to pkg/dagger.io/README.md diff --git a/pkg/alpha.dagger.io/europa/dagger/engine/exec.cue b/pkg/dagger.io/dagger/engine/exec.cue similarity index 100% rename from pkg/alpha.dagger.io/europa/dagger/engine/exec.cue rename to pkg/dagger.io/dagger/engine/exec.cue diff --git a/pkg/alpha.dagger.io/europa/dagger/engine/fs.cue b/pkg/dagger.io/dagger/engine/fs.cue similarity index 100% rename from pkg/alpha.dagger.io/europa/dagger/engine/fs.cue rename to pkg/dagger.io/dagger/engine/fs.cue diff --git a/pkg/alpha.dagger.io/europa/dagger/engine/git.cue b/pkg/dagger.io/dagger/engine/git.cue similarity index 100% rename from pkg/alpha.dagger.io/europa/dagger/engine/git.cue rename to pkg/dagger.io/dagger/engine/git.cue diff --git a/pkg/alpha.dagger.io/europa/dagger/engine/http.cue b/pkg/dagger.io/dagger/engine/http.cue similarity index 100% rename from pkg/alpha.dagger.io/europa/dagger/engine/http.cue rename to pkg/dagger.io/dagger/engine/http.cue diff --git a/pkg/alpha.dagger.io/europa/dagger/engine/image.cue b/pkg/dagger.io/dagger/engine/image.cue similarity index 100% rename from pkg/alpha.dagger.io/europa/dagger/engine/image.cue rename to pkg/dagger.io/dagger/engine/image.cue diff --git a/pkg/alpha.dagger.io/europa/dagger/engine/plan.cue b/pkg/dagger.io/dagger/engine/plan.cue similarity index 100% rename from pkg/alpha.dagger.io/europa/dagger/engine/plan.cue rename to pkg/dagger.io/dagger/engine/plan.cue diff --git a/pkg/alpha.dagger.io/europa/dagger/engine/secret.cue b/pkg/dagger.io/dagger/engine/secret.cue similarity index 100% rename from pkg/alpha.dagger.io/europa/dagger/engine/secret.cue rename to pkg/dagger.io/dagger/engine/secret.cue diff --git a/pkg/alpha.dagger.io/europa/dagger/engine/types.cue b/pkg/dagger.io/dagger/engine/types.cue similarity index 100% rename from pkg/alpha.dagger.io/europa/dagger/engine/types.cue rename to pkg/dagger.io/dagger/engine/types.cue diff --git a/pkg/alpha.dagger.io/europa/dagger/plan.cue b/pkg/dagger.io/dagger/plan.cue similarity index 100% rename from pkg/alpha.dagger.io/europa/dagger/plan.cue rename to pkg/dagger.io/dagger/plan.cue diff --git a/pkg/alpha.dagger.io/europa/dagger/types.cue b/pkg/dagger.io/dagger/types.cue similarity index 100% rename from pkg/alpha.dagger.io/europa/dagger/types.cue rename to pkg/dagger.io/dagger/types.cue diff --git a/pkg/alpha.dagger.io/europa/dagger/utils.cue b/pkg/dagger.io/dagger/utils.cue similarity index 100% rename from pkg/alpha.dagger.io/europa/dagger/utils.cue rename to pkg/dagger.io/dagger/utils.cue From 4e04bf9d22da21632b08adc28c5c1eb31c181df2 Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Tue, 11 Jan 2022 16:40:21 -0800 Subject: [PATCH 2/4] update europa dagger import path to dagger.io/dagger Signed-off-by: Andrea Luzzardi --- europa-universe/examples/changelog.com/lowlevel/main.cue | 2 +- pkg/alpha.dagger.io/dagger/dagger.cue | 2 +- pkg/dagger.io/dagger/plan.cue | 2 +- pkg/dagger.io/dagger/types.cue | 2 +- pkg/dagger.io/dagger/utils.cue | 2 +- tests/plan/hello-europa/main.cue | 2 +- tests/plan/inputs/directories/conflicting_values.cue | 2 +- tests/plan/inputs/directories/exists.cue | 2 +- tests/plan/inputs/directories/not_exists.cue | 2 +- tests/plan/inputs/secrets/exec.cue | 2 +- tests/plan/inputs/secrets/exec_relative.cue | 2 +- tests/plan/inputs/secrets/invalid_command.cue | 2 +- tests/plan/outputs/outputs.cue | 2 +- .../platform/config_platform_failure_invalid_platform.cue | 2 +- tests/plan/platform/config_platform_linux_amd64.cue | 2 +- tests/plan/platform/config_platform_linux_arm64.cue | 2 +- tests/plan/proxy/incomplete_service.cue | 2 +- tests/plan/proxy/incomplete_unix.cue | 2 +- tests/plan/proxy/invalid_schema.cue | 2 +- tests/plan/proxy/invalid_value.cue | 2 +- tests/plan/proxy/unix.cue | 2 +- tests/plan/with/actions.cue | 2 +- tests/plan/with/params.cue | 2 +- tests/tasks/build/build_args.cue | 2 +- tests/tasks/build/build_auth.cue | 2 +- tests/tasks/build/dockerfile.cue | 2 +- tests/tasks/build/dockerfile_path.cue | 2 +- tests/tasks/build/image_config.cue | 2 +- tests/tasks/build/inlined_dockerfile.cue | 2 +- tests/tasks/build/labels.cue | 2 +- tests/tasks/build/platform.cue | 2 +- tests/tasks/copy/copy_exec.cue | 2 +- tests/tasks/copy/copy_exec_invalid.cue | 2 +- tests/tasks/copy/copy_file.cue | 2 +- tests/tasks/exec/args.cue | 2 +- tests/tasks/exec/env.cue | 2 +- tests/tasks/exec/hosts.cue | 2 +- tests/tasks/exec/mount_cache.cue | 2 +- tests/tasks/exec/mount_fs.cue | 2 +- tests/tasks/exec/mount_secret.cue | 2 +- tests/tasks/exec/mount_service.cue | 2 +- tests/tasks/exec/mount_tmp.cue | 2 +- tests/tasks/exec/user.cue | 2 +- tests/tasks/exec/workdir.cue | 2 +- tests/tasks/gitpull/bad_ref.cue | 2 +- tests/tasks/gitpull/bad_remote.cue | 2 +- tests/tasks/gitpull/exists.cue | 2 +- tests/tasks/gitpull/git_dir.cue | 2 +- tests/tasks/gitpull/invalid.cue | 2 +- tests/tasks/gitpull/private_repo.cue | 2 +- tests/tasks/httpfetch/exist.cue | 2 +- tests/tasks/httpfetch/not_exist.cue | 2 +- tests/tasks/mkdir/mkdir.cue | 2 +- tests/tasks/mkdir/mkdir_failure_disable_parents.cue | 2 +- tests/tasks/mkdir/mkdir_parents.cue | 2 +- tests/tasks/newsecret/newsecret.cue | 2 +- tests/tasks/pull/pull.cue | 2 +- tests/tasks/pull/pull_auth.cue | 2 +- tests/tasks/push/push.cue | 2 +- tests/tasks/readfile/readfile.cue | 2 +- tests/tasks/scratch/scratch.cue | 2 +- tests/tasks/scratch/scratch_build_scratch.cue | 2 +- tests/tasks/scratch/scratch_writefile.cue | 2 +- tests/tasks/subdir/subdir_invalid_exec.cue | 4 ++-- tests/tasks/subdir/subdir_invalid_path.cue | 4 ++-- tests/tasks/subdir/subdir_simple.cue | 4 ++-- tests/tasks/writefile/writefile.cue | 2 +- tests/tasks/writefile/writefile_failure_diff_contents.cue | 2 +- 68 files changed, 71 insertions(+), 71 deletions(-) diff --git a/europa-universe/examples/changelog.com/lowlevel/main.cue b/europa-universe/examples/changelog.com/lowlevel/main.cue index abf2a9b0..ffb0e9a7 100644 --- a/europa-universe/examples/changelog.com/lowlevel/main.cue +++ b/europa-universe/examples/changelog.com/lowlevel/main.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) runtime_image_ref: string | *"thechangelog/runtime:2021-05-29T10.17.12Z" diff --git a/pkg/alpha.dagger.io/dagger/dagger.cue b/pkg/alpha.dagger.io/dagger/dagger.cue index 25ac9123..bc433c23 100644 --- a/pkg/alpha.dagger.io/dagger/dagger.cue +++ b/pkg/alpha.dagger.io/dagger/dagger.cue @@ -3,7 +3,7 @@ package dagger import ( "alpha.dagger.io/dagger/op" - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) // An artifact such as source code checkout, container image, binary archive... diff --git a/pkg/dagger.io/dagger/plan.cue b/pkg/dagger.io/dagger/plan.cue index c9db332f..7df1478b 100644 --- a/pkg/dagger.io/dagger/plan.cue +++ b/pkg/dagger.io/dagger/plan.cue @@ -1,7 +1,7 @@ package dagger import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) // A deployment plan executed by `dagger up` diff --git a/pkg/dagger.io/dagger/types.cue b/pkg/dagger.io/dagger/types.cue index f1f53df8..975feb30 100644 --- a/pkg/dagger.io/dagger/types.cue +++ b/pkg/dagger.io/dagger/types.cue @@ -1,7 +1,7 @@ package dagger import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) // A reference to a filesystem tree. diff --git a/pkg/dagger.io/dagger/utils.cue b/pkg/dagger.io/dagger/utils.cue index 2f8a9f0a..7b53f2b0 100644 --- a/pkg/dagger.io/dagger/utils.cue +++ b/pkg/dagger.io/dagger/utils.cue @@ -1,7 +1,7 @@ package dagger import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) // Select a subdirectory from a filesystem tree diff --git a/tests/plan/hello-europa/main.cue b/tests/plan/hello-europa/main.cue index 4459013a..1609a66b 100644 --- a/tests/plan/hello-europa/main.cue +++ b/tests/plan/hello-europa/main.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" "alpha.dagger.io/os" ) diff --git a/tests/plan/inputs/directories/conflicting_values.cue b/tests/plan/inputs/directories/conflicting_values.cue index 60422bea..761d4d22 100644 --- a/tests/plan/inputs/directories/conflicting_values.cue +++ b/tests/plan/inputs/directories/conflicting_values.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/plan/inputs/directories/exists.cue b/tests/plan/inputs/directories/exists.cue index 5f43171a..302cb8af 100644 --- a/tests/plan/inputs/directories/exists.cue +++ b/tests/plan/inputs/directories/exists.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/plan/inputs/directories/not_exists.cue b/tests/plan/inputs/directories/not_exists.cue index 5fc01c0d..ab6422d3 100644 --- a/tests/plan/inputs/directories/not_exists.cue +++ b/tests/plan/inputs/directories/not_exists.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/plan/inputs/secrets/exec.cue b/tests/plan/inputs/secrets/exec.cue index b8aa8fd9..e98251b7 100644 --- a/tests/plan/inputs/secrets/exec.cue +++ b/tests/plan/inputs/secrets/exec.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/plan/inputs/secrets/exec_relative.cue b/tests/plan/inputs/secrets/exec_relative.cue index 271419b1..094835eb 100644 --- a/tests/plan/inputs/secrets/exec_relative.cue +++ b/tests/plan/inputs/secrets/exec_relative.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/plan/inputs/secrets/invalid_command.cue b/tests/plan/inputs/secrets/invalid_command.cue index 87a133a0..eeb0a512 100644 --- a/tests/plan/inputs/secrets/invalid_command.cue +++ b/tests/plan/inputs/secrets/invalid_command.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/plan/outputs/outputs.cue b/tests/plan/outputs/outputs.cue index 455b4af8..5a9aa3fa 100644 --- a/tests/plan/outputs/outputs.cue +++ b/tests/plan/outputs/outputs.cue @@ -1,6 +1,6 @@ package main -import "alpha.dagger.io/europa/dagger/engine" +import "dagger.io/dagger/engine" engine.#Plan & { actions: data: engine.#WriteFile & { diff --git a/tests/plan/platform/config_platform_failure_invalid_platform.cue b/tests/plan/platform/config_platform_failure_invalid_platform.cue index 457a3cf6..7dbaa63e 100644 --- a/tests/plan/platform/config_platform_failure_invalid_platform.cue +++ b/tests/plan/platform/config_platform_failure_invalid_platform.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/plan/platform/config_platform_linux_amd64.cue b/tests/plan/platform/config_platform_linux_amd64.cue index e1902bb3..2960890f 100644 --- a/tests/plan/platform/config_platform_linux_amd64.cue +++ b/tests/plan/platform/config_platform_linux_amd64.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/plan/platform/config_platform_linux_arm64.cue b/tests/plan/platform/config_platform_linux_arm64.cue index eb497405..d53cf340 100644 --- a/tests/plan/platform/config_platform_linux_arm64.cue +++ b/tests/plan/platform/config_platform_linux_arm64.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/plan/proxy/incomplete_service.cue b/tests/plan/proxy/incomplete_service.cue index a8432ab9..61470502 100644 --- a/tests/plan/proxy/incomplete_service.cue +++ b/tests/plan/proxy/incomplete_service.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" "alpha.dagger.io/dagger/op" "alpha.dagger.io/alpine" ) diff --git a/tests/plan/proxy/incomplete_unix.cue b/tests/plan/proxy/incomplete_unix.cue index 475368bc..2c6f2ad3 100644 --- a/tests/plan/proxy/incomplete_unix.cue +++ b/tests/plan/proxy/incomplete_unix.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" "alpha.dagger.io/dagger/op" "alpha.dagger.io/alpine" ) diff --git a/tests/plan/proxy/invalid_schema.cue b/tests/plan/proxy/invalid_schema.cue index d7f5b174..7033eb62 100644 --- a/tests/plan/proxy/invalid_schema.cue +++ b/tests/plan/proxy/invalid_schema.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" "alpha.dagger.io/dagger/op" "alpha.dagger.io/alpine" ) diff --git a/tests/plan/proxy/invalid_value.cue b/tests/plan/proxy/invalid_value.cue index 6844fe61..9fb25504 100644 --- a/tests/plan/proxy/invalid_value.cue +++ b/tests/plan/proxy/invalid_value.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" "alpha.dagger.io/dagger/op" "alpha.dagger.io/alpine" ) diff --git a/tests/plan/proxy/unix.cue b/tests/plan/proxy/unix.cue index bc3ae101..3952e6cf 100644 --- a/tests/plan/proxy/unix.cue +++ b/tests/plan/proxy/unix.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" "alpha.dagger.io/dagger/op" "alpha.dagger.io/alpine" ) diff --git a/tests/plan/with/actions.cue b/tests/plan/with/actions.cue index 1d856fdd..cf01b33e 100644 --- a/tests/plan/with/actions.cue +++ b/tests/plan/with/actions.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/plan/with/params.cue b/tests/plan/with/params.cue index 402ac379..7b3d9f8a 100644 --- a/tests/plan/with/params.cue +++ b/tests/plan/with/params.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/build/build_args.cue b/tests/tasks/build/build_args.cue index c4015e9a..952ff96c 100644 --- a/tests/tasks/build/build_args.cue +++ b/tests/tasks/build/build_args.cue @@ -1,7 +1,7 @@ package testing import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/build/build_auth.cue b/tests/tasks/build/build_auth.cue index cb46d0c2..79d2fa05 100644 --- a/tests/tasks/build/build_auth.cue +++ b/tests/tasks/build/build_auth.cue @@ -1,7 +1,7 @@ package testing import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/build/dockerfile.cue b/tests/tasks/build/dockerfile.cue index 6f044846..43d47457 100644 --- a/tests/tasks/build/dockerfile.cue +++ b/tests/tasks/build/dockerfile.cue @@ -1,7 +1,7 @@ package testing import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/build/dockerfile_path.cue b/tests/tasks/build/dockerfile_path.cue index 2a3a6b13..dcd5add4 100644 --- a/tests/tasks/build/dockerfile_path.cue +++ b/tests/tasks/build/dockerfile_path.cue @@ -1,7 +1,7 @@ package testing import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/build/image_config.cue b/tests/tasks/build/image_config.cue index 28c8ebf3..b163d44e 100644 --- a/tests/tasks/build/image_config.cue +++ b/tests/tasks/build/image_config.cue @@ -1,7 +1,7 @@ package testing import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/build/inlined_dockerfile.cue b/tests/tasks/build/inlined_dockerfile.cue index feaae27d..5d3a5370 100644 --- a/tests/tasks/build/inlined_dockerfile.cue +++ b/tests/tasks/build/inlined_dockerfile.cue @@ -1,7 +1,7 @@ package testing import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/build/labels.cue b/tests/tasks/build/labels.cue index 9a578eae..9e74cb57 100644 --- a/tests/tasks/build/labels.cue +++ b/tests/tasks/build/labels.cue @@ -1,7 +1,7 @@ package testing import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/build/platform.cue b/tests/tasks/build/platform.cue index e4a59937..8b28c174 100644 --- a/tests/tasks/build/platform.cue +++ b/tests/tasks/build/platform.cue @@ -1,7 +1,7 @@ package testing import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/copy/copy_exec.cue b/tests/tasks/copy/copy_exec.cue index ed0d8468..18639639 100644 --- a/tests/tasks/copy/copy_exec.cue +++ b/tests/tasks/copy/copy_exec.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/copy/copy_exec_invalid.cue b/tests/tasks/copy/copy_exec_invalid.cue index 1ad17fe3..ef669620 100644 --- a/tests/tasks/copy/copy_exec_invalid.cue +++ b/tests/tasks/copy/copy_exec_invalid.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/copy/copy_file.cue b/tests/tasks/copy/copy_file.cue index b860caa3..ac95ea19 100644 --- a/tests/tasks/copy/copy_file.cue +++ b/tests/tasks/copy/copy_file.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/exec/args.cue b/tests/tasks/exec/args.cue index 398ca6b8..661100b7 100644 --- a/tests/tasks/exec/args.cue +++ b/tests/tasks/exec/args.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/exec/env.cue b/tests/tasks/exec/env.cue index 0684057b..313691f9 100644 --- a/tests/tasks/exec/env.cue +++ b/tests/tasks/exec/env.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/exec/hosts.cue b/tests/tasks/exec/hosts.cue index a5e3dc4f..14c782cc 100644 --- a/tests/tasks/exec/hosts.cue +++ b/tests/tasks/exec/hosts.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/exec/mount_cache.cue b/tests/tasks/exec/mount_cache.cue index 4ed586cb..ec2bcb6d 100644 --- a/tests/tasks/exec/mount_cache.cue +++ b/tests/tasks/exec/mount_cache.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/exec/mount_fs.cue b/tests/tasks/exec/mount_fs.cue index 26896971..79671d27 100644 --- a/tests/tasks/exec/mount_fs.cue +++ b/tests/tasks/exec/mount_fs.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/exec/mount_secret.cue b/tests/tasks/exec/mount_secret.cue index 96d38edb..3d0df74b 100644 --- a/tests/tasks/exec/mount_secret.cue +++ b/tests/tasks/exec/mount_secret.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/exec/mount_service.cue b/tests/tasks/exec/mount_service.cue index a3b03460..2be6922c 100644 --- a/tests/tasks/exec/mount_service.cue +++ b/tests/tasks/exec/mount_service.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/exec/mount_tmp.cue b/tests/tasks/exec/mount_tmp.cue index b3207144..446000dd 100644 --- a/tests/tasks/exec/mount_tmp.cue +++ b/tests/tasks/exec/mount_tmp.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/exec/user.cue b/tests/tasks/exec/user.cue index 55c98ced..83c5b48b 100644 --- a/tests/tasks/exec/user.cue +++ b/tests/tasks/exec/user.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/exec/workdir.cue b/tests/tasks/exec/workdir.cue index 1f005917..7b813c37 100644 --- a/tests/tasks/exec/workdir.cue +++ b/tests/tasks/exec/workdir.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/gitpull/bad_ref.cue b/tests/tasks/gitpull/bad_ref.cue index f49fc236..ff46a770 100644 --- a/tests/tasks/gitpull/bad_ref.cue +++ b/tests/tasks/gitpull/bad_ref.cue @@ -1,6 +1,6 @@ package main -import "alpha.dagger.io/europa/dagger/engine" +import "dagger.io/dagger/engine" engine.#Plan & { actions: badref: engine.#GitPull & { diff --git a/tests/tasks/gitpull/bad_remote.cue b/tests/tasks/gitpull/bad_remote.cue index b926ed97..a2c3f2a3 100644 --- a/tests/tasks/gitpull/bad_remote.cue +++ b/tests/tasks/gitpull/bad_remote.cue @@ -1,6 +1,6 @@ package main -import "alpha.dagger.io/europa/dagger/engine" +import "dagger.io/dagger/engine" engine.#Plan & { actions: badremote: engine.#GitPull & { diff --git a/tests/tasks/gitpull/exists.cue b/tests/tasks/gitpull/exists.cue index ef6a7ded..5ebcd2cb 100644 --- a/tests/tasks/gitpull/exists.cue +++ b/tests/tasks/gitpull/exists.cue @@ -1,6 +1,6 @@ package main -import "alpha.dagger.io/europa/dagger/engine" +import "dagger.io/dagger/engine" engine.#Plan & { actions: gitPull: engine.#GitPull & { diff --git a/tests/tasks/gitpull/git_dir.cue b/tests/tasks/gitpull/git_dir.cue index 3baef549..4272a01a 100644 --- a/tests/tasks/gitpull/git_dir.cue +++ b/tests/tasks/gitpull/git_dir.cue @@ -1,6 +1,6 @@ package testing -import "alpha.dagger.io/europa/dagger/engine" +import "dagger.io/dagger/engine" engine.#Plan & { actions: { diff --git a/tests/tasks/gitpull/invalid.cue b/tests/tasks/gitpull/invalid.cue index 61d83638..fd669f1b 100644 --- a/tests/tasks/gitpull/invalid.cue +++ b/tests/tasks/gitpull/invalid.cue @@ -1,6 +1,6 @@ package main -import "alpha.dagger.io/europa/dagger/engine" +import "dagger.io/dagger/engine" engine.#Plan & { actions: invalid: engine.#GitPull & {} diff --git a/tests/tasks/gitpull/private_repo.cue b/tests/tasks/gitpull/private_repo.cue index d09389e2..028852a2 100644 --- a/tests/tasks/gitpull/private_repo.cue +++ b/tests/tasks/gitpull/private_repo.cue @@ -1,6 +1,6 @@ package main -import "alpha.dagger.io/europa/dagger/engine" +import "dagger.io/dagger/engine" engine.#Plan & { inputs: secrets: token: command: { diff --git a/tests/tasks/httpfetch/exist.cue b/tests/tasks/httpfetch/exist.cue index aa2aaa81..f80a0644 100644 --- a/tests/tasks/httpfetch/exist.cue +++ b/tests/tasks/httpfetch/exist.cue @@ -1,6 +1,6 @@ package main -import "alpha.dagger.io/europa/dagger/engine" +import "dagger.io/dagger/engine" engine.#Plan & { actions: fetch: engine.#HTTPFetch & { diff --git a/tests/tasks/httpfetch/not_exist.cue b/tests/tasks/httpfetch/not_exist.cue index 2ee9097c..52e008e1 100644 --- a/tests/tasks/httpfetch/not_exist.cue +++ b/tests/tasks/httpfetch/not_exist.cue @@ -1,6 +1,6 @@ package main -import "alpha.dagger.io/europa/dagger/engine" +import "dagger.io/dagger/engine" engine.#Plan & { actions: fetch: engine.#HTTPFetch & { diff --git a/tests/tasks/mkdir/mkdir.cue b/tests/tasks/mkdir/mkdir.cue index 926f1791..15c07a51 100644 --- a/tests/tasks/mkdir/mkdir.cue +++ b/tests/tasks/mkdir/mkdir.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/mkdir/mkdir_failure_disable_parents.cue b/tests/tasks/mkdir/mkdir_failure_disable_parents.cue index d353ac54..2be6b131 100644 --- a/tests/tasks/mkdir/mkdir_failure_disable_parents.cue +++ b/tests/tasks/mkdir/mkdir_failure_disable_parents.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/mkdir/mkdir_parents.cue b/tests/tasks/mkdir/mkdir_parents.cue index 4996459a..77dfaf95 100644 --- a/tests/tasks/mkdir/mkdir_parents.cue +++ b/tests/tasks/mkdir/mkdir_parents.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/newsecret/newsecret.cue b/tests/tasks/newsecret/newsecret.cue index 5bebcbb2..357c27bb 100644 --- a/tests/tasks/newsecret/newsecret.cue +++ b/tests/tasks/newsecret/newsecret.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/pull/pull.cue b/tests/tasks/pull/pull.cue index 67ab1aab..d7f2c05a 100644 --- a/tests/tasks/pull/pull.cue +++ b/tests/tasks/pull/pull.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/pull/pull_auth.cue b/tests/tasks/pull/pull_auth.cue index 64b7697b..91b944f5 100644 --- a/tests/tasks/pull/pull_auth.cue +++ b/tests/tasks/pull/pull_auth.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/push/push.cue b/tests/tasks/push/push.cue index 2736ef42..0a43842c 100644 --- a/tests/tasks/push/push.cue +++ b/tests/tasks/push/push.cue @@ -2,7 +2,7 @@ package main import ( "strings" - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/readfile/readfile.cue b/tests/tasks/readfile/readfile.cue index 65603d6d..75562181 100644 --- a/tests/tasks/readfile/readfile.cue +++ b/tests/tasks/readfile/readfile.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/scratch/scratch.cue b/tests/tasks/scratch/scratch.cue index cf69b5c8..bafc7fa0 100644 --- a/tests/tasks/scratch/scratch.cue +++ b/tests/tasks/scratch/scratch.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/scratch/scratch_build_scratch.cue b/tests/tasks/scratch/scratch_build_scratch.cue index fb0473c1..ede7662a 100644 --- a/tests/tasks/scratch/scratch_build_scratch.cue +++ b/tests/tasks/scratch/scratch_build_scratch.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/scratch/scratch_writefile.cue b/tests/tasks/scratch/scratch_writefile.cue index 6ac4c12f..de17f19c 100644 --- a/tests/tasks/scratch/scratch_writefile.cue +++ b/tests/tasks/scratch/scratch_writefile.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/subdir/subdir_invalid_exec.cue b/tests/tasks/subdir/subdir_invalid_exec.cue index fea7241b..84cfc328 100644 --- a/tests/tasks/subdir/subdir_invalid_exec.cue +++ b/tests/tasks/subdir/subdir_invalid_exec.cue @@ -1,8 +1,8 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" - "alpha.dagger.io/europa/dagger" + "dagger.io/dagger/engine" + "dagger.io/dagger" ) engine.#Plan & { diff --git a/tests/tasks/subdir/subdir_invalid_path.cue b/tests/tasks/subdir/subdir_invalid_path.cue index f93df6f9..1edbeb92 100644 --- a/tests/tasks/subdir/subdir_invalid_path.cue +++ b/tests/tasks/subdir/subdir_invalid_path.cue @@ -1,8 +1,8 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" - "alpha.dagger.io/europa/dagger" + "dagger.io/dagger/engine" + "dagger.io/dagger" ) engine.#Plan & { diff --git a/tests/tasks/subdir/subdir_simple.cue b/tests/tasks/subdir/subdir_simple.cue index 3faab7ce..5cbb578f 100644 --- a/tests/tasks/subdir/subdir_simple.cue +++ b/tests/tasks/subdir/subdir_simple.cue @@ -1,8 +1,8 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" - "alpha.dagger.io/europa/dagger" + "dagger.io/dagger/engine" + "dagger.io/dagger" ) engine.#Plan & { diff --git a/tests/tasks/writefile/writefile.cue b/tests/tasks/writefile/writefile.cue index 57894403..3d8fd447 100644 --- a/tests/tasks/writefile/writefile.cue +++ b/tests/tasks/writefile/writefile.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { diff --git a/tests/tasks/writefile/writefile_failure_diff_contents.cue b/tests/tasks/writefile/writefile_failure_diff_contents.cue index c3277755..d1c38172 100644 --- a/tests/tasks/writefile/writefile_failure_diff_contents.cue +++ b/tests/tasks/writefile/writefile_failure_diff_contents.cue @@ -1,7 +1,7 @@ package main import ( - "alpha.dagger.io/europa/dagger/engine" + "dagger.io/dagger/engine" ) engine.#Plan & { From fb16ac8b299e516eaa6c0f0a2d8bc4b88064812d Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Tue, 11 Jan 2022 16:36:23 -0800 Subject: [PATCH 3/4] vendoring: support multiple modules Signed-off-by: Andrea Luzzardi --- pkg/pkg.go | 153 +++++++++++++++++++++++++++++++++++++++++++++-- plan/plan.go | 6 +- state/project.go | 134 +---------------------------------------- state/state.go | 3 +- 4 files changed, 153 insertions(+), 143 deletions(-) diff --git a/pkg/pkg.go b/pkg/pkg.go index 319b28c1..1b7ce4d6 100644 --- a/pkg/pkg.go +++ b/pkg/pkg.go @@ -3,24 +3,112 @@ package pkg import ( "context" "embed" + "errors" "fmt" "io/fs" "os" "path" "path/filepath" + + "github.com/gofrs/flock" + "github.com/rs/zerolog/log" ) var ( // FS contains the filesystem of the stdlib. - //go:embed alpha.dagger.io/**/*.cue alpha.dagger.io/**/*/*.cue alpha.dagger.io/europa/dagger/*.cue alpha.dagger.io/europa/dagger/engine/*.cue + //go:embed alpha.dagger.io/**/*.cue alpha.dagger.io/**/*/*.cue dagger.io/**/*.cue dagger.io/**/*/*.cue FS embed.FS - - AlphaModule = "alpha.dagger.io" - EnginePackage = fmt.Sprintf("%s/europa/dagger/engine", AlphaModule) ) -func Vendor(ctx context.Context, dest string) error { - // Write the current version +var ( + AlphaModule = "alpha.dagger.io" + DaggerModule = "dagger.io" + EnginePackage = fmt.Sprintf("%s/dagger/engine", DaggerModule) + + modules = []string{ + AlphaModule, + DaggerModule, + } + + lockFilePath = "dagger.lock" +) + +func Vendor(ctx context.Context, p string) error { + if p == "" { + p = getCueModParent() + } + + cuePkgDir := path.Join(p, "cue.mod", "pkg") + if err := os.MkdirAll(cuePkgDir, 0755); err != nil { + return err + } + + // Lock this function so no more than 1 process can run it at once. + lockFile := path.Join(cuePkgDir, lockFilePath) + l := flock.New(lockFile) + if err := l.Lock(); err != nil { + return err + } + defer func() { + l.Unlock() + os.Remove(lockFile) + }() + + // ensure cue module is initialized + if err := cueModInit(ctx, p); err != nil { + return err + } + + // generate `.gitignore` + if err := os.WriteFile( + path.Join(cuePkgDir, ".gitignore"), + []byte(fmt.Sprintf("# generated by dagger\n%s\n%s\ndagger.lock\n", AlphaModule, DaggerModule)), + 0600, + ); err != nil { + return err + } + + log.Ctx(ctx).Debug().Str("mod", p).Msg("vendoring packages") + + // Unpack modules in a temporary directory + unpackDir, err := os.MkdirTemp(cuePkgDir, "vendor-*") + if err != nil { + return err + } + defer os.RemoveAll(unpackDir) + + if err := extractModules(unpackDir); err != nil { + return err + } + + for _, module := range modules { + // Semi-atomic swap of the module + // + // The following basically does: + // $ rm -rf cue.mod/pkg/MODULE.old + // $ mv cue.mod/pkg/MODULE cue.mod/pkg/MODULE.old + // $ mv VENDOR/MODULE cue.mod/pkg/MODULE + // $ rm -rf cue.mod/pkg/MODULE.old + + moduleDir := path.Join(cuePkgDir, module) + backupModuleDir := moduleDir + ".old" + if err := os.RemoveAll(backupModuleDir); err != nil && !errors.Is(err, os.ErrNotExist) { + return err + } + if err := os.Rename(moduleDir, backupModuleDir); err != nil && !errors.Is(err, os.ErrNotExist) { + return err + } + defer os.RemoveAll(backupModuleDir) + + if err := os.Rename(path.Join(unpackDir, module), moduleDir); err != nil { + return err + } + } + + return nil +} + +func extractModules(dest string) error { return fs.WalkDir(FS, ".", func(p string, entry fs.DirEntry, err error) error { if err != nil { return err @@ -48,3 +136,56 @@ func Vendor(ctx context.Context, dest string) error { return os.WriteFile(overlayPath, contents, 0600) }) } + +// getCueModParent traverses the directory tree up through ancestors looking for a cue.mod folder +func getCueModParent() string { + cwd, _ := os.Getwd() + parentDir := cwd + + for { + if _, err := os.Stat(path.Join(parentDir, "cue.mod")); !errors.Is(err, os.ErrNotExist) { + break // found it! + } + + parentDir = filepath.Dir(parentDir) + + if parentDir == string(os.PathSeparator) { + // reached the root + parentDir = cwd // reset to working directory + break + } + } + + return parentDir +} + +func cueModInit(ctx context.Context, parentDir string) error { + lg := log.Ctx(ctx) + + modDir := path.Join(parentDir, "cue.mod") + modFile := path.Join(modDir, "module.cue") + if _, err := os.Stat(modFile); err != nil { + if !errors.Is(err, os.ErrNotExist) { + return err + } + + lg.Debug().Str("mod", parentDir).Msg("initializing cue.mod") + + if err := os.WriteFile(modFile, []byte("module: \"\"\n"), 0600); err != nil { + return err + } + } + + if err := os.Mkdir(path.Join(modDir, "usr"), 0755); err != nil { + if !errors.Is(err, os.ErrExist) { + return err + } + } + if err := os.Mkdir(path.Join(modDir, "pkg"), 0755); err != nil { + if !errors.Is(err, os.ErrExist) { + return err + } + } + + return nil +} diff --git a/plan/plan.go b/plan/plan.go index 08346821..ffbed5d8 100644 --- a/plan/plan.go +++ b/plan/plan.go @@ -11,10 +11,10 @@ import ( "github.com/rs/zerolog/log" "go.dagger.io/dagger/compiler" "go.dagger.io/dagger/environment" + "go.dagger.io/dagger/pkg" "go.dagger.io/dagger/plan/task" "go.dagger.io/dagger/plancontext" "go.dagger.io/dagger/solver" - "go.dagger.io/dagger/state" "go.opentelemetry.io/otel" ) @@ -33,8 +33,8 @@ type Config struct { func Load(ctx context.Context, cfg Config) (*Plan, error) { log.Ctx(ctx).Debug().Interface("args", cfg.Args).Msg("loading plan") - // FIXME: universe vendoring - if err := state.VendorUniverse(ctx, ""); err != nil { + // FIXME: vendoring path + if err := pkg.Vendor(ctx, ""); err != nil { return nil, err } diff --git a/state/project.go b/state/project.go index e035d69d..bc530d9e 100644 --- a/state/project.go +++ b/state/project.go @@ -10,7 +10,6 @@ import ( "path/filepath" "strings" - "github.com/gofrs/flock" "github.com/rs/zerolog/log" "go.dagger.io/dagger/keychain" "go.dagger.io/dagger/pkg" @@ -32,7 +31,6 @@ const ( planDir = "plan" manifestFile = "values.yaml" computedFile = "computed.json" - lockFilePath = "dagger.lock" ) type Project struct { @@ -57,7 +55,7 @@ func Init(ctx context.Context, dir string) (*Project, error) { return nil, err } - if err := VendorUniverse(ctx, root); err != nil { + if err := pkg.Vendor(ctx, root); err != nil { return nil, err } @@ -354,133 +352,3 @@ func (w *Project) cleanPackageName(ctx context.Context, pkg string) (string, err return p, nil } - -func cueModInit(ctx context.Context, parentDir string) error { - lg := log.Ctx(ctx) - - modDir := path.Join(parentDir, "cue.mod") - modFile := path.Join(modDir, "module.cue") - if _, err := os.Stat(modFile); err != nil { - if !errors.Is(err, os.ErrNotExist) { - return err - } - - lg.Debug().Str("mod", parentDir).Msg("initializing cue.mod") - - if err := os.WriteFile(modFile, []byte("module: \"\"\n"), 0600); err != nil { - return err - } - } - - if err := os.Mkdir(path.Join(modDir, "usr"), 0755); err != nil { - if !errors.Is(err, os.ErrExist) { - return err - } - } - if err := os.Mkdir(path.Join(modDir, "pkg"), 0755); err != nil { - if !errors.Is(err, os.ErrExist) { - return err - } - } - - return nil -} - -func VendorUniverse(ctx context.Context, p string) error { - if p == "" { - p = getCueModParent() - } - - cueModDir := path.Join(p, "cue.mod") - if err := os.Mkdir(cueModDir, 0755); err != nil { - if !errors.Is(err, os.ErrExist) { - return err - } - } - - if err := os.MkdirAll(cueModDir, 0755); err != nil { - return err - } - - lockFilePath := path.Join(cueModDir, lockFilePath) - fileLock := flock.New(lockFilePath) - if err := fileLock.Lock(); err != nil { - return err - } - - defer func() { - fileLock.Unlock() - os.Remove(lockFilePath) - }() - - // ensure cue module is initialized - if err := cueModInit(ctx, p); err != nil { - return err - } - - // add universe and lock file to `.gitignore` - if err := os.WriteFile( - path.Join(p, "cue.mod", "pkg", ".gitignore"), - []byte(fmt.Sprintf("# generated by dagger\n%s\ndagger.lock\n", pkg.AlphaModule)), - 0600, - ); err != nil { - return err - } - - log.Ctx(ctx).Debug().Str("mod", p).Msg("vendoring universe") - - // Vendor in a temporary directory - tmp, err := os.MkdirTemp(path.Join(p, "cue.mod", "pkg"), "vendor-*") - if err != nil { - return err - } - if err := pkg.Vendor(ctx, tmp); err != nil { - // FIXME(samalba): disabled install remote stdlib temporarily - // if _, err := mod.Install(ctx, p, stdlib.ModuleName, ""); err != nil { - return err - } - - // Semi-atomic swap of the vendor directory - // The following basically does: - // rm -rf cue.mod/pkg/MODULE.old - // mv cue.mod/pkg/MODULE cue.mod/pkg/MODULE.old - // mv VENDOR cue.mod/pkg/MODULE - // rm -rf cue.mod/pkg/MODULE.old - newStdlib := path.Join(p, "cue.mod", "pkg", pkg.AlphaModule) - oldStdlib := newStdlib + ".old" - if err := os.RemoveAll(oldStdlib); err != nil && !errors.Is(err, os.ErrNotExist) { - return err - } - if err := os.Rename(newStdlib, oldStdlib); err != nil && !errors.Is(err, os.ErrNotExist) { - return err - } - defer os.RemoveAll(oldStdlib) - - if err := os.Rename(path.Join(tmp, pkg.AlphaModule), newStdlib); err != nil { - return err - } - - return nil -} - -func getCueModParent() string { - cwd, _ := os.Getwd() - parentDir := cwd - - // traverse the directory tree up through ancestors looking for a cue.mod folder - for { - if _, err := os.Stat(path.Join(parentDir, "cue.mod")); !errors.Is(err, os.ErrNotExist) { - break // found it! - } - - parentDir = filepath.Dir(parentDir) - - if parentDir == string(os.PathSeparator) { - // reached the root - parentDir = cwd // reset to working directory - break - } - } - - return parentDir -} diff --git a/state/state.go b/state/state.go index e68126e0..df68d2bd 100644 --- a/state/state.go +++ b/state/state.go @@ -6,6 +6,7 @@ import ( "cuelang.org/go/cue" "go.dagger.io/dagger/compiler" + "go.dagger.io/dagger/pkg" "go.dagger.io/dagger/plancontext" ) @@ -55,7 +56,7 @@ func (s *State) CompilePlan(ctx context.Context) (*compiler.Value, error) { // 2) For backward compatibility: if the project was `dagger // init`-ed before we added support for vendoring universe, it might not // contain a `cue.mod`. - if err := VendorUniverse(ctx, w); err != nil { + if err := pkg.Vendor(ctx, w); err != nil { return nil, err } From 27059ff74d19bc0da1cec694a048e2710d69e6cb Mon Sep 17 00:00:00 2001 From: Andrea Luzzardi Date: Tue, 11 Jan 2022 16:45:12 -0800 Subject: [PATCH 4/4] docs: update Signed-off-by: Andrea Luzzardi --- docs/reference/README.md | 2 - docs/reference/europa/dagger/README.md | 81 ----- docs/reference/europa/dagger/engine.md | 293 ------------------ docs/reference/europa/dagger/engine/README.md | 165 ---------- .../europa/dagger/engine/spec/README.md | 11 - .../europa/dagger/engine/spec/engine.md | 281 ----------------- 6 files changed, 833 deletions(-) delete mode 100644 docs/reference/europa/dagger/README.md delete mode 100644 docs/reference/europa/dagger/engine.md delete mode 100644 docs/reference/europa/dagger/engine/README.md delete mode 100644 docs/reference/europa/dagger/engine/spec/README.md delete mode 100644 docs/reference/europa/dagger/engine/spec/engine.md diff --git a/docs/reference/README.md b/docs/reference/README.md index 4bc60543..9589c25e 100644 --- a/docs/reference/README.md +++ b/docs/reference/README.md @@ -19,8 +19,6 @@ - [dagger/op](./dagger/op.md) - op: low-level operations for Dagger processing pipelines - [docker](./docker/README.md) - Docker container operations - [docker/compose](./docker/compose.md) - Docker-compose operations -- [europa/dagger](./europa/dagger/README.md) - - -- [europa/dagger/engine](./europa/dagger/engine.md) - - - [gcp](./gcp/README.md) - Google Cloud Platform - [gcp/cloudrun](./gcp/cloudrun.md) - - - [gcp/gcr](./gcp/gcr.md) - Google Container Registry diff --git a/docs/reference/europa/dagger/README.md b/docs/reference/europa/dagger/README.md deleted file mode 100644 index 3fea4de4..00000000 --- a/docs/reference/europa/dagger/README.md +++ /dev/null @@ -1,81 +0,0 @@ ---- -sidebar_label: dagger ---- - -# alpha.dagger.io/europa/dagger - -```cue -import "alpha.dagger.io/europa/dagger" -``` - -## dagger.#DAG - -A special kind of program which `dagger` can execute. - -### dagger.#DAG Inputs - -_No input._ - -### dagger.#DAG Outputs - -_No output._ - -## dagger.#FS - -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. - -### dagger.#FS Inputs - -_No input._ - -### dagger.#FS Outputs - -_No output._ - -## dagger.#Plan - -A deployment plan executed by `dagger up` - -### dagger.#Plan Inputs - -_No input._ - -### dagger.#Plan Outputs - -_No output._ - -## dagger.#Secret - -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. - -### dagger.#Secret Inputs - -_No input._ - -### dagger.#Secret Outputs - -_No output._ - -## dagger.#Service - -A reference to a network service endpoint, for example: - A TCP or UDP port - A unix socket - An HTTPS endpoint - -### dagger.#Service Inputs - -_No input._ - -### dagger.#Service Outputs - -_No output._ - -## dagger.#Subdir - -Select a subdirectory from a filesystem tree - -### dagger.#Subdir Inputs - -_No input._ - -### dagger.#Subdir Outputs - -_No output._ diff --git a/docs/reference/europa/dagger/engine.md b/docs/reference/europa/dagger/engine.md deleted file mode 100644 index b591dd29..00000000 --- a/docs/reference/europa/dagger/engine.md +++ /dev/null @@ -1,293 +0,0 @@ ---- -sidebar_label: engine ---- - -# alpha.dagger.io/europa/dagger/engine - -```cue -import "alpha.dagger.io/europa/dagger/engine" -``` - -## engine.#Build - -Build a container image using buildkit - -### engine.#Build Inputs - -_No input._ - -### engine.#Build Outputs - -_No output._ - -## engine.#CacheDir - -A (best effort) persistent cache dir - -### engine.#CacheDir Inputs - -_No input._ - -### engine.#CacheDir Outputs - -_No output._ - -## engine.#Copy - -Copy files from one FS tree to another - -### engine.#Copy Inputs - -_No input._ - -### engine.#Copy Outputs - -_No output._ - -## engine.#CopyInfo - -### engine.#CopyInfo Inputs - -_No input._ - -### engine.#CopyInfo Outputs - -_No output._ - -## engine.#DAG - -A special kind of program which `dagger` can execute. - -### engine.#DAG Inputs - -_No input._ - -### engine.#DAG Outputs - -_No output._ - -## engine.#Exec - -Execute a command in a container - -### engine.#Exec Inputs - -_No input._ - -### engine.#Exec Outputs - -_No output._ - -## engine.#FS - -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. - -### engine.#FS Inputs - -_No input._ - -### engine.#FS Outputs - -_No output._ - -## engine.#GitPull - -Pull a directory from a git remote Warning: do NOT embed credentials in the remote url as this will expose them in logs. By using username and password Dagger will handle this for you in a secure manner. - -### engine.#GitPull Inputs - -_No input._ - -### engine.#GitPull Outputs - -_No output._ - -## engine.#GitPush - -Push a directory to a git remote - -### engine.#GitPush Inputs - -_No input._ - -### engine.#GitPush Outputs - -_No output._ - -## engine.#HTTPFetch - -Fetch a file over HTTP - -### engine.#HTTPFetch Inputs - -_No input._ - -### engine.#HTTPFetch Outputs - -_No output._ - -## engine.#ImageConfig - -Container image config. See [OCI](https://www.opencontainers.org/). Spec left open on purpose to account for additional fields. [Image Spec](https://github.com/opencontainers/image-spec/blob/main/specs-go/v1/config.go) [Docker Superset](https://github.com/moby/buildkit/blob/master/frontend/dockerfile/dockerfile2llb/image.go) - -### engine.#ImageConfig Inputs - -_No input._ - -### engine.#ImageConfig Outputs - -_No output._ - -## engine.#Merge - -Merge multiple FS trees into one - -### engine.#Merge Inputs - -_No input._ - -### engine.#Merge Outputs - -_No output._ - -## engine.#Mkdir - -Create one or multiple directory in a container - -### engine.#Mkdir Inputs - -_No input._ - -### engine.#Mkdir Outputs - -_No output._ - -## engine.#Mount - -A transient filesystem mount. - -### engine.#Mount Inputs - -_No input._ - -### engine.#Mount Outputs - -_No output._ - -## engine.#NewSecret - -Create a new a secret from a filesystem tree - -### engine.#NewSecret Inputs - -_No input._ - -### engine.#NewSecret Outputs - -_No output._ - -## engine.#Plan - -A deployment plan executed by `dagger up` - -### engine.#Plan Inputs - -_No input._ - -### engine.#Plan Outputs - -_No output._ - -## engine.#Pull - -Download a container image from a remote repository - -### engine.#Pull Inputs - -_No input._ - -### engine.#Pull Outputs - -_No output._ - -## engine.#Push - -Upload a container image to a remote repository - -### engine.#Push Inputs - -_No input._ - -### engine.#Push Outputs - -_No output._ - -## engine.#ReadFile - -### engine.#ReadFile Inputs - -_No input._ - -### engine.#ReadFile Outputs - -_No output._ - -## engine.#Scratch - -Produce an empty directory - -### engine.#Scratch Inputs - -_No input._ - -### engine.#Scratch Outputs - -_No output._ - -## engine.#Secret - -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. - -### engine.#Secret Inputs - -_No input._ - -### engine.#Secret Outputs - -_No output._ - -## engine.#Service - -A reference to a network service endpoint, for example: - A TCP or UDP port - A unix or npipe socket - An HTTPS endpoint - -### engine.#Service Inputs - -_No input._ - -### engine.#Service Outputs - -_No output._ - -## engine.#TempDir - -A temporary directory for command execution - -### engine.#TempDir Inputs - -_No input._ - -### engine.#TempDir Outputs - -_No output._ - -## engine.#WriteFile - -Write a file to a filesystem tree, creating it if needed - -### engine.#WriteFile Inputs - -_No input._ - -### engine.#WriteFile Outputs - -_No output._ diff --git a/docs/reference/europa/dagger/engine/README.md b/docs/reference/europa/dagger/engine/README.md deleted file mode 100644 index ca890581..00000000 --- a/docs/reference/europa/dagger/engine/README.md +++ /dev/null @@ -1,165 +0,0 @@ ---- -sidebar_label: engine ---- - -# alpha.dagger.io/europa/dagger/engine - -```cue -import "alpha.dagger.io/europa/dagger/engine" -``` - -## engine.#CacheDir - -A (best effort) persistent cache dir - -### engine.#CacheDir Inputs - -_No input._ - -### engine.#CacheDir Outputs - -_No output._ - -## engine.#Exec - -Execute a command in a container - -### engine.#Exec Inputs - -_No input._ - -### engine.#Exec Outputs - -_No output._ - -## engine.#FS - -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. - -### engine.#FS Inputs - -_No input._ - -### engine.#FS Outputs - -_No output._ - -## engine.#ImageConfig - -Container image config. See [OCI](https://www.opencontainers.org/). Spec left open on purpose to account for additional fields. [Image Spec](https://github.com/opencontainers/image-spec/blob/main/specs-go/v1/config.go) [Docker Superset](https://github.com/moby/buildkit/blob/master/frontend/dockerfile/dockerfile2llb/image.go) - -### engine.#ImageConfig Inputs - -_No input._ - -### engine.#ImageConfig Outputs - -_No output._ - -## engine.#Mkdir - -Create one or multiple directory in a container - -### engine.#Mkdir Inputs - -_No input._ - -### engine.#Mkdir Outputs - -_No output._ - -## engine.#Mount - -A transient filesystem mount. - -### engine.#Mount Inputs - -_No input._ - -### engine.#Mount Outputs - -_No output._ - -## engine.#Plan - -A deployment plan executed by `dagger up` - -### engine.#Plan Inputs - -_No input._ - -### engine.#Plan Outputs - -_No output._ - -## engine.#Pull - -Download a container image from a remote repository - -### engine.#Pull Inputs - -_No input._ - -### engine.#Pull Outputs - -_No output._ - -## engine.#ReadFile - -Read a file from a filesystem tree - -### engine.#ReadFile Inputs - -_No input._ - -### engine.#ReadFile Outputs - -_No output._ - -## engine.#Secret - -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. - -### engine.#Secret Inputs - -_No input._ - -### engine.#Secret Outputs - -_No output._ - -## engine.#Service - -A reference to a network service endpoint, for example: - A TCP or UDP port - A unix or npipe socket - An HTTPS endpoint - -### engine.#Service Inputs - -_No input._ - -### engine.#Service Outputs - -_No output._ - -## engine.#TempDir - -A temporary directory for command execution - -### engine.#TempDir Inputs - -_No input._ - -### engine.#TempDir Outputs - -_No output._ - -## engine.#WriteFile - -Write a file to a filesystem tree, creating it if needed - -### engine.#WriteFile Inputs - -_No input._ - -### engine.#WriteFile Outputs - -_No output._ diff --git a/docs/reference/europa/dagger/engine/spec/README.md b/docs/reference/europa/dagger/engine/spec/README.md deleted file mode 100644 index 16a956c6..00000000 --- a/docs/reference/europa/dagger/engine/spec/README.md +++ /dev/null @@ -1,11 +0,0 @@ ---- -sidebar_label: spec ---- - -# alpha.dagger.io/europa/dagger/engine/spec - -Placeholder package, to keep docs generating tool happy. - -```cue -import "alpha.dagger.io/europa/dagger/engine/spec" -``` diff --git a/docs/reference/europa/dagger/engine/spec/engine.md b/docs/reference/europa/dagger/engine/spec/engine.md deleted file mode 100644 index 2073079f..00000000 --- a/docs/reference/europa/dagger/engine/spec/engine.md +++ /dev/null @@ -1,281 +0,0 @@ ---- -sidebar_label: engine ---- - -# alpha.dagger.io/europa/dagger/engine/spec/engine - -The Dagger API. - -```cue -import "alpha.dagger.io/europa/dagger/engine/spec/engine" -``` - -## engine.#Build - -Build a container image using buildkit - -### engine.#Build Inputs - -_No input._ - -### engine.#Build Outputs - -_No output._ - -## engine.#CacheDir - -A (best effort) persistent cache dir - -### engine.#CacheDir Inputs - -_No input._ - -### engine.#CacheDir Outputs - -_No output._ - -## engine.#Copy - -### engine.#Copy Inputs - -_No input._ - -### engine.#Copy Outputs - -_No output._ - -## engine.#CopyInfo - -### engine.#CopyInfo Inputs - -_No input._ - -### engine.#CopyInfo Outputs - -_No output._ - -## engine.#DAG - -A special kind of program which `dagger` can execute. - -### engine.#DAG Inputs - -_No input._ - -### engine.#DAG Outputs - -_No output._ - -## engine.#Exec - -Execute a command in a container - -### engine.#Exec Inputs - -_No input._ - -### engine.#Exec Outputs - -_No output._ - -## engine.#FS - -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. - -### engine.#FS Inputs - -_No input._ - -### engine.#FS Outputs - -_No output._ - -## engine.#GitPull - -Pull a directory from a git remote - -### engine.#GitPull Inputs - -_No input._ - -### engine.#GitPull Outputs - -_No output._ - -## engine.#GitPush - -Push a directory to a git remote - -### engine.#GitPush Inputs - -_No input._ - -### engine.#GitPush Outputs - -_No output._ - -## engine.#HTTPFetch - -Fetch a file over HTTP - -### engine.#HTTPFetch Inputs - -_No input._ - -### engine.#HTTPFetch Outputs - -_No output._ - -## engine.#ImageConfig - -Container image config. See [OCI](https://www.opencontainers.org/). Spec left open on purpose to account for additional fields. [Image Spec](https://github.com/opencontainers/image-spec/blob/main/specs-go/v1/config.go) [Docker Superset](https://github.com/moby/buildkit/blob/master/frontend/dockerfile/dockerfile2llb/image.go) - -### engine.#ImageConfig Inputs - -_No input._ - -### engine.#ImageConfig Outputs - -_No output._ - -## engine.#Merge - -### engine.#Merge Inputs - -_No input._ - -### engine.#Merge Outputs - -_No output._ - -## engine.#Mkdir - -Create one or multiple directory in a container Create a directory - -### engine.#Mkdir Inputs - -_No input._ - -### engine.#Mkdir Outputs - -_No output._ - -## engine.#Mount - -A transient filesystem mount. - -### engine.#Mount Inputs - -_No input._ - -### engine.#Mount Outputs - -_No output._ - -## engine.#Plan - -A deployment plan executed by `dagger up` - -### engine.#Plan Inputs - -_No input._ - -### engine.#Plan Outputs - -_No output._ - -## engine.#Pull - -Download a container image from a remote repository - -### engine.#Pull Inputs - -_No input._ - -### engine.#Pull Outputs - -_No output._ - -## engine.#Push - -Upload a container image to a remote repository - -### engine.#Push Inputs - -_No input._ - -### engine.#Push Outputs - -_No output._ - -## engine.#ReadFile - -Read a file from a filesystem tree - -### engine.#ReadFile Inputs - -_No input._ - -### engine.#ReadFile Outputs - -_No output._ - -## engine.#Scratch - -Produce an empty directory - -### engine.#Scratch Inputs - -_No input._ - -### engine.#Scratch Outputs - -_No output._ - -## engine.#Secret - -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. - -### engine.#Secret Inputs - -_No input._ - -### engine.#Secret Outputs - -_No output._ - -## engine.#Service - -A reference to a network service endpoint, for example: - A TCP or UDP port - A unix or npipe socket - An HTTPS endpoint - -### engine.#Service Inputs - -_No input._ - -### engine.#Service Outputs - -_No output._ - -## engine.#TempDir - -A temporary directory for command execution - -### engine.#TempDir Inputs - -_No input._ - -### engine.#TempDir Outputs - -_No output._ - -## engine.#WriteFile - -Write a file to a filesystem tree, creating it if needed - -### engine.#WriteFile Inputs - -_No input._ - -### engine.#WriteFile Outputs - -_No output._