-
Notifications
You must be signed in to change notification settings - Fork 39
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
ci: speed up workflows and reduce costs #1545
Changes from all commits
01260d0
6a39ac3
421c950
1b6b0b9
4ed50f2
bb69884
8ad9d7b
2021e69
4ecfb59
71ea0e8
0523b78
5773e7a
07ce3b6
fbca54f
96290df
f1f3989
8a42490
5c5c852
4f27dac
bc4ecaf
65b6f1d
e9c7149
ffe6f24
a15114c
a20ff31
16612ca
a45139a
2a4771f
2cc2f78
63bb902
aa370af
631602b
00bacb4
9a9191c
7c9d023
aeb4e96
8841231
defba96
677e078
b5c17f4
ee1203f
bff9aa0
71875f8
a6a55f7
604ef3b
4103141
c19baf4
171b551
ce0a69a
a491cf9
0b2b5a0
75753bc
436215a
39b66f2
3d65352
87687d9
e241fde
946794a
861f7b7
d798152
af89c72
6909305
9f91b44
f45c129
dae57c3
52d062a
13776f2
9429b0c
4c32852
3a83dc7
6ff61b2
490c593
0245e20
d47bd2f
4436a33
47a71ea
1559ab4
89204a9
45c8dee
2994e7f
3947030
5cbe77f
0b0acce
f975e20
0ec3f57
14c2e8d
7ec084d
2087428
5659333
a65453b
f432324
a72e9be
d3be298
5fec03a
b065ba3
5611188
ac719db
4c4a53a
457c3f8
f00b7b6
6b98def
5de7bce
044f3a7
4c3a5f0
c780358
a566ae0
53be75b
4e41ed5
bf3cde4
6b584f3
ed1d3a2
12bd828
e0a0753
2b3b7cb
cdc6510
ca6ca45
1f14eb2
4eeba04
6fbec85
f406770
5ace41f
0e40a67
66f43a9
716113d
8454780
4338cc9
8a4fc2e
11ed883
8e8aed8
0043124
c048f6a
150bb7a
e26af33
6455cc1
eef8b26
8244c5b
74ad36b
94b0b6d
2b520a7
a99d530
bbf655b
bc7d8e0
775c16c
fd9c924
34fd3f3
348a8b6
8c5df06
b07c756
55243aa
7f21cc3
f8cf09a
84921f2
37ae1ab
9112dc6
ce1e8df
c9ee444
b940309
5570c5a
81a83bc
bea6ae0
1080cbf
6bb9fbe
d8309ca
bb5dcb0
52e7d7b
586cf38
07067c7
6b00f53
8a8c545
31c2c15
8685d7e
f432b51
7dea3b9
128a44f
ab2694e
725f0d2
dc81e3f
0205f26
7ebfb46
6f4635f
a258b0a
20b3fda
4f4f9eb
ff3d017
f4691cd
e664405
3be9ac5
58f6685
31ed71c
59461cf
d0fc1f3
2eb973b
f8d578a
d4bde5f
fb615dd
51b553b
563cb67
dcba11a
ec420d7
8c6da42
6a7840d
185a682
4b2efe3
e3392cc
a7ed7a8
f04cfc6
6a8ee03
0cd1c1f
dee8e6a
69d01bc
082e219
1dd7e0e
1965ade
722d3a0
53315d9
2f22e97
060dde4
3c88bed
4e646d0
bc02130
ea947f8
902e15f
b5b036e
9970d06
f1e29f4
e5f4062
a4c5512
523e2be
47b2798
dcedc48
9120679
b605297
6df7414
533b407
376e0ee
d3b98b7
9f42000
295d12e
34dd2e9
4d2257b
c973f32
47b1754
9074b5f
3188982
cda2028
1019b04
ea4abe3
bd795d2
196343b
007dddf
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,99 @@ | ||
--- | ||
name: "Start local network" | ||
description: "Setup and start dashmate local network" | ||
inputs: | ||
image_org: | ||
description: "Docker image organization" | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Setup Node.JS | ||
uses: ./.github/actions/nodejs | ||
|
||
- name: Restore JS build artifacts | ||
uses: strophy/actions-cache@opendal-update | ||
with: | ||
bucket: multi-runner-cache-x1xibo9c | ||
root: actions-cache | ||
path: build-js-artifacts-${{ github.sha }}.tar | ||
key: build-js-artifacts/${{ github.sha }} | ||
|
||
- name: Unpack JS build artifacts archive | ||
shell: bash | ||
run: tar -xf build-js-artifacts-${{ github.sha }}.tar | ||
|
||
- name: Get dashmate fingerprint | ||
id: dashmate-fingerprint | ||
shell: bash | ||
run: echo "sha=$(git log -1 --format="%h" -- packages/dashmate)" >> $GITHUB_OUTPUT | ||
|
||
# TODO: Use upload artifacts action instead | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. check this todo There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I wasn't going to do it this iteration |
||
- name: Restore local network data | ||
id: local-network-data | ||
uses: strophy/actions-cache/restore@opendal-update | ||
with: | ||
bucket: multi-runner-cache-x1xibo9c | ||
root: local-network-data | ||
path: | | ||
/home/ubuntu/.dashmate | ||
**/.env | ||
dashmate_volumes_dump | ||
key: local-network-volumes/${{ steps.dashmate-fingerprint.outputs.sha }} | ||
|
||
- name: Restore dashmate volumes | ||
run: ./scripts/dashmate/volumes/restore.sh | ||
shell: bash | ||
if: steps.local-network-data.outputs.cache-hit == 'true' | ||
|
||
- name: Setup local network | ||
run: | | ||
set -ex | ||
|
||
# create tenderdash blocks every 10s to speed up test suite | ||
yarn dashmate config set --config=local platform.drive.tenderdash.consensus.createEmptyBlocksInterval "10s" | ||
|
||
# collect drive logs for bench suite | ||
yarn dashmate config set --config=local platform.drive.abci.logs.stdout.level "trace" | ||
|
||
./scripts/setup_local_network.sh | ||
./scripts/configure_test_suite.sh | ||
./scripts/configure_dotenv.sh | ||
shell: bash | ||
if: steps.local-network-data.outputs.cache-hit != 'true' | ||
|
||
- name: Dump dashmate volumes | ||
run: ./scripts/dashmate/volumes/dump.sh | ||
shell: bash | ||
if: steps.local-network-data.outputs.cache-hit != 'true' | ||
|
||
- name: Save local network data | ||
uses: strophy/actions-cache/save@opendal-update | ||
with: | ||
bucket: multi-runner-cache-x1xibo9c | ||
root: local-network-data | ||
path: | | ||
/home/ubuntu/.dashmate | ||
**/.env | ||
dashmate_volumes_dump | ||
key: local-network-volumes/${{ steps.dashmate-fingerprint.outputs.sha }} | ||
if: steps.local-network-data.outputs.cache-hit != 'true' | ||
|
||
- name: Configure pre-built docker images | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Where do we get these images from? Looks like we assume they are already pushed (= we should have some dependency on another job declared above). Please add dependency/comment explaining that. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's not a job, it's an action that pulls images to do the work. Workflows what use this action defines dependencies to build-images job. |
||
shell: bash | ||
run: | | ||
SHA_TAG=sha-${{ github.sha }} | ||
VERSION=$(cat package.json | jq -r '.version') | ||
|
||
# Dashmate helper | ||
docker pull ${{ inputs.image_org }}/dashmate-helper:$SHA_TAG | ||
docker tag ${{ inputs.image_org }}/dashmate-helper:$SHA_TAG dashpay/dashmate-helper:$VERSION | ||
|
||
# Replace DAPI and Drive images with new org and tag in dashmate config | ||
sed -i -E "s/dashpay\/(drive|dapi):[^\"]+/${{ inputs.image_org }}\/\1:${SHA_TAG}/g" /home/ubuntu/.dashmate/config.json | ||
|
||
cat /home/ubuntu/.dashmate/config.json | ||
|
||
- name: Start local network | ||
shell: bash | ||
run: yarn start |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,33 +17,16 @@ runs: | |
shell: bash | ||
run: npm config set audit false | ||
|
||
- name: Configure AWS credentials and bucket region | ||
uses: aws-actions/configure-aws-credentials@v4 | ||
if: contains(runner.name, 'ubuntu-platform') | ||
with: | ||
aws-region: eu-west-1 | ||
|
||
- name: Cache NPM build artifacts (S3 bucket cache) | ||
uses: everpcpc/actions-cache@v1 | ||
if: contains(runner.name, 'ubuntu-platform') | ||
uses: strophy/actions-cache@opendal-update | ||
strophy marked this conversation as resolved.
Show resolved
Hide resolved
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should prefer There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We expect some updates on upstream soon. When they don't we will change it. |
||
with: | ||
bucket: multi-runner-cache-x1xibo9c | ||
root: actions-cache | ||
path: | | ||
.yarn/unplugged | ||
key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn-unplugged- | ||
|
||
- name: Cache NPM build artifacts (GitHub Actions cache) | ||
uses: actions/cache@v3 | ||
if: ${{ !contains(runner.name, 'ubuntu-platform') }} | ||
with: | ||
path: | | ||
.yarn/unplugged | ||
key: ${{ runner.os }}-yarn-unplugged-${{ hashFiles('yarn.lock') }} | ||
key: ${{ runner.os }}/yarn/unplugged/${{ hashFiles('yarn.lock') }} | ||
restore-keys: | | ||
${{ runner.os }}-yarn-unplugged- | ||
${{ runner.os }}/yarn/unplugged/ | ||
|
||
- name: Install dependencies | ||
shell: bash | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
it means the cache size will grow indefinitely
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We drop it every time. Only cargo registry mount is stored on S3 where we have own retention policy for files (3 days)