Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Verify environment variables in e2e test #73

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

nojnhuh
Copy link

@nojnhuh nojnhuh commented Jan 14, 2025

This change adds new steps to the e2e test to verify that each container in each pod contains logs showing the presence of any GPU_DEVICE_* environment variables. I checked that this at least catches where the CDI config is not setup properly, but didn't try all of the other possible failure modes here.

Fixes #57

@k8s-ci-robot k8s-ci-robot requested review from elezar and pohly January 14, 2025 18:47
@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: nojnhuh
Once this PR has been reviewed and has the lgtm label, please assign klueska for approval. For more information see the Code Review Process.

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 14, 2025

kubectl wait --for=condition=Ready -n gpu-test4 pod/pod0 --timeout=120s
kubectl wait --for=condition=Ready -n gpu-test4 pod/pod1 --timeout=120s
gpu_test_4=$(kubectl get pods -n gpu-test4 | grep -c 'Running')
if [ $gpu_test_4 != 2 ]; then
echo "gpu_test_4 $gpu_test_4 failed to match against 1 expected pods"
echo "gpu_test_4 $gpu_test_4 failed to match against 2 expected pods"
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

FYI I did sneak in this typo fix also.

@elezar
Copy link
Contributor

elezar commented Jan 15, 2025

@nojnhuh this is definitely an improvement, thanks.

Do you have a feel for the effort required to actually test the expected behaviour as called out in the README?

@nojnhuh
Copy link
Author

nojnhuh commented Jan 15, 2025

Do you have a feel for the effort required to actually test the expected behaviour as called out in the README?

Do you mean checking at least as far as whether certain containers have the same or different GPUs allocated based on the environment variables defined in each container? And that the correct TimeSlicing/SpacePartitioning parameters are set? I could definitely do that, but it might get a little messy in a bash script.

@nojnhuh
Copy link
Author

nojnhuh commented Jan 15, 2025

Do you have a feel for the effort required to actually test the expected behaviour as called out in the README?

Do you mean checking at least as far as whether certain containers have the same or different GPUs allocated based on the environment variables defined in each container? And that the correct TimeSlicing/SpacePartitioning parameters are set? I could definitely do that, but it might get a little messy in a bash script.

I pushed these changes in a new commit which I plan to squash if we're good with those changes.

/hold

@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/S Denotes a PR that changes 10-29 lines, ignoring generated files. labels Jan 15, 2025
@@ -35,6 +72,36 @@ if [ $gpu_test_1 != 2 ]; then
exit 1
fi

gpu_test1_pod0_ctr0_logs=$(kubectl logs -n gpu-test1 pod0 -c ctr0)
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm very open to suggestions for ways to make this less of a copy-paste nightmare.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance e2e tests to detect GPU devices
3 participants