Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add docker-compose for test_docker_compose_release #1777

Merged
merged 11 commits into from
Nov 23, 2020
12 changes: 8 additions & 4 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -600,6 +600,8 @@ jobs:
test_docker_compose_release:
machine:
image: ubuntu-1604:201903-01
environment:
SNAPSHOT: SNAPSHOT_MIX_EXIT_PERIOD_SECONDS_120
parallelism: 4
steps:
- checkout
Expand All @@ -617,8 +619,9 @@ jobs:
- run:
name: Start daemon services
command: |
cd priv/cabbage
make start_daemon_services-2 || (START_RESULT=$?; docker-compose logs; exit $START_RESULT;)
make init_test
cp ./localchain_contract_addresses.env ./priv/cabbage/apps/itest/localchain_contract_addresses.env
docker-compose -f docker-compose.yml -f docker-compose.feefeed.yml -f docker-compose.specs.yml up -d || (START_RESULT=$?; docker-compose logs; exit $START_RESULT;)
- run:
name: Log daemon services
command: make cabbage-logs
Expand Down Expand Up @@ -730,8 +733,9 @@ jobs:
- run:
name: Start daemon services
command: |
cd priv/cabbage
make start_daemon_services_reorg-2 || (START_RESULT=$?; docker-compose logs; exit $START_RESULT;)
make init_test_reorg
cp ./localchain_contract_addresses.env ./priv/cabbage/apps/itest/localchain_contract_addresses.env
docker-compose -f docker-compose.yml -f docker-compose.feefeed.yml -f docker-compose.reorg.yml -f docker-compose.specs.yml up -d || (START_RESULT=$?; docker-compose logs; exit $START_RESULT;)
- run:
name: Log daemon services
command: make cabbage-logs-reorg
Expand Down
14 changes: 7 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -320,27 +320,27 @@ docker-push: docker
### Cabbage logs

cabbage-logs:
docker-compose -f docker-compose.yml -f docker-compose.feefeed.yml -f ./priv/cabbage/docker-compose-2-specs.yml logs --follow
docker-compose -f docker-compose.yml -f docker-compose.feefeed.yml -f docker-compose.specs.yml logs --follow

cabbage-logs-reorg:
docker-compose -f docker-compose.yml -f docker-compose.feefeed.yml -f ./priv/cabbage/docker-compose-2-reorg.yml -f ./priv/cabbage/docker-compose-2-specs.yml logs --follow
docker-compose -f docker-compose.yml -f docker-compose.feefeed.yml -f docker-compose.reorg.yml -f docker-compose.specs.yml logs --follow

### Cabbage reorg docker logs

cabbage-reorg-watcher-logs:
docker-compose -f docker-compose.yml -f ./priv/cabbage/docker-compose-2-reorg.yml -f ./priv/cabbage/docker-compose-2-specs.yml logs --follow watcher
docker-compose -f docker-compose.yml -f docker-compose.reorg.yml -f docker-compose.specs.yml logs --follow watcher

cabbage-reorg-watcher_info-logs:
docker-compose -f docker-compose.yml -f ./priv/cabbage/docker-compose-2-reorg.yml -f ./priv/cabbage/docker-compose-2-specs.yml logs --follow watcher_info
docker-compose -f docker-compose.yml -f docker-compose.reorg.yml -f docker-compose.specs.yml logs --follow watcher_info

cabbage-reorg-childchain-logs:
docker-compose -f docker-compose.yml -f ./priv/cabbage/docker-compose-2-reorg.yml -f ./priv/cabbage/docker-compose-2-specs.yml logs --follow childchain
docker-compose -f docker-compose.yml -f docker-compose.reorg.yml -f docker-compose.specs.yml logs --follow childchain

cabbage-reorg-geth-logs:
docker-compose -f docker-compose.yml -f ./priv/cabbage/docker-compose-2-reorg.yml -f ./priv/cabbage/docker-compose-2-specs.yml logs --follow | grep "geth"
docker-compose -f docker-compose.yml -f docker-compose.reorg.yml -f docker-compose.specs.yml logs --follow | grep "geth"

