-
Notifications
You must be signed in to change notification settings - Fork 16
156 lines (143 loc) · 4.98 KB
/
cannon-smoke-test.yaml
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
name: Cannon Smoke Test
on:
pull_request:
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
cannon-smoke-test:
timeout-minutes: 20
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
# - name: Setup tmate session
# uses: mxschmitt/action-tmate@v3
# with:
# limit-access-to-actor: true
# detached: true
- name: Install clickhouse client
run: |
sudo apt-get install -y apt-transport-https ca-certificates curl gnupg
curl -fsSL 'https://packages.clickhouse.com/rpm/lts/repodata/repomd.xml.key' | sudo gpg --dearmor -o /usr/share/keyrings/clickhouse-keyring.gpg
echo "deb [signed-by=/usr/share/keyrings/clickhouse-keyring.gpg] https://packages.clickhouse.com/deb stable main" | sudo tee \
/etc/apt/sources.list.d/clickhouse.list
sudo apt-get update
sudo apt-get install -y clickhouse-client
clickhouse-client --version
- name: Pull docker compose images in the background
run: |
docker compose pull &
- name: Build xatu image
run: |
docker build -t ethpandaops/xatu:local .
echo "Xatu image is built."
- name: Run Xatu stack
timeout-minutes: 10
shell: bash
run: |
docker compose up --build --detach --quiet-pull
- name: Seed Postgres with cannon data
run: |
set -e;
# Wait for Postgres to be ready
echo "Waiting for Postgres to be ready..."
docker exec xatu-postgres sh -c 'while ! pg_isready; do sleep 1; done'
echo "Postgres is ready."
# Wait for the cannon_location table to be created
echo "Waiting for cannon_location table to be created..."
until docker exec xatu-postgres psql -U user -d xatu -c "SELECT 1 FROM cannon_location LIMIT 1" &> /dev/null
do
echo "Table not ready yet. Waiting 5 seconds..."
sleep 5
done
echo "cannon_location table is now available."
# Generate seeding commands
echo "Generating seeding commands..."
SEEDING_COMMANDS=$(bash .github/cannon/create-seed-commands.sh .github/cannon/seeding.yaml)
echo "Seeding data prepared."
echo "SEEDING_COMMANDS: $SEEDING_COMMANDS"
docker exec xatu-postgres psql -U user -d xatu -c "$SEEDING_COMMANDS"
echo "Seeding completed successfully."
- name: Show the state of the database
run: |
docker exec xatu-postgres psql -U user -d xatu -c "SELECT * FROM cannon_location;"
- name: Create Xatu Cannon config
run: |
cat <<EOF > /tmp/cannon_config.yaml
logging: debug
name: cannon-smoke-test
labels:
ethpandaops: rocks
derivers:
attesterSlashing:
enabled: true
blsToExecutionChange:
enabled: true
deposit:
enabled: true
withdrawal:
enabled: true
executionTransaction:
enabled: true
proposerSlashing:
enabled: true
voluntaryExit:
enabled: true
beaconBlock:
enabled: true
beaconBlobSidecar:
enabled: false
proposerDuty:
enabled: true
beaconCommittee:
enabled: true
ntpServer: time.google.com
ethereum:
beaconNodeAddress: "https://bn-holesky-lighthouse-erigon-001.utility.production.platform.ethpandaops.io"
beaconNodeHeaders:
Authorization: "AUTH_HEADER"
coordinator:
address: xatu-server:8080
outputs:
- name: xatu
type: xatu
config:
address: xatu-server:8080
tls: false
maxQueueSize: 51200
batchTimeout: 1s
exportTimeout: 30s
maxExportBatchSize: 512
- name: Show config
run: |
cat /tmp/cannon_config.yaml
- name: Set authorization header
run: |
sed -i 's/AUTH_HEADER/${{ secrets.PLATFORM_UTILITY_NODE_AUTHORIZATION }}/' /tmp/cannon_config.yaml
- name: Start Xatu cannon
run: |
docker run -d --network xatu_xatu-net --name xatu-cannon -v /tmp/cannon_config.yaml:/etc/xatu/config.yaml ethpandaops/xatu:local cannon --config /etc/xatu/config.yaml
- name: Wait for Xatu cannon to start
run: |
sleep 5
docker logs xatu-cannon
- name: Verify Clickhouse has data
timeout-minutes: 15
run: |
.github/cannon/assert_clickhouse.sh .github/cannon/seeding.yaml
- name: Collect docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v2
with:
dest: './logs'
- name: Tar logs
if: failure()
run: tar cvzf ./logs.tgz ./logs
- name: Upload logs to GitHub
if: failure()
uses: actions/upload-artifact@master
with:
name: logs.tgz
path: ./logs.tgz