Merge pull request #4 from status-im/container

put container restarts under the "cont_restart" flag
This commit is contained in:
Ștefan Talpalaru 2020-07-06 23:22:09 +02:00 committed by GitHub
commit cfba480e1e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 12 additions and 11 deletions

View File

@ -24,7 +24,7 @@ beacon_node_mem_limit: '{{ (ansible_memtotal_mb * 0.6) | int }}'
beacon_node_mem_reserve: '{{ (ansible_memtotal_mb * 0.4) | int }}'
# container restart policy
beacon_node_restart_ondition: 'on-failure'
beacon_node_restart_condition: 'on-failure'
beacon_node_restart_max_attempts: 3
beacon_node_restart_delay_sec: 10
beacon_node_restart_window_sec: 120

View File

@ -22,7 +22,7 @@
reservations:
memory: '{{ beacon_node_mem_reserve }}M'
restart_policy:
condition: '{{ beacon_node_restart_ondition }}'
condition: '{{ beacon_node_restart_condition }}'
max_attempts: '{{ beacon_node_restart_max_attempts }}'
delay: '{{ beacon_node_restart_delay_sec }}s'
window: '{{ beacon_node_restart_window_sec }}s'

View File

@ -9,17 +9,18 @@
# --compatibility flag required for mem/cpu limits
- name: 'Create container: {{ beacon_node_cont_name }}'
command: |
docker-compose \
--compatibility \
up \
--quiet-pull \
--no-build \
command: >-
docker-compose
--compatibility
up
--quiet-pull
--no-build
{% if compose_recreate %}
--force-recreate \
--force-recreate
{% endif %}
--no-color \
--no-start
--no-color
-d
args:
chdir: '{{ beacon_node_cont_vol }}'
when: cont_restart