Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
af3bc705
Commit
af3bc705
authored
Jun 26, 2018
by
Rohit Agarwal
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Remove COS requirement while running e2e nvidia gpu tests.
parent
1f4f0123
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
18 deletions
+6
-18
nvidia-gpus.go
test/e2e/scheduling/nvidia-gpus.go
+6
-18
No files found.
test/e2e/scheduling/nvidia-gpus.go
View file @
af3bc705
...
...
@@ -18,7 +18,6 @@ package scheduling
import
(
"os"
"strings"
"time"
"k8s.io/api/core/v1"
...
...
@@ -35,7 +34,6 @@ import (
const
(
testPodNamePrefix
=
"nvidia-gpu-"
cosOSImage
=
"Container-Optimized OS from Google"
// Nvidia driver installation can take upwards of 5 minutes.
driverInstallTimeout
=
10
*
time
.
Minute
)
...
...
@@ -69,15 +67,12 @@ func makeCudaAdditionDevicePluginTestPod() *v1.Pod {
return
testPod
}
func
isClusterRunningCOS
(
f
*
framework
.
Framework
)
bool
{
func
logOSImages
(
f
*
framework
.
Framework
)
{
nodeList
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Nodes
()
.
List
(
metav1
.
ListOptions
{})
framework
.
ExpectNoError
(
err
,
"getting node list"
)
for
_
,
node
:=
range
nodeList
.
Items
{
if
!
strings
.
Contains
(
node
.
Status
.
NodeInfo
.
OSImage
,
cosOSImage
)
{
return
false
}
framework
.
Logf
(
"OS Image: %v"
,
node
.
Status
.
NodeInfo
.
OSImage
)
}
return
true
}
func
areGPUsAvailableOnAllSchedulableNodes
(
f
*
framework
.
Framework
)
bool
{
...
...
@@ -111,14 +106,7 @@ func getGPUsAvailable(f *framework.Framework) int64 {
}
func
SetupNVIDIAGPUNode
(
f
*
framework
.
Framework
,
setupResourceGatherer
bool
)
*
framework
.
ContainerResourceGatherer
{
// Skip the test if the base image is not COS.
// TODO: Add support for other base images.
// CUDA apps require host mounts which is not portable across base images (yet).
framework
.
Logf
(
"Checking base image"
)
if
!
isClusterRunningCOS
(
f
)
{
Skip
(
"Nvidia GPU tests are supproted only on Container Optimized OS image currently"
)
}
framework
.
Logf
(
"Cluster is running on COS. Proceeding with test"
)
logOSImages
(
f
)
dsYamlUrlFromEnv
:=
os
.
Getenv
(
"NVIDIA_DRIVER_INSTALLER_DAEMONSET"
)
if
dsYamlUrlFromEnv
!=
""
{
...
...
@@ -163,7 +151,7 @@ func SetupNVIDIAGPUNode(f *framework.Framework, setupResourceGatherer bool) *fra
return
rsgather
}
func
testNvidiaGPUs
OnCOS
(
f
*
framework
.
Framework
)
{
func
testNvidiaGPUs
(
f
*
framework
.
Framework
)
{
rsgather
:=
SetupNVIDIAGPUNode
(
f
,
true
)
framework
.
Logf
(
"Creating as many pods as there are Nvidia GPUs and have the pods run a CUDA app"
)
podList
:=
[]
*
v1
.
Pod
{}
...
...
@@ -186,7 +174,7 @@ func testNvidiaGPUsOnCOS(f *framework.Framework) {
var
_
=
SIGDescribe
(
"[Feature:GPUDevicePlugin]"
,
func
()
{
f
:=
framework
.
NewDefaultFramework
(
"device-plugin-gpus"
)
It
(
"run Nvidia GPU Device Plugin tests
on Container Optimized OS only
"
,
func
()
{
testNvidiaGPUs
OnCOS
(
f
)
It
(
"run Nvidia GPU Device Plugin tests"
,
func
()
{
testNvidiaGPUs
(
f
)
})
})
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment