diff --git a/.goreleaser.yaml b/.goreleaser.yaml index 83944c508..4310db73c 100644 --- a/.goreleaser.yaml +++ b/.goreleaser.yaml @@ -24,9 +24,9 @@ builds: goos: - linux - darwin - id: envd-ssh - main: ./cmd/envd-ssh - binary: envd-ssh + id: envd-sshd + main: ./cmd/envd-sshd + binary: envd-sshd ldflags: - -s -w - -X github.com/tensorchord/envd/pkg/version.version={{ .Version }} @@ -44,10 +44,10 @@ archives: windows: Windows 386: i386 amd64: x86_64 - - id: envd-ssh + - id: envd-sshd format: binary builds: - - envd-ssh + - envd-sshd replacements: darwin: Darwin linux: Linux @@ -69,27 +69,27 @@ changelog: - '^chore:' dockers: - image_templates: - - "ghcr.io/tensorchord/envd-ssh-from-scratch:{{ .Version }}-amd64" + - "ghcr.io/tensorchord/envd-sshd-from-scratch:{{ .Version }}-amd64" use: buildx - dockerfile: .goreleaser/envd-ssh.Dockerfile + dockerfile: .goreleaser/envd-sshd.Dockerfile ids: - - envd-ssh + - envd-sshd build_flag_templates: - "--platform=linux/amd64" - image_templates: - - "ghcr.io/tensorchord/envd-ssh-from-scratch:{{ .Version }}-arm64v8" + - "ghcr.io/tensorchord/envd-sshd-from-scratch:{{ .Version }}-arm64v8" use: buildx goarch: arm64 ids: - - envd-ssh - dockerfile: .goreleaser/envd-ssh.Dockerfile + - envd-sshd + dockerfile: .goreleaser/envd-sshd.Dockerfile build_flag_templates: - "--platform=linux/arm64/v8" docker_manifests: -- name_template: ghcr.io/tensorchord/envd-ssh-from-scratch:{{ .Version }} +- name_template: ghcr.io/tensorchord/envd-sshd-from-scratch:{{ .Version }} image_templates: - - ghcr.io/tensorchord/envd-ssh-from-scratch:{{ .Version }}-amd64 - - ghcr.io/tensorchord/envd-ssh-from-scratch:{{ .Version }}-arm64v8 + - ghcr.io/tensorchord/envd-sshd-from-scratch:{{ .Version }}-amd64 + - ghcr.io/tensorchord/envd-sshd-from-scratch:{{ .Version }}-arm64v8 brews: - name: envd ids: diff --git a/.goreleaser/envd-ssh.Dockerfile b/.goreleaser/envd-ssh.Dockerfile deleted file mode 100644 index ddc593ae2..000000000 --- a/.goreleaser/envd-ssh.Dockerfile +++ /dev/null @@ -1,2 +0,0 @@ -FROM scratch -COPY envd-ssh /usr/bin/envd-ssh diff --git a/.goreleaser/envd-sshd.Dockerfile b/.goreleaser/envd-sshd.Dockerfile new file mode 100644 index 000000000..5a27fde53 --- /dev/null +++ b/.goreleaser/envd-sshd.Dockerfile @@ -0,0 +1,2 @@ +FROM scratch +COPY envd-sshd /usr/bin/envd-sshd diff --git a/Makefile b/Makefile index 79e7a9081..c23d11dd4 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ ROOT := github.com/tensorchord/envd # Target binaries. You can build multiple binaries for a single project. -TARGETS := envd envd-ssh +TARGETS := envd envd-sshd # Container image prefix and suffix added to targets. # The final built images are: diff --git a/base-images/build.sh b/base-images/build.sh index a7cd8951b..fb00594cb 100755 --- a/base-images/build.sh +++ b/base-images/build.sh @@ -24,13 +24,13 @@ docker run --rm --privileged multiarch/qemu-user-static --reset -p yes docker buildx build \ --build-arg ENVD_VERSION=${ENVD_VERSION} \ - --build-arg ENVD_SSH_IMAGE=ghcr.io/tensorchord/envd-ssh-from-scratch \ + --build-arg ENVD_SSH_IMAGE=ghcr.io/tensorchord/envd-sshd-from-scratch \ --pull --push --platform linux/x86_64,linux/arm64 \ -t ${DOCKER_HUB_ORG}/python:${PYTHON_VERSION}-${ENVD_OS}-envd-${DOCKER_IMAGE_TAG} \ -f python${PYTHON_VERSION}-${ENVD_OS}.Dockerfile . docker buildx build --build-arg IMAGE_NAME=docker.io/nvidia/cuda \ --build-arg ENVD_VERSION=${ENVD_VERSION} \ - --build-arg ENVD_SSH_IMAGE=ghcr.io/tensorchord/envd-ssh-from-scratch \ + --build-arg ENVD_SSH_IMAGE=ghcr.io/tensorchord/envd-sshd-from-scratch \ --pull --push --platform linux/x86_64,linux/arm64 \ -t ${DOCKER_HUB_ORG}/python:${PYTHON_VERSION}-${ENVD_OS}-cuda11.2-cudnn8-envd-${DOCKER_IMAGE_TAG} \ -f python${PYTHON_VERSION}-${ENVD_OS}-cuda11.2.Dockerfile . @@ -38,13 +38,13 @@ docker buildx build --build-arg IMAGE_NAME=docker.io/nvidia/cuda \ # TODO(gaocegege): Support linux/arm64 docker buildx build \ --build-arg ENVD_VERSION=${ENVD_VERSION} \ - --build-arg ENVD_SSH_IMAGE=ghcr.io/tensorchord/envd-ssh-from-scratch \ + --build-arg ENVD_SSH_IMAGE=ghcr.io/tensorchord/envd-sshd-from-scratch \ -t ${DOCKER_HUB_ORG}/r-base:${RLANG_VERSION}-envd-${DOCKER_IMAGE_TAG} \ --pull --push --platform linux/x86_64 \ -f r${RLANG_VERSION}.Dockerfile . docker buildx build \ --build-arg ENVD_VERSION=${ENVD_VERSION} \ - --build-arg ENVD_SSH_IMAGE=ghcr.io/tensorchord/envd-ssh-from-scratch \ + --build-arg ENVD_SSH_IMAGE=ghcr.io/tensorchord/envd-sshd-from-scratch \ -t ${DOCKER_HUB_ORG}/julia:${JULIA_VERSION}-${ENVD_OS}-envd-${DOCKER_IMAGE_TAG} \ --pull --push --platform linux/x86_64,linux/arm64 \ -f julia${JULIA_VERSION}-${ENVD_OS}.Dockerfile . diff --git a/base-images/julia1.8rc1-ubuntu20.04.Dockerfile b/base-images/julia1.8rc1-ubuntu20.04.Dockerfile index d44f466b5..338cf4c85 100644 --- a/base-images/julia1.8rc1-ubuntu20.04.Dockerfile +++ b/base-images/julia1.8rc1-ubuntu20.04.Dockerfile @@ -29,7 +29,7 @@ RUN apt-get update && \ # prompt && curl --proto '=https' --tlsv1.2 -sSf https://starship.rs/install.sh | sh -s -- -y -COPY --from=envd /usr/bin/envd-ssh /var/envd/bin/envd-ssh +COPY --from=envd /usr/bin/envd-sshd /var/envd/bin/envd-sshd ENV JULIA_PATH /usr/local/julia ENV PATH $JULIA_PATH/bin:$PATH diff --git a/base-images/python3.9-ubuntu20.04-cuda11.2.Dockerfile b/base-images/python3.9-ubuntu20.04-cuda11.2.Dockerfile index 778261e87..e9a1920c0 100644 --- a/base-images/python3.9-ubuntu20.04-cuda11.2.Dockerfile +++ b/base-images/python3.9-ubuntu20.04-cuda11.2.Dockerfile @@ -32,4 +32,4 @@ RUN apt-get update && \ # prompt && curl --proto '=https' --tlsv1.2 -sSf https://starship.rs/install.sh | sh -s -- -y -COPY --from=envd /usr/bin/envd-ssh /var/envd/bin/envd-ssh +COPY --from=envd /usr/bin/envd-sshd /var/envd/bin/envd-sshd diff --git a/base-images/python3.9-ubuntu20.04.Dockerfile b/base-images/python3.9-ubuntu20.04.Dockerfile index 3813e2fc5..46f7df522 100644 --- a/base-images/python3.9-ubuntu20.04.Dockerfile +++ b/base-images/python3.9-ubuntu20.04.Dockerfile @@ -32,4 +32,4 @@ RUN apt-get update && \ # prompt && curl --proto '=https' --tlsv1.2 -sSf https://starship.rs/install.sh | sh -s -- -y -COPY --from=envd /usr/bin/envd-ssh /var/envd/bin/envd-ssh +COPY --from=envd /usr/bin/envd-sshd /var/envd/bin/envd-sshd diff --git a/base-images/r4.2.Dockerfile b/base-images/r4.2.Dockerfile index 16d004cee..0a341b3a9 100644 --- a/base-images/r4.2.Dockerfile +++ b/base-images/r4.2.Dockerfile @@ -43,4 +43,4 @@ RUN set -x && \ dpkg -i "$DOWNLOAD_FILE" && \ rm ${DOWNLOAD_FILE} && rm -f /var/lib/rstudio-server/secure-cookie-key -COPY --from=envd /usr/bin/envd-ssh /var/envd/bin/envd-ssh +COPY --from=envd /usr/bin/envd-sshd /var/envd/bin/envd-sshd diff --git a/cmd/envd-ssh/main.go b/cmd/envd-sshd/main.go similarity index 99% rename from cmd/envd-ssh/main.go rename to cmd/envd-sshd/main.go index 7c299e3b6..dda3bb502 100644 --- a/cmd/envd-ssh/main.go +++ b/cmd/envd-sshd/main.go @@ -44,7 +44,7 @@ func main() { } app := cli.NewApp() - app.Name = "envd-ssh" + app.Name = "envd-sshd" app.Usage = "ssh server for envd" app.Version = version.GetVersion().String() app.Flags = []cli.Flag{ diff --git a/pkg/lang/ir/compile.go b/pkg/lang/ir/compile.go index f94a02d1d..c4dd146f9 100644 --- a/pkg/lang/ir/compile.go +++ b/pkg/lang/ir/compile.go @@ -204,7 +204,7 @@ func (g Graph) GetEntrypoint(buildContextDir string) ([]string, error) { } template := `set -e -/var/envd/bin/envd-ssh --authorized-keys %s --port %d --shell %s & +/var/envd/bin/envd-sshd --authorized-keys %s --port %d --shell %s & %s wait -n`