X-Git-Url: https://git.arvados.org/arvados.git/blobdiff_plain/7000c1ebd170001e10807b583a29e9e7e9570b23..refs/heads/21283-callable-api-module:/tools/compute-images/scripts/base.sh diff --git a/tools/compute-images/scripts/base.sh b/tools/compute-images/scripts/base.sh index 260c5d47ee..a9323214ce 100644 --- a/tools/compute-images/scripts/base.sh +++ b/tools/compute-images/scripts/base.sh @@ -50,8 +50,8 @@ echo "deb http://apt.arvados.org/$LSB_RELEASE_CODENAME $LSB_RELEASE_CODENAME${RE # Add the arvados signing key cat /tmp/1078ECD7.asc | $SUDO apt-key add - -# Add the debian keys -wait_for_apt_locks && $SUDO DEBIAN_FRONTEND=noninteractive apt-get install --yes debian-keyring debian-archive-keyring +# Add the debian keys (but don't abort if we can't find them, e.g. on Ubuntu where we don't need them) +wait_for_apt_locks && $SUDO DEBIAN_FRONTEND=noninteractive apt-get install --yes debian-keyring debian-archive-keyring 2>/dev/null || true # Fix locale $SUDO /bin/sed -ri 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen @@ -68,8 +68,7 @@ wait_for_apt_locks && $SUDO DEBIAN_FRONTEND=noninteractive apt-get -qq --yes ins libcurl4-openssl-dev \ lvm2 \ cryptsetup \ - xfsprogs \ - squashfs-tools + xfsprogs # Install the Arvados packages we need wait_for_apt_locks && $SUDO DEBIAN_FRONTEND=noninteractive apt-get -qq --yes install \ @@ -114,35 +113,6 @@ $SUDO systemctl daemon-reload # and the BootProbeCommand might be "docker ps -q" $SUDO systemctl disable docker -# Get Go and build singularity -goversion=1.17.1 -mkdir -p /var/lib/arvados -rm -rf /var/lib/arvados/go/ -curl -s https://storage.googleapis.com/golang/go${goversion}.linux-amd64.tar.gz | tar -C /var/lib/arvados -xzf - -ln -sf /var/lib/arvados/go/bin/* /usr/local/bin/ - -singularityversion=3.7.4 -curl -Ls https://github.com/sylabs/singularity/archive/refs/tags/v${singularityversion}.tar.gz | tar -C /var/lib/arvados -xzf - -cd /var/lib/arvados/singularity-${singularityversion} - -# build dependencies for singularity -wait_for_apt_locks && $SUDO DEBIAN_FRONTEND=noninteractive apt-get -qq --yes install \ - make build-essential libssl-dev uuid-dev cryptsetup - -echo $singularityversion > VERSION -./mconfig --prefix=/var/lib/arvados -make -C ./builddir -make -C ./builddir install -ln -sf /var/lib/arvados/bin/* /usr/local/bin/ - -# set `mksquashfs mem` in the singularity config file if it is configured -if [ "$MKSQUASHFS_MEM" != "" ]; then - echo "mksquashfs mem = ${MKSQUASHFS_MEM}" >> /var/lib/arvados/etc/singularity/singularity.conf -fi - -# Print singularity version installed -singularity --version - # Remove unattended-upgrades if it is installed wait_for_apt_locks && $SUDO DEBIAN_FRONTEND=noninteractive apt-get -qq --yes remove unattended-upgrades --purge @@ -150,8 +120,8 @@ wait_for_apt_locks && $SUDO DEBIAN_FRONTEND=noninteractive apt-get -qq --yes rem $SUDO mkdir -p /etc/arvados/docker-cleaner $SUDO echo -e "{\n \"Quota\": \"10G\",\n \"RemoveStoppedContainers\": \"always\"\n}" > /etc/arvados/docker-cleaner/docker-cleaner.json -# Enable cgroup accounting -$SUDO sed -i 's/GRUB_CMDLINE_LINUX=""/GRUB_CMDLINE_LINUX="cgroup_enable=memory swapaccount=1"/g' /etc/default/grub +# Enable cgroup accounting (forcing cgroups v1) +$SUDO echo 'GRUB_CMDLINE_LINUX="$GRUB_CMDLINE_LINUX cgroup_enable=memory swapaccount=1 systemd.unified_cgroup_hierarchy=0"' >> /etc/default/grub $SUDO update-grub # Make sure user_allow_other is set in fuse.conf @@ -188,13 +158,9 @@ else unzip -q /tmp/awscliv2.zip -d /tmp && $SUDO /tmp/aws/install # Pinned to v2.4.5 because we apply a patch below #export EBS_AUTOSCALE_VERSION=$(curl --silent "https://api.github.com/repos/awslabs/amazon-ebs-autoscale/releases/latest" | jq -r .tag_name) - export EBS_AUTOSCALE_VERSION="v2.4.5" - cd /opt && $SUDO git clone https://github.com/awslabs/amazon-ebs-autoscale.git + export EBS_AUTOSCALE_VERSION="5ca6e24e05787b8ae1184c2a10db80053ddd3038" + cd /opt && $SUDO git clone https://github.com/arvados/amazon-ebs-autoscale.git cd /opt/amazon-ebs-autoscale && $SUDO git checkout $EBS_AUTOSCALE_VERSION - $SUDO patch -p1 < /tmp/create-ebs-volume-nvme.patch - - # This script really requires bash and the shebang line is wrong - $SUDO sed -i 's|^#!/bin/sh|#!/bin/bash|' /opt/amazon-ebs-autoscale/bin/ebs-autoscale # Set up the cloud-init script that makes use of the AWS EBS autoscaler $SUDO mv /tmp/usr-local-bin-ensure-encrypted-partitions-aws-ebs-autoscale.sh /usr/local/bin/ensure-encrypted-partitions.sh @@ -217,6 +183,7 @@ if [ "$NVIDIA_GPU_SUPPORT" == "1" ]; then # Install CUDA $SUDO apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/$DIST/x86_64/7fa2af80.pub + $SUDO apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/$DIST/x86_64/3bf863cc.pub $SUDO apt-get -y install software-properties-common $SUDO add-apt-repository "deb https://developer.download.nvidia.com/compute/cuda/repos/$DIST/x86_64/ /" # Ubuntu 18.04's add-apt-repository does not understand 'contrib' @@ -252,4 +219,36 @@ if [ "$NVIDIA_GPU_SUPPORT" == "1" ]; then $SUDO systemctl disable nvidia-persistenced.service fi +# Get Go and build singularity +mkdir -p /var/lib/arvados +rm -rf /var/lib/arvados/go/ +curl -s https://storage.googleapis.com/golang/go${GOVERSION}.linux-amd64.tar.gz | tar -C /var/lib/arvados -xzf - +ln -sf /var/lib/arvados/go/bin/* /usr/local/bin/ + +singularityversion=3.10.4 +cd /var/lib/arvados +git clone --recurse-submodules https://github.com/sylabs/singularity +cd singularity +git checkout v${singularityversion} + +# build dependencies for singularity +wait_for_apt_locks && $SUDO DEBIAN_FRONTEND=noninteractive apt-get -qq --yes install \ + make build-essential libssl-dev uuid-dev cryptsetup \ + squashfs-tools libglib2.0-dev libseccomp-dev + + +echo $singularityversion > VERSION +./mconfig --prefix=/var/lib/arvados +make -C ./builddir +make -C ./builddir install +ln -sf /var/lib/arvados/bin/* /usr/local/bin/ + +# set `mksquashfs mem` in the singularity config file if it is configured +if [ "$MKSQUASHFS_MEM" != "" ]; then + echo "mksquashfs mem = ${MKSQUASHFS_MEM}" >> /var/lib/arvados/etc/singularity/singularity.conf +fi + +# Print singularity version installed +singularity --version + $SUDO apt-get clean