-
Notifications
You must be signed in to change notification settings - Fork 1
288 lines (253 loc) · 11.9 KB
/
testing-release-with-qa-test-job.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
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
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
name: testing-release-with-qa-test-job
run-name: test - Release ${{ inputs.release_version }} from branch ${{ inputs.checkout_ref }} executed by @${{ github.actor }}
env:
APPLICATION: "erigon"
APPLICATION_VERSION: "Erigon2"
BUILDER_IMAGE: "golang:1.22-bookworm"
TARGET_BASE_IMAGE: "debian:12.7-slim"
APP_REPO: "erigontech/erigon"
CHECKOUT_REF: "release/2.60"
DOCKERHUB_REPOSITORY: "erigontech/dev-erigon"
TEST_TRACKING_TIME_SECONDS: 7200 # 2 hours
TEST_TOTAL_TIME_SECONDS: 432000 # 5 days
TEST_CHAIN: "mainnet"
LABEL_DESCRIPTION: "Erigon is an implementation of Ethereum (execution layer with embeddable consensus layer), on the efficiency frontier. Archive Node by default."
on:
workflow_dispatch:
inputs:
release_version:
required: true
type: string
description: 'Release version number (Pattern - v#.#.# , f.e. v2.60.1 or v3.0.0 or v3.0.0-alpha1 for pre-releases. Use prefix "v".)'
jobs:
build-release:
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- name: Fast checkout git repository devops-testing-workflows
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 ## 4.1.7 release
with:
repository: erigontech/devops-testing-workflows
fetch-depth: 1
path: 'devops-testing-workflows'
- name: Fast checkout git repository in order to get commit id for further checkouts by this workflow
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 ## 4.1.7 release
with:
repository: ${{ env.APP_REPO }}
fetch-depth: 0
ref: ${{ env.CHECKOUT_REF }}
path: 'erigon'
- name: Get commit id
id: getCommitId
run: |
mkdir ${GITHUB_WORKSPACE}/build-arm64 ${GITHUB_WORKSPACE}/build-amd64 ${GITHUB_WORKSPACE}/build-amd64v2
cd erigon
echo "id=$(git rev-parse HEAD)" >> $GITHUB_OUTPUT
echo "short_commit_id=$(git rev-parse --short=7 HEAD)" >> $GITHUB_OUTPUT
echo "week_of_the_year=$(/bin/date -u "+%Y-%W")" >> $GITHUB_OUTPUT
cd ..
echo GITHUB_WORKSPACE=${GITHUB_WORKSPACE} and pwd=$(pwd)
echo
echo "ls -l .."
ls -l ../
- name: Configure go build and pkg cache for one week only
id: cache
uses: actions/cache@v4
with:
key: cache-year-week-${{ steps.getCommitId.outputs.week_of_the_year }}-go.mod-hash:${{ hashFiles('erigon/go.mod') }}
path: |
~/go/pkg
~/.cache
- name: Login to Docker Hub
uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 ## v3.3.0
with:
username: ${{ secrets.ORG_DOCKERHUB_ERIGONTECH_USERNAME }}
password: ${{ secrets.ORG_DOCKERHUB_ERIGONTECH_TOKEN }}
- name: Set up QEMU
uses: docker/setup-qemu-action@49b3bc8e6bdd4a60e6116a5414239cba5943d3cf ## v3.2.0
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@988b5a0280414f521da01fcc63a27aeeb4b104db ## v3.6.1
- name: build arm64
run: >
docker run --platform linux/arm64
--rm
-v $(pwd)/erigon:/erigon:ro
-v ${GITHUB_WORKSPACE}/build-arm64:/erigon-build
-v ${HOME}/.cache:/root/.cache
-v ${HOME}/go/pkg/mod:/go/pkg/mod
-w /erigon --entrypoint /bin/bash
${{ env.BUILDER_IMAGE }}
-c "git config --global --add safe.directory /erigon;
make GOARCH=arm64 GOBIN=/erigon-build BUILD_TAGS=nosqlite,noboltdb,nosilkworm
erigon downloader devnet evm caplin diag integration rpcdaemon sentry txpool"
- name: build amd64
run: |
docker run --platform linux/amd64 \
--rm -v $(pwd)/erigon:/erigon:ro \
-v ${GITHUB_WORKSPACE}/build-amd64:/erigon-build \
-v ${HOME}/.cache:/root/.cache \
-v ${HOME}/go/pkg/mod:/go/pkg/mod \
-w /erigon --entrypoint /bin/bash \
${{ env.BUILDER_IMAGE }} \
-c "git config --global --add safe.directory /erigon; make GOARCH=amd64 GOAMD64=v1 GOBIN=/erigon-build BUILD_TAGS=nosqlite,noboltdb erigon downloader devnet evm caplin diag integration rpcdaemon sentry txpool; find / -name libsilkworm_capi.so -exec install {} /erigon-build \; "
- name: build amd64v2
run: |
docker run --platform linux/amd64/v2 \
--rm -v $(pwd)/erigon:/erigon:ro \
-v ${GITHUB_WORKSPACE}/build-amd64v2:/erigon-build \
-v ${HOME}/.cache:/root/.cache \
-v ${HOME}/go/pkg/mod:/go/pkg/mod \
-w /erigon --entrypoint /bin/bash \
${{ env.BUILDER_IMAGE }} \
-c "git config --global --add safe.directory /erigon; make GOARCH=amd64 GOAMD64=v2 GOBIN=/erigon-build BUILD_TAGS=nosqlite,noboltdb erigon downloader devnet evm caplin diag integration rpcdaemon sentry txpool; find / -name libsilkworm_capi.so -exec install {} /erigon-build \; "
- name: Pack Artifacts
run: |
cd ${GITHUB_WORKSPACE}
mkdir $GITHUB_WORKSPACE/release
for dir in build-*; do
cd $dir
echo Current directory is $(pwd) . Checksum file and archive will be created for this directory
sha256sum * > checksums.txt
tar czvf $GITHUB_WORKSPACE/release/${APPLICATION}_${{ inputs.release_version }}_linux_$(echo $dir | sed 's,build-,,').tar.gz \
--transform "s,^./,${APPLICATION}_${{ inputs.release_version }}_linux_$(echo $dir | sed 's,build-,,')/," .
cd -
done
cd $GITHUB_WORKSPACE/release
sha256sum * > ${APPLICATION}_${{ inputs.release_version }}_checksums.txt
find . -type f -ls
- name: Upload Artifact - checksums.txt
uses: actions/upload-artifact@v4
with:
name: ${{ env.APPLICATION }}_${{ inputs.release_version }}_checksums.txt
path: ${{ github.workspace }}/release/${{ env.APPLICATION }}_${{ inputs.release_version }}_checksums.txt
retention-days: 7
compression-level: 0
- name: Upload Artifact - arm64
uses: actions/upload-artifact@v4
with:
name: ${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_arm64.tar.gz
path: ${{ github.workspace }}/release/${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_arm64.tar.gz
retention-days: 7
compression-level: 0
- name: Upload Artifact - amd64
uses: actions/upload-artifact@v4
with:
name: ${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_amd64.tar.gz
path: ${{ github.workspace }}/release/${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_amd64.tar.gz
retention-days: 7
compression-level: 0
- name: Upload Artifact - amd64v2
uses: actions/upload-artifact@v4
with:
name: ${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_amd64v2.tar.gz
path: ${{ github.workspace }}/release/${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_amd64v2.tar.gz
retention-days: 7
compression-level: 0
test-release:
name: test on ${{ matrix.id }}
runs-on: [ self-hosted, Release, "${{ matrix.runner-arch }}" ]
timeout-minutes: 7200 # 5 days
needs: [ build-release ]
strategy:
matrix:
include:
- id: linux/amd64
#runner: ubuntu-latest-release-test-amd64
#runner: ubuntu-latest-devops-large
runner-arch: X64
artifact: linux_amd64
#- id: linux/amd64/v2
# #runner: ubuntu-latest-release-test-amd64
# #runner: ubuntu-latest-devops-large
# runner-arch: X64
# artifact: linux_amd64v2
- id: linux/arm64
#runner: ubuntu-latest-release-test-arm64
#runner: ubuntu-latest-devops-large-arm
runner-arch: ARM64
artifact: linux_arm64
steps:
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.12'
- name: Download artifact ${{ env.APPLICATION }}_${{ inputs.release_version }}_${{ matrix.artifact }}.tar.gz
uses: actions/download-artifact@v4
with:
name: ${{ env.APPLICATION }}_${{ inputs.release_version }}_${{ matrix.artifact }}.tar.gz
path: .
- name: Extract artifact ${{ env.APPLICATION }}_${{ inputs.release_version }}_${{ matrix.artifact }}.tar.gz
run: |
pwd
ls -l ${{ env.APPLICATION }}_${{ inputs.release_version }}_${{ matrix.artifact }}.tar.gz
tar xzvf ${{ env.APPLICATION }}_${{ inputs.release_version }}_${{ matrix.artifact }}.tar.gz
ls -lR
- name: Fast checkout git repository erigontech/erigon-qa
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 ## 4.1.7 release
with:
token: ${{ secrets.ORG_GITHUB_ERIGONTECH_ERIGON_QA_READ }}
repository: erigontech/erigon-qa
fetch-depth: 1
ref: main
path: erigon-qa
- name: Checkout QA Tests Repository & Install Requirements
run: |
cd ./erigon-qa/test_system
pwd
ls -lao
pip3 install -r requirements.txt
ln -s $(pwd)/base_library $(pwd)/qa-tests/tip-tracking/base_library
echo "DEBUG -- content of directory $(pwd) :"
ls -l
echo "DEBUG -- content of directory $(pwd)/qa-tests/tip-tracking/"
ls -l $(pwd)/qa-tests/tip-tracking/
echo "DEBUG -- content of directory GITHUB_WORKSPACE ${GITHUB_WORKSPACE} :"
ls -l ${GITHUB_WORKSPACE}
echo "DEBUG -- end."
rm -rf ${RUNNER_WORKSPACE}/erigon-data || true
mkdir ${RUNNER_WORKSPACE}/erigon-data
# Run Erigon, wait sync and check ability to maintain sync
python3 qa-tests/tip-tracking/run_and_check_tip_tracking.py \
${GITHUB_WORKSPACE}/${{ env.APPLICATION }}_${{ inputs.release_version }}_${{ matrix.artifact }} \
${RUNNER_WORKSPACE}/erigon-data ${{ env.TEST_TRACKING_TIME_SECONDS }} ${{ env.TEST_TOTAL_TIME_SECONDS }} ${{ env.APPLICATION_VERSION }} ${{ env.TEST_CHAIN }}
# Capture monitoring script exit status
test_exit_status=$?
# Save the subsection reached status
echo "::set-output name=test_executed::true"
# Check test runner script exit status
if [ $test_exit_status -eq 0 ]; then
echo "Tests completed successfully"
echo "TEST_RESULT=success" >> "$GITHUB_OUTPUT"
else
echo "Error detected during tests"
echo "TEST_RESULT=failure" >> "$GITHUB_OUTPUT"
fi
publish-release:
name: Publish release
runs-on: ubuntu-latest
needs: [ test-release ]
steps:
- name: Download artifact ${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_amd64.tar.gz
uses: actions/download-artifact@v4
with:
name: ${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_amd64.tar.gz
path: .
- name: Download artifact ${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_amd64v2.tar.gz
uses: actions/download-artifact@v4
with:
name: ${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_amd64v2.tar.gz
path: .
- name: Download artifact ${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_arm64.tar.gz
uses: actions/download-artifact@v4
with:
name: ${{ env.APPLICATION }}_${{ inputs.release_version }}_linux_arm64.tar.gz
path: .
- name: Download artifact ${{ env.APPLICATION }}_${{ inputs.release_version }}_checksums.txt
uses: actions/download-artifact@v4
with:
name: ${{ env.APPLICATION }}_${{ inputs.release_version }}_checksums.txt
path: .
- name: Debug output
run: |
pwd
ls -lao