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
3f0267a6
Commit
3f0267a6
authored
Oct 07, 2016
by
Daniele Venzano
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add top-level zapp parameter to disable all services/containers auto restart policy
parent
ffbd7546
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
18 additions
and
1 deletion
+18
-1
docs/developer/zapp_format.rst
docs/developer/zapp_format.rst
+9
-0
zoe_lib/applications.py
zoe_lib/applications.py
+6
-0
zoe_master/zapp_to_docker.py
zoe_master/zapp_to_docker.py
+3
-1
No files found.
docs/developer/zapp_format.rst
View file @
3f0267a6
...
...
@@ -42,6 +42,13 @@ required, number [0, 1024)
For now this value is unused.
disable_autorestart
^^^^^^^^^^^^^^^^^^^
optional, boolean
If set to true, disables all kinds of auorestart on all services of this ZApp.
requires_binary
^^^^^^^^^^^^^^^
...
...
@@ -121,6 +128,8 @@ If set to ``false``, Zoe will configure Docker to automatically restart the serv
Please note that at least one service must be set as a monitor for each ZApp.
All autorestart behaviour is disabled if the global parameter ``disable_autorestart`` (see above) is enabled.
total_count
^^^^^^^^^^^
...
...
zoe_lib/applications.py
View file @
3f0267a6
...
...
@@ -150,6 +150,12 @@ def _service_check(data):
if
not
hasattr
(
data
[
'constraints'
],
'__iter__'
):
raise
InvalidApplicationDescription
(
msg
=
'networks should be an iterable'
)
if
'disable_autorestart'
in
data
:
try
:
bool
(
data
[
'disable_autorestart'
])
except
ValueError
:
raise
InvalidApplicationDescription
(
msg
=
"disable_autorestart field should be a boolean"
)
def
_port_check
(
data
):
required_keys
=
[
'name'
,
'protocol'
,
'port_number'
,
'is_main_endpoint'
]
...
...
zoe_master/zapp_to_docker.py
View file @
3f0267a6
...
...
@@ -87,7 +87,9 @@ def _spawn_service(execution: Execution, service: Service, env_subst_dict: dict)
copts
.
labels
[
'zoe.monitor'
]
=
'true'
else
:
copts
.
labels
[
'zoe.monitor'
]
=
'false'
copts
.
restart
=
not
service
.
description
[
'monitor'
]
# Monitor containers should not restart
if
'disable_autorestart'
in
execution
.
description
and
execution
.
description
[
'disable_autorestart'
]:
copts
.
restart
=
not
service
.
description
[
'monitor'
]
# Monitor containers should not restart
_gen_environment
(
service
,
env_subst_dict
,
copts
)
...
...
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