22317: Replace compute image base.sh with an Ansible playbook
authorBrett Smith <brett.smith@curii.com>
Tue, 19 Nov 2024 14:25:18 +0000 (09:25 -0500)
committerBrett Smith <brett.smith@curii.com>
Tue, 19 Nov 2024 15:39:56 +0000 (10:39 -0500)
commit2638fb1852ec48f5b65364768ab9978dda818efa
treeeb1dea57f1b6fecf86045eb2aeb4d5bb6927c67d
parent39414210d71abee0926309e1a83319821310bafd
22317: Replace compute image base.sh with an Ansible playbook

The hope is that this will be more maintainable and extendable, and
allow us to start building towards a general Ansible installer.

This Ansible playbook was written and tested against Ansible 8.7.0,
because Ansible 8.x seems to be the version that supports most of the
Pythons we care about. This might need refinement in the future.

The Ansible playbook supports all the same deployment configurations as
base.sh, but there are some differences in the way it goes about things:

* It no longer configures GRUB for cgroups v1 because Arvados supports
  cgroups v2 now.

* It installs software to /opt instead of /var/lib/arvados, because
  software doesn't belong in /var and none of this is Arvados software
  specifically looking for that path.

* It only installs either Docker or Singularity as required, not both.

* It builds Singularity in a temporary directory that it cleans up
  afterwards to save space in the AMI.

* It sets up the encrypted partition script as a systemd service rather
  than a cloud-init script so we can be more explicit about the ordering
  requirements. The service orders itself before SSH so it has a chance to
  finish before the Crunch dispatcher is able to SSH in. If it fails, that
  will be reflected in systemctl's system state, and therefore our default
  BootProbeCommand as well.

Arvados-DCO-1.1-Signed-off-by: Brett Smith <brett.smith@curii.com>
33 files changed:
tools/compute-images/1078ECD7.asc [deleted file]
tools/compute-images/ansible/build-compute-image.yml [new file with mode: 0644]
tools/compute-images/ansible/roles/arvados_apt/defaults/main.yml [new file with mode: 0644]
tools/compute-images/ansible/roles/arvados_apt/tasks/main.yml [new file with mode: 0644]
tools/compute-images/ansible/roles/arvados_apt/templates/arvados.pref.j2 [new file with mode: 0644]
tools/compute-images/ansible/roles/compute_docker/defaults/main.yml [new file with mode: 0644]
tools/compute-images/ansible/roles/compute_docker/files/arvados-docker.pref [new file with mode: 0644]
tools/compute-images/ansible/roles/compute_docker/tasks/main.yml [new file with mode: 0644]
tools/compute-images/ansible/roles/compute_encrypt_tmp/defaults/main.yml [new file with mode: 0644]
tools/compute-images/ansible/roles/compute_encrypt_tmp/files/arvados-ensure-encrypted-partitions.service [new file with mode: 0644]
tools/compute-images/ansible/roles/compute_encrypt_tmp/files/ebs-autoscale.conf [new file with mode: 0644]
tools/compute-images/ansible/roles/compute_encrypt_tmp/files/ensure-encrypted-partitions.sh [moved from tools/compute-images/scripts/usr-local-bin-ensure-encrypted-partitions.sh with 74% similarity]
tools/compute-images/ansible/roles/compute_encrypt_tmp/tasks/aws_ebs.yml [new file with mode: 0644]
tools/compute-images/ansible/roles/compute_encrypt_tmp/tasks/main.yml [new file with mode: 0644]
tools/compute-images/ansible/roles/compute_nvidia/defaults/main.yml [new file with mode: 0644]
tools/compute-images/ansible/roles/compute_nvidia/files/arvados-nvidia.pref [new file with mode: 0644]
tools/compute-images/ansible/roles/compute_nvidia/files/detect-gpu.conf [moved from tools/compute-images/scripts/etc-systemd-system-systemd-modules-load.service.d-detect-gpu.conf with 68% similarity]
tools/compute-images/ansible/roles/compute_nvidia/files/detect-gpu.sh [moved from tools/compute-images/scripts/usr-local-bin-detect-gpu.sh with 100% similarity]
tools/compute-images/ansible/roles/compute_nvidia/tasks/main.yml [new file with mode: 0644]
tools/compute-images/ansible/roles/compute_singularity/defaults/main.yml [new file with mode: 0644]
tools/compute-images/ansible/roles/compute_singularity/tasks/main.yml [new file with mode: 0644]
tools/compute-images/ansible/roles/compute_user/defaults/main.yml [moved from tools/compute-images/.licenseignore with 53% similarity]
tools/compute-images/ansible/roles/compute_user/tasks/main.yml [new file with mode: 0644]
tools/compute-images/ansible/roles/distro_apt/defaults/main.yml [new file with mode: 0644]
tools/compute-images/ansible/roles/distro_apt/tasks/debian.yml [new file with mode: 0644]
tools/compute-images/ansible/roles/distro_apt/tasks/main.yml [new file with mode: 0644]
tools/compute-images/arvados-images-aws.json
tools/compute-images/arvados-images-azure.json
tools/compute-images/build.sh
tools/compute-images/scripts/base.sh [deleted file]
tools/compute-images/scripts/etc-apt-preferences.d-arvados.pref [deleted file]
tools/compute-images/scripts/etc-cloud-cloud.cfg.d-07_compute_arvados_dispatch_cloud.cfg [deleted file]
tools/compute-images/scripts/usr-local-bin-ensure-encrypted-partitions-aws-ebs-autoscale.sh [deleted file]