Skip to content

Commit 3ec74e0

Browse files
committed
split into 3 distinct tests
Signed-off-by: Davanum Srinivas <[email protected]>
1 parent 630abc6 commit 3ec74e0

File tree

1 file changed

+29
-3
lines changed

1 file changed

+29
-3
lines changed

test/e2e/node/gpu.go

Lines changed: 29 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ package node
1818

1919
import (
2020
"context"
21-
e2ejob "k8s.io/kubernetes/test/e2e/framework/job"
2221
"os"
2322
"regexp"
2423
"time"
@@ -34,6 +33,7 @@ import (
3433
"k8s.io/kubernetes/test/e2e/framework"
3534
e2edebug "k8s.io/kubernetes/test/e2e/framework/debug"
3635
e2egpu "k8s.io/kubernetes/test/e2e/framework/gpu"
36+
e2ejob "k8s.io/kubernetes/test/e2e/framework/job"
3737
e2emanifest "k8s.io/kubernetes/test/e2e/framework/manifest"
3838
e2enode "k8s.io/kubernetes/test/e2e/framework/node"
3939
e2epod "k8s.io/kubernetes/test/e2e/framework/pod"
@@ -46,9 +46,13 @@ import (
4646
"github.com/onsi/gomega"
4747
)
4848

49-
var _ = SIGDescribe(feature.GPUDevicePlugin, "Sanity test for Nvidia Device", func() {
49+
// NOTE: All the tests in this file are run serially because they share a limited set of GPU(s), please inspect
50+
// the CI job definitions to see how many GPU(s) are available in the environment
51+
// Currently the CI jobs have 2 nodes each with 4 Nvidia T4's across both GCE and AWS harness(es).
52+
53+
var _ = SIGDescribe(feature.GPUDevicePlugin, framework.WithSerial(), "Sanity test using nvidia-smi", func() {
5054

51-
f := framework.NewDefaultFramework("nvidia-gpu")
55+
f := framework.NewDefaultFramework("nvidia-gpu1")
5256
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
5357
var podClient *e2epod.PodClient
5458

@@ -74,6 +78,18 @@ var _ = SIGDescribe(feature.GPUDevicePlugin, "Sanity test for Nvidia Device", fu
7478
gomega.Expect(log).To(gomega.ContainSubstring("Driver Version:"))
7579
gomega.Expect(log).To(gomega.ContainSubstring("CUDA Version:"))
7680
})
81+
})
82+
83+
var _ = SIGDescribe(feature.GPUDevicePlugin, framework.WithSerial(), "Test using a Pod", func() {
84+
85+
f := framework.NewDefaultFramework("nvidia-gpu2")
86+
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
87+
var podClient *e2epod.PodClient
88+
89+
ginkgo.BeforeEach(func() {
90+
e2eskipper.SkipUnlessProviderIs("aws", "gce")
91+
podClient = e2epod.NewPodClient(f)
92+
})
7793

7894
f.It("should run gpu based matrix multiplication", func(ctx context.Context) {
7995
SetupEnvironmentAndSkipIfNeeded(ctx, f, f.ClientSet)
@@ -91,6 +107,16 @@ var _ = SIGDescribe(feature.GPUDevicePlugin, "Sanity test for Nvidia Device", fu
91107
gomega.Expect(log).To(gomega.ContainSubstring("Matrix multiplication result:"))
92108
gomega.Expect(log).To(gomega.ContainSubstring("Time taken for 5000x5000 matrix multiplication"))
93109
})
110+
})
111+
112+
var _ = SIGDescribe(feature.GPUDevicePlugin, framework.WithSerial(), "Test using a Job", func() {
113+
114+
f := framework.NewDefaultFramework("nvidia-gpu2")
115+
f.NamespacePodSecurityLevel = admissionapi.LevelPrivileged
116+
117+
ginkgo.BeforeEach(func() {
118+
e2eskipper.SkipUnlessProviderIs("aws", "gce")
119+
})
94120

95121
f.It("should run gpu based jobs", func(ctx context.Context) {
96122
SetupEnvironmentAndSkipIfNeeded(ctx, f, f.ClientSet)

0 commit comments

Comments
 (0)