[ARVADOS] created: 2.1.0-1568-g3ce789550

Git user git at public.arvados.org
Fri Oct 29 17:47:51 UTC 2021


        at  3ce7895505f99de703ec750e4b0bf10334522b2d (commit)


commit 3ce7895505f99de703ec750e4b0bf10334522b2d
Author: Ward Vandewege <ward at curii.com>
Date:   Fri Oct 29 13:47:00 2021 -0400

    18313: make the arvbox build scripts look up the Go compiler version to
           use for bootstrapping by pulling it from lib/install/deps.go
    
    Arvados-DCO-1.1-Signed-off-by: Ward Vandewege <ward at curii.com>

diff --git a/tools/arvbox/bin/arvbox b/tools/arvbox/bin/arvbox
index 36a33376a..785a7708b 100755
--- a/tools/arvbox/bin/arvbox
+++ b/tools/arvbox/bin/arvbox
@@ -400,6 +400,9 @@ build() {
     fi
     set -e
 
+    # Get the go version we should use for bootstrapping
+    GO_VERSION=`grep 'goversion :=' $LOCAL_ARVADOS_ROOT/lib/install/deps.go |awk -F'"' '{print $2}'`
+
     if test "$1" = localdemo -o "$1" = publicdemo ; then
         BUILDTYPE=demo
     else
@@ -411,6 +414,7 @@ build() {
     fi
 
     docker build --build-arg=BUILDTYPE=$BUILDTYPE $NO_CACHE \
+	   --build-arg=go_version=$GO_VERSION \
 	   --build-arg=arvados_version=$ARVADOS_BRANCH \
 	   --build-arg=workbench2_version=$WORKBENCH2_BRANCH \
 	   --build-arg=workdir=/tools/arvbox/lib/arvbox/docker \
@@ -419,6 +423,7 @@ build() {
 	   "$LOCAL_ARVADOS_ROOT"
     docker tag $FORCE arvados/arvbox-base:$GITHEAD arvados/arvbox-base:latest
     docker build $NO_CACHE \
+	   --build-arg=go_version=$GO_VERSION \
 	   --build-arg=arvados_version=$ARVADOS_BRANCH \
 	   --build-arg=workbench2_version=$WORKBENCH2_BRANCH \
 	   -t arvados/arvbox-$BUILDTYPE:$GITHEAD \
diff --git a/tools/arvbox/lib/arvbox/docker/Dockerfile.base b/tools/arvbox/lib/arvbox/docker/Dockerfile.base
index 27757be64..6a6c251fd 100644
--- a/tools/arvbox/lib/arvbox/docker/Dockerfile.base
+++ b/tools/arvbox/lib/arvbox/docker/Dockerfile.base
@@ -22,14 +22,20 @@ RUN apt-get update && \
 
 ENV GOPATH /var/lib/gopath
 
-# Get Go 1.16.9
+RUN --mount=type=bind,target=/usr/src/arvados \
+    cd /usr/src/arvados && \
+    grep 'goversion :=' lib/install/deps.go |awk -F'"' '{print $2}'
+
+ARG go_version
+
+# Get Go
 RUN cd /usr/src && \
-    wget https://golang.org/dl/go1.16.9.linux-amd64.tar.gz && \
-    tar xzf go1.16.9.linux-amd64.tar.gz && \
-    ln -s /usr/src/go/bin/go /usr/local/bin/go-1.16.9 && \
-    ln -s /usr/src/go/bin/gofmt /usr/local/bin/gofmt-1.16.9 && \
-    ln -s /usr/local/bin/go-1.16.9 /usr/local/bin/go && \
-    ln -s /usr/local/bin/gofmt-1.16.9 /usr/local/bin/gofmt
+    wget https://golang.org/dl/go${go_version}.linux-amd64.tar.gz && \
+    tar xzf go${go_version}.linux-amd64.tar.gz && \
+    ln -s /usr/src/go/bin/go /usr/local/bin/go-${go_version} && \
+    ln -s /usr/src/go/bin/gofmt /usr/local/bin/gofmt-${go_version} && \
+    ln -s /usr/local/bin/go-${go_version} /usr/local/bin/go && \
+    ln -s /usr/local/bin/gofmt-${go_version} /usr/local/bin/gofmt
 
 # the --mount option requires the experimental syntax enabled (enables
 # buildkit) on the first line of this file. This Dockerfile must also be built
@@ -49,15 +55,15 @@ RUN apt-get update && \
     build-essential ca-certificates git libpam0g-dev wget
 
 ENV GOPATH /var/lib/gopath
+ARG go_version
 
-# Get Go 1.16.9
 RUN cd /usr/src && \
-    wget https://golang.org/dl/go1.16.9.linux-amd64.tar.gz && \
-    tar xzf go1.16.9.linux-amd64.tar.gz && \
-    ln -s /usr/src/go/bin/go /usr/local/bin/go-1.16.9 && \
-    ln -s /usr/src/go/bin/gofmt /usr/local/bin/gofmt-1.16.9 && \
-    ln -s /usr/local/bin/go-1.16.9 /usr/local/bin/go && \
-    ln -s /usr/local/bin/gofmt-1.16.9 /usr/local/bin/gofmt
+    wget https://golang.org/dl/go${go_version}.linux-amd64.tar.gz && \
+    tar xzf go${go_version}.linux-amd64.tar.gz && \
+    ln -s /usr/src/go/bin/go /usr/local/bin/go-${go_version} && \
+    ln -s /usr/src/go/bin/gofmt /usr/local/bin/gofmt-${go_version} && \
+    ln -s /usr/local/bin/go-${go_version} /usr/local/bin/go && \
+    ln -s /usr/local/bin/gofmt-${go_version} /usr/local/bin/gofmt
 
 ARG arvados_version
 RUN echo arvados_version is git commit $arvados_version

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list