3 # Copyright (C) The Arvados Authors. All rights reserved.
5 # SPDX-License-Identifier: Apache-2.0
9 sudo su -c "echo ssh-rsa AAAAB3NzaC1yc2EAAAABIwAAAgEA3nzI6T6Lpd5xFoRewcx91Dv9sUzNNmdYfwOleemBFz0y3RaQElehUWasyjuIURZw7RL5EjvrqeQq9pe/lO99dO0F9yMuMsMH2t88YrVJQ/z/5Aa4I2zYQotKb/9CCfynsy41y5xywxtOwXiDk2kpo+c9VZCyCeW8Hnc9HaIpkKSLnkqDVhESzlrkYyNKZvUAL1hiFIzmmw/veFgRb7/ol76Ze3xsWugbHUECEIAKoz/8uaevOAAoJrMFhffFIQ8IfClqDZv2lnBBhvh1O9TO0Mg4klcieyQ1RZhMjeP4WnAa9PXP7xZlQHLgO9qO1jDd2sOdkX6EedCfX5jO4Y51HPJpV35uYumw3veftMlpIJFmA2eIQxU19SCYpojWRGXZ5v9WtFIHX2nGy+Gi1bk7TR+HBsCDXOPhhQk4ceIM4OonqEb1NJ57elxh6mFbDAQCZtYhRLqYvcyGpuBdVdLNOJbOZ7vBJY3Kfjxa87rvFIJheT6DXhpdRayeOovLm0vuJ53bZoWxWOqjpuigQqHtSB3OmintrKB916BhNFsHwPeZpK0ahZGFygV63REM/X8m0nOlHqyAY69uzLHyYXM83zAI1L5Y4wuzsVqO+1tnK6PMcfg5/DArjBrn7YqA5tzJY9EgdVVPjpgjD2yYYTOP6b3UUw4uFj3asnOX24dfVzk= ward@countzero" >> /home/jenkins/.ssh/authorized_keys
10 sudo su -c "echo ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQCfRJenfxGPFuJ/W2KUs6Wf0waiFsSaxd8WUTFXi4ophH2qkUMxd8xvoex/Z+Iq1fA8QCe4DfFnhUOMViP9bBB6+Va/x1Jx521P+DfN8ILqM2kcug0OoC4c5gTyFecJaKIyX6jMeidQThkd/UPHeTdicOnMqUTKIksQVXzIxzve6MQxbZts1viw0VgcO2t16F9LA+JaB8ONOTPfBzJ/BzZRiztfz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4ZDS+O+8S7aC5m8sQ/V+NqiiXLH22vN58K7qNrkHWdb1n+rhilMbA5zp3cSKBgwmmNdupyPkJOKvf3IS7i4El+c8RFmRQv4FzGrdjGXAP8LPtt1dWPgHTFYjmrkOHLmfWM/y8cuyPWW/HEp3Y/msPQRlS3Gymce//vAWgN4T9yN46w== lucas@notebook" >> /home/jenkins/.ssh/authorized_keys
13 # Install a few dependency packages
14 # First, let's figure out the OS we're working on
15 OS_ID=$(grep ^ID= /etc/os-release |cut -f 2 -d \" | cut -f 2 -d = )
16 echo "Detected distro: ${OS_ID}"
20 PREINSTALL_CMD="/bin/true"
21 INSTALL_CMD="yum install -y"
22 POSTINSTALL_CMD="/bin/true"
23 PKGS="git nmap-ncat java-11-openjdk"
26 if [ ${OS_ID} = "debian" ]; then
27 echo "deb http://deb.debian.org/debian buster-backports main" | sudo tee /etc/apt/sources.list.d/buster-backports.list
29 PREINSTALL_CMD="DEBIAN_FRONTEND=noninteractive apt-get update"
30 INSTALL_CMD="DEBIAN_FRONTEND=noninteractive apt-get install -y"
31 POSTINSTALL_CMD="DEBIAN_FRONTEND=noninteractive apt-get purge --autoremove -y"
32 # SUFFIX packages with - to remove them
33 # Remove unattended-upgrades so that it doesn't interfere with our nodes at startup
34 PKGS="git netcat-traditional default-jdk unattended-upgrades-"
38 sudo su -c "${PREINSTALL_CMD}"
39 sudo su -c "${INSTALL_CMD} ${PKGS}"
40 sudo su -c "${POSTINSTALL_CMD}"
42 # create a reference repository (bare git repo)
43 # jenkins will use this to speed up the checkout for each job
45 sudo git clone --mirror https://git.arvados.org/arvados.git
46 sudo chown jenkins:jenkins arvados.git -R
48 # Jenkins will use this script to determine when the node is ready for use
49 sudo mv /tmp/node-ready.sh /usr/local/bin/
51 # make sure sshd does not start on boot (yes, this is nasty). Jenkins will call
52 # /tmp/node-ready.sh as a GCP `startup script`, which gets run on node start.
53 # That script loops until it can connect to git.arvados.org, and then starts
54 # sshd so that the Jenkins agent can connect. This avoids the race where Jenkins
55 # tries to start a job before the GCP outbound routing is working, and fails on
56 # the first thing it needs internet for, the checkout from git.arvados.org
57 sudo /bin/systemctl disable sshd