Skip to content

Commit

Permalink
ubuntu24.04 precompile image support
Browse files Browse the repository at this point in the history
Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 ci pipeline fix

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 ci pipeline fix

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 ci pipeline fix

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 ci pipeline fix

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 ci pipeline fix

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 ci pipeline fix

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 ci pipeline fix

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 ci pipeline fix

Signed-off-by: shiva kumar <[email protected]>

ubuntu24.04 precompile image support

ubuntu24.04 precompile image support

Signed-off-by: shiva kumar <[email protected]>
  • Loading branch information
shivakunv committed Nov 26, 2024
1 parent ad6a4f9 commit ba8fd67
Show file tree
Hide file tree
Showing 2 changed files with 84 additions and 44 deletions.
126 changes: 82 additions & 44 deletions .github/workflows/precompiled.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -45,11 +45,14 @@ jobs:
run: |
# get driver_branch
DRIVER_BRANCH=("535" "550")
# DRIVER_BRANCH=("550")
driver_branch_json=$(printf '%s\n' "${DRIVER_BRANCH[@]}" | jq -R . | jq -cs .)
echo "driver_branch=$driver_branch_json" >> $GITHUB_OUTPUT
# get kernel flavors
KERNEL_FLAVORS=("aws" "azure" "generic" "nvidia" "oracle")
# KERNEL_FLAVORS=("aws")
# KERNEL_FLAVORS=("aws" "generic")
kernel_flavors_json=$(printf '%s\n' "${KERNEL_FLAVORS[@]}" | jq -R . | jq -cs .)
echo "kernel_flavors=$kernel_flavors_json" >> $GITHUB_OUTPUT
Expand Down Expand Up @@ -165,10 +168,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
Expand All @@ -180,13 +179,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"
Expand All @@ -213,22 +209,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
Expand All @@ -238,36 +278,39 @@ jobs:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Set and Calculate test vars
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 }}"
# Extract the last segment after the last dash
DIST=$(echo "$KERNEL_VERSION" | awk -F'-' '{print $NF}')
DIST=$(echo "$DIST" | sed 's/]$//') # Remove trailing bracket if present
echo "DIST=$DIST" >> $GITHUB_ENV
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/[email protected]
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
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
Expand Down Expand Up @@ -322,14 +365,14 @@ jobs:
fi
for DRIVER_VERSION in "${DRIVER_BRANCHES[@]}"; do
echo "Running e2e for DRIVER_VERSION=$DRIVER_VERSION"
image="driver-images-${DRIVER_VERSION}-${KERNEL_VERSION}-${DIST}"
image="driver-images-${DRIVER_VERSION}-${KERNEL_VERSION}"
echo "Downloading $image in tests directory"
gh run download --name $image --dir ./tests/
status=0
TEST_CASE_ARGS="${GPU_OPERATOR_OPTIONS} --set driver.version=${DRIVER_VERSION}"
# add escape character for space
TEST_CASE_ARGS=$(printf '%q ' "$TEST_CASE_ARGS")
IMAGE_PATH="./tests/driver-images-${DRIVER_VERSION}-${KERNEL_VERSION}-${DIST}.tar"
IMAGE_PATH="./tests/driver-images-${DRIVER_VERSION}-${KERNEL_VERSION}.tar"
./tests/ci-run-e2e.sh "${TEST_CASE}" "${TEST_CASE_ARGS}" ${IMAGE_PATH} || status=$?
if [ $status -eq 1 ]; then
echo "e2e validation failed for driver version $DRIVER_VERSION with status $status"
Expand All @@ -352,16 +395,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
Expand All @@ -375,17 +414,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 }}
2 changes: 2 additions & 0 deletions tests/scripts/findkernelversion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,5 @@ if [[ $status -eq 0 ]]; then
else
export should_continue=true
fi
#SHIVA
export should_continue=true

0 comments on commit ba8fd67

Please sign in to comment.