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
65b76f36
Commit
65b76f36
authored
Sep 27, 2017
by
Jiaying Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Fixes a flakiness in GPUDevicePlugin e2e test.
Waits till nvidia gpu disappears from all nodes after deleting the device plug DaemonSet to make sure its pods are deleted from all nodes.
parent
ce4afa84
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
21 additions
and
3 deletions
+21
-3
nvidia-gpus.go
test/e2e/scheduling/nvidia-gpus.go
+21
-3
No files found.
test/e2e/scheduling/nvidia-gpus.go
View file @
65b76f36
...
@@ -139,6 +139,24 @@ func areGPUsAvailableOnAllSchedulableNodes(f *framework.Framework) bool {
...
@@ -139,6 +139,24 @@ func areGPUsAvailableOnAllSchedulableNodes(f *framework.Framework) bool {
return
true
return
true
}
}
func
areGPUsAvailableOnAnySchedulableNodes
(
f
*
framework
.
Framework
)
bool
{
framework
.
Logf
(
"Getting list of Nodes from API server"
)
nodeList
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Nodes
()
.
List
(
metav1
.
ListOptions
{})
framework
.
ExpectNoError
(
err
,
"getting node list"
)
for
_
,
node
:=
range
nodeList
.
Items
{
if
node
.
Spec
.
Unschedulable
{
continue
}
framework
.
Logf
(
"gpuResourceName %s"
,
gpuResourceName
)
if
val
,
ok
:=
node
.
Status
.
Capacity
[
gpuResourceName
];
ok
&&
val
.
Value
()
>
0
{
framework
.
Logf
(
"Nvidia GPUs available on Node: %q"
,
node
.
Name
)
return
true
}
}
framework
.
Logf
(
"Nvidia GPUs don't exist on all schedulable nodes"
)
return
false
}
func
getGPUsAvailable
(
f
*
framework
.
Framework
)
int64
{
func
getGPUsAvailable
(
f
*
framework
.
Framework
)
int64
{
nodeList
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Nodes
()
.
List
(
metav1
.
ListOptions
{})
nodeList
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Nodes
()
.
List
(
metav1
.
ListOptions
{})
framework
.
ExpectNoError
(
err
,
"getting node list"
)
framework
.
ExpectNoError
(
err
,
"getting node list"
)
...
@@ -220,10 +238,10 @@ var _ = SIGDescribe("[Feature:GPUDevicePlugin]", func() {
...
@@ -220,10 +238,10 @@ var _ = SIGDescribe("[Feature:GPUDevicePlugin]", func() {
err
=
f
.
ClientSet
.
Extensions
()
.
DaemonSets
(
f
.
Namespace
.
Name
)
.
Delete
(
ds
.
Name
,
&
metav1
.
DeleteOptions
{
OrphanDependents
:
&
falseVar
})
err
=
f
.
ClientSet
.
Extensions
()
.
DaemonSets
(
f
.
Namespace
.
Name
)
.
Delete
(
ds
.
Name
,
&
metav1
.
DeleteOptions
{
OrphanDependents
:
&
falseVar
})
framework
.
ExpectNoError
(
err
,
"failed to delete daemonset"
)
framework
.
ExpectNoError
(
err
,
"failed to delete daemonset"
)
framework
.
Logf
(
"Successfully deleted device plugin daemonset. Wait for resource to be removed."
)
framework
.
Logf
(
"Successfully deleted device plugin daemonset. Wait for resource to be removed."
)
// Wait for Nvidia GPUs to be
not available on nodes
// Wait for Nvidia GPUs to be
unavailable on all nodes.
Eventually
(
func
()
bool
{
Eventually
(
func
()
bool
{
return
!
areGPUsAvailableOnA
ll
SchedulableNodes
(
f
)
return
!
areGPUsAvailableOnA
ny
SchedulableNodes
(
f
)
},
5
*
time
.
Minute
,
time
.
Second
)
.
Should
(
BeTrue
())
},
10
*
time
.
Minute
,
time
.
Second
)
.
Should
(
BeTrue
())
// 3. Restarts the device plugin DaemonSet. Verifies GPU resource is successfully advertised
// 3. Restarts the device plugin DaemonSet. Verifies GPU resource is successfully advertised
// on the nodes and we can run pods using GPUs.
// on the nodes and we can run pods using GPUs.
...
...
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