From fb7ad959fa8e54ff5bca83d16e3d118942902e92 Mon Sep 17 00:00:00 2001 From: Andrey Talman Date: Fri, 28 Jul 2023 12:58:08 -0400 Subject: [PATCH] Add nvidia-docker tools installation to worker provisioning (#4438) fix tflint --- .../modules/runners-instances/templates/user-data.sh | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/terraform-aws-github-runner/modules/runners-instances/templates/user-data.sh b/terraform-aws-github-runner/modules/runners-instances/templates/user-data.sh index 649ec1b7b3..2f3095538d 100644 --- a/terraform-aws-github-runner/modules/runners-instances/templates/user-data.sh +++ b/terraform-aws-github-runner/modules/runners-instances/templates/user-data.sh @@ -24,8 +24,7 @@ ${install_config_runner} echo Checking if nvidia install required ${nvidia_driver_install} %{ if nvidia_driver_install ~} set +e -os_id=$(awk -F= '/^ID=/{print $2}' /etc/os-release) -os_version=$(awk -F= '/^VERSION=/{print $2}' /etc/os-release) +os_id=$(. /etc/os-release;echo $ID$VERSION_ID) if ! [[ "$os_id" =~ ^amzn.* ]]; then echo Installing Development Tools sudo yum groupinstall -y "Development Tools" @@ -38,7 +37,7 @@ sudo rm -fv /tmp/nvidia_driver if ! [[ "$os_id" =~ ^amzn.* ]]; then echo Installing nvidia-docker tools sudo yum install -y yum-utils - sudo yum-config-manager --add-repo https://nvidia.github.io/nvidia-docker/${os_id}${os_version}/nvidia-docker.repo + sudo yum-config-manager --add-repo https://nvidia.github.io/nvidia-docker/$os_id/nvidia-docker.repo sudo yum install -y nvidia-docker2 sudo systemctl restart docker fi