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
dfadd3a3
Commit
dfadd3a3
authored
Aug 17, 2018
by
Łukasz Osipiuk
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Allow requesting specific gpu in autoscaling e2e tests
parent
de1656ab
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
5 deletions
+17
-5
cluster_size_autoscaling.go
test/e2e/autoscaling/cluster_size_autoscaling.go
+17
-5
No files found.
test/e2e/autoscaling/cluster_size_autoscaling.go
View file @
dfadd3a3
...
@@ -83,6 +83,8 @@ const (
...
@@ -83,6 +83,8 @@ const (
expendablePriorityClassName
=
"expendable-priority"
expendablePriorityClassName
=
"expendable-priority"
highPriorityClassName
=
"high-priority"
highPriorityClassName
=
"high-priority"
gpuLabel
=
"cloud.google.com/gke-accelerator"
)
)
var
_
=
SIGDescribe
(
"Cluster size autoscaling [Slow]"
,
func
()
{
var
_
=
SIGDescribe
(
"Cluster size autoscaling [Slow]"
,
func
()
{
...
@@ -224,7 +226,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
...
@@ -224,7 +226,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
Expect
(
len
(
getPoolNodes
(
f
,
gpuPoolName
)))
.
Should
(
Equal
(
0
))
Expect
(
len
(
getPoolNodes
(
f
,
gpuPoolName
)))
.
Should
(
Equal
(
0
))
By
(
"Schedule a pod which requires GPU"
)
By
(
"Schedule a pod which requires GPU"
)
framework
.
ExpectNoError
(
schedu
leGpuPod
(
f
,
"gpu-pod-rc"
))
framework
.
ExpectNoError
(
ScheduleAnySing
leGpuPod
(
f
,
"gpu-pod-rc"
))
defer
framework
.
DeleteRCAndWaitForGC
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
"gpu-pod-rc"
)
defer
framework
.
DeleteRCAndWaitForGC
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
"gpu-pod-rc"
)
framework
.
ExpectNoError
(
WaitForClusterSizeFunc
(
f
.
ClientSet
,
framework
.
ExpectNoError
(
WaitForClusterSizeFunc
(
f
.
ClientSet
,
...
@@ -246,7 +248,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
...
@@ -246,7 +248,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
installNvidiaDriversDaemonSet
()
installNvidiaDriversDaemonSet
()
By
(
"Schedule a single pod which requires GPU"
)
By
(
"Schedule a single pod which requires GPU"
)
framework
.
ExpectNoError
(
schedu
leGpuPod
(
f
,
"gpu-pod-rc"
))
framework
.
ExpectNoError
(
ScheduleAnySing
leGpuPod
(
f
,
"gpu-pod-rc"
))
defer
framework
.
DeleteRCAndWaitForGC
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
"gpu-pod-rc"
)
defer
framework
.
DeleteRCAndWaitForGC
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
"gpu-pod-rc"
)
By
(
"Enable autoscaler"
)
By
(
"Enable autoscaler"
)
...
@@ -305,7 +307,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
...
@@ -305,7 +307,7 @@ var _ = SIGDescribe("Cluster size autoscaling [Slow]", func() {
installNvidiaDriversDaemonSet
()
installNvidiaDriversDaemonSet
()
By
(
"Schedule a single pod which requires GPU"
)
By
(
"Schedule a single pod which requires GPU"
)
framework
.
ExpectNoError
(
schedu
leGpuPod
(
f
,
"gpu-pod-rc"
))
framework
.
ExpectNoError
(
ScheduleAnySing
leGpuPod
(
f
,
"gpu-pod-rc"
))
defer
framework
.
DeleteRCAndWaitForGC
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
"gpu-pod-rc"
)
defer
framework
.
DeleteRCAndWaitForGC
(
f
.
ClientSet
,
f
.
Namespace
.
Name
,
"gpu-pod-rc"
)
By
(
"Enable autoscaler"
)
By
(
"Enable autoscaler"
)
...
@@ -1517,7 +1519,13 @@ func makeNodeSchedulable(c clientset.Interface, node *v1.Node, failOnCriticalAdd
...
@@ -1517,7 +1519,13 @@ func makeNodeSchedulable(c clientset.Interface, node *v1.Node, failOnCriticalAdd
return
fmt
.
Errorf
(
"Failed to remove taint from node in allowed number of retries"
)
return
fmt
.
Errorf
(
"Failed to remove taint from node in allowed number of retries"
)
}
}
func
scheduleGpuPod
(
f
*
framework
.
Framework
,
id
string
)
error
{
// ScheduleAnySingleGpuPod schedules a pod which requires single GPU of any type
func
ScheduleAnySingleGpuPod
(
f
*
framework
.
Framework
,
id
string
)
error
{
return
ScheduleGpuPod
(
f
,
id
,
""
,
1
)
}
// ScheduleGpuPod schedules a pod which requires a given number of gpus of given type
func
ScheduleGpuPod
(
f
*
framework
.
Framework
,
id
string
,
gpuType
string
,
gpuLimit
int64
)
error
{
config
:=
&
testutils
.
RCConfig
{
config
:=
&
testutils
.
RCConfig
{
Client
:
f
.
ClientSet
,
Client
:
f
.
ClientSet
,
InternalClient
:
f
.
InternalClientset
,
InternalClient
:
f
.
InternalClientset
,
...
@@ -1526,10 +1534,14 @@ func scheduleGpuPod(f *framework.Framework, id string) error {
...
@@ -1526,10 +1534,14 @@ func scheduleGpuPod(f *framework.Framework, id string) error {
Timeout
:
3
*
scaleUpTimeout
,
// spinning up GPU node is slow
Timeout
:
3
*
scaleUpTimeout
,
// spinning up GPU node is slow
Image
:
imageutils
.
GetPauseImageName
(),
Image
:
imageutils
.
GetPauseImageName
(),
Replicas
:
1
,
Replicas
:
1
,
GpuLimit
:
1
,
GpuLimit
:
gpuLimit
,
Labels
:
map
[
string
]
string
{
"requires-gpu"
:
"yes"
},
Labels
:
map
[
string
]
string
{
"requires-gpu"
:
"yes"
},
}
}
if
gpuType
!=
""
{
config
.
NodeSelector
=
map
[
string
]
string
{
gpuLabel
:
gpuType
}
}
err
:=
framework
.
RunRC
(
*
config
)
err
:=
framework
.
RunRC
(
*
config
)
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
...
...
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