envd 0.3.30__tar.gz → 0.3.32__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Potentially problematic release.
This version of envd might be problematic. Click here for more details.
- envd-0.3.32/.GIT_TAG_INFO +1 -0
- {envd-0.3.30 → envd-0.3.32}/CHANGELOG.md +17 -0
- {envd-0.3.30 → envd-0.3.32}/PKG-INFO +1 -1
- {envd-0.3.30 → envd-0.3.32}/bin/envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/envd.egg-info/PKG-INFO +1 -1
- {envd-0.3.30 → envd-0.3.32}/pkg/app/bootstrap.go +119 -12
- {envd-0.3.30 → envd-0.3.32}/pkg/app/build.go +2 -2
- {envd-0.3.30 → envd-0.3.32}/pkg/app/run.go +1 -1
- {envd-0.3.30 → envd-0.3.32}/pkg/app/up.go +3 -3
- {envd-0.3.30 → envd-0.3.32}/pkg/driver/docker/docker.go +11 -14
- {envd-0.3.30 → envd-0.3.32}/pkg/driver/nerdctl/nerdctl.go +1 -1
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/system.go +12 -7
- envd-0.3.32/pkg/util/buildkitutil/buildkit.go +83 -0
- envd-0.3.32/pkg/util/buildkitutil/buildkit_test.go +127 -0
- envd-0.3.30/.GIT_TAG_INFO +0 -1
- envd-0.3.30/pkg/util/buildkitutil/buildkit.go +0 -48
- envd-0.3.30/pkg/util/buildkitutil/buildkit_test.go +0 -69
- {envd-0.3.30 → envd-0.3.32}/.all-contributorsrc +0 -0
- {envd-0.3.30 → envd-0.3.32}/.editorconfig +0 -0
- {envd-0.3.30 → envd-0.3.32}/.gitignore +0 -0
- {envd-0.3.30 → envd-0.3.32}/.golangci.yml +0 -0
- {envd-0.3.30 → envd-0.3.32}/.goreleaser.yaml +0 -0
- {envd-0.3.30 → envd-0.3.32}/.markdown-lint.json +0 -0
- {envd-0.3.30 → envd-0.3.32}/.pre-commit-config.yaml +0 -0
- {envd-0.3.30 → envd-0.3.32}/.vscode/launch.json +0 -0
- {envd-0.3.30 → envd-0.3.32}/CODEOWNERS +0 -0
- {envd-0.3.30 → envd-0.3.32}/CODE_OF_CONDUCT.md +0 -0
- {envd-0.3.30 → envd-0.3.32}/LICENSE +0 -0
- {envd-0.3.30 → envd-0.3.32}/MANIFEST.in +0 -0
- {envd-0.3.30 → envd-0.3.32}/Makefile +0 -0
- {envd-0.3.30 → envd-0.3.32}/OWNERS +0 -0
- {envd-0.3.30 → envd-0.3.32}/README.md +0 -0
- {envd-0.3.30 → envd-0.3.32}/base-images/.dockerignore +0 -0
- {envd-0.3.30 → envd-0.3.32}/base-images/build.sh +0 -0
- {envd-0.3.30 → envd-0.3.32}/base-images/envd/build.sh +0 -0
- {envd-0.3.30 → envd-0.3.32}/base-images/envd/envd-daemonless.Dockerfile +0 -0
- {envd-0.3.30 → envd-0.3.32}/base-images/envd/envd.Dockerfile +0 -0
- {envd-0.3.30 → envd-0.3.32}/base-images/envd-sshd/envd-sshd.Dockerfile +0 -0
- {envd-0.3.30 → envd-0.3.32}/base-images/envd-starship/envd-starship.Dockerfile +0 -0
- {envd-0.3.30 → envd-0.3.32}/base-images/julia1.8rc1-ubuntu20.04.Dockerfile +0 -0
- {envd-0.3.30 → envd-0.3.32}/base-images/r4.2.Dockerfile +0 -0
- {envd-0.3.30 → envd-0.3.32}/base-images/remote-cache/build-and-push-remote-cache.sh +0 -0
- {envd-0.3.30 → envd-0.3.32}/base-images/remote-cache/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/cmd/envd/main.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/cmd/envd-sshd/main.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/cli/build_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/cli/bytecode_hash_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/cli/context_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/cli/get_env_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/cli/init_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/cli/quick_start_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/cli/suite_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/cli/testdata/build-test/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/cli/testdata/custom-image-test/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/cli/testdata/quick-start/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/cli/testdata/quick-start/demo.py +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/cli/testdata/up-test/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/cli/up_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/docs/docs_gpu_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/docs/docs_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/docs/suite_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/docs/testdata/complex/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/docs/testdata/envdlib/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/docs/testdata/getting_started/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/docs/testdata/jupyter/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/docs/testdata/minimal/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/e2e_helper.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/language/python_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/language/runtime_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/language/suite_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/language/testdata/python/conda/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/language/testdata/python/conda/env.yaml +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/language/testdata/python/conda/setup.py +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/language/testdata/python/conda_channel/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/language/testdata/python/conda_channel/env.yaml +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/language/testdata/python/hybrid/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/language/testdata/python/hybrid/requirements.txt +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/language/testdata/python/packages/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/language/testdata/python/requirements/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/language/testdata/python/requirements/requirements.txt +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/language/testdata/python/requirements/setup.py +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/language/testdata/run/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/language/testdata/runtime/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v0/language/testdata/runtime/demo.py +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/cli/build_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/cli/bytecode_hash_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/cli/context_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/cli/get_env_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/cli/init_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/cli/quick_start_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/cli/suite_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/cli/testdata/build-test/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/cli/testdata/custom-image-test/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/cli/testdata/quick-start/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/cli/testdata/quick-start/demo.py +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/cli/testdata/up-test/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/cli/up_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/docs/docs_gpu_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/docs/docs_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/docs/extra_lang_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/docs/julia_mnist_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/docs/rlang_mnist_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/docs/suite_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/docs/testdata/complex/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/docs/testdata/envdlib/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/docs/testdata/getting_started/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/docs/testdata/julia/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/docs/testdata/julia_mnist/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/docs/testdata/julia_mnist/mnist.jl +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/docs/testdata/jupyter/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/docs/testdata/minimal/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/docs/testdata/rlang/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/docs/testdata/rlang_mnist/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/docs/testdata/rlang_mnist/mnist.r +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/e2e_helper.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/language/python_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/language/runtime_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/language/suite_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/language/testdata/python/conda/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/language/testdata/python/conda/env.yaml +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/language/testdata/python/conda/setup.py +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/language/testdata/python/conda_channel/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/language/testdata/python/conda_channel/env.yaml +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/language/testdata/python/hybrid/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/language/testdata/python/hybrid/requirements.txt +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/language/testdata/python/packages/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/language/testdata/python/requirements/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/language/testdata/python/requirements/requirements.txt +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/language/testdata/python/requirements/setup.py +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/language/testdata/run/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/language/testdata/runtime/build.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/e2e/v1/language/testdata/runtime/demo.py +0 -0
- {envd-0.3.30 → envd-0.3.32}/envd/api/v0/__init__.py +0 -0
- {envd-0.3.30 → envd-0.3.32}/envd/api/v0/config.py +0 -0
- {envd-0.3.30 → envd-0.3.32}/envd/api/v0/install.py +0 -0
- {envd-0.3.30 → envd-0.3.32}/envd/api/v0/io.py +0 -0
- {envd-0.3.30 → envd-0.3.32}/envd/api/v0/runtime.py +0 -0
- {envd-0.3.30 → envd-0.3.32}/envd/api/v1/__init__.py +0 -0
- {envd-0.3.30 → envd-0.3.32}/envd/api/v1/config.py +0 -0
- {envd-0.3.30 → envd-0.3.32}/envd/api/v1/install.py +0 -0
- {envd-0.3.30 → envd-0.3.32}/envd/api/v1/io.py +0 -0
- {envd-0.3.30 → envd-0.3.32}/envd/api/v1/runtime.py +0 -0
- {envd-0.3.30 → envd-0.3.32}/envd/api.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/envd.egg-info/SOURCES.txt +0 -0
- {envd-0.3.30 → envd-0.3.32}/envd.egg-info/dependency_links.txt +0 -0
- {envd-0.3.30 → envd-0.3.32}/envd.egg-info/not-zip-safe +0 -0
- {envd-0.3.30 → envd-0.3.32}/envd.egg-info/top_level.txt +0 -0
- {envd-0.3.30 → envd-0.3.32}/go.mod +0 -0
- {envd-0.3.30 → envd-0.3.32}/go.sum +0 -0
- {envd-0.3.30 → envd-0.3.32}/hack/changelog.sh +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/app.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/build/build.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/completion.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/const.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/context.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/context_create.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/context_ls.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/context_rm.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/context_use.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/debug.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/debug_llb.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/destroy.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/env.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/env_describe.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/env_ls.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/exec.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/formatter/data.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/formatter/json/context.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/formatter/json/env.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/formatter/json/image.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/formatter/json/print.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/formatter/json/version.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/formatter/table/context.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/formatter/table/env.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/formatter/table/image.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/formatter/table/version.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/image.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/image_describe.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/image_prune.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/image_prune_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/image_remove.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/init.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/interactive.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/login.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/pause.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/prune.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/resume.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/telemetry/reporter.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/template/julia.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/template/r.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/top.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/app/version.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/autocomplete/bash.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/autocomplete/fish.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/autocomplete/zsh.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/builder/build.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/builder/build_func.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/builder/builder.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/builder/builder_suite_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/builder/builder_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/builder/dep_check.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/builder/err.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/builder/types.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/builder/util.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/builder/util_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/buildkitd/buildkitd.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/buildkitd/mock/mock.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/buildkitd/print.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/config/config.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/data/datasource.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/data/envd.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/driver/client.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/driver/docker/docker_suite_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/driver/docker/docker_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/driver/docker/label.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/driver/nerdctl/buildkit.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/driver/stats_type.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/editor/vscode/types.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/editor/vscode/util.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/editor/vscode/vscode.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/editor/vscode/vscode_suite_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/editor/vscode/vscode_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/envd/docker.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/envd/engine.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/envd/envdserver.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/envd/factory.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/envd/types.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/flag/consts.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/home/auth.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/home/auth_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/home/cache.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/home/config.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/home/context.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/home/context_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/home/data.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/home/home_suite_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/home/manager.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/home/manager_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/interpreter.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/mock/mock.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v0/builtin/builtin.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v0/config/config.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v0/config/const.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v0/data/const.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v0/data/rule.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v0/data/util.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v0/install/const.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v0/install/install.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v0/interpreter.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v0/interpreter_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v0/io/const.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v0/io/io.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v0/runtime/const.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v0/runtime/runtime.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v0/starlark_suite_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v0/testdata/test.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v0/universe/const.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v0/universe/universe.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v1/builtin/builtin.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v1/config/config.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v1/config/const.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v1/data/const.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v1/data/rule.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v1/data/util.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v1/install/const.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v1/install/install.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v1/interpreter.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v1/interpreter_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v1/io/const.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v1/io/io.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v1/runtime/const.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v1/runtime/runtime.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v1/starlark_suite_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v1/testdata/test.envd +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v1/universe/const.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/frontend/starlark/v1/universe/universe.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/graph.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/types.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/util.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/cache.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/checker.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/compile.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/conda.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/consts.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/custom.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/editor.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/editor_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/fs.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/git.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/install-conda.sh +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/install-mamba.sh +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/interface.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/julia.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/python.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/r.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/shell.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/supervisor.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/system.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/types.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/user.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/util.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v0/util_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/cache.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/checker.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/compile.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/conda.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/consts.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/editor.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/editor_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/fs.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/get_conda.sh +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/git.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/install_conda.sh +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/interface.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/julia.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/julia.sh +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/python.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/r.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/shell.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/supervisor.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/types.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/user.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/util.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/ir/v1/util_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/lang/version/version.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/metrics/collector.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/metrics/docker_collector.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/metrics/helper.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/metrics/model.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/metrics/widget.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/progress/compileui/display.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/progress/compileui/mock/mock.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/progress/compileui/term.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/progress/compileui/term_windows.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/progress/compileui/trace.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/progress/compileui/types.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/progress/mode/mode.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/progress/progressui/display.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/progress/progressui/display_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/progress/progressui/printer.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/progress/progressui/term.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/progress/progressui/term_windows.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/progress/progresswriter/printer.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/progress/progresswriter/writer.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/remote/sshd/os.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/remote/sshd/sshd.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/shell/install.sh +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/shell/zsh.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/shell/zsh_suite_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/shell/zsh_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/shell/zshrc +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/ssh/config/entry.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/ssh/config/key.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/ssh/config/ssh_config.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/ssh/config/ssh_config_suite_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/ssh/config/ssh_config_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/ssh/copy.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/ssh/ssh.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/syncthing/client.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/syncthing/config.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/syncthing/device.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/syncthing/event.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/syncthing/file.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/syncthing/folder.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/syncthing/install.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/syncthing/syncthing.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/syncthing/syncthing_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/syncthing/util.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/types/envd.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/types/label.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/types/types_suite_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/util/envutil/env.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/util/envutil/env_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/util/fileutil/file.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/util/fileutil/file_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/util/fileutil/namegenerator.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/util/netutil/netutil.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/util/netutil/netutil_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/util/osutil/wsl.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/util/runtimeutil/runtimeutil.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/util/starlarkutil/stringslice.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/util/starlarkutil/stringslice_test.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/util/ziputil/unzip.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pkg/version/version.go +0 -0
- {envd-0.3.30 → envd-0.3.32}/pyproject.toml +0 -0
- {envd-0.3.30 → envd-0.3.32}/scripts/envd-daemonless.sh +0 -0
- {envd-0.3.30 → envd-0.3.32}/setup.cfg +0 -0
- {envd-0.3.30 → envd-0.3.32}/setup.py +0 -0
- {envd-0.3.30 → envd-0.3.32}/typos.toml +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
v0.3.32
|
|
@@ -1,5 +1,22 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## v0.3.31 (2023-07-04)
|
|
4
|
+
|
|
5
|
+
* [67ce1d7](https://github.com/tensorchord/envd/commit/67ce1d7cd5c234a59294a4bba02df35fa190bb2b) fix: mount buildkitd toml file (#1686)
|
|
6
|
+
* [cde4632](https://github.com/tensorchord/envd/commit/cde4632b2954b510e72efe2a7373d2c1d37456e9) support using json for registry config (#1680)
|
|
7
|
+
* [b5f9a49](https://github.com/tensorchord/envd/commit/b5f9a49d911ce5ee1e8859968f449835d4147c5f) Fix PATH Order (#1679)
|
|
8
|
+
|
|
9
|
+
### Contributors
|
|
10
|
+
|
|
11
|
+
* Keming
|
|
12
|
+
* Richard Li
|
|
13
|
+
|
|
14
|
+
## v0.3.30 (2023-06-29)
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
### Contributors
|
|
18
|
+
|
|
19
|
+
|
|
3
20
|
## v0.3.29 (2023-06-29)
|
|
4
21
|
|
|
5
22
|
|
|
Binary file
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
package app
|
|
16
16
|
|
|
17
17
|
import (
|
|
18
|
+
"encoding/json"
|
|
18
19
|
"fmt"
|
|
19
20
|
"os"
|
|
20
21
|
"path/filepath"
|
|
@@ -47,12 +48,12 @@ var CommandBootstrap = &cli.Command{
|
|
|
47
48
|
},
|
|
48
49
|
&cli.BoolFlag{
|
|
49
50
|
Name: "with-autocomplete",
|
|
50
|
-
Usage: "Add envd
|
|
51
|
+
Usage: "Add envd auto-completions",
|
|
51
52
|
Value: true,
|
|
52
53
|
},
|
|
53
54
|
&cli.StringFlag{
|
|
54
55
|
Name: "dockerhub-mirror",
|
|
55
|
-
Usage: "
|
|
56
|
+
Usage: "DockerHub mirror to use",
|
|
56
57
|
Aliases: []string{"m"},
|
|
57
58
|
},
|
|
58
59
|
&cli.StringFlag{
|
|
@@ -62,7 +63,7 @@ var CommandBootstrap = &cli.Command{
|
|
|
62
63
|
},
|
|
63
64
|
&cli.StringSliceFlag{
|
|
64
65
|
Name: "ssh-keypair",
|
|
65
|
-
Usage: fmt.Sprintf("Manually specify ssh key pair as `publicKey,privateKey`.
|
|
66
|
+
Usage: fmt.Sprintf("Manually specify ssh key pair as `publicKey,privateKey`. envd will generate a keypair at %s and %s if not specified",
|
|
66
67
|
sshconfig.GetPublicKeyOrPanic(), sshconfig.GetPrivateKeyOrPanic()),
|
|
67
68
|
Aliases: []string{"k"},
|
|
68
69
|
},
|
|
@@ -75,6 +76,11 @@ var CommandBootstrap = &cli.Command{
|
|
|
75
76
|
Name: "registry",
|
|
76
77
|
Usage: "Specify the registry to pull the image from",
|
|
77
78
|
Aliases: []string{"r"},
|
|
79
|
+
Value: "docker.io",
|
|
80
|
+
},
|
|
81
|
+
&cli.StringFlag{
|
|
82
|
+
Name: "registry-config",
|
|
83
|
+
Usage: "Path to a JSON file containing registry configuration. Cannot be used with 'registry' or 'registry-ca-keypair'",
|
|
78
84
|
},
|
|
79
85
|
},
|
|
80
86
|
|
|
@@ -91,6 +97,9 @@ func bootstrap(clicontext *cli.Context) error {
|
|
|
91
97
|
}, {
|
|
92
98
|
"registry CA keypair",
|
|
93
99
|
registryCA,
|
|
100
|
+
}, {
|
|
101
|
+
"registry json config",
|
|
102
|
+
registryJSONConfig,
|
|
94
103
|
}, {
|
|
95
104
|
"autocomplete",
|
|
96
105
|
autocomplete,
|
|
@@ -112,16 +121,25 @@ func bootstrap(clicontext *cli.Context) error {
|
|
|
112
121
|
}
|
|
113
122
|
|
|
114
123
|
func registryCA(clicontext *cli.Context) error {
|
|
124
|
+
configFile := clicontext.String("registry-config")
|
|
115
125
|
ca := clicontext.String("registry-ca-keypair")
|
|
126
|
+
registry := clicontext.String("registry")
|
|
127
|
+
|
|
116
128
|
if len(ca) == 0 {
|
|
117
129
|
return nil
|
|
118
130
|
}
|
|
131
|
+
|
|
132
|
+
// We only need this check in registryCA because it is called before registryJSONConfig
|
|
133
|
+
if len(configFile) > 0 && len(ca) > 0 {
|
|
134
|
+
return errors.New("only one of `registry-config` and `registry-ca-keypair` can be used")
|
|
135
|
+
}
|
|
136
|
+
|
|
119
137
|
mirror := clicontext.String("dockerhub-mirror")
|
|
120
138
|
if len(mirror) == 0 {
|
|
121
139
|
return errors.New("`registry-ca-keypair` should be used with `dockerhub-mirror`")
|
|
122
140
|
}
|
|
123
141
|
|
|
124
|
-
//
|
|
142
|
+
// Parse ca/key/cert
|
|
125
143
|
kvPairs := strings.Split(ca, ",")
|
|
126
144
|
if len(kvPairs) != 3 {
|
|
127
145
|
return errors.New("`registry-ca-keypair` requires ca/key/cert 3 part separated by ','")
|
|
@@ -146,7 +164,8 @@ func registryCA(clicontext *cli.Context) error {
|
|
|
146
164
|
if !exist {
|
|
147
165
|
return errors.Newf("file %s doesn't exist", kv[1])
|
|
148
166
|
}
|
|
149
|
-
|
|
167
|
+
|
|
168
|
+
path, err := fileutil.ConfigFile(fmt.Sprintf("%s_%s.pem", registry, kv[0]))
|
|
150
169
|
if err != nil {
|
|
151
170
|
return errors.Wrap(err, "failed to get the envd config file path")
|
|
152
171
|
}
|
|
@@ -166,6 +185,69 @@ func registryCA(clicontext *cli.Context) error {
|
|
|
166
185
|
return nil
|
|
167
186
|
}
|
|
168
187
|
|
|
188
|
+
func registryJSONConfig(clicontext *cli.Context) error {
|
|
189
|
+
configFile := clicontext.String("registry-config")
|
|
190
|
+
if len(configFile) == 0 {
|
|
191
|
+
return nil
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
// Check if file exists
|
|
195
|
+
exist, err := fileutil.FileExists(configFile)
|
|
196
|
+
if err != nil {
|
|
197
|
+
return errors.Wrap(err, fmt.Sprintf("failed to parse file path %s", configFile))
|
|
198
|
+
}
|
|
199
|
+
if !exist {
|
|
200
|
+
return errors.Newf("file %s doesn't exist", configFile)
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
config := buildkitutil.BuildkitConfig{}
|
|
204
|
+
configJson, err := os.ReadFile(configFile)
|
|
205
|
+
if err != nil {
|
|
206
|
+
return errors.Wrap(err, "Failed to read registry config file")
|
|
207
|
+
}
|
|
208
|
+
if err := json.Unmarshal(configJson, &config); err != nil {
|
|
209
|
+
return errors.Wrap(err, "Failed to parse registry config file")
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
// Check for required keys in each registry
|
|
213
|
+
for i, registry := range config.Registries {
|
|
214
|
+
if registry.Name == "" {
|
|
215
|
+
return errors.Newf("`name` key is required in the config for registry at index %d", i)
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// Check for optional keys and if they exist, ensure they point to existing files
|
|
219
|
+
optionalKeys := map[string]string{"ca": registry.Ca, "cert": registry.Cert, "key": registry.Key}
|
|
220
|
+
for key, value := range optionalKeys {
|
|
221
|
+
if value != "" {
|
|
222
|
+
exist, err := fileutil.FileExists(value)
|
|
223
|
+
if err != nil {
|
|
224
|
+
return errors.Wrap(err, fmt.Sprintf("failed to parse file path %s", value))
|
|
225
|
+
}
|
|
226
|
+
if !exist {
|
|
227
|
+
return errors.Newf("file %s doesn't exist", value)
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
// Read the file
|
|
231
|
+
content, err := os.ReadFile(value)
|
|
232
|
+
if err != nil {
|
|
233
|
+
return errors.Wrap(err, fmt.Sprintf("failed to read the %s file for registry %s", key, registry.Name))
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
// Write the content to the envd config directory
|
|
237
|
+
envdConfigPath, err := fileutil.ConfigFile(fmt.Sprintf("%s_%s.pem", registry.Name, key))
|
|
238
|
+
if err != nil {
|
|
239
|
+
return errors.Wrap(err, fmt.Sprintf("failed to get the envd config file path for %s of registry %s", key, registry.Name))
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
if err = os.WriteFile(envdConfigPath, content, 0644); err != nil {
|
|
243
|
+
return errors.Wrap(err, fmt.Sprintf("failed to store the %s file for registry %s", key, registry.Name))
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
return nil
|
|
249
|
+
}
|
|
250
|
+
|
|
169
251
|
func sshKey(clicontext *cli.Context) error {
|
|
170
252
|
sshKeyPair := clicontext.StringSlice("ssh-keypair")
|
|
171
253
|
|
|
@@ -240,7 +322,7 @@ func sshKey(clicontext *cli.Context) error {
|
|
|
240
322
|
return nil
|
|
241
323
|
|
|
242
324
|
default:
|
|
243
|
-
return errors.
|
|
325
|
+
return errors.Newf("Invalid ssh-keypair flag")
|
|
244
326
|
}
|
|
245
327
|
}
|
|
246
328
|
|
|
@@ -289,14 +371,39 @@ func buildkit(clicontext *cli.Context) error {
|
|
|
289
371
|
}
|
|
290
372
|
|
|
291
373
|
logrus.Debug("bootstrap the buildkitd container")
|
|
292
|
-
|
|
293
|
-
config := buildkitutil.BuildkitConfig{
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
374
|
+
// Populate the BuildkitConfig struct
|
|
375
|
+
config := buildkitutil.BuildkitConfig{}
|
|
376
|
+
|
|
377
|
+
configFile := clicontext.String("registry-config")
|
|
378
|
+
if len(configFile) != 0 {
|
|
379
|
+
configJson, err := os.ReadFile(configFile)
|
|
380
|
+
if err != nil {
|
|
381
|
+
return errors.Wrap(err, "Failed to read registry config file")
|
|
382
|
+
}
|
|
383
|
+
if err := json.Unmarshal(configJson, &config); err != nil {
|
|
384
|
+
return errors.Wrap(err, "Failed to parse registry config file")
|
|
385
|
+
}
|
|
386
|
+
} else if len(clicontext.String("registry-ca-keypair")) != 0 {
|
|
387
|
+
// The values of Ca, Cert, and Key don't actually matter since we already copied their contents to the envd config directory and mounted to `/etc/registry`.
|
|
388
|
+
// So instead of parsing registry-ca-keypair again, we'll just put the default value.
|
|
389
|
+
// This is to ensure that buildkitConfigTemplate parses properly.
|
|
390
|
+
config.Registries = append(config.Registries, buildkitutil.Registry{
|
|
391
|
+
Name: clicontext.String("registry"),
|
|
392
|
+
Ca: "/etc/registry",
|
|
393
|
+
Cert: "/etc/registry",
|
|
394
|
+
Key: "/etc/registry",
|
|
395
|
+
UseHTTP: clicontext.Bool("use-http"),
|
|
396
|
+
Mirror: clicontext.String("dockerhub-mirror"),
|
|
397
|
+
})
|
|
398
|
+
} else if len(clicontext.String("dockerhub-mirror")) != 0 {
|
|
399
|
+
config.Registries = append(config.Registries, buildkitutil.Registry{
|
|
400
|
+
Name: clicontext.String("registry"),
|
|
401
|
+
UseHTTP: clicontext.Bool("use-http"),
|
|
402
|
+
Mirror: clicontext.String("dockerhub-mirror"),
|
|
403
|
+
})
|
|
298
404
|
}
|
|
299
405
|
|
|
406
|
+
var bkClient buildkitd.Client
|
|
300
407
|
if c.Builder == types.BuilderTypeMoby {
|
|
301
408
|
bkClient, err = buildkitd.NewMobyClient(clicontext.Context,
|
|
302
409
|
c.Builder, c.BuilderAddress, &config)
|
|
@@ -83,12 +83,12 @@ To build and push the image to a registry:
|
|
|
83
83
|
// https://github.com/urfave/cli/issues/1134#issuecomment-1191407527
|
|
84
84
|
&cli.StringFlag{
|
|
85
85
|
Name: "export-cache",
|
|
86
|
-
Usage: "Export the cache (e.g. type=registry,ref=<image
|
|
86
|
+
Usage: "Export the cache (e.g. `type=registry,ref=<image>`)",
|
|
87
87
|
Aliases: []string{"ec"},
|
|
88
88
|
},
|
|
89
89
|
&cli.StringFlag{
|
|
90
90
|
Name: "import-cache",
|
|
91
|
-
Usage: "Import the cache (e.g. type=registry,ref=<image
|
|
91
|
+
Usage: "Import the cache (e.g. `type=registry,ref=<image>`)",
|
|
92
92
|
Aliases: []string{"ic"},
|
|
93
93
|
},
|
|
94
94
|
&cli.StringFlag{
|
|
@@ -80,7 +80,7 @@ var CommandCreate = &cli.Command{
|
|
|
80
80
|
},
|
|
81
81
|
&cli.StringFlag{
|
|
82
82
|
Name: "host",
|
|
83
|
-
Usage: "Assign the host address for environment
|
|
83
|
+
Usage: "Assign the host address for the environment SSH access server listening",
|
|
84
84
|
Value: envd.Localhost,
|
|
85
85
|
},
|
|
86
86
|
&cli.IntFlag{
|
|
@@ -128,18 +128,18 @@ var CommandUp = &cli.Command{
|
|
|
128
128
|
},
|
|
129
129
|
&cli.StringFlag{
|
|
130
130
|
Name: "host",
|
|
131
|
-
Usage: "Assign the host address for environment
|
|
131
|
+
Usage: "Assign the host address for the environment SSH access server listening",
|
|
132
132
|
Value: envd.Localhost,
|
|
133
133
|
},
|
|
134
134
|
// https://github.com/urfave/cli/issues/1134#issuecomment-1191407527
|
|
135
135
|
&cli.StringFlag{
|
|
136
136
|
Name: "export-cache",
|
|
137
|
-
Usage: "Export the cache (e.g. type=registry,ref=<image
|
|
137
|
+
Usage: "Export the cache (e.g. `type=registry,ref=<image>`)",
|
|
138
138
|
Aliases: []string{"ec"},
|
|
139
139
|
},
|
|
140
140
|
&cli.StringFlag{
|
|
141
141
|
Name: "import-cache",
|
|
142
|
-
Usage: "Import the cache (e.g. type=registry,ref=<image
|
|
142
|
+
Usage: "Import the cache (e.g. `type=registry,ref=<image>`)",
|
|
143
143
|
Aliases: []string{"ic"},
|
|
144
144
|
},
|
|
145
145
|
&cli.StringFlag{
|
|
@@ -17,9 +17,9 @@ package docker
|
|
|
17
17
|
import (
|
|
18
18
|
"context"
|
|
19
19
|
"encoding/json"
|
|
20
|
-
"fmt"
|
|
21
20
|
"io"
|
|
22
21
|
"os"
|
|
22
|
+
"path/filepath"
|
|
23
23
|
"regexp"
|
|
24
24
|
"strconv"
|
|
25
25
|
"strings"
|
|
@@ -40,7 +40,7 @@ import (
|
|
|
40
40
|
"github.com/tensorchord/envd/pkg/util/fileutil"
|
|
41
41
|
)
|
|
42
42
|
|
|
43
|
-
const
|
|
43
|
+
const buildkitdConfigPath = "/etc/registry"
|
|
44
44
|
|
|
45
45
|
var (
|
|
46
46
|
anchoredIdentifierRegexp = regexp.MustCompile(`^([a-f0-9]{64})$`)
|
|
@@ -205,25 +205,22 @@ func (c dockerClient) StartBuildkitd(ctx context.Context, tag, name string, bc *
|
|
|
205
205
|
hostConfig := &container.HostConfig{
|
|
206
206
|
Privileged: true,
|
|
207
207
|
AutoRemove: true,
|
|
208
|
+
Mounts: []mount.Mount{
|
|
209
|
+
{
|
|
210
|
+
Type: mount.TypeBind,
|
|
211
|
+
Source: fileutil.DefaultConfigDir,
|
|
212
|
+
Target: buildkitdConfigPath,
|
|
213
|
+
},
|
|
214
|
+
},
|
|
208
215
|
}
|
|
209
216
|
|
|
210
|
-
|
|
211
|
-
hostConfig.Mounts = append(hostConfig.Mounts, mount.Mount{
|
|
212
|
-
Type: mount.TypeBind,
|
|
213
|
-
Source: fileutil.DefaultConfigDir,
|
|
214
|
-
Target: buildkitdCertPath,
|
|
215
|
-
})
|
|
216
|
-
}
|
|
217
|
-
cfg, err := bc.String()
|
|
217
|
+
err := bc.Save()
|
|
218
218
|
if err != nil {
|
|
219
219
|
return "", errors.Wrap(err, "failed to generate buildkit config")
|
|
220
220
|
}
|
|
221
221
|
config.Entrypoint = []string{
|
|
222
|
-
"
|
|
223
|
-
"-c",
|
|
224
|
-
fmt.Sprintf("mkdir /etc/buildkit && echo '%s' > /etc/buildkit/buildkitd.toml && buildkitd", cfg),
|
|
222
|
+
"buildkitd", "--config", filepath.Join(buildkitdConfigPath, "buildkitd.toml"),
|
|
225
223
|
}
|
|
226
|
-
logger.Debugf("setting buildkit config: %s", cfg)
|
|
227
224
|
created, _ := c.Exists(ctx, name)
|
|
228
225
|
if created {
|
|
229
226
|
err := c.ContainerStart(ctx, name, types.ContainerStartOptions{})
|
|
@@ -83,7 +83,7 @@ func (nc *nerdctlClient) StartBuildkitd(ctx context.Context, tag, name string, b
|
|
|
83
83
|
if !existed {
|
|
84
84
|
buildkitdCmd := "buildkitd"
|
|
85
85
|
// TODO: support mirror CA keypair
|
|
86
|
-
if bc.
|
|
86
|
+
if len(bc.Registries) > 0 {
|
|
87
87
|
cfg, err := bc.String()
|
|
88
88
|
if err != nil {
|
|
89
89
|
return "", errors.Wrap(err, "failed to generate buildkit config")
|
|
@@ -353,15 +353,20 @@ func (g *generalGraph) compileBaseImage() (llb.State, error) {
|
|
|
353
353
|
// 1. configured paths in the Starlark frontend `runtime.environ(extra_path=[...])`
|
|
354
354
|
// 2. paths in the base image
|
|
355
355
|
// 3. others added during the image building (Python paths, etc.)
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
}
|
|
356
|
+
|
|
357
|
+
// iterate over the original paths and add them to the map
|
|
358
|
+
pathMap := make(map[string]bool)
|
|
360
359
|
for _, path := range g.RuntimeEnvPaths {
|
|
361
|
-
|
|
360
|
+
pathMap[path] = true
|
|
362
361
|
}
|
|
363
|
-
|
|
364
|
-
|
|
362
|
+
// split the PATH into different paths
|
|
363
|
+
newPaths := strings.Split(kv[1], ":")
|
|
364
|
+
// iterate over the new paths
|
|
365
|
+
for _, path := range newPaths {
|
|
366
|
+
// check if the path is already in the map
|
|
367
|
+
if _, ok := pathMap[path]; !ok {
|
|
368
|
+
// if not, add the path to the map and slice
|
|
369
|
+
pathMap[path] = true
|
|
365
370
|
g.RuntimeEnvPaths = append(g.RuntimeEnvPaths, path)
|
|
366
371
|
}
|
|
367
372
|
}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
// Copyright 2023 The envd Authors
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
package buildkitutil
|
|
16
|
+
|
|
17
|
+
import (
|
|
18
|
+
"os"
|
|
19
|
+
"strings"
|
|
20
|
+
"text/template"
|
|
21
|
+
|
|
22
|
+
"github.com/cockroachdb/errors"
|
|
23
|
+
|
|
24
|
+
"github.com/tensorchord/envd/pkg/util/fileutil"
|
|
25
|
+
)
|
|
26
|
+
|
|
27
|
+
const buildkitConfigTemplate = `
|
|
28
|
+
[registry]
|
|
29
|
+
{{- range $registry := .Registries }}
|
|
30
|
+
[registry."{{ if $registry.Name }}{{ $registry.Name }}{{ else }}docker.io{{ end }}"]
|
|
31
|
+
{{- if $registry.UseHTTP }}
|
|
32
|
+
http = true
|
|
33
|
+
{{- end }}
|
|
34
|
+
{{- if $registry.Mirror }}
|
|
35
|
+
mirrors = ["{{ $registry.Mirror }}"]
|
|
36
|
+
{{- end }}
|
|
37
|
+
{{- if $registry.Ca }}
|
|
38
|
+
ca=["/etc/registry/{{ $registry.Name }}_ca.pem"]
|
|
39
|
+
{{- end }}
|
|
40
|
+
{{- if and $registry.Cert $registry.Key }}
|
|
41
|
+
[[registry."{{ if $registry.Name }}{{ $registry.Name }}{{ else }}docker.io{{ end }}".keypair]]
|
|
42
|
+
key="/etc/registry/{{ $registry.Name }}_key.pem"
|
|
43
|
+
cert="/etc/registry/{{ $registry.Name }}_cert.pem"
|
|
44
|
+
{{- end }}
|
|
45
|
+
{{- end }}
|
|
46
|
+
`
|
|
47
|
+
|
|
48
|
+
type Registry struct {
|
|
49
|
+
Name string `json:"name"`
|
|
50
|
+
Ca string `json:"ca"`
|
|
51
|
+
Cert string `json:"cert"`
|
|
52
|
+
Key string `json:"key"`
|
|
53
|
+
UseHTTP bool `json:"use_http"`
|
|
54
|
+
Mirror string `json:"mirror"`
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
type BuildkitConfig struct {
|
|
58
|
+
Registries []Registry `json:"registries"`
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
func (c *BuildkitConfig) String() (string, error) {
|
|
62
|
+
tmpl, err := template.New("buildkitConfig").Parse(buildkitConfigTemplate)
|
|
63
|
+
if err != nil {
|
|
64
|
+
return "", err
|
|
65
|
+
}
|
|
66
|
+
var config strings.Builder
|
|
67
|
+
err = tmpl.Execute(&config, c)
|
|
68
|
+
return config.String(), err
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
func (c *BuildkitConfig) Save() error {
|
|
72
|
+
text, err := c.String()
|
|
73
|
+
if err != nil {
|
|
74
|
+
return err
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
path, err := fileutil.ConfigFile("buildkitd.toml")
|
|
78
|
+
if err != nil {
|
|
79
|
+
return errors.Wrap(err, "failed to get the buildkitd config file")
|
|
80
|
+
}
|
|
81
|
+
err = os.WriteFile(path, []byte(text), 0644)
|
|
82
|
+
return err
|
|
83
|
+
}
|
|
@@ -0,0 +1,127 @@
|
|
|
1
|
+
// Copyright 2023 The envd Authors
|
|
2
|
+
//
|
|
3
|
+
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
+
// you may not use this file except in compliance with the License.
|
|
5
|
+
// You may obtain a copy of the License at
|
|
6
|
+
//
|
|
7
|
+
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
+
//
|
|
9
|
+
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
+
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
+
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
+
// See the License for the specific language governing permissions and
|
|
13
|
+
// limitations under the License.
|
|
14
|
+
|
|
15
|
+
package buildkitutil
|
|
16
|
+
|
|
17
|
+
import (
|
|
18
|
+
"strings"
|
|
19
|
+
"testing"
|
|
20
|
+
|
|
21
|
+
"github.com/stretchr/testify/assert"
|
|
22
|
+
)
|
|
23
|
+
|
|
24
|
+
func TestBuildkitWithRegistry(t *testing.T) {
|
|
25
|
+
testCases := []struct {
|
|
26
|
+
bc BuildkitConfig
|
|
27
|
+
expected string
|
|
28
|
+
}{
|
|
29
|
+
{
|
|
30
|
+
BuildkitConfig{
|
|
31
|
+
Registries: []Registry{
|
|
32
|
+
{
|
|
33
|
+
Name: "registry.example.com",
|
|
34
|
+
Ca: "/etc/registry/ca.pem",
|
|
35
|
+
Cert: "/etc/registry/cert.pem",
|
|
36
|
+
Key: "/etc/registry/key.pem",
|
|
37
|
+
UseHTTP: false,
|
|
38
|
+
Mirror: "https://mirror.example.com",
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
`
|
|
43
|
+
[registry]
|
|
44
|
+
[registry."registry.example.com"]
|
|
45
|
+
mirrors = ["https://mirror.example.com"]
|
|
46
|
+
ca=["/etc/registry/registry.example.com_ca.pem"]
|
|
47
|
+
[[registry."registry.example.com".keypair]]
|
|
48
|
+
key="/etc/registry/registry.example.com_key.pem"
|
|
49
|
+
cert="/etc/registry/registry.example.com_cert.pem"
|
|
50
|
+
`,
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
BuildkitConfig{
|
|
54
|
+
Registries: []Registry{
|
|
55
|
+
{
|
|
56
|
+
Name: "registry.example.com",
|
|
57
|
+
UseHTTP: true,
|
|
58
|
+
Mirror: "https://mirror.example.com",
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
Name: "docker.io",
|
|
62
|
+
Mirror: "https://mirror.example.com",
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
`
|
|
67
|
+
[registry]
|
|
68
|
+
[registry."registry.example.com"]
|
|
69
|
+
http = true
|
|
70
|
+
mirrors = ["https://mirror.example.com"]
|
|
71
|
+
[registry."docker.io"]
|
|
72
|
+
mirrors = ["https://mirror.example.com"]
|
|
73
|
+
`,
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
BuildkitConfig{
|
|
77
|
+
Registries: []Registry{},
|
|
78
|
+
},
|
|
79
|
+
`
|
|
80
|
+
[registry]
|
|
81
|
+
`,
|
|
82
|
+
},
|
|
83
|
+
{
|
|
84
|
+
BuildkitConfig{
|
|
85
|
+
Registries: []Registry{
|
|
86
|
+
{
|
|
87
|
+
Name: "registry1.example.com",
|
|
88
|
+
Ca: "/etc/registry/ca1.pem",
|
|
89
|
+
Cert: "/etc/registry/cert1.pem",
|
|
90
|
+
Key: "/etc/registry/key1.pem",
|
|
91
|
+
UseHTTP: true,
|
|
92
|
+
Mirror: "https://mirror.example.com",
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
Name: "registry2.example.com",
|
|
96
|
+
Ca: "/etc/registry/ca2.pem",
|
|
97
|
+
Cert: "/etc/registry/cert2.pem",
|
|
98
|
+
Key: "/etc/registry/key2.pem",
|
|
99
|
+
Mirror: "https://mirror.example.com",
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
},
|
|
103
|
+
`
|
|
104
|
+
[registry]
|
|
105
|
+
[registry."registry1.example.com"]
|
|
106
|
+
http = true
|
|
107
|
+
mirrors = ["https://mirror.example.com"]
|
|
108
|
+
ca=["/etc/registry/registry1.example.com_ca.pem"]
|
|
109
|
+
[[registry."registry1.example.com".keypair]]
|
|
110
|
+
key="/etc/registry/registry1.example.com_key.pem"
|
|
111
|
+
cert="/etc/registry/registry1.example.com_cert.pem"
|
|
112
|
+
[registry."registry2.example.com"]
|
|
113
|
+
mirrors = ["https://mirror.example.com"]
|
|
114
|
+
ca=["/etc/registry/registry2.example.com_ca.pem"]
|
|
115
|
+
[[registry."registry2.example.com".keypair]]
|
|
116
|
+
key="/etc/registry/registry2.example.com_key.pem"
|
|
117
|
+
cert="/etc/registry/registry2.example.com_cert.pem"
|
|
118
|
+
`,
|
|
119
|
+
},
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
for _, tc := range testCases {
|
|
123
|
+
config, err := tc.bc.String()
|
|
124
|
+
assert.NoError(t, err)
|
|
125
|
+
assert.Equal(t, strings.TrimSpace(tc.expected), strings.TrimSpace(config))
|
|
126
|
+
}
|
|
127
|
+
}
|
envd-0.3.30/.GIT_TAG_INFO
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
v0.3.30
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
// Copyright 2023 The envd Authors
|
|
2
|
-
//
|
|
3
|
-
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
4
|
-
// you may not use this file except in compliance with the License.
|
|
5
|
-
// You may obtain a copy of the License at
|
|
6
|
-
//
|
|
7
|
-
// http://www.apache.org/licenses/LICENSE-2.0
|
|
8
|
-
//
|
|
9
|
-
// Unless required by applicable law or agreed to in writing, software
|
|
10
|
-
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
11
|
-
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
12
|
-
// See the License for the specific language governing permissions and
|
|
13
|
-
// limitations under the License.
|
|
14
|
-
|
|
15
|
-
package buildkitutil
|
|
16
|
-
|
|
17
|
-
import (
|
|
18
|
-
"strings"
|
|
19
|
-
"text/template"
|
|
20
|
-
)
|
|
21
|
-
|
|
22
|
-
const buildkitConfigTemplate = `
|
|
23
|
-
[registry."{{ if .Registry }}{{ .Registry }}{{ else }}docker.io{{ end }}"]{{ if .Mirror }}
|
|
24
|
-
mirrors = ["{{ .Mirror }}"]{{ end }}
|
|
25
|
-
http = {{ .UseHTTP }}
|
|
26
|
-
{{ if .SetCA}}ca=["/etc/registry/ca.pem"]
|
|
27
|
-
[[registry."{{ if .Registry }}{{ .Registry }}{{ else }}docker.io{{ end }}".keypair]]
|
|
28
|
-
key="/etc/registry/key.pem"
|
|
29
|
-
cert="/etc/registry/cert.pem"
|
|
30
|
-
{{ end }}
|
|
31
|
-
`
|
|
32
|
-
|
|
33
|
-
type BuildkitConfig struct {
|
|
34
|
-
Registry string
|
|
35
|
-
Mirror string
|
|
36
|
-
UseHTTP bool
|
|
37
|
-
SetCA bool
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
func (c *BuildkitConfig) String() (string, error) {
|
|
41
|
-
tmpl, err := template.New("buildkitConfig").Parse(buildkitConfigTemplate)
|
|
42
|
-
if err != nil {
|
|
43
|
-
return "", err
|
|
44
|
-
}
|
|
45
|
-
var config strings.Builder
|
|
46
|
-
err = tmpl.Execute(&config, c)
|
|
47
|
-
return config.String(), err
|
|
48
|
-
}
|