Tweak fuse.conf after the fuse package is installed, not before.
[arvados-dev.git] / jenkins / packer-images / jenkins-image-arvados-tests.sh
1 #!/bin/bash
2
3 # Copyright (C) The Arvados Authors. All rights reserved.
4 #
5 # SPDX-License-Identifier: Apache-2.0
6
7 set -eo pipefail
8
9 # Install the dependencies for arvados-server
10 sudo su -c "DEBIAN_FRONTEND=noninteractive apt-get install -y libpam0g-dev wget build-essential"
11
12 # Install docker (used in our tests and also for package building/testing)
13 sudo su -c "DEBIAN_FRONTEND=noninteractive apt-get install -y docker.io make wget dpkg-dev createrepo unzip"
14 sudo usermod -a -G docker jenkins
15
16 # Check out a local copy of the arvados repo so we can use it to install the dependencies
17 cd /usr/src
18 sudo git clone arvados.git
19
20 # Install the correct version of Go
21 GO_VERSION=`grep 'const goversion =' /usr/src/arvados/lib/install/deps.go |awk -F'"' '{print $2}'`
22 cd /usr/src
23 sudo wget https://golang.org/dl/go${GO_VERSION}.linux-amd64.tar.gz
24 sudo tar xzf go${GO_VERSION}.linux-amd64.tar.gz
25 sudo ln -s /usr/src/go/bin/go /usr/local/bin/go-${GO_VERSION}
26 sudo ln -s /usr/src/go/bin/gofmt /usr/local/bin/gofmt-${GO_VERSION}
27 sudo ln -s /usr/local/bin/go-${GO_VERSION} /usr/local/bin/go
28 sudo ln -s /usr/local/bin/gofmt-${GO_VERSION} /usr/local/bin/gofmt
29
30 # Preseed our dependencies
31 cd arvados
32 sudo go mod download
33 sudo go run ./cmd/arvados-server install -type test
34
35 # FUSE must be configured with the 'user_allow_other' option enabled for Crunch to set up Keep mounts that are readable by containers.
36 # This is used in our test suite.
37 echo user_allow_other | sudo tee -a /etc/fuse.conf
38
39 # Our Jenkins jobs use this directory to store the temporary files for the tests
40 mkdir /home/jenkins/tmp
41
42 # Preseed the run-tests.sh cache. This is a little bit silly (a lot of this
43 # stuff was already done by the call to `./cmd/arvados-server install -type
44 # test` above, but they do not share a cache.
45 sudo chown jenkins:jenkins /home/jenkins -R
46 sudo chown jenkins:jenkins /usr/src/arvados -R
47 sudo -u jenkins ./build/run-tests.sh WORKSPACE=/usr/src/arvados --temp /home/jenkins/tmp --only install
48
49 # Install the arvados-dev repo where the jenkins `test-provision-multinode` job
50 # expects it
51 cd /usr/local
52 sudo git clone --depth 1 https://github.com/arvados/arvados-dev
53 sudo chown -R jenkins:jenkins /usr/local/arvados-dev/