-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Pre-compiled end-to-end gpu driver validation
Signed-off-by: shiva kumar <[email protected]>
- Loading branch information
Showing
15 changed files
with
191 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
#! /bin/bash | ||
# This test case runs the operator installation / test case with the default options. | ||
|
||
SCRIPTS_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )"/../scripts && pwd )" | ||
source "${SCRIPTS_DIR}"/.definitions.sh | ||
|
||
# Run an end-to-end test cycle | ||
"${SCRIPTS_DIR}"/nvidia-kernel-upgrade-aws.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
tests/ | ||
tests/*** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
if [[ "${SKIP_INSTALL}" == "true" ]]; then | ||
echo "Skipping install: SKIP_INSTALL=${SKIP_INSTALL}" | ||
exit 0 | ||
fi | ||
|
||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
source "${SCRIPT_DIR}"/.definitions.sh | ||
|
||
export REGCTL_VERSION=v0.4.7 | ||
mkdir -p bin | ||
curl -sSLo bin/regctl https://github.com/regclient/regclient/releases/download/${REGCTL_VERSION}/regctl-linux-amd64 | ||
chmod a+x bin/regctl | ||
export PATH=$(pwd)/bin:${PATH} | ||
DRIVER_BRANCH=$(echo "${TARGET_DRIVER_VERSION}" | cut -d '.' -f 1) | ||
KERNEL_FLAVOR=$(uname -r | awk -F'-' '{print $3}') | ||
regctl image get-file ghcr.io/nvidia/driver:base-${BASE_TARGET}-${KERNEL_FLAVOR}-${DRIVER_BRANCH} /var/kernel_version.txt ${LOG_DIR}/kernel_version.txt || true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#!/bin/bash | ||
|
||
if [[ "${SKIP_INSTALL}" == "true" ]]; then | ||
echo "Skipping install: SKIP_INSTALL=${SKIP_INSTALL}" | ||
exit 0 | ||
fi | ||
|
||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
source "${SCRIPT_DIR}"/.definitions.sh | ||
|
||
# finding kernel version | ||
${SCRIPT_DIR}/findkernelversion.sh | ||
source "${LOG_DIR}"/kernel_version.txt | ||
|
||
echo "Checking current kernel version..." | ||
CURRENT_KERNEL=$(uname -r) | ||
echo "Current kernel version: $CURRENT_KERNEL" | ||
|
||
if [ "${CURRENT_KERNEL}" != ${KERNEL_VERSION} ]; then | ||
echo "" | ||
echo "" | ||
echo "--------------Starting the Precompiled kernel version ${KERNEL_VERSION} upgrade--------------" | ||
|
||
sudo apt-get update -y | ||
sudo apt-get install --allow-downgrades linux-image-${KERNEL_VERSION} -y | ||
if [ $? -ne 0 ]; then | ||
echo "Kernel upgrade failed." | ||
exit 1 | ||
fi | ||
|
||
echo "update grub ..." | ||
sudo sed -i "s/^GRUB_DEFAULT=.*/GRUB_DEFAULT=\"Advanced options for Ubuntu>Ubuntu, with Linux ${KERNEL_VERSION}\"/" /etc/default/grub | ||
sudo cat /etc/default/grub | grep "GRUB_DEFAULT" | ||
sudo update-grub | ||
|
||
echo "Rebooting ..." | ||
# Run the reboot command with nohup to avoid abrupt SSH closure issues | ||
nohup sudo reboot & | ||
|
||
echo "--------------Installation of kernel completed --------------" | ||
else | ||
echo "--------------Installation is not required, kernel is already on ${KERNEL_VERSION} --------------" | ||
fi | ||
|
||
# Exit with a success code since the reboot command was issued successfully | ||
exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
|
||
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | ||
source ${SCRIPT_DIR}/.definitions.sh | ||
source ${SCRIPT_DIR}/.local.sh | ||
|
||
try_ssh_connection() { | ||
status=0 | ||
ssh -o ConnectTimeout=20 -i ${private_key} ${instance_hostname} "exit" || status=$? | ||
return $status | ||
} | ||
|
||
echo "Waiting for aws system to come back online..." | ||
START_TIME=$(date +%s) | ||
while true; do | ||
sleep 60 | ||
try_ssh_connection | ||
if [ $? -eq 0 ]; then | ||
echo "Successfully connected to aws system after reboot." | ||
break; | ||
fi | ||
ELAPSED_TIME=$(($(date +%s) - START_TIME)) | ||
if [ "$ELAPSED_TIME" -ge "$SYSTEM_ONLINE_CHECK_TIMEOUT" ]; then | ||
echo "Failed to connect to aws within ${SYSTEM_ONLINE_CHECK_TIMEOUT} minutes after reboot." | ||
exit 1 | ||
fi | ||
echo "ssh retry again..." | ||
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters