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
56f1744c
Commit
56f1744c
authored
Apr 26, 2018
by
Łukasz Osipiuk
Committed by
Łukasz Osipiuk
May 10, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add way to request GPUs in tests via RCConfig
parent
8d064823
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
1 deletion
+5
-1
runners.go
test/utils/runners.go
+5
-1
No files found.
test/utils/runners.go
View file @
56f1744c
...
...
@@ -124,6 +124,7 @@ type RCConfig struct {
CpuLimit
int64
// millicores
MemRequest
int64
// bytes
MemLimit
int64
// bytes
GpuLimit
int64
// count
ReadinessProbe
*
v1
.
Probe
DNSPolicy
*
v1
.
DNSPolicy
PriorityClassName
string
...
...
@@ -615,7 +616,7 @@ func (config *RCConfig) applyTo(template *v1.PodTemplateSpec) {
c
.
Ports
=
append
(
c
.
Ports
,
v1
.
ContainerPort
{
Name
:
k
,
ContainerPort
:
int32
(
v
),
HostPort
:
int32
(
v
)})
}
}
if
config
.
CpuLimit
>
0
||
config
.
MemLimit
>
0
{
if
config
.
CpuLimit
>
0
||
config
.
MemLimit
>
0
||
config
.
GpuLimit
>
0
{
template
.
Spec
.
Containers
[
0
]
.
Resources
.
Limits
=
v1
.
ResourceList
{}
}
if
config
.
CpuLimit
>
0
{
...
...
@@ -633,6 +634,9 @@ func (config *RCConfig) applyTo(template *v1.PodTemplateSpec) {
if
config
.
MemRequest
>
0
{
template
.
Spec
.
Containers
[
0
]
.
Resources
.
Requests
[
v1
.
ResourceMemory
]
=
*
resource
.
NewQuantity
(
config
.
MemRequest
,
resource
.
DecimalSI
)
}
if
config
.
GpuLimit
>
0
{
template
.
Spec
.
Containers
[
0
]
.
Resources
.
Limits
[
"nvidia.com/gpu"
]
=
*
resource
.
NewQuantity
(
config
.
GpuLimit
,
resource
.
DecimalSI
)
}
if
len
(
config
.
Volumes
)
>
0
{
template
.
Spec
.
Volumes
=
config
.
Volumes
}
...
...
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