From 236cd0be8cdfa9e4731d3b69cec7027001c8770b Mon Sep 17 00:00:00 2001 From: Keming Date: Wed, 28 Sep 2022 20:51:42 +0800 Subject: [PATCH] fix: version tag in build.sh (#947) * fix: version tag in build.sh Signed-off-by: Keming * rename to sshd Signed-off-by: Keming * rm cuda inspect Signed-off-by: Keming Signed-off-by: Keming --- base-images/build.sh | 21 +++++++------------ .../julia1.8rc1-ubuntu20.04.Dockerfile | 4 ++-- base-images/r4.2.Dockerfile | 4 ++-- 3 files changed, 12 insertions(+), 17 deletions(-) diff --git a/base-images/build.sh b/base-images/build.sh index c7017cbf4..ff1cd40ad 100755 --- a/base-images/build.sh +++ b/base-images/build.sh @@ -4,35 +4,30 @@ set -euo pipefail ROOT_DIR=`dirname $0` -GIT_TAG_VERSION=$(git describe --tags --abbrev=0 | sed -r 's/[v]+//g') # remove v from version -ENVD_VERSION="${ENVD_VERSION:-$GIT_TAG_VERSION}" -DOCKER_IMAGE_TAG="${DOCKER_IMAGE_TAG:-v$ENVD_VERSION}" +GIT_TAG_VERSION=$(git describe --tags --abbrev=0) DOCKER_HUB_ORG="${DOCKER_HUB_ORG:-tensorchord}" -PYTHON_VERSION="${PYTHON_VERSION:-3.9}" ENVD_OS="${ENVD_OS:-ubuntu20.04}" JULIA_VERSION="${JULIA_VERSION:-1.8rc1}" RLANG_VERSION="${RLANG_VERSION:-4.2}" cd ${ROOT_DIR} # ubuntu 22.04 build require moby/buildkit version greater than 0.8.1 -if ! docker buildx inspect cuda; then - docker buildx create --use --platform linux/x86_64,linux/arm64,linux/ppc64le --driver-opt image=moby/buildkit:v0.10.3 -fi +docker buildx create --use --platform linux/x86_64,linux/arm64,linux/ppc64le --driver-opt image=moby/buildkit:v0.10.3 # https://github.com/docker/buildx/issues/495#issuecomment-754688157 docker run --rm --privileged multiarch/qemu-user-static --reset -p yes # TODO(gaocegege): Support linux/arm64 docker buildx build \ - --build-arg ENVD_VERSION=${ENVD_VERSION} \ - --build-arg ENVD_SSH_IMAGE=tensorchord/envd-sshd-from-scratch \ - -t ${DOCKER_HUB_ORG}/r-base:${RLANG_VERSION}-envd-${DOCKER_IMAGE_TAG} \ + --build-arg ENVD_VERSION=${GIT_TAG_VERSION} \ + --build-arg ENVD_SSHD_IMAGE=tensorchord/envd-sshd-from-scratch \ + -t ${DOCKER_HUB_ORG}/r-base:${RLANG_VERSION}-envd-${GIT_TAG_VERSION} \ --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=tensorchord/envd-sshd-from-scratch \ - -t ${DOCKER_HUB_ORG}/julia:${JULIA_VERSION}-${ENVD_OS}-envd-${DOCKER_IMAGE_TAG} \ + --build-arg ENVD_VERSION=${GIT_TAG_VERSION} \ + --build-arg ENVD_SSHD_IMAGE=tensorchord/envd-sshd-from-scratch \ + -t ${DOCKER_HUB_ORG}/julia:${JULIA_VERSION}-${ENVD_OS}-envd-${GIT_TAG_VERSION} \ --pull --push --platform linux/x86_64,linux/arm64 \ -f julia${JULIA_VERSION}-${ENVD_OS}.Dockerfile . cd - > /dev/null diff --git a/base-images/julia1.8rc1-ubuntu20.04.Dockerfile b/base-images/julia1.8rc1-ubuntu20.04.Dockerfile index 338cf4c85..0cdd309e5 100644 --- a/base-images/julia1.8rc1-ubuntu20.04.Dockerfile +++ b/base-images/julia1.8rc1-ubuntu20.04.Dockerfile @@ -1,12 +1,12 @@ ARG ENVD_VERSION -ARG ENVD_SSH_IMAGE +ARG ENVD_SSHD_IMAGE FROM ubuntu:20.04 as base FROM base as base-amd64 FROM base as base-arm64 -FROM ${ENVD_SSH_IMAGE}:${ENVD_VERSION} AS envd +FROM ${ENVD_SSHD_IMAGE}:${ENVD_VERSION} AS envd FROM base-${TARGETARCH} diff --git a/base-images/r4.2.Dockerfile b/base-images/r4.2.Dockerfile index 0a341b3a9..038ded4e9 100644 --- a/base-images/r4.2.Dockerfile +++ b/base-images/r4.2.Dockerfile @@ -1,12 +1,12 @@ ARG ENVD_VERSION -ARG ENVD_SSH_IMAGE +ARG ENVD_SSHD_IMAGE FROM r-base:4.2.0 as base FROM base as base-amd64 FROM base as base-arm64 -FROM ${ENVD_SSH_IMAGE}:${ENVD_VERSION} AS envd +FROM ${ENVD_SSHD_IMAGE}:${ENVD_VERSION} AS envd FROM base-${TARGETARCH}