From f9d7c15e7cb65ed20db729050a800ffd59bd67c6 Mon Sep 17 00:00:00 2001 From: Flaki Date: Tue, 20 Sep 2022 18:19:52 +0300 Subject: [PATCH 01/11] refactor: runnable-templates, fix create project --- project/context.go | 20 ++++++++++---------- subo/command/create_project.go | 16 ++++++++-------- subo/command/dev.go | 2 +- subo/release/version.go | 4 ++-- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/project/context.go b/project/context.go index ae4e61d1..66798474 100644 --- a/project/context.go +++ b/project/context.go @@ -30,16 +30,16 @@ var validLangs = map[string]struct{}{ // Context describes the context under which the tool is being run. type Context struct { - Cwd string - CwdIsRunnable bool - Modules []ModuleDir - Bundle BundleRef - TenantConfig *tenant.Config - DeltavVersion string - Langs []string - MountPath string - RelDockerPath string - BuilderTag string + Cwd string + CwdIsRunnable bool + Modules []ModuleDir + Bundle BundleRef + TenantConfig *tenant.Config + RuntimeVersion string + Langs []string + MountPath string + RelDockerPath string + BuilderTag string } // ModuleDir represents a directory containing a Runnable. diff --git a/subo/command/create_project.go b/subo/command/create_project.go index b7e6a875..aad55bec 100644 --- a/subo/command/create_project.go +++ b/subo/command/create_project.go @@ -19,10 +19,10 @@ const ( ) type projectData struct { - Name string - Environment string - APIVersion string - DeltavVersion string + Name string + Environment string + APIVersion string + RuntimeVersion string } // CreateProjectCmd returns the build command. @@ -68,10 +68,10 @@ func CreateProjectCmd() *cobra.Command { } data := projectData{ - Name: name, - Environment: environment, - APIVersion: release.FFIVersion, - DeltavVersion: release.DeltavVersion, + Name: name, + Environment: environment, + APIVersion: release.FFIVersion, + RuntimeVersion: release.RuntimeVersion, } if err := template.ExecTmplDir(bctx.Cwd, name, templatesPath, "project", data); err != nil { diff --git a/subo/command/dev.go b/subo/command/dev.go index 246db754..99aa42e8 100644 --- a/subo/command/dev.go +++ b/subo/command/dev.go @@ -43,7 +43,7 @@ func DevCmd() *cobra.Command { util.LogInfo("Running DeltaV with debug logging") } - dockerCmd := fmt.Sprintf("docker run -v=%s:/home/atmo -e=DELTAV_HTTP_PORT=%s %s -p=%s:%s suborbital/deltav:%s deltav start", bctx.Cwd, port, envvar, port, port, release.DeltavVersion) + dockerCmd := fmt.Sprintf("docker run -v=%s:/home/atmo -e=DELTAV_HTTP_PORT=%s %s -p=%s:%s suborbital/deltav:%s deltav start", bctx.Cwd, port, envvar, port, port, release.RuntimeVersion) _, err = util.Command.Run(dockerCmd) if err != nil { diff --git a/subo/release/version.go b/subo/release/version.go index dafdc99f..f40a2569 100644 --- a/subo/release/version.go +++ b/subo/release/version.go @@ -7,8 +7,8 @@ var SuboDotVersion = "0.5.4" // FFIVersion is the FFI version used by this version of subo. var FFIVersion = "0.15.1" -// DeltavVersion is the default version of Deltav that will be used for new projects. -var DeltavVersion = "0.4.7" +// RuntimeVersion is the default version of Deltav that will be used for new projects. +var RuntimeVersion = "0.4.7" // SCCTag is the docker tag used for creating new compute core deployments. var SCCTag = "v0.3.1" From 260c33a183633da95c3d73c52c0da7fb9f3fc15a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ram=C3=B3n=20Huidobro?= Date: Tue, 13 Sep 2022 15:43:21 +0200 Subject: [PATCH 02/11] Update smoketest commands --- scripts/smoketest.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/scripts/smoketest.sh b/scripts/smoketest.sh index 6f9dfea1..0755cf93 100755 --- a/scripts/smoketest.sh +++ b/scripts/smoketest.sh @@ -27,11 +27,11 @@ subo create project "$TEST_PROJECT" pushd "$TEST_PROJECT" > /dev/null # create a runnable for each supported language -subo create runnable rs-test --lang rust -subo create runnable swift-test --lang swift -subo create runnable as-test --lang assemblyscript -subo create runnable tinygo-test --lang tinygo -subo create runnable js-test --lang javascript +subo create module rs-test --lang rust +subo create module swift-test --lang swift +subo create module as-test --lang assemblyscript +subo create module tinygo-test --lang tinygo +subo create module js-test --lang javascript # build project bundle subo build . \ No newline at end of file From c0f5e5ae64cfc13ba86e9d5d6d73265557b2a9a8 Mon Sep 17 00:00:00 2001 From: Flaki Date: Wed, 21 Sep 2022 20:27:48 +0300 Subject: [PATCH 03/11] feat: added new toolchaintest to test the docker builders --- Makefile | 3 +++ scripts/toolchaintest.sh | 53 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 56 insertions(+) create mode 100755 scripts/toolchaintest.sh diff --git a/Makefile b/Makefile index fad10b7a..3c3a031c 100644 --- a/Makefile +++ b/Makefile @@ -21,6 +21,9 @@ subo/docker/publish: subo/smoketest: subo ./scripts/smoketest.sh +subo/toolchaintest: subo/docker + ./scripts/toolchaintest.sh + mod/replace/atmo: go mod edit -replace github.com/suborbital/atmo=$(HOME)/Workspaces/suborbital/atmo diff --git a/scripts/toolchaintest.sh b/scripts/toolchaintest.sh new file mode 100755 index 00000000..e0116639 --- /dev/null +++ b/scripts/toolchaintest.sh @@ -0,0 +1,53 @@ +#!/bin/bash + +set -eu + +TEST_PROJECT="buildertest" + +trap 'catch $? $LINENO' EXIT + +catch() { + if [[ "$1" != "0" ]]; then + echo "An Error $1 occurred on $2" + fi + + # return to origin, clear directory stack + pushd -0 > /dev/null && dirs -c + + if [[ -d "$TEST_PROJECT" ]]; then + echo "Cleaning up test artifacts..." + rm -rf "$TEST_PROJECT" || echo "Failed to clean up test artifacts, if this was a permissions error try using 'sudo rm -rf $TEST_PROJECT'" + fi +} + +# build local subo docker image +docker image ls -q suborbital/subo:dev +if [[ "$?" != "0" ]]; then + make subo/docker +fi + +# rebuild local docker build tooling +docker build . -f builder/docker/assemblyscript/Dockerfile -t suborbital/builder-as:dev +docker build . -f builder/docker/grain/Dockerfile --platform linux/amd64 -t suborbital/builder-gr:dev +docker build . -f builder/docker/javascript/Dockerfile -t suborbital/builder-js:dev +docker build . -f builder/docker/rust/Dockerfile -t suborbital/builder-rs:dev +docker build . -f builder/docker/swift/Dockerfile -t suborbital/builder-swift:dev +docker build . -f builder/docker/tinygo/Dockerfile --platform linux/amd64 --build-arg TARGETARCH=amd64 -t suborbital/builder-tinygo:dev +docker build . -f builder/docker/wat/Dockerfile -t suborbital/builder-wat:dev + + +# create a new project +subo create project "$TEST_PROJECT" + +# enter project directory +pushd "$TEST_PROJECT" > /dev/null + +# create a runnable for each supported language +subo create module rs-test --lang rust +subo create module swift-test --lang swift +subo create module as-test --lang assemblyscript +subo create module tinygo-test --lang tinygo +subo create module js-test --lang javascript + +# build project bundle +subo build . --builder-tag dev From 8d67dd930ff633d2cc629bddbbe8641a2f079555 Mon Sep 17 00:00:00 2001 From: Flaki Date: Wed, 21 Sep 2022 20:28:27 +0300 Subject: [PATCH 04/11] fix: update runnable references in the UI to "module" --- builder/builder.go | 2 +- builder/prereq.go | 2 +- project/context.go | 8 ++++---- root.go | 4 ++-- subo/command/build.go | 12 ++++++------ subo/command/clean.go | 4 ++-- 6 files changed, 16 insertions(+), 16 deletions(-) diff --git a/builder/builder.go b/builder/builder.go index 3b3b3ff6..351afc39 100644 --- a/builder/builder.go +++ b/builder/builder.go @@ -93,7 +93,7 @@ func (b *Builder) BuildWithToolchain(tcn Toolchain) error { } if tcn == ToolchainNative { - b.log.LogStart(fmt.Sprintf("building runnable: %s (%s)", mod.Name, mod.Module.Lang)) + b.log.LogStart(fmt.Sprintf("building module: %s (%s)", mod.Name, mod.Module.Lang)) result := &BuildResult{} diff --git a/builder/prereq.go b/builder/prereq.go index 82138bee..225abad5 100644 --- a/builder/prereq.go +++ b/builder/prereq.go @@ -115,7 +115,7 @@ func (p Prereq) GetCommand(b BuildConfig, md project.ModuleDir) (string, error) var fullCmd strings.Builder err = cmdTmpl.Execute(&fullCmd, data) if err != nil { - return "", errors.Wrap(err, "failed to execute prerequisite Command string with runnableDir") + return "", errors.Wrap(err, "failed to execute prerequisite Command string with moduleDir") } return fullCmd.String(), nil diff --git a/project/context.go b/project/context.go index 66798474..5cca4ebf 100644 --- a/project/context.go +++ b/project/context.go @@ -66,7 +66,7 @@ func ForDirectory(dir string) (*Context, error) { modules, cwdIsRunnable, err := getModuleDirs(fullDir) if err != nil { - return nil, errors.Wrap(err, "failed to getRunnableDirs") + return nil, errors.Wrap(err, "failed to getModuleDirs") } bundle, err := bundleTargetPath(fullDir) @@ -189,11 +189,11 @@ func getModuleDirs(cwd string) ([]ModuleDir, bool, error) { return nil, false, errors.Wrap(err, "failed to list directory") } - // Check to see if we're running from within a Runnable directory + // Check to see if we're running from within a Module directory // and return true if so. moduleDir, err := getModuleFromFiles(cwd, topLvlFiles) if err != nil { - return nil, false, errors.Wrap(err, "failed to getRunnableFromFiles") + return nil, false, errors.Wrap(err, "failed to getModuleFromFiles") } else if moduleDir != nil { modules = append(modules, *moduleDir) return modules, true, nil @@ -215,7 +215,7 @@ func getModuleDirs(cwd string) ([]ModuleDir, bool, error) { moduleDir, err := getModuleFromFiles(dirPath, innerFiles) if err != nil { - return nil, false, errors.Wrap(err, "failed to getRunnableFromFiles") + return nil, false, errors.Wrap(err, "failed to getModuleFromFiles") } else if moduleDir == nil { continue } diff --git a/root.go b/root.go index e543f115..d5906b50 100644 --- a/root.go +++ b/root.go @@ -26,8 +26,8 @@ including building WebAssembly Runnables and Atmo projects.`, // create commands. create := &cobra.Command{ Use: "create", - Short: "create a runnable, project, or handler", - Long: `create a new Atmo project, WebAssembly runnable or handler`, + Short: "create a module, project, or handler", + Long: `create a new DeltaV project, WebAssembly module or handler`, } if features.EnableReleaseCommands { diff --git a/subo/command/build.go b/subo/command/build.go index f5e4e647..0f786cb2 100644 --- a/subo/command/build.go +++ b/subo/command/build.go @@ -15,8 +15,8 @@ import ( func BuildCmd() *cobra.Command { cmd := &cobra.Command{ Use: "build [dir]", - Short: "build a WebAssembly runnable", - Long: `build a WebAssembly runnable and/or create a Runnable Bundle`, + Short: "build a WebAssembly module", + Long: `build a WebAssembly module and/or create an application bundle`, RunE: func(cmd *cobra.Command, args []string) error { dir := "." if len(args) > 0 { @@ -29,11 +29,11 @@ func BuildCmd() *cobra.Command { } if len(bdr.Context.Modules) == 0 { - return errors.New("🚫 no runnables found in current directory (no .runnable.yaml files found)") + return errors.New("🚫 build found no modules in current directory (no .module.yaml files found)") } if bdr.Context.CwdIsRunnable { - util.LogInfo("building single Runnable (run from project root to create bundle)") + util.LogInfo("building a single module (run from project root to create bundle)") } langs, _ := cmd.Flags().GetStringSlice("langs") @@ -44,7 +44,7 @@ func BuildCmd() *cobra.Command { shouldDockerBuild, _ := cmd.Flags().GetBool("docker") if bdr.Context.CwdIsRunnable && shouldDockerBuild { - return errors.New("🚫 cannot build Docker image for a single Runnable (must be a project)") + return errors.New("🚫 cannot build Docker image for a single module (must be a project)") } useNative, _ := cmd.Flags().GetBool("native") @@ -113,7 +113,7 @@ func BuildCmd() *cobra.Command { cmd.Flags().Bool("native", false, "use native (locally installed) toolchain rather than Docker") cmd.Flags().String("make", "", "execute the provided Make target before building the project bundle") cmd.Flags().Bool("docker", false, "build your project's Dockerfile. It will be tagged {identifier}:{appVersion}") - cmd.Flags().StringSlice("langs", []string{}, "build only Runnables for the listed languages (comma-seperated)") + cmd.Flags().StringSlice("langs", []string{}, "build only modules for the listed languages (comma-seperated)") cmd.Flags().String("mountpath", "", "if passed, the Docker builders will mount their volumes at the provided path") cmd.Flags().String("relpath", "", "if passed, the Docker builders will run `subo build` using the provided path, relative to '--mountpath'") cmd.Flags().String("builder-tag", "", "use the provided tag for builder images") diff --git a/subo/command/clean.go b/subo/command/clean.go index 34b9fc0f..e8b2f5c7 100644 --- a/subo/command/clean.go +++ b/subo/command/clean.go @@ -14,7 +14,7 @@ import ( "github.com/suborbital/subo/subo/util" ) -//CleanCmd removes all of the target/.build folders for Runnables and deletes the .wasm files. +// CleanCmd removes all of the target/.build folders for Runnables and deletes the .wasm files. func CleanCmd() *cobra.Command { cmd := &cobra.Command{ Use: "clean", @@ -32,7 +32,7 @@ func CleanCmd() *cobra.Command { } if len(bctx.Modules) == 0 { - return errors.New("🚫 no runnables found in current directory (no .runnable yaml files found)") + return errors.New("🚫 cleanup found no modules in current directory (no .module.yaml files found)") } util.LogStart(fmt.Sprintf("cleaning in %s", bctx.Cwd)) From 97291d36867b957e50e567fb67e4b92451bfb4cb Mon Sep 17 00:00:00 2001 From: Flaki Date: Fri, 5 Aug 2022 00:21:36 +0300 Subject: [PATCH 05/11] fix: build artifacts owned by root on Linux Fixes #175 --- builder/builder.go | 6 +++++- builder/docker/rust/Dockerfile | 13 +++++++------ 2 files changed, 12 insertions(+), 7 deletions(-) diff --git a/builder/builder.go b/builder/builder.go index 351afc39..cb1aeb3a 100644 --- a/builder/builder.go +++ b/builder/builder.go @@ -157,7 +157,11 @@ func (b *Builder) dockerBuildForLang(lang string) (*BuildResult, error) { result := &BuildResult{} - outputLog, err := b.Config.CommandRunner.Run(fmt.Sprintf("docker run --rm --mount type=bind,source=%s,target=/root/runnable %s subo build %s --native --langs %s", b.Context.MountPath, img, b.Context.RelDockerPath, lang)) + // Run the Docker toolchain as the current user + uid := os.Getuid() + gid := os.Getgid() + + outputLog, err := b.Config.CommandRunner.Run(fmt.Sprintf("docker run --rm --mount type=bind,source=%s,target=/usr/src/runnable -u %d:%d %s subo build %s --native --langs %s", b.Context.MountPath, uid, gid, img, b.Context.RelDockerPath, lang)) result.OutputLog = outputLog diff --git a/builder/docker/rust/Dockerfile b/builder/docker/rust/Dockerfile index bc410a41..dc40e7cc 100644 --- a/builder/docker/rust/Dockerfile +++ b/builder/docker/rust/Dockerfile @@ -1,11 +1,12 @@ FROM suborbital/subo:dev as subo FROM rust:1.56.1-slim-buster -WORKDIR /root/runnable +WORKDIR /usr/src/runnable COPY --from=subo /go/bin/subo /usr/local/bin -# install the wasm target and then install something that -# doesn't exist (and ignore the error) to update the crates.io index -RUN mkdir /root/suborbital && \ - rustup target install wasm32-wasi -RUN cargo install lazy_static; exit 0 +# install the wasm target and then force an update of the crates.io index +RUN rustup target install wasm32-wasi && \ + cargo search suborbital + +# make everything inside CARGO_HOME writable for anyone (again) +RUN chmod -R a+w $RUSTUP_HOME $CARGO_HOME From 423b47899d72d4c794975a546d2e97ff5438ed35 Mon Sep 17 00:00:00 2001 From: Flaki Date: Thu, 22 Sep 2022 09:17:04 +0300 Subject: [PATCH 06/11] refactor: better logging for toolchain commands --- builder/builder.go | 9 ++++++++- project/context.go | 1 + subo/command/build.go | 10 +++++++++- 3 files changed, 18 insertions(+), 2 deletions(-) diff --git a/builder/builder.go b/builder/builder.go index cb1aeb3a..2541c3d0 100644 --- a/builder/builder.go +++ b/builder/builder.go @@ -161,7 +161,14 @@ func (b *Builder) dockerBuildForLang(lang string) (*BuildResult, error) { uid := os.Getuid() gid := os.Getgid() - outputLog, err := b.Config.CommandRunner.Run(fmt.Sprintf("docker run --rm --mount type=bind,source=%s,target=/usr/src/runnable -u %d:%d %s subo build %s --native --langs %s", b.Context.MountPath, uid, gid, img, b.Context.RelDockerPath, lang)) + toolchainCmd := fmt.Sprintf("docker run --rm --mount type=bind,source=%s,target=/usr/src/runnable -u %d:%d %s subo build %s --native --langs %s", b.Context.MountPath, uid, gid, img, b.Context.RelDockerPath, lang) + + // Show the toolchain command being run + if b.Context.LogLevel == "verbose" { + util.LogInfo(fmt.Sprintf("🐳 %s", toolchainCmd)) + } + + outputLog, err := b.Config.CommandRunner.Run(toolchainCmd) result.OutputLog = outputLog diff --git a/project/context.go b/project/context.go index 5cca4ebf..c1dcea87 100644 --- a/project/context.go +++ b/project/context.go @@ -40,6 +40,7 @@ type Context struct { MountPath string RelDockerPath string BuilderTag string + LogLevel string } // ModuleDir represents a directory containing a Runnable. diff --git a/subo/command/build.go b/subo/command/build.go index 0f786cb2..c931d9f1 100644 --- a/subo/command/build.go +++ b/subo/command/build.go @@ -29,7 +29,7 @@ func BuildCmd() *cobra.Command { } if len(bdr.Context.Modules) == 0 { - return errors.New("🚫 build found no modules in current directory (no .module.yaml files found)") + return errors.New(fmt.Sprintf("🚫 build found no modules in %s (no .module.yaml files found)", bdr.Context.Cwd)) } if bdr.Context.CwdIsRunnable { @@ -69,6 +69,11 @@ func BuildCmd() *cobra.Command { bdr.Context.BuilderTag = builderTag } + verbose, _ := cmd.Flags().GetBool("verbose") + if verbose { + bdr.Context.LogLevel = "verbose" + } + if makeTarget != "" { util.LogStart(fmt.Sprintf("make %s", makeTarget)) _, err = util.Command.Run(fmt.Sprintf("make %s", makeTarget)) @@ -118,5 +123,8 @@ func BuildCmd() *cobra.Command { cmd.Flags().String("relpath", "", "if passed, the Docker builders will run `subo build` using the provided path, relative to '--mountpath'") cmd.Flags().String("builder-tag", "", "use the provided tag for builder images") + cmd.Flags().BoolP("verbose", "v", false, "enable verbose logging") + cmd.Flags().Lookup("verbose").NoOptDefVal = "true" + return cmd } From d13b939d90c571cc668a71f705c053c22468810a Mon Sep 17 00:00:00 2001 From: Flaki Date: Thu, 22 Sep 2022 09:18:16 +0300 Subject: [PATCH 07/11] fix: build local dev subo for toolchaintests --- Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 3c3a031c..7a88cce0 100644 --- a/Makefile +++ b/Makefile @@ -21,7 +21,7 @@ subo/docker/publish: subo/smoketest: subo ./scripts/smoketest.sh -subo/toolchaintest: subo/docker +subo/toolchaintest: subo subo/docker ./scripts/toolchaintest.sh mod/replace/atmo: From f85165f8b0da4bd2e7f6314c585cdd109a9fab3d Mon Sep 17 00:00:00 2001 From: Flaki Date: Thu, 22 Sep 2022 09:19:50 +0300 Subject: [PATCH 08/11] fix: update all language toolchains for rootless builders --- builder/builder.go | 2 +- builder/docker/assemblyscript/Dockerfile | 2 +- builder/docker/grain/Dockerfile | 2 +- builder/docker/javascript/Dockerfile | 4 ++-- builder/docker/rust/Dockerfile | 4 +++- builder/docker/swift/Dockerfile | 2 +- builder/docker/tinygo/Dockerfile | 2 +- 7 files changed, 10 insertions(+), 8 deletions(-) diff --git a/builder/builder.go b/builder/builder.go index 2541c3d0..87563af8 100644 --- a/builder/builder.go +++ b/builder/builder.go @@ -161,7 +161,7 @@ func (b *Builder) dockerBuildForLang(lang string) (*BuildResult, error) { uid := os.Getuid() gid := os.Getgid() - toolchainCmd := fmt.Sprintf("docker run --rm --mount type=bind,source=%s,target=/usr/src/runnable -u %d:%d %s subo build %s --native --langs %s", b.Context.MountPath, uid, gid, img, b.Context.RelDockerPath, lang) + toolchainCmd := fmt.Sprintf("docker run --rm --mount type=bind,source=%s,target=/usr/src/runnable -u %d:%d --env HOME=/tmp %s subo build %s --native --langs %s", b.Context.MountPath, uid, gid, img, b.Context.RelDockerPath, lang) // Show the toolchain command being run if b.Context.LogLevel == "verbose" { diff --git a/builder/docker/assemblyscript/Dockerfile b/builder/docker/assemblyscript/Dockerfile index 2b2d00b6..64adbafe 100644 --- a/builder/docker/assemblyscript/Dockerfile +++ b/builder/docker/assemblyscript/Dockerfile @@ -1,6 +1,6 @@ FROM suborbital/subo:dev as subo FROM node:16-buster-slim -WORKDIR /root/runnable +WORKDIR /usr/src/runnable COPY --from=subo /go/bin/subo /usr/local/bin RUN npm install -g npm@latest diff --git a/builder/docker/grain/Dockerfile b/builder/docker/grain/Dockerfile index 711d571c..7cd2a9ee 100644 --- a/builder/docker/grain/Dockerfile +++ b/builder/docker/grain/Dockerfile @@ -1,6 +1,6 @@ FROM suborbital/subo:dev as subo FROM ghcr.io/grain-lang/grain:0.4-slim -WORKDIR /root/runnable +WORKDIR /usr/src/runnable COPY --from=subo /go/bin/subo /usr/local/bin/subo RUN mkdir /root/suborbital diff --git a/builder/docker/javascript/Dockerfile b/builder/docker/javascript/Dockerfile index b36e7bc4..75793cf4 100644 --- a/builder/docker/javascript/Dockerfile +++ b/builder/docker/javascript/Dockerfile @@ -2,11 +2,11 @@ FROM ghcr.io/suborbital/javy:v0.3.0 as javy FROM suborbital/subo:dev as subo FROM node:16-bullseye-slim -WORKDIR /root/runnable +WORKDIR /usr/src/runnable # Propagate our root permissions for our home folder to everyone. This allows # npm scripts (which get run as whatever user owns the mounted runnable # directory) to access common home folder resources (caches, etc.). -RUN mkdir /root/suborbital && chmod -R o=u /root +# RUN mkdir /root/suborbital && chmod -R o=u /root COPY --from=javy /usr/local/bin/javy /usr/local/bin COPY --from=subo /go/bin/subo /usr/local/bin diff --git a/builder/docker/rust/Dockerfile b/builder/docker/rust/Dockerfile index dc40e7cc..23b79b8a 100644 --- a/builder/docker/rust/Dockerfile +++ b/builder/docker/rust/Dockerfile @@ -2,7 +2,6 @@ FROM suborbital/subo:dev as subo FROM rust:1.56.1-slim-buster WORKDIR /usr/src/runnable -COPY --from=subo /go/bin/subo /usr/local/bin # install the wasm target and then force an update of the crates.io index RUN rustup target install wasm32-wasi && \ @@ -10,3 +9,6 @@ RUN rustup target install wasm32-wasi && \ # make everything inside CARGO_HOME writable for anyone (again) RUN chmod -R a+w $RUSTUP_HOME $CARGO_HOME + +# embed subo +COPY --from=subo /go/bin/subo /usr/local/bin diff --git a/builder/docker/swift/Dockerfile b/builder/docker/swift/Dockerfile index 4fb50cae..d79384b2 100644 --- a/builder/docker/swift/Dockerfile +++ b/builder/docker/swift/Dockerfile @@ -1,5 +1,5 @@ FROM suborbital/subo:dev as subo FROM ghcr.io/swiftwasm/swift:focal -WORKDIR /root/runnable +WORKDIR /usr/src/runnable COPY --from=subo /go/bin/subo /usr/local/bin diff --git a/builder/docker/tinygo/Dockerfile b/builder/docker/tinygo/Dockerfile index da259c87..ce9255dc 100644 --- a/builder/docker/tinygo/Dockerfile +++ b/builder/docker/tinygo/Dockerfile @@ -18,7 +18,7 @@ RUN wget -O tinygo.tar.gz \ rm -rf tinygo/src/examples && \ rm -rf tinygo.tar.gz -WORKDIR /root/runnable +WORKDIR /usr/src/runnable COPY --from=go /usr/local/go /usr/local/ COPY --from=subo /go/bin/subo /usr/local/bin From 06f1dff10f780799ca6a3c4fdf1a5dcf978e33d2 Mon Sep 17 00:00:00 2001 From: Flaki Date: Thu, 22 Sep 2022 09:22:42 +0300 Subject: [PATCH 09/11] fix: enable verbose output for toolchaintest --- scripts/toolchaintest.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/toolchaintest.sh b/scripts/toolchaintest.sh index e0116639..b5591375 100755 --- a/scripts/toolchaintest.sh +++ b/scripts/toolchaintest.sh @@ -50,4 +50,4 @@ subo create module tinygo-test --lang tinygo subo create module js-test --lang javascript # build project bundle -subo build . --builder-tag dev +subo build . --builder-tag dev --verbose From 4280842b60100021990732b33b5a25b8f48618d0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Szmozs=C3=A1nszky?= Date: Fri, 23 Sep 2022 10:22:04 +0300 Subject: [PATCH 10/11] fix: update to latest E2 branding Co-authored-by: Oscar Spencer --- root.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/root.go b/root.go index d5906b50..423f5672 100644 --- a/root.go +++ b/root.go @@ -27,7 +27,7 @@ including building WebAssembly Runnables and Atmo projects.`, create := &cobra.Command{ Use: "create", Short: "create a module, project, or handler", - Long: `create a new DeltaV project, WebAssembly module or handler`, + Long: `create a new E2Core project, WebAssembly module or handler`, } if features.EnableReleaseCommands { From 0b0e3eade267ba3742f1e36ae2506f70d3200614 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Istv=C3=A1n=20Szmozs=C3=A1nszky?= Date: Wed, 28 Sep 2022 17:28:13 +0300 Subject: [PATCH 11/11] fix: remove obsolate permission hack in the JS build image Co-authored-by: Jagger De Leo --- builder/docker/javascript/Dockerfile | 1 - 1 file changed, 1 deletion(-) diff --git a/builder/docker/javascript/Dockerfile b/builder/docker/javascript/Dockerfile index 75793cf4..bb6fcfdb 100644 --- a/builder/docker/javascript/Dockerfile +++ b/builder/docker/javascript/Dockerfile @@ -6,7 +6,6 @@ WORKDIR /usr/src/runnable # Propagate our root permissions for our home folder to everyone. This allows # npm scripts (which get run as whatever user owns the mounted runnable # directory) to access common home folder resources (caches, etc.). -# RUN mkdir /root/suborbital && chmod -R o=u /root COPY --from=javy /usr/local/bin/javy /usr/local/bin COPY --from=subo /go/bin/subo /usr/local/bin