Merge branch '12859-keepstore-fd-leak'
authorTom Clegg <tom@curii.com>
Wed, 3 Nov 2021 20:33:19 +0000 (16:33 -0400)
committerTom Clegg <tom@curii.com>
Wed, 3 Nov 2021 20:33:19 +0000 (16:33 -0400)
fixes #12859

Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

apps/workbench/Gemfile.lock
lib/install/deps.go
lib/install/deps_go_version_test.go [new file with mode: 0644]
services/api/Gemfile.lock
tools/arvbox/bin/arvbox
tools/arvbox/lib/arvbox/docker/Dockerfile.base

index ab9256a38688e1af3f7ac2e5905108cea38a9ebb..13c4430965c3244bee92111d5ee7238cfe6f0797 100644 (file)
@@ -178,7 +178,7 @@ GEM
       mime-types-data (~> 3.2015)
     mime-types-data (3.2019.0331)
     mini_mime (1.1.0)
-    mini_portile2 (2.5.3)
+    mini_portile2 (2.6.1)
     minitest (5.10.3)
     mocha (1.8.0)
       metaclass (~> 0.0.1)
@@ -194,8 +194,8 @@ GEM
     net-ssh-gateway (2.0.0)
       net-ssh (>= 4.0.0)
     nio4r (2.5.7)
-    nokogiri (1.11.7)
-      mini_portile2 (~> 2.5.0)
+    nokogiri (1.12.5)
+      mini_portile2 (~> 2.6.1)
       racc (~> 1.4)
     npm-rails (0.2.1)
       rails (>= 3.2)
@@ -214,7 +214,7 @@ GEM
       multi_json (~> 1.0)
       websocket-driver (>= 0.2.0)
     public_suffix (4.0.6)
-    racc (1.5.2)
+    racc (1.6.0)
     rack (2.2.3)
     rack-mini-profiler (1.0.2)
       rack (>= 1.2.0)
index ff00ee1e350159ea82e2bc5a54293853708a8eef..714604c8454ed0ecbecbc59db6ba02c956da6104 100644 (file)
@@ -29,6 +29,7 @@ import (
 var Command cmd.Handler = &installCommand{}
 
 const devtestDatabasePassword = "insecure_arvados_test"
+const goversion = "1.17.1"
 
 type installCommand struct {
        ClusterType    string
@@ -245,7 +246,6 @@ make install
        }
 
        if !prod {
-               goversion := "1.17.1"
                if havegoversion, err := exec.Command("/usr/local/bin/go", "version").CombinedOutput(); err == nil && bytes.HasPrefix(havegoversion, []byte("go version go"+goversion+" ")) {
                        logger.Print("go " + goversion + " already installed")
                } else {
diff --git a/lib/install/deps_go_version_test.go b/lib/install/deps_go_version_test.go
new file mode 100644 (file)
index 0000000..1a69b6e
--- /dev/null
@@ -0,0 +1,40 @@
+// Copyright (C) The Arvados Authors. All rights reserved.
+//
+// SPDX-License-Identifier: AGPL-3.0
+
+package install
+
+import (
+       "bytes"
+       "os/exec"
+       "testing"
+
+       "gopkg.in/check.v1"
+)
+
+func Test(t *testing.T) {
+       check.TestingT(t)
+}
+
+var _ = check.Suite(&Suite{})
+
+type Suite struct{}
+
+/*
+       TestExtractGoVersion tests the grep/awk command used in
+       tools/arvbox/bin/arvbox to extract the version of Go to install for
+       bootstrapping `arvados-server`.
+
+       If this test is changed, the arvbox code will also need to be updated.
+*/
+func (*Suite) TestExtractGoVersion(c *check.C) {
+       script := `
+  sourcepath="$(realpath ../..)"
+  (cd ${sourcepath} && grep 'const goversion =' lib/install/deps.go |awk -F'"' '{print $2}')
+       `
+       cmd := exec.Command("bash", "-")
+       cmd.Stdin = bytes.NewBufferString("set -ex -o pipefail\n" + script)
+       cmdOutput, err := cmd.Output()
+       c.Assert(err, check.IsNil)
+       c.Assert(string(cmdOutput), check.Equals, goversion+"\n")
+}
index 6e149d45af0d102159a0baa899d54335b389ce25..bdf791153446a7f56013edeaed00a04cb524646a 100644 (file)
@@ -142,7 +142,7 @@ GEM
     metaclass (0.0.4)
     method_source (1.0.0)
     mini_mime (1.1.0)
-    mini_portile2 (2.5.3)
+    mini_portile2 (2.6.1)
     minitest (5.10.3)
     mocha (1.8.0)
       metaclass (~> 0.0.1)
@@ -156,8 +156,8 @@ GEM
     net-ssh-gateway (2.0.0)
       net-ssh (>= 4.0.0)
     nio4r (2.5.7)
-    nokogiri (1.11.7)
-      mini_portile2 (~> 2.5.0)
+    nokogiri (1.12.5)
+      mini_portile2 (~> 2.6.1)
       racc (~> 1.4)
     oj (3.9.2)
     optimist (3.0.0)
@@ -168,7 +168,7 @@ GEM
     pg (1.1.4)
     power_assert (1.1.4)
     public_suffix (4.0.6)
-    racc (1.5.2)
+    racc (1.6.0)
     rack (2.2.3)
     rack-test (1.1.0)
       rack (>= 1.0, < 3)
index 36a33376a1892fb88f5458e18a1d3f59484c27e0..ca98ff63f1492a55e7b4d03ad3442f3fd37b8665 100755 (executable)
@@ -400,6 +400,9 @@ build() {
     fi
     set -e
 
+    # Get the go version we should use for bootstrapping
+    GO_VERSION=`grep 'const 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 \
index 27757be649d7f8ee015aed39145846e3c1d5f3c9..c93c1a10a16438e0ee5945cd3356c1cc14b894ef 100644 (file)
@@ -21,15 +21,16 @@ 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
+# 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 +50,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