cabbage-reorgs-logs:
docker-compose -f docker-compose.yml -f ./priv/cabbage/docker-compose-2-reorg.yml -f ./priv/cabbage/docker-compose-2-specs.yml logs --follow | grep "reorg"
docker-compose -f docker-compose.yml -f docker-compose.reorg.yml -f docker-compose.specs.yml logs --follow | grep "reorg"

###OTHER
docker-start-cluster:
Expand Down
67 changes: 67 additions & 0 deletions docker-compose.reorg.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
version: "2.3"
services:
geth:
entrypoint: ["echo", "clique geth is disabled for reorgs"]

geth-1:
image: ethereum/client-go:v1.9.12
container_name: geth-1
environment:
- ACCOUNT=0x6de4b3b9c28e9c3e84c2b2d3a875c947a84de68d
- BOOTNODES=enode://b655cc3e5b72ab9beb8a8536a3c3ae92fbeb79feb1ebd7f95d72be72554ca586428bd48a54eb9c2bcaae455cc674299b6dd3df3c6556a493dfd50070f1a448aa@172.27.0.202:30303
- INIT=false
entrypoint: /bin/sh -c ". data/geth/command"
expose:
- 8545
- 8546
- 30303
ports:
- 9000:8545
volumes:
- ./data1:/data
- ./data/ethash:/root/.ethash
healthcheck:
test: curl geth-1:8545
interval: 5s
timeout: 3s
retries: 5
networks:
chain_net:
ipv4_address: 172.27.0.201

geth-2:
image: ethereum/client-go:v1.9.12
container_name: geth-2
depends_on:
- geth-1
environment:
- ACCOUNT=0xc0f780dfc35075979b0def588d999225b7ecc56f
- BOOTNODES=enode://4574f825d67bf570b9216e704a5b761d05d5015c458e2c9dd4b30abb2fe8c881400c2074a126df94690c4c9fb72ee046e6e3ac2bb73dede42fce66cb0a963b36@172.27.0.201:30303
- INIT=false
entrypoint: /bin/sh -c ". data/geth/command"
expose:
- 8546
- 8545
- 30303
ports:
- 9001:8545
volumes:
- ./data2:/data
- ./data/ethash:/root/.ethash
healthcheck:
test: curl geth-2:8545
interval: 5s
timeout: 3s
retries: 5
networks:
chain_net:
ipv4_address: 172.27.0.202

nginx:
depends_on:
geth-1:
condition: service_healthy
geth-2:
condition: service_healthy
volumes:
- ./nginx.reorg.conf:/etc/nginx/nginx.conf
10 changes: 10 additions & 0 deletions docker-compose.specs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# this is an override to our usual docker-compose.yml which enables cabbage integration tests to run against a
# test-friendly setup of our services
version: "2.3"
services:
watcher:
environment:
- EXIT_PROCESSOR_SLA_MARGIN=30
watcher_info:
environment:
- EXIT_PROCESSOR_SLA_MARGIN=30
39 changes: 39 additions & 0 deletions nginx.reorg.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
events {}
http {
upstream geth {
server 172.27.0.201:8545;
server 172.27.0.202:8545;
}

upstream websocket {
server 172.27.0.201:8546;
server 172.27.0.202:8546;
}

server {
listen 80;

location / {
proxy_pass http://geth;
proxy_next_upstream non_idempotent invalid_header error timeout http_500 http_502 http_504 http_403 http_404;
proxy_next_upstream_tries 4;
fastcgi_read_timeout 10;
proxy_read_timeout 10;
}
}

server {
listen 81;

location / {
proxy_pass http://websocket;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_next_upstream non_idempotent invalid_header error timeout http_500 http_502 http_504 http_403 http_404;
proxy_connect_timeout 7d;
proxy_send_timeout 7d;
proxy_read_timeout 7d;
}
}
}