From f177782a13bb9746c963ac1ccfbfa3b482dc89a2 Mon Sep 17 00:00:00 2001 From: shiva kumar Date: Mon, 25 Nov 2024 18:36:02 +0530 Subject: [PATCH] ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 ci pipeline fix Signed-off-by: shiva kumar ubuntu24.04 ci pipeline fix Signed-off-by: shiva kumar ubuntu24.04 ci pipeline fix Signed-off-by: shiva kumar ubuntu24.04 ci pipeline fix Signed-off-by: shiva kumar ubuntu24.04 ci pipeline fix Signed-off-by: shiva kumar ubuntu24.04 ci pipeline fix Signed-off-by: shiva kumar ubuntu24.04 ci pipeline fix Signed-off-by: shiva kumar ubuntu24.04 ci pipeline fix Signed-off-by: shiva kumar ubuntu24.04 precompile image support ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 ci pipeline fix Signed-off-by: shiva kumar ubuntu24.04 ci pipeline fix Signed-off-by: shiva kumar ubuntu24.04 precompile image support Signed-off-by: shiva kumar ubuntu24.04 precompile support Signed-off-by: shiva kumar ubuntu24.04 precompile image support ubuntu24.04 precompile image support Signed-off-by: shiva kumar --- .common-ci.yml | 8 -- .github/workflows/precompiled.yaml | 117 +++++++++++++++++++---------- .nvidia-ci.yml | 41 +++++----- Makefile | 4 +- tests/scripts/findkernelversion.sh | 2 + 5 files changed, 102 insertions(+), 70 deletions(-) diff --git a/.common-ci.yml b/.common-ci.yml index 21707491..737f727c 100644 --- a/.common-ci.yml +++ b/.common-ci.yml @@ -179,14 +179,6 @@ trigger-pipeline: rules: - if: $CI_PIPELINE_SOURCE != "schedule" -.release-ubuntu24.04: - # Perform for each DRIVER_VERSION - extends: - - .release-generic - - .driver-versions - rules: - - if: $CI_PIPELINE_SOURCE != "schedule" - .release-rhel9: # Perform for each DRIVER_VERSION extends: diff --git a/.github/workflows/precompiled.yaml b/.github/workflows/precompiled.yaml index c7ea8b4c..2c7ca5e2 100644 --- a/.github/workflows/precompiled.yaml +++ b/.github/workflows/precompiled.yaml @@ -25,10 +25,10 @@ on: - opened - synchronize branches: - - ci-precompile-ubuntu24.04 + - test-ubuntu24.04 push: branches: - - ci-precompile-ubuntu24.04 + - test-ubuntu24.04 jobs: set-driver-version-matrix: @@ -165,10 +165,6 @@ jobs: needs: - precompiled-build-image - set-driver-version-matrix - outputs: - matrix_values_not_empty: ${{ steps.set_kernel_version.outputs.matrix_values_not_empty }} - matrix_values: ${{ steps.set_kernel_version.outputs.matrix_values }} - dist: ${{ steps.set-driver-version-matrix.outputs.dist }} steps: - name: Check out code uses: actions/checkout@v4 @@ -180,13 +176,10 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Set kernel version - id: set_kernel_version env: DIST: ${{ matrix.dist }} GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | - echo "matrix_values_not_empty=0" >> $GITHUB_OUTPUT - if [ "$DIST" == "ubuntu22.04" ]; then export BASE_TARGET="jammy" export LTS_KERNEL="5.15" @@ -213,22 +206,66 @@ jobs: echo "Skipping e2e tests" exit 0 fi + for i in "${!KERNEL_VERSIONS[@]}"; do + KERNEL_VERSIONS[$i]="${KERNEL_VERSIONS[$i]}-$DIST" + done # Convert array to JSON format and assign - echo "[]" > $GITHUB_WORKSPACE/matrix_values.json - printf '%s\n' "${KERNEL_VERSIONS[@]}" | jq -R . | jq -s . > $GITHUB_WORKSPACE/matrix_values.json - echo "matrix_values=$(cat $GITHUB_WORKSPACE/matrix_values.json | jq -c .)" >> $GITHUB_OUTPUT - echo "matrix_values_not_empty=1" >> $GITHUB_OUTPUT + echo "[]" > ./matrix_values_$DIST.json + printf '%s\n' "${KERNEL_VERSIONS[@]}" | jq -R . | jq -s . > ./matrix_values_$DIST.json - e2e-tests-nvidiadriver: + - name: Upload kernel matrix values as artifacts + uses: actions/upload-artifact@v4 + with: + name: matrix-values-${{ matrix.dist }} + path: ./matrix_values_${{ matrix.dist }}.json + + collect-e2e-test-matrix: runs-on: linux-amd64-cpu4 needs: - determine-e2e-test-matrix - set-driver-version-matrix - if: ${{ needs.determine-e2e-test-matrix.outputs.matrix_values_not_empty == '1' }} + outputs: + matrix_values_not_empty: ${{ steps.set_kernel_version.outputs.matrix_values_not_empty }} + matrix_values: ${{ steps.set_kernel_version.outputs.matrix_values }} + steps: + - name: Check out code + uses: actions/checkout@v4 + - name: Set and append matrix values for ubuntu + id: set_kernel_version + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + echo "matrix_values_not_empty=0" >> $GITHUB_OUTPUT + # combined_values="[]" + kernel_versions=() + + # Read and merge kernel_version values from dist files + DIST=("ubuntu22.04" "ubuntu24.04") + for d in "${DIST[@]}"; do + artifact_name="matrix-values-${d}" + file_path="./matrix_values_${d}.json" + echo "Attempting to download artifact: $artifact_name" + if gh run download --name "$artifact_name" --dir ./; then + echo "Successfully downloaded artifact: $artifact_name" + value=$(jq -r '.[]' "$file_path") + kernel_versions+=($value) + echo "matrix_values_not_empty=1" >> $GITHUB_OUTPUT + fi + done + echo "Collected Kernel Versions: ${kernel_versions[@]}" + combined_values=$(printf '%s\n' "${kernel_versions[@]}" | jq -R . | jq -s -c . | tr -d ' \n') + echo "Combined Kernel Versions JSON: $combined_values" + echo "matrix_values=$combined_values" >> $GITHUB_OUTPUT + + e2e-tests-nvidiadriver: + runs-on: linux-amd64-cpu4 + needs: + - collect-e2e-test-matrix + - set-driver-version-matrix + if: ${{ needs.collect-e2e-test-matrix.outputs.matrix_values_not_empty == '1' }} strategy: matrix: - kernel_version: ${{ fromJson(needs.determine-e2e-test-matrix.outputs.matrix_values) }} - dist: ${{ fromJson(needs.set-driver-version-matrix.outputs.dist) }} + kernel_version: ${{ fromJson(needs.collect-e2e-test-matrix.outputs.matrix_values) }} steps: - name: Check out code uses: actions/checkout@v4 @@ -238,36 +275,41 @@ jobs: registry: ghcr.io username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Set and Calculate test vars + run: | + echo "private_key=${{ github.workspace }}/key.pem" >> $GITHUB_ENV + echo "${{ secrets.AWS_SSH_KEY }}" > ${{ github.workspace }}/key.pem && chmod 400 ${{ github.workspace }}/key.pem + echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV + echo "PRIVATE_REGISTRY=ghcr.io" >> $GITHUB_ENV + KERNEL_VERSION="${{ matrix.kernel_version }}" + # Extract the last segment after the last dash + DIST=${KERNEL_VERSION##*-} + echo "DIST=$DIST" >> $GITHUB_ENV + KERNEL_VERSION=${KERNEL_VERSION%-*} + echo "KERNEL_VERSION=$KERNEL_VERSION" >> $GITHUB_ENV + driver_branch_json="${{ needs.set-driver-version-matrix.outputs.driver_branch }}" + DRIVER_BRANCHES=($(echo "$driver_branch_json" | jq -r '.[]')) + echo "DRIVER_BRANCHES=${DRIVER_BRANCHES[*]}" >> $GITHUB_ENV - name: Set up Holodeck uses: NVIDIA/holodeck@v0.2.1 env: AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} AWS_SSH_KEY: ${{ secrets.AWS_SSH_KEY }} + DIST: ${{ env.DIST }} with: aws_access_key_id: ${{ secrets.AWS_ACCESS_KEY_ID }} aws_secret_access_key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} aws_ssh_key: ${{ secrets.AWS_SSH_KEY }} - holodeck_config: "tests/holodeck_${{ matrix.dist }}.yaml" - + holodeck_config: "tests/holodeck_${{ env.DIST }}.yaml" - name: Get public dns name id: get_public_dns_name uses: mikefarah/yq@master with: cmd: yq '.status.properties[] | select(.name == "public-dns-name") | .value' /github/workspace/.cache/holodeck.yaml - - name: Set and Calculate test vars + - name: Calculate holodeck instance hostname run: | echo "instance_hostname=ubuntu@${{ steps.get_public_dns_name.outputs.result }}" >> $GITHUB_ENV - echo "private_key=${{ github.workspace }}/key.pem" >> $GITHUB_ENV - echo "${{ secrets.AWS_SSH_KEY }}" > ${{ github.workspace }}/key.pem && chmod 400 ${{ github.workspace }}/key.pem - echo "COMMIT_SHORT_SHA=${GITHUB_SHA:0:8}" >> $GITHUB_ENV - echo "PRIVATE_REGISTRY=ghcr.io" >> $GITHUB_ENV - KERNEL_VERSION="${{ matrix.kernel_version }}" - echo "KERNEL_VERSION=$KERNEL_VERSION" >> $GITHUB_ENV - echo "DIST=${{ matrix.dist }}" >> $GITHUB_ENV - driver_branch_json="${{ needs.set-driver-version-matrix.outputs.driver_branch }}" - DRIVER_BRANCHES=($(echo "$driver_branch_json" | jq -r '.[]')) - echo "DRIVER_BRANCHES=${DRIVER_BRANCHES[*]}" >> $GITHUB_ENV # step added to skip azure e2e tests and publish the image # FIXME -- remove step once azure kernel upgrade starts working @@ -352,16 +394,12 @@ jobs: runs-on: linux-amd64-cpu4 needs: - set-driver-version-matrix - - determine-e2e-test-matrix + - collect-e2e-test-matrix - e2e-tests-nvidiadriver strategy: matrix: driver_branch: ${{ fromJson(needs.set-driver-version-matrix.outputs.driver_branch) }} - kernel_version: ${{ fromJson(needs.determine-e2e-test-matrix.outputs.matrix_values) }} - dist: ${{ fromJson(needs.set-driver-version-matrix.outputs.dist) }} - exclude: - - dist: ubuntu24.04 - driver_branch: 535 + kernel_version: ${{ fromJson(needs.collect-e2e-test-matrix.outputs.matrix_values) }} steps: - name: Check out code uses: actions/checkout@v4 @@ -375,17 +413,16 @@ jobs: - name: Set image vars run: | echo "PRIVATE_REGISTRY=ghcr.io" >> $GITHUB_ENV - echo "DIST=${{ matrix.dist }}" >> $GITHUB_ENV - name: Download built image artifact uses: actions/download-artifact@v4 with: - name: driver-images-${{ matrix.driver_branch }}-${{ matrix.kernel_version }}-${{ env.DIST }} + name: driver-images-${{ matrix.driver_branch }}-${{ matrix.kernel_version }} path: ./ - name: Publish image run: | - image_path="./driver-images-${{ matrix.driver_branch }}-${{ matrix.kernel_version }}-${{ env.DIST }}.tar" + image_path="./driver-images-${{ matrix.driver_branch }}-${{ matrix.kernel_version }}.tar" echo "uploading $image_path" docker load -i $image_path - docker push ${PRIVATE_REGISTRY}/nvidia/driver:${{ matrix.driver_branch }}-${{ matrix.kernel_version }}-${{ env.DIST }} + docker push ${PRIVATE_REGISTRY}/nvidia/driver:${{ matrix.driver_branch }}-${{ matrix.kernel_version }} diff --git a/.nvidia-ci.yml b/.nvidia-ci.yml index c44668ca..87461cd1 100644 --- a/.nvidia-ci.yml +++ b/.nvidia-ci.yml @@ -211,7 +211,7 @@ image-rhel8: .scan-ubuntu24.04: # Repeat for each DRIVER_VERSION extends: - - .driver-versions + - .driver-versions-ubuntu24.04 - .scan-generic rules: - !reference [.scan-rules-common, rules] @@ -342,24 +342,25 @@ release:ngc-ubuntu22.04: - .dist-ubuntu22.04 - .driver-versions -release:ngc-ubuntu24.04: - extends: - - .release:ngc - - .dist-ubuntu24.04 - - .driver-versions - -release:ngc-precompiled-ubuntu24.04: - variables: - DIST: signed_ubuntu24.04 - BASE_TARGET: noble - PRECOMPILED: "true" - extends: - - .driver-versions-precompiled-ubuntu24.04 - - .release-generic - - .release:ngc-variables - rules: - # Only run NGC release job on scheduled pipelines - - if: $CI_PIPELINE_SOURCE == "schedule" +# TODO will be enabled after QA +# release:ngc-ubuntu24.04: +# extends: +# - .release:ngc +# - .dist-ubuntu24.04 +# - .driver-versions + +# release:ngc-precompiled-ubuntu24.04: +# variables: +# DIST: signed_ubuntu24.04 +# BASE_TARGET: noble +# PRECOMPILED: "true" +# extends: +# - .driver-versions-precompiled-ubuntu24.04 +# - .release-generic +# - .release:ngc-variables +# rules: +# # Only run NGC release job on scheduled pipelines +# - if: $CI_PIPELINE_SOURCE == "schedule" release:ngc-precompiled-ubuntu22.04: variables: @@ -529,7 +530,7 @@ sign:ngc-ubuntu-rhel-rhcos: matrix: - SIGN_JOB_NAME: ["ubuntu"] VERSION: ["24.04"] - DRIVER_VERSION: ["535.216.03", "550.127.08"] + DRIVER_VERSION: ["550.127.05"] - SIGN_JOB_NAME: ["ubuntu"] VERSION: ["22.04"] DRIVER_VERSION: ["535.216.03", "550.127.08"] diff --git a/Makefile b/Makefile index bad9c916..07aae4e6 100644 --- a/Makefile +++ b/Makefile @@ -54,9 +54,9 @@ OUT_IMAGE_TAG = $(OUT_IMAGE_VERSION)-$(OUT_DIST) OUT_IMAGE = $(OUT_IMAGE_NAME):$(OUT_IMAGE_TAG) ##### Public rules ##### -DISTRIBUTIONS := ubuntu18.04 ubuntu20.04 ubuntu22.04 ubuntu24.04 signed_ubuntu24.04 signed_ubuntu20.04 signed_ubuntu22.04 rhel8 rhel9 flatcar fedora36 sles15.3 precompiled_rhcos +DISTRIBUTIONS := ubuntu18.04 ubuntu20.04 ubuntu22.04 ubuntu24.04 signed_ubuntu20.04 signed_ubuntu22.04 signed_ubuntu24.04 rhel8 rhel9 flatcar fedora36 sles15.3 precompiled_rhcos PUSH_TARGETS := $(patsubst %, push-%, $(DISTRIBUTIONS)) -BASE_FROM := jammy focal noble +BASE_FROM := noble jammy focal PUSH_TARGETS := $(patsubst %, push-%, $(DISTRIBUTIONS)) DRIVER_PUSH_TARGETS := $(foreach push_target, $(PUSH_TARGETS), $(addprefix $(push_target)-, $(DRIVER_VERSIONS))) BUILD_TARGETS := $(patsubst %, build-%, $(DISTRIBUTIONS)) diff --git a/tests/scripts/findkernelversion.sh b/tests/scripts/findkernelversion.sh index 726bebc9..8428fb4b 100755 --- a/tests/scripts/findkernelversion.sh +++ b/tests/scripts/findkernelversion.sh @@ -48,3 +48,5 @@ if [[ $status -eq 0 ]]; then else export should_continue=true fi +#SHIVA +export should_continue=true