Add erc to native docker config in deployment playbooks
This commit is contained in:
parent
ed2de112a2
commit
b6588ff3c5
@ -0,0 +1,26 @@
|
|||||||
|
---
|
||||||
|
- name: Slurp docker compose file
|
||||||
|
slurp:
|
||||||
|
src: "/home/poadocker/bridge/oracle/{{ item }}.yml"
|
||||||
|
register: docker_compose_slurp
|
||||||
|
- name: Parse docker compose file
|
||||||
|
set_fact:
|
||||||
|
docker_compose_parsed: "{{ docker_compose_slurp['content'] | b64decode | from_yaml }}"
|
||||||
|
|
||||||
|
- name: Add the external network used to connect to Parity nodes
|
||||||
|
set_fact:
|
||||||
|
docker_compose_parsed: "{{ docker_compose_parsed |combine({'networks': {'ultimate': {'external': 'true'}}}, recursive=True) }}"
|
||||||
|
|
||||||
|
- name: Add all Oracle containers to the network
|
||||||
|
set_fact:
|
||||||
|
docker_compose_parsed: "{{ docker_compose_parsed | combine({'services': {item: {'networks': docker_compose_parsed.services[item].networks | union(['ultimate'])}}}, recursive=True) }}"
|
||||||
|
with_items: "{{ docker_compose_parsed.services }}"
|
||||||
|
|
||||||
|
- name: Expose Redis port to allow connecting from redis-cli
|
||||||
|
set_fact:
|
||||||
|
docker_compose_parsed: "{{ docker_compose_parsed | combine({'services': {'redis': {'ports': ['6379:6379']}}}, recursive=True) }}"
|
||||||
|
|
||||||
|
- name: Write updated docker file
|
||||||
|
copy:
|
||||||
|
content: "{{ docker_compose_parsed | to_yaml }}"
|
||||||
|
dest: "/home/poadocker/bridge/oracle/{{ item }}.yml"
|
@ -5,58 +5,12 @@
|
|||||||
tasks:
|
tasks:
|
||||||
- name: stop the service
|
- name: stop the service
|
||||||
shell: service poabridge stop
|
shell: service poabridge stop
|
||||||
|
|
||||||
- name: Slurp docker compose file
|
|
||||||
slurp:
|
|
||||||
src: "/home/poadocker/bridge/oracle/docker-compose.yml"
|
|
||||||
register: docker_compose_slurp
|
|
||||||
- name: Parse docker compose file
|
|
||||||
set_fact:
|
|
||||||
docker_compose_parsed: "{{ docker_compose_slurp['content'] | b64decode | from_yaml }}"
|
|
||||||
|
|
||||||
- name: Add the external network used to connect to Parity nodes
|
- include_tasks: oracle-add-docker-external-network.yml
|
||||||
set_fact:
|
with_items:
|
||||||
docker_compose_parsed: "{{ docker_compose_parsed |combine({'networks': {'ultimate': {'external': 'true'}}}, recursive=True) }}"
|
- docker-compose
|
||||||
|
- docker-compose-transfer
|
||||||
- name: Add all Oracle containers to the network
|
- docker-compose-erc-native
|
||||||
set_fact:
|
|
||||||
docker_compose_parsed: "{{ docker_compose_parsed | combine({'services': {item: {'networks': docker_compose_parsed.services[item].networks | union(['ultimate'])}}}, recursive=True) }}"
|
|
||||||
with_items: "{{ docker_compose_parsed.services }}"
|
|
||||||
|
|
||||||
- name: Expose Redis port to allow connecting from redis-cli
|
|
||||||
set_fact:
|
|
||||||
docker_compose_parsed: "{{ docker_compose_parsed | combine({'services': {'redis': {'ports': ['6379:6379']}}}, recursive=True) }}"
|
|
||||||
|
|
||||||
- name: Write new docker-compose file
|
|
||||||
copy:
|
|
||||||
content: "{{ docker_compose_parsed | to_yaml }}"
|
|
||||||
dest: "/home/poadocker/bridge/oracle/docker-compose.yml"
|
|
||||||
|
|
||||||
- name: Slurp docker compose extended file
|
|
||||||
slurp:
|
|
||||||
src: "/home/poadocker/bridge/oracle/docker-compose-transfer.yml"
|
|
||||||
register: docker_compose_extended_slurp
|
|
||||||
- name: Parse docker compose file
|
|
||||||
set_fact:
|
|
||||||
docker_compose_extended_parsed: "{{ docker_compose_extended_slurp['content'] | b64decode | from_yaml }}"
|
|
||||||
|
|
||||||
- name: Add the external network used to connect to Parity nodes in compose extended file
|
|
||||||
set_fact:
|
|
||||||
docker_compose_extended_parsed: "{{ docker_compose_extended_parsed |combine({'networks': {'ultimate': {'external': 'true'}}}, recursive=True) }}"
|
|
||||||
|
|
||||||
- name: Add all Oracle containers to the network in compose extended file
|
|
||||||
set_fact:
|
|
||||||
docker_compose_extended_parsed: "{{ docker_compose_extended_parsed | combine({'services': {item: {'networks': docker_compose_extended_parsed.services[item].networks | union(['ultimate'])}}}, recursive=True) }}"
|
|
||||||
with_items: "{{ docker_compose_extended_parsed.services }}"
|
|
||||||
|
|
||||||
- name: Expose Redis port to allow connecting from redis-cli in compose extended file
|
|
||||||
set_fact:
|
|
||||||
docker_compose_extended_parsed: "{{ docker_compose_extended_parsed | combine({'services': {'redis': {'ports': ['6379:6379']}}}, recursive=True) }}"
|
|
||||||
|
|
||||||
- name: Write new docker-compose extended file
|
|
||||||
copy:
|
|
||||||
content: "{{ docker_compose_extended_parsed | to_yaml }}"
|
|
||||||
dest: "/home/poadocker/bridge/oracle/docker-compose-transfer.yml"
|
|
||||||
|
|
||||||
- name: start the service
|
- name: start the service
|
||||||
shell: service poabridge start
|
shell: service poabridge start
|
||||||
|
@ -1,41 +1,9 @@
|
|||||||
---
|
---
|
||||||
- name: Slurp docker compose file
|
- include_tasks: logging_remote.yml
|
||||||
slurp:
|
with_items:
|
||||||
src: "{{ bridge_path }}/oracle/docker-compose.yml"
|
- docker-compose
|
||||||
register: docker_compose_slurp
|
- docker-compose-transfer
|
||||||
|
- docker-compose-erc-native
|
||||||
- name: Parse docker compose file
|
|
||||||
set_fact:
|
|
||||||
docker_compose_parsed: "{{ docker_compose_slurp['content'] | b64decode | from_yaml }}"
|
|
||||||
|
|
||||||
- name: Set logger to remote server
|
|
||||||
set_fact:
|
|
||||||
docker_compose_parsed: "{{ docker_compose_parsed |combine({'services': {item: {'logging': {'driver': 'syslog','options': {'tag': '{{.Name}}/{{.ID}}'}}}}}, recursive=True) }}"
|
|
||||||
with_items: "{{ docker_compose_parsed.services }}"
|
|
||||||
|
|
||||||
- name: Write new docker-compose file
|
|
||||||
copy:
|
|
||||||
content: "{{ docker_compose_parsed | to_yaml }}"
|
|
||||||
dest: "{{ bridge_path }}/oracle/docker-compose.yml"
|
|
||||||
|
|
||||||
- name: Slurp docker compose extended file
|
|
||||||
slurp:
|
|
||||||
src: "{{ bridge_path }}/oracle/docker-compose-transfer.yml"
|
|
||||||
register: docker_compose_extended_slurp
|
|
||||||
|
|
||||||
- name: Parse docker compose extended file
|
|
||||||
set_fact:
|
|
||||||
docker_compose_extended_parsed: "{{ docker_compose_extended_slurp['content'] | b64decode | from_yaml }}"
|
|
||||||
|
|
||||||
- name: Set logger to remote server for extended file
|
|
||||||
set_fact:
|
|
||||||
docker_compose_extended_parsed: "{{ docker_compose_extended_parsed |combine({'services': {item: {'logging': {'driver': 'syslog','options': {'tag': '{{.Name}}/{{.ID}}'}}}}}, recursive=True) }}"
|
|
||||||
with_items: "{{ docker_compose_extended_parsed.services }}"
|
|
||||||
|
|
||||||
- name: Write new docker-compose-extended file
|
|
||||||
copy:
|
|
||||||
content: "{{ docker_compose_extended_parsed | to_yaml }}"
|
|
||||||
dest: "{{ bridge_path }}/oracle/docker-compose-transfer.yml"
|
|
||||||
|
|
||||||
- name: Set the local container logs configuration file
|
- name: Set the local container logs configuration file
|
||||||
template:
|
template:
|
||||||
|
19
deployment/roles/oracle/tasks/logging_remote.yml
Normal file
19
deployment/roles/oracle/tasks/logging_remote.yml
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
---
|
||||||
|
- name: Slurp docker compose file
|
||||||
|
slurp:
|
||||||
|
src: "{{ bridge_path }}/oracle/{{ item }}.yml"
|
||||||
|
register: docker_compose_slurp
|
||||||
|
|
||||||
|
- name: Parse docker compose file
|
||||||
|
set_fact:
|
||||||
|
docker_compose_parsed: "{{ docker_compose_slurp['content'] | b64decode | from_yaml }}"
|
||||||
|
|
||||||
|
- name: Set logger to remote server
|
||||||
|
set_fact:
|
||||||
|
docker_compose_parsed: "{{ docker_compose_parsed |combine({'services': {item: {'logging': {'driver': 'syslog','options': {'tag': '{{.Name}}/{{.ID}}'}}}}}, recursive=True) }}"
|
||||||
|
with_items: "{{ docker_compose_parsed.services }}"
|
||||||
|
|
||||||
|
- name: Write updated docker file
|
||||||
|
copy:
|
||||||
|
content: "{{ docker_compose_parsed | to_yaml }}"
|
||||||
|
dest: "{{ bridge_path }}/oracle/{{ item }}.yml"
|
@ -40,7 +40,11 @@
|
|||||||
|
|
||||||
- name: Extend docker compose file
|
- name: Extend docker compose file
|
||||||
set_fact: composefileoverride="-f docker-compose-transfer.yml"
|
set_fact: composefileoverride="-f docker-compose-transfer.yml"
|
||||||
when: ORACLE_BRIDGE_MODE == "ERC_TO_NATIVE" or ( ORACLE_BRIDGE_MODE == "ERC_TO_ERC" and FOREIGN_ERC_TYPE != "ERC677")
|
when: ORACLE_BRIDGE_MODE == "ERC_TO_ERC" and FOREIGN_ERC_TYPE != "ERC677"
|
||||||
|
|
||||||
|
- name: Extend docker compose file for erc to native
|
||||||
|
set_fact: composefileoverride="-f docker-compose-erc-native.yml"
|
||||||
|
when: ORACLE_BRIDGE_MODE == "ERC_TO_NATIVE"
|
||||||
|
|
||||||
- name: Install .key config
|
- name: Install .key config
|
||||||
template:
|
template:
|
||||||
|
126
oracle/docker-compose-erc-native.yml
Normal file
126
oracle/docker-compose-erc-native.yml
Normal file
@ -0,0 +1,126 @@
|
|||||||
|
---
|
||||||
|
version: '2.4'
|
||||||
|
services:
|
||||||
|
rabbit:
|
||||||
|
extends:
|
||||||
|
file: docker-compose.yml
|
||||||
|
service: rabbit
|
||||||
|
networks:
|
||||||
|
- net_rabbit_bridge_transfer
|
||||||
|
redis:
|
||||||
|
extends:
|
||||||
|
file: docker-compose.yml
|
||||||
|
service: redis
|
||||||
|
networks:
|
||||||
|
- net_db_bridge_transfer
|
||||||
|
bridge_request:
|
||||||
|
extends:
|
||||||
|
file: docker-compose.yml
|
||||||
|
service: bridge_request
|
||||||
|
networks:
|
||||||
|
- net_db_bridge_request
|
||||||
|
- net_rabbit_bridge_request
|
||||||
|
bridge_collected:
|
||||||
|
extends:
|
||||||
|
file: docker-compose.yml
|
||||||
|
service: bridge_collected
|
||||||
|
networks:
|
||||||
|
- net_db_bridge_request
|
||||||
|
- net_rabbit_bridge_request
|
||||||
|
bridge_affirmation:
|
||||||
|
extends:
|
||||||
|
file: docker-compose.yml
|
||||||
|
service: bridge_affirmation
|
||||||
|
networks:
|
||||||
|
- net_db_bridge_request
|
||||||
|
- net_rabbit_bridge_request
|
||||||
|
bridge_transfer:
|
||||||
|
cpus: 0.1
|
||||||
|
mem_limit: 500m
|
||||||
|
build:
|
||||||
|
context: ..
|
||||||
|
dockerfile: oracle/Dockerfile
|
||||||
|
env_file: ./.env
|
||||||
|
environment:
|
||||||
|
- NODE_ENV=production
|
||||||
|
- ORACLE_VALIDATOR_ADDRESS=${ORACLE_VALIDATOR_ADDRESS}
|
||||||
|
restart: unless-stopped
|
||||||
|
entrypoint: yarn watcher:transfer
|
||||||
|
networks:
|
||||||
|
- net_db_bridge_transfer
|
||||||
|
- net_rabbit_bridge_transfer
|
||||||
|
bridge_half_duplex_transfer:
|
||||||
|
cpus: 0.1
|
||||||
|
mem_limit: 500m
|
||||||
|
build:
|
||||||
|
context: ..
|
||||||
|
dockerfile: oracle/Dockerfile
|
||||||
|
env_file: ./.env
|
||||||
|
environment:
|
||||||
|
- NODE_ENV=production
|
||||||
|
- ORACLE_VALIDATOR_ADDRESS=${ORACLE_VALIDATOR_ADDRESS}
|
||||||
|
restart: unless-stopped
|
||||||
|
entrypoint: yarn watcher:half-duplex-transfer
|
||||||
|
networks:
|
||||||
|
- net_db_bridge_half_duplex_transfer
|
||||||
|
- net_rabbit_bridge_half_duplex_transfer
|
||||||
|
bridge_swap_tokens_worker:
|
||||||
|
cpus: 0.1
|
||||||
|
mem_limit: 500m
|
||||||
|
build:
|
||||||
|
context: ..
|
||||||
|
dockerfile: oracle/Dockerfile
|
||||||
|
env_file: ./.env
|
||||||
|
environment:
|
||||||
|
- NODE_ENV=production
|
||||||
|
- ORACLE_VALIDATOR_ADDRESS=${ORACLE_VALIDATOR_ADDRESS}
|
||||||
|
restart: unless-stopped
|
||||||
|
entrypoint: yarn worker:swap-tokens
|
||||||
|
networks:
|
||||||
|
- net_rabbit_bridge_swap_tokens_worker
|
||||||
|
bridge_senderhome:
|
||||||
|
extends:
|
||||||
|
file: docker-compose.yml
|
||||||
|
service: bridge_senderhome
|
||||||
|
networks:
|
||||||
|
- net_db_bridge_request
|
||||||
|
- net_rabbit_bridge_request
|
||||||
|
bridge_senderforeign:
|
||||||
|
extends:
|
||||||
|
file: docker-compose.yml
|
||||||
|
service: bridge_senderforeign
|
||||||
|
networks:
|
||||||
|
- net_db_bridge_request
|
||||||
|
- net_rabbit_bridge_request
|
||||||
|
|
||||||
|
networks:
|
||||||
|
net_db_bridge_request:
|
||||||
|
driver: bridge
|
||||||
|
net_db_bridge_collected:
|
||||||
|
driver: bridge
|
||||||
|
net_db_bridge_affirmation:
|
||||||
|
driver: bridge
|
||||||
|
net_db_bridge_transfer:
|
||||||
|
driver: bridge
|
||||||
|
net_db_bridge_half_duplex_transfer:
|
||||||
|
driver: bridge
|
||||||
|
net_db_bridge_senderhome:
|
||||||
|
driver: bridge
|
||||||
|
net_db_bridge_senderforeign:
|
||||||
|
driver: bridge
|
||||||
|
net_rabbit_bridge_request:
|
||||||
|
driver: bridge
|
||||||
|
net_rabbit_bridge_collected:
|
||||||
|
driver: bridge
|
||||||
|
net_rabbit_bridge_affirmation:
|
||||||
|
driver: bridge
|
||||||
|
net_rabbit_bridge_transfer:
|
||||||
|
driver: bridge
|
||||||
|
net_rabbit_bridge_half_duplex_transfer:
|
||||||
|
driver: bridge
|
||||||
|
net_rabbit_bridge_swap_tokens_worker:
|
||||||
|
driver: bridge
|
||||||
|
net_rabbit_bridge_senderhome:
|
||||||
|
driver: bridge
|
||||||
|
net_rabbit_bridge_senderforeign:
|
||||||
|
driver: bridge
|
@ -49,21 +49,6 @@ services:
|
|||||||
networks:
|
networks:
|
||||||
- net_db_bridge_transfer
|
- net_db_bridge_transfer
|
||||||
- net_rabbit_bridge_transfer
|
- net_rabbit_bridge_transfer
|
||||||
bridge_half_duplex_transfer:
|
|
||||||
cpus: 0.1
|
|
||||||
mem_limit: 500m
|
|
||||||
build:
|
|
||||||
context: ..
|
|
||||||
dockerfile: oracle/Dockerfile
|
|
||||||
env_file: ./.env
|
|
||||||
environment:
|
|
||||||
- NODE_ENV=production
|
|
||||||
- ORACLE_VALIDATOR_ADDRESS=${ORACLE_VALIDATOR_ADDRESS}
|
|
||||||
restart: unless-stopped
|
|
||||||
entrypoint: yarn watcher:half-duplex-transfer
|
|
||||||
networks:
|
|
||||||
- net_db_bridge_half_duplex_transfer
|
|
||||||
- net_rabbit_bridge_half_duplex_transfer
|
|
||||||
bridge_senderhome:
|
bridge_senderhome:
|
||||||
extends:
|
extends:
|
||||||
file: docker-compose.yml
|
file: docker-compose.yml
|
||||||
@ -88,8 +73,6 @@ networks:
|
|||||||
driver: bridge
|
driver: bridge
|
||||||
net_db_bridge_transfer:
|
net_db_bridge_transfer:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
net_db_bridge_half_duplex_transfer:
|
|
||||||
driver: bridge
|
|
||||||
net_db_bridge_senderhome:
|
net_db_bridge_senderhome:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
net_db_bridge_senderforeign:
|
net_db_bridge_senderforeign:
|
||||||
@ -102,8 +85,6 @@ networks:
|
|||||||
driver: bridge
|
driver: bridge
|
||||||
net_rabbit_bridge_transfer:
|
net_rabbit_bridge_transfer:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
net_rabbit_bridge_half_duplex_transfer:
|
|
||||||
driver: bridge
|
|
||||||
net_rabbit_bridge_senderhome:
|
net_rabbit_bridge_senderhome:
|
||||||
driver: bridge
|
driver: bridge
|
||||||
net_rabbit_bridge_senderforeign:
|
net_rabbit_bridge_senderforeign:
|
||||||
|
Loading…
Reference in New Issue
Block a user