diff --git a/.github/workflows/build-ami.yml b/.github/workflows/build-ami.yml index 3f9b665..1683e20 100644 --- a/.github/workflows/build-ami.yml +++ b/.github/workflows/build-ami.yml @@ -53,6 +53,9 @@ jobs: - name: Build AMI id: build run: | + # pipefail is required so a packer failure isn't masked by the + # exit status of the `tee` at the end of the pipeline below. + set -eo pipefail cd packer BUILD_JOB_URL="https://github.com/${{ github.repository }}/actions/runs/${{ github.run_id }}" COMMIT_HASH="${{ github.sha }}" diff --git a/packer/scripts/install-nvidia-drivers.sh b/packer/scripts/install-nvidia-drivers.sh index f017722..b322503 100755 --- a/packer/scripts/install-nvidia-drivers.sh +++ b/packer/scripts/install-nvidia-drivers.sh @@ -14,15 +14,17 @@ uname -r # Check for NVIDIA GPU (may not work in all environments) lspci | grep -i nvidia || echo "Note: NVIDIA GPU check may not work in build environment" -# Verify gcc is installed -gcc --version - # Update package lists sudo apt-get update -# Install required packages for CUDA installation +# Install required packages for CUDA installation. build-essential provides +# gcc, which is needed to build the NVIDIA kernel modules, so it must be +# installed before the gcc verification below. sudo apt-get install -y linux-headers-$(uname -r) build-essential +# Verify gcc is installed +gcc --version + # Force Ubuntu 24.04 repository (we must use Ubuntu 24.04) echo "Detecting Ubuntu version..." UBUNTU_VERSION=$(lsb_release -rs)