Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
main
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Operations
Operations
Environments
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Simone Rossi
main
Commits
a256027a
Commit
a256027a
authored
Oct 15, 2018
by
Daniele Venzano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add optional field to specify amount of SHM in bytes
parent
07fdce15
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
18 additions
and
3 deletions
+18
-3
schemas/app_description_schema.json
schemas/app_description_schema.json
+6
-1
zoe_lib/state/service.py
zoe_lib/state/service.py
+6
-1
zoe_master/backends/docker/api_client.py
zoe_master/backends/docker/api_client.py
+4
-1
zoe_master/backends/service_instance.py
zoe_master/backends/service_instance.py
+2
-0
No files found.
schemas/app_description_schema.json
View file @
a256027a
...
...
@@ -129,7 +129,12 @@
"min"
,
"max"
]
}
},
"shm_size"
:
{
"type"
:
"number"
,
"multipleOf"
:
1.0
,
"minimum"
:
0
},
},
"additionalProperties"
:
false
,
"required"
:
[
...
...
zoe_lib/state/service.py
View file @
a256027a
...
...
@@ -61,12 +61,17 @@ class ResourceReservation:
def
__init__
(
self
,
data
):
self
.
memory
=
ResourceLimits
(
data
[
'memory'
],
"bytes"
)
self
.
cores
=
ResourceLimits
(
data
[
'cores'
],
'units'
)
if
'shm'
in
data
:
self
.
shm
=
data
[
'shm_size'
]
else
:
self
.
shm
=
0
def
__add__
(
self
,
other
):
if
isinstance
(
other
,
ResourceReservation
):
res
=
{
'memory'
:
self
.
memory
+
other
.
memory
,
'cores'
:
self
.
cores
+
other
.
cores
'cores'
:
self
.
cores
+
other
.
cores
,
'shm'
:
self
.
shm
+
other
.
shm
}
return
ResourceReservation
(
res
)
else
:
...
...
zoe_master/backends/docker/api_client.py
View file @
a256027a
...
...
@@ -99,7 +99,7 @@ class DockerClient:
for
volume
in
service_instance
.
volumes
:
if
volume
.
type
==
"host_directory"
:
assert
isinstance
(
volume
,
VolumeDescriptionHostPath
)
run_args
[
'volumes'
][
volume
.
path
]
=
{
'bind'
:
volume
.
mount_point
,
'mode'
:
(
"ro"
if
volume
.
readonly
else
"rw"
)}
run_args
[
'volumes'
][
volume
.
path
]
=
{
'bi
nd'
:
volume
.
mount_point
,
'mode'
:
(
"ro"
if
volume
.
readonly
else
"rw"
)}
else
:
log
.
error
(
'Docker backend does not support volume type {}'
.
format
(
volume
.
type
))
...
...
@@ -112,6 +112,9 @@ class DockerClient:
if
service_instance
.
core_limit
is
not
None
:
run_args
[
'cpu_quota'
]
=
int
(
100000
*
service_instance
.
core_limit
.
min
)
if
service_instance
.
shm_size
>
0
:
run_args
[
'shm_size'
]
=
service_instance
.
shm_size
if
get_conf
().
gelf_address
!=
''
:
run_args
[
'log_config'
]
=
{
"type"
:
"gelf"
,
...
...
zoe_master/backends/service_instance.py
View file @
a256027a
...
...
@@ -45,6 +45,8 @@ class ServiceInstance:
if
self
.
core_limit
.
max
>
get_conf
().
max_core_limit
:
self
.
core_limit
=
get_conf
().
max_core_limit
self
.
shm_size
=
service
.
resource_reservation
.
shm
self
.
labels
=
{
'zoe.execution.name'
:
execution
.
name
,
'zoe.execution.id'
:
str
(
execution
.
id
),
...
...
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