Merge pull request #3 from status-im/fixes

syntax and CLI fixes
This commit is contained in:
Ștefan Talpalaru 2020-07-01 00:07:08 +02:00 committed by GitHub
commit 42a5d65627
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 29 additions and 18 deletions

View File

@ -20,9 +20,7 @@ beacon_node_metrics_port: 9200
beacon_node_rpc_port: 9900
# resource limits, mem in MB
beacon_node_cpu_limit: 0.80
beacon_node_mem_limit: '{{ (ansible_memtotal_mb * 0.6) | int }}'
beacon_node_cpu_reserve: 0.40
beacon_node_mem_reserve: '{{ (ansible_memtotal_mb * 0.4) | int }}'
# container restart policy
@ -33,3 +31,7 @@ beacon_node_restart_window_sec: 120
# general container management
compose_recreate: false
# shared testnet cron job
beacon_node_shared_testnet_cron: false

View File

@ -18,10 +18,8 @@
deploy:
resources:
limits:
cpus: '{{ beacon_node_cpu_limit | string }}'
memory: '{{ beacon_node_mem_limit }}M'
reservations:
cpus: '{{ beacon_node_cpu_reserve | string }}'
memory: '{{ beacon_node_mem_reserve }}M'
restart_policy:
condition: '{{ beacon_node_restart_ondition }}'
@ -33,20 +31,20 @@
- '{{ beacon_node_metrics_port }}:{{ beacon_node_metrics_port }}/tcp'
- '{{ beacon_node_listening_port }}:{{ beacon_node_listening_port }}/tcp'
- '{{ beacon_node_discovery_port }}:{{ beacon_node_discovery_port }}/udp'
command:
command: >-
{% if beacon_node_network == "testnet2" %}
- '--run'
- '--'
--run
--
{% endif %}
- '--nat=extip:{{ beacon_node_public_address }}'
- '--log-level={{ beacon_node_log_level }}'
- '--tcp-port={{ beacon_node_listening_port }}'
- '--udp-port={{ beacon_node_discovery_port }}'
- '--rpc'
- '--rpc-address=0.0.0.0'
- '--rpc-port={{ beacon_node_rpc_port }}'
- '--metrics'
- '--metrics-address=0.0.0.0'
- '--metrics-port={{ beacon_node_metrics_port }}'
--nat=extip:{{ beacon_node_public_address }}
--log-level={{ beacon_node_log_level }}
--tcp-port={{ beacon_node_listening_port }}
--udp-port={{ beacon_node_discovery_port }}
--rpc
--rpc-address=0.0.0.0
--rpc-port={{ beacon_node_rpc_port }}
--metrics
--metrics-address=0.0.0.0
--metrics-port={{ beacon_node_metrics_port }}
volumes:
- '{{ beacon_node_cont_vol }}/data:/root/.cache/nimbus'

View File

@ -15,7 +15,6 @@
up \
--quiet-pull \
--no-build \
--detach \
{% if compose_recreate %}
--force-recreate \
{% endif %}

11
tasks/cron.yml Normal file
View File

@ -0,0 +1,11 @@
---
# "cron.name" should not be changed, or a new cron job will be created for the new name,
# in addition to the old one.
- name: "Shared testnet: periodic container restart Cron job"
cron:
name: "shared testnet restart"
minute: "10"
hour: "0,6,12,18"
job: "PATH='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/snap/bin'; cd {{ beacon_node_cont_vol }}; docker-compose --compatibility run --rm --name {{ beacon_node_cont_name }}-build-run beacon_node --build; docker-compose restart -t 60"
when: beacon_node_shared_testnet_cron

View File

@ -2,5 +2,6 @@
- import_tasks: install.yml
- import_tasks: compose.yml
- import_tasks: container.yml
- import_tasks: cron.yml
- import_tasks: firewall.yml
- import_tasks: consul.yml