forked from covalenthq/refiner
-
Notifications
You must be signed in to change notification settings - Fork 0
/
docker-compose-ci.yml
130 lines (125 loc) · 4.1 KB
/
docker-compose-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
version: "3"
# runs the entire refiner pipeline with all supporting services (including refiner) in docker
# set .env such that all services in docker are talking to each other only
services:
eth-node:
image: "us-docker.pkg.dev/covalent-project/network/cqt-staking:latest-refiner"
container_name: hardhat-node
restart: on-failure
expose:
- "8545:8545"
entrypoint: |
/bin/bash -l -c "
echo "forked-node-address:" $ERIGON_NODE;
./entrypoint.sh;"
networks:
- cqt-net
environment:
- ERIGON_NODE=${ERIGON_NODE}
- NODE_TLS_REJECT_UNAUTHORIZED=0
ports:
- "8545:8545"
cqt-staking:
image: "us-docker.pkg.dev/covalent-project/network/cqt-staking:latest-refiner"
container_name: proof-chain
restart: on-failure
entrypoint: |
/bin/bash -l -c "
echo Waiting for hardhat-node to start up...;
sleep 20;
echo hard-hat node started!;
echo "web3-jwt:" $WEB3_JWT;
npm run docker:deploy;
nc -v refiner 8008;
sleep 1000000;"
depends_on:
- eth-node
networks:
- cqt-net
ports:
- "8008:8008"
ipfs-pinner:
image: "us-docker.pkg.dev/covalent-project/network/ipfs-pinner:stable"
volumes:
- ~/.ipfs:/root/.ipfs/
container_name: ipfs-pinner
restart: on-failure
entrypoint: |
/bin/bash -l -c "
touch proof_out_hex.txt;
chmod +x proof_out_hex.txt;
echo "$PROOF_OUT_HEX" > proof_out_hex.txt;
xxd -r -p proof_out_hex.txt > proof_from_hex.out;
chmod +x proof_from_hex.out;
mv ./proof_from_hex.out /root/.ipfs/proof_from_hex.out;
./ipfs-server -port 3001 -w3-agent-key $W3_AGENT_KEY -w3-delegation-file $W3_DELEGATION_FILE;"
expose:
- "4001:4001"
- "3001:3001"
environment:
- W3_AGENT_KEY=${W3_AGENT_KEY}
- W3_DELEGATION_FILE=${W3_DELEGATION_FILE}
- PROOF_OUT_HEX=${PROOF_OUT_HEX}
networks:
- cqt-net
ports:
- "4001:4001"
- "3001:3001"
evm-server:
image: "us-docker.pkg.dev/covalent-project/network/evm-server:latest"
container_name: evm-server
restart: on-failure
expose:
- "3002:3002"
networks:
- cqt-net
ports:
- "3002:3002"
refiner:
image: "us-docker.pkg.dev/covalent-project/network/refiner:latest"
container_name: refiner
links:
- "ipfs-pinner:ipfs-pinner"
# build:
# context: .
# dockerfile: Dockerfile
restart: on-failure
depends_on:
ipfs-pinner:
condition: service_healthy
evm-server:
condition: service_healthy
entrypoint: >
/bin/bash -l -c "
echo "ipfs-node-address:" $IPFS_PINNER_URL;
echo "hardhat-node-address:" $NODE_ETHEREUM_MAINNET;
echo "brp-op-pk:" $BLOCK_RESULT_OPERATOR_PRIVATE_KEY;
echo "evm-server-address:" $EVM_SERVER_URL;
echo "code-test-coverage:" $CODECOV_TOKEN;
echo Waiting for proof-chain to be deployed...;
while ! nc -v -l -k -p 8008;
do
sleep 1;
done;
echo Proof-chain contracts deployed!;
echo Uploading test files to local .ipfs...;
curl -F "filedata=@/app/test-data/codec-0.36/encoded/1-19434485-replica-0x5800aab40ca1c9aedae3329ad82ad051099edaa293d68504b987a12acfa7b799" http://ipfs-pinner:3001/upload;
curl -F "filedata=@/app/test-data/codec-0.36/encoded/1-19434555-replica-0x3e6af5a88c6205e03364e4a8e4d6d558d53bbea0ed9398df0ee078e6bce3086e" http://ipfs-pinner:3001/upload;
echo Test bsp files uploaded!;
cd /mix;
MIX_ENV=docker mix coveralls.json;
curl -Os https://uploader.codecov.io/latest/linux/codecov;
chmod +x codecov;
./codecov -t $CODECOV_TOKEN -C $GITHUB_SHA -r $CODECOV_SLUG -B $GITHUB_HEAD_REF;
exit 0; "
environment:
- NODE_ETHEREUM_MAINNET=${NODE_ETHEREUM_MAINNET}
- BLOCK_RESULT_OPERATOR_PRIVATE_KEY=${BLOCK_RESULT_OPERATOR_PRIVATE_KEY}
- EVM_SERVER_URL=${EVM_SERVER_URL}
- IPFS_PINNER_URL=${IPFS_PINNER_URL}
- CODECOV_TOKEN=${CODECOV_TOKEN}
- CI=${CI}
networks:
- cqt-net
networks:
cqt-net: