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
f3823cc2
Commit
f3823cc2
authored
Jul 19, 2018
by
wackxu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix e2e tests which set PodPriority are failing
parent
afcc1568
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
39 additions
and
8 deletions
+39
-8
gpu_util.go
test/e2e/framework/gpu_util.go
+2
-2
BUILD
test/e2e_node/BUILD
+1
-0
eviction_test.go
test/e2e_node/eviction_test.go
+32
-4
gpu_device_plugin.go
test/e2e_node/gpu_device_plugin.go
+4
-2
No files found.
test/e2e/framework/gpu_util.go
View file @
f3823cc2
...
...
@@ -50,13 +50,13 @@ func NumberOfNVIDIAGPUs(node *v1.Node) int64 {
}
// NVIDIADevicePlugin returns the official Google Device Plugin pod for NVIDIA GPU in GKE
func
NVIDIADevicePlugin
(
ns
string
)
*
v1
.
Pod
{
func
NVIDIADevicePlugin
()
*
v1
.
Pod
{
ds
,
err
:=
DsFromManifest
(
GPUDevicePluginDSYAML
)
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
p
:=
&
v1
.
Pod
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
"device-plugin-nvidia-gpu-"
+
string
(
uuid
.
NewUUID
()),
Namespace
:
ns
,
Namespace
:
metav1
.
NamespaceSystem
,
},
Spec
:
ds
.
Spec
.
Template
.
Spec
,
...
...
test/e2e_node/BUILD
View file @
f3823cc2
...
...
@@ -129,6 +129,7 @@ go_test(
"//pkg/kubelet/types:go_default_library",
"//pkg/security/apparmor:go_default_library",
"//staging/src/k8s.io/api/core/v1:go_default_library",
"//staging/src/k8s.io/api/scheduling/v1beta1:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/equality:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/errors:go_default_library",
"//staging/src/k8s.io/apimachinery/pkg/api/resource:go_default_library",
...
...
test/e2e_node/eviction_test.go
View file @
f3823cc2
...
...
@@ -24,6 +24,8 @@ import (
"time"
"k8s.io/api/core/v1"
schedulerapi
"k8s.io/api/scheduling/v1beta1"
"k8s.io/apimachinery/pkg/api/errors"
"k8s.io/apimachinery/pkg/api/resource"
metav1
"k8s.io/apimachinery/pkg/apis/meta/v1"
"k8s.io/apimachinery/pkg/fields"
...
...
@@ -285,6 +287,20 @@ var _ = framework.KubeDescribe("PriorityMemoryEvictionOrdering [Slow] [Serial] [
expectedNodeCondition
:=
v1
.
NodeMemoryPressure
expectedStarvedResource
:=
v1
.
ResourceMemory
pressureTimeout
:=
10
*
time
.
Minute
highPriorityClassName
:=
f
.
BaseName
+
"-high-priority"
highPriority
:=
int32
(
999999999
)
BeforeEach
(
func
()
{
_
,
err
:=
f
.
ClientSet
.
SchedulingV1beta1
()
.
PriorityClasses
()
.
Create
(
&
schedulerapi
.
PriorityClass
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
highPriorityClassName
},
Value
:
highPriority
})
Expect
(
err
==
nil
||
errors
.
IsAlreadyExists
(
err
))
.
To
(
BeTrue
())
})
AfterEach
(
func
()
{
err
:=
f
.
ClientSet
.
SchedulingV1beta1
()
.
PriorityClasses
()
.
Delete
(
highPriorityClassName
,
&
metav1
.
DeleteOptions
{})
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
})
Context
(
fmt
.
Sprintf
(
testContextFmt
,
expectedNodeCondition
),
func
()
{
tempSetCurrentKubeletConfig
(
f
,
func
(
initialConfig
*
kubeletconfig
.
KubeletConfiguration
)
{
initialConfig
.
FeatureGates
[
string
(
features
.
PodPriority
)]
=
true
...
...
@@ -318,8 +334,7 @@ var _ = framework.KubeDescribe("PriorityMemoryEvictionOrdering [Slow] [Serial] [
}),
},
}
systemPriority
:=
int32
(
2147483647
)
specs
[
1
]
.
pod
.
Spec
.
Priority
=
&
systemPriority
specs
[
1
]
.
pod
.
Spec
.
PriorityClassName
=
highPriorityClassName
runEvictionTest
(
f
,
pressureTimeout
,
expectedNodeCondition
,
expectedStarvedResource
,
logMemoryMetrics
,
specs
)
})
})
...
...
@@ -332,6 +347,20 @@ var _ = framework.KubeDescribe("PriorityLocalStorageEvictionOrdering [Slow] [Ser
expectedNodeCondition
:=
v1
.
NodeDiskPressure
expectedStarvedResource
:=
v1
.
ResourceEphemeralStorage
pressureTimeout
:=
10
*
time
.
Minute
highPriorityClassName
:=
f
.
BaseName
+
"-high-priority"
highPriority
:=
int32
(
999999999
)
BeforeEach
(
func
()
{
_
,
err
:=
f
.
ClientSet
.
SchedulingV1beta1
()
.
PriorityClasses
()
.
Create
(
&
schedulerapi
.
PriorityClass
{
ObjectMeta
:
metav1
.
ObjectMeta
{
Name
:
highPriorityClassName
},
Value
:
highPriority
})
Expect
(
err
==
nil
||
errors
.
IsAlreadyExists
(
err
))
.
To
(
BeTrue
())
})
AfterEach
(
func
()
{
err
:=
f
.
ClientSet
.
SchedulingV1beta1
()
.
PriorityClasses
()
.
Delete
(
highPriorityClassName
,
&
metav1
.
DeleteOptions
{})
Expect
(
err
)
.
NotTo
(
HaveOccurred
())
})
Context
(
fmt
.
Sprintf
(
testContextFmt
,
expectedNodeCondition
),
func
()
{
tempSetCurrentKubeletConfig
(
f
,
func
(
initialConfig
*
kubeletconfig
.
KubeletConfiguration
)
{
initialConfig
.
FeatureGates
[
string
(
features
.
PodPriority
)]
=
true
...
...
@@ -367,8 +396,7 @@ var _ = framework.KubeDescribe("PriorityLocalStorageEvictionOrdering [Slow] [Ser
}),
},
}
systemPriority
:=
int32
(
2147483647
)
specs
[
1
]
.
pod
.
Spec
.
Priority
=
&
systemPriority
specs
[
1
]
.
pod
.
Spec
.
PriorityClassName
=
highPriorityClassName
runEvictionTest
(
f
,
pressureTimeout
,
expectedNodeCondition
,
expectedStarvedResource
,
logDiskMetrics
,
specs
)
})
})
...
...
test/e2e_node/gpu_device_plugin.go
View file @
f3823cc2
...
...
@@ -42,6 +42,7 @@ var _ = framework.KubeDescribe("NVIDIA GPU Device Plugin [Feature:GPUDevicePlugi
Context
(
"DevicePlugin"
,
func
()
{
var
devicePluginPod
*
v1
.
Pod
var
err
error
BeforeEach
(
func
()
{
By
(
"Ensuring that Nvidia GPUs exists on the node"
)
if
!
checkIfNvidiaGPUsExistOnNode
()
{
...
...
@@ -49,7 +50,8 @@ var _ = framework.KubeDescribe("NVIDIA GPU Device Plugin [Feature:GPUDevicePlugi
}
By
(
"Creating the Google Device Plugin pod for NVIDIA GPU in GKE"
)
devicePluginPod
=
f
.
PodClient
()
.
CreateSync
(
framework
.
NVIDIADevicePlugin
(
f
.
Namespace
.
Name
))
devicePluginPod
,
err
=
f
.
ClientSet
.
CoreV1
()
.
Pods
(
metav1
.
NamespaceSystem
)
.
Create
(
framework
.
NVIDIADevicePlugin
())
framework
.
ExpectNoError
(
err
)
By
(
"Waiting for GPUs to become available on the local node"
)
Eventually
(
func
()
bool
{
...
...
@@ -106,7 +108,7 @@ var _ = framework.KubeDescribe("NVIDIA GPU Device Plugin [Feature:GPUDevicePlugi
Expect
(
devId1
)
.
To
(
Not
(
Equal
(
devId2
)))
By
(
"Deleting device plugin."
)
f
.
PodClient
(
)
.
Delete
(
devicePluginPod
.
Name
,
&
metav1
.
DeleteOptions
{})
f
.
ClientSet
.
CoreV1
()
.
Pods
(
metav1
.
NamespaceSystem
)
.
Delete
(
devicePluginPod
.
Name
,
&
metav1
.
DeleteOptions
{})
By
(
"Waiting for GPUs to become unavailable on the local node"
)
Eventually
(
func
()
bool
{
node
,
err
:=
f
.
ClientSet
.
CoreV1
()
.
Nodes
()
.
Get
(
framework
.
TestContext
.
NodeName
,
metav1
.
GetOptions
{})
...
...
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