Skip to content

Commit

Permalink
Error out when GFD labels won't match for GPU sharing
Browse files Browse the repository at this point in the history
  • Loading branch information
shivamerla committed Jun 4, 2022
1 parent 487c7f1 commit c70fa9e
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions tests/scripts/update-clusterpolicy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,14 +133,16 @@ test_gpu_sharing() {
fi

# Verify GFD labels
replica_count=$(kubectl get node -o json | jq '.items[0].metadata.labels["nvidia.com/gpu.replicas"]')
replica_count=$(kubectl get node -o json | jq '.items[0].metadata.labels["nvidia.com/gpu.replicas"]' | tr -d '"')
if [ "$replica_count" != "10" ]; then
echo "Required label nvidia.com/gpu.replicas is incorrect when GPU sharing is enabled - $replica_count"
exit 1
fi

product_name=$(kubectl get node -o json | jq '.items[0].metadata.labels["nvidia.com/gpu.product"]')
product_name=$(kubectl get node -o json | jq '.items[0].metadata.labels["nvidia.com/gpu.product"]' | tr -d '"')
if [ "$product_name" != "Tesla-T4-SHARED" ]; then
echo "Label nvidia.com/gpu.product is incorrect when GPU sharing is enabled - $product_name"
exit 1
fi

# Cleanup plugin test pod.
Expand Down

0 comments on commit c70fa9e

Please sign in to comment.