For running our tests, FUSE must be configured with the
[arvados-dev.git] / jenkins / packer-images / jenkins-image-arvados-tests.sh
index abe0e18a885761ff2a1f22e05cc8233e93f9ad92..b673ecf0eef6510e833addc457dccf5bfd58b951 100755 (executable)
@@ -9,21 +9,45 @@ set -eo pipefail
 # Install the dependencies for arvados-server
 sudo su -c "DEBIAN_FRONTEND=noninteractive apt-get install -y libpam0g-dev wget build-essential"
 
-# Get Go 1.16.3
-cd /usr/src
-sudo wget https://golang.org/dl/go1.16.3.linux-amd64.tar.gz
-sudo tar xzf go1.16.3.linux-amd64.tar.gz
-sudo ln -s /usr/src/go/bin/go /usr/local/bin/go-1.16.3
-sudo ln -s /usr/src/go/bin/gofmt /usr/local/bin/gofmt-1.16.3
-sudo ln -s /usr/local/bin/go-1.16.3 /usr/local/bin/go
-sudo ln -s /usr/local/bin/gofmt-1.16.3 /usr/local/bin/gofmt
+# Install docker (used in our tests and also for package building/testing)
+sudo su -c "DEBIAN_FRONTEND=noninteractive apt-get install -y docker.io make wget dpkg-dev createrepo unzip"
+sudo usermod -a -G docker jenkins
+
+# FUSE must be configured with the 'user_allow_other' option enabled for Crunch to set up Keep mounts that are readable by containers.
+# This is used in our test suite.
+echo user_allow_other | sudo tee -a /etc/fuse.conf
 
 # Check out a local copy of the arvados repo so we can use it to install the dependencies
 cd /usr/src
 sudo git clone arvados.git
+
+# Install the correct version of Go
+GO_VERSION=`grep 'const goversion =' /usr/src/arvados/lib/install/deps.go |awk -F'"' '{print $2}'`
+cd /usr/src
+sudo wget https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz
+sudo tar xzf go${GO_VERSION}.linux-amd64.tar.gz
+sudo ln -s /usr/src/go/bin/go /usr/local/bin/go-${GO_VERSION}
+sudo ln -s /usr/src/go/bin/gofmt /usr/local/bin/gofmt-${GO_VERSION}
+sudo ln -s /usr/local/bin/go-${GO_VERSION} /usr/local/bin/go
+sudo ln -s /usr/local/bin/gofmt-${GO_VERSION} /usr/local/bin/gofmt
+
+# Preseed our dependencies
 cd arvados
 sudo go mod download
 sudo go run ./cmd/arvados-server install -type test
 
 # Our Jenkins jobs use this directory to store the temporary files for the tests
 mkdir /home/jenkins/tmp
+
+# Preseed the run-tests.sh cache. This is a little bit silly (a lot of this
+# stuff was already done by the call to `./cmd/arvados-server install -type
+# test` above, but they do not share a cache.
+sudo chown jenkins:jenkins /home/jenkins -R
+sudo chown jenkins:jenkins /usr/src/arvados -R
+sudo -u jenkins ./build/run-tests.sh WORKSPACE=/usr/src/arvados --temp /home/jenkins/tmp --only install
+
+# Install the arvados-dev repo where the jenkins `test-provision-multinode` job
+# expects it
+cd /usr/local
+sudo git clone --depth 1 https://github.com/arvados/arvados-dev
+sudo chown -R jenkins:jenkins /usr/local/arvados-dev/