Skip to content

Commit c1f680a

Browse files
authored
feat(ci): add native dependencies to the CI (dynamic docker) (starkware-libs#726)
* fix: ci * fix: return back old images in the CI * fix: add native deps to some CI jobs * chore: update feature contracts * fix: add LLVM deps to the Dockerfile * fix: add LLVM to `install_build_tools.sh` * fix: make larger runner * fix: make ubuntu latest runner * fix: update build tools, add env vars * fix: update build tools, add env vars * fix: add clean up of the native artifacts * fix: add clean up of the native artifacts * fix: native artifacts push CI * fix: native artifacts push CI * fix: native artifacts push CI * fix: add -y arg to apt * fix: add env to ignore interactive env * fix: increase size of the runners * fix: update runner version * fix: remove native and rust dependencies * fix: update sequencer-ci.Dockerfile * fix: update sequencer-ci.Dockerfile * fix: update sequencer-ci.Dockerfile * fix: increase runner size * fix: try to fix Dockerfile with adding musl-g++ * fix: try to fix Dockerfile with adding musl-g++ #2 * fix: try to fix Dockerfile with adding musl-g++ #2 * fix: try to fix Dockerfile with adding musl-g++ #4 * fix: try to fix Dockerfile with adding musl-g++ #4 * fix: try to fix Dockerfile * fix: try to fix Dockerfile finally? * fix: try to fix Dockerfile * fix: add hard option for sym link creation * fix: make Dockerfile dynamic * Merge remote-tracking branch 'origin/main' into fix/native-dynamic-ci * feat: add script to install native deps * feat: add script to install native deps * fix: add sudo for running the script * fix: add sudo for running the script * fix: add sudo for running the script * fix: fix llvm paths * fix: script * fix: script * fix: script * fix: script * fix: script * fix: script * fix: script * fix: script * fix: script * fix: verify_cairo_file_dependencies ci * fix: cairo native runtime library path * Merge branch 'main' into fix/native-dynamic-ci # Conflicts: # Cargo.lock # Cargo.toml * fix: conflicts after merge * fix: update feature contracts * fix: update gas in secp tests * fix: increase merge-gatekeeper timeout to 25 minutes (1500 seconds)
1 parent 1233182 commit c1f680a

27 files changed

+4571
-1445
lines changed
Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
name: "Setup Cairo Native Dependencies"
2+
description: "Sets up LLVM and GMP libraries"
3+
4+
outputs:
5+
cairo-native-runtime-library:
6+
description: "The path to the cairo native runtime library"
7+
value: ${{ steps.set-env-vars.outputs.cairo-native-runtime-library }}
8+
9+
runs:
10+
using: "composite"
11+
steps:
12+
- name: Make script executable
13+
shell: bash
14+
run: chmod +x ./scripts/setup_native_deps.sh
15+
16+
- name: Install Cairo Native Runtime Dependencies
17+
id: set-runtime-deps
18+
shell: bash
19+
run: |
20+
sudo ./scripts/setup_native_deps.sh
21+
22+
- name: Set Environment Variables
23+
id: set-env-vars
24+
shell: bash
25+
run: |
26+
echo "MLIR_SYS_180_PREFIX=/usr/lib/llvm-18/" >> $GITHUB_ENV &&
27+
echo "LLVM_SYS_181_PREFIX=/usr/lib/llvm-18/" >> $GITHUB_ENV &&
28+
echo "TABLEGEN_180_PREFIX=/usr/lib/llvm-18/" >> $GITHUB_ENV

.github/workflows/blockifier_ci.yml

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -46,19 +46,17 @@ jobs:
4646
- uses: Swatinem/rust-cache@v2
4747
with:
4848
prefix-key: "v0-rust-ubuntu-20.04"
49+
- name: Set up Native Dependencies
50+
uses: ./.github/actions/setup-native-deps
51+
id: native-deps
4952
- run: cargo build -p blockifier
5053
- run: cargo test -p blockifier
5154

5255
native-blockifier-artifacts-push:
53-
runs-on: starkware-ubuntu-20-04-medium
56+
runs-on: starkware-ubuntu-latest-large
5457
steps:
5558
- uses: actions/checkout@v4
56-
- uses: ./.github/actions/install_rust
57-
58-
- uses: Swatinem/rust-cache@v2
59-
with:
60-
prefix-key: "v1-rust-ubuntu-20.04"
61-
59+
6260
- name: Build native blockifier
6361
run: ./build_native_in_docker.sh scripts/build_native_blockifier.sh
6462

.github/workflows/blockifier_compiled_cairo.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,10 @@ jobs:
4040
with:
4141
prefix-key: "v0-rust-ubuntu-20.04"
4242

43+
- name: Set up Native Dependencies
44+
uses: ./.github/actions/setup-native-deps
45+
id: native-deps
46+
4347
# Setup pypy and link to the location expected by .cargo/config.toml.
4448
- uses: actions/setup-python@v5
4549
id: setup-pypy

.github/workflows/blockifier_post-merge.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,10 @@ jobs:
2121
with:
2222
prefix-key: "v0-rust-ubuntu-20.04"
2323

24+
- name: Set up Native Dependencies
25+
uses: ./.github/actions/setup-native-deps
26+
id: native-deps
27+
2428
# Setup pypy and link to the location expected by .cargo/config.toml.
2529
- uses: actions/setup-python@v5
2630
id: setup-pypy

.github/workflows/committer_ci.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ jobs:
7676

7777
# List the existing benchmarks.
7878
- run: |
79-
cargo bench -p committer_cli -- --list | grep ': benchmark$' | sed -e "s/: benchmark$//" > benchmarks_list.txt
79+
cargo bench -p committer_cli -- --list | grep ': benchmark$' | sed -e "s/: benchmark$//" > benchmarks_list.txt
8080
8181
# Benchmark the old code.
8282
- run: cargo bench -p committer_cli
@@ -119,6 +119,7 @@ jobs:
119119
owner: context.repo.owner,
120120
repo: context.repo.repo,
121121
body: fs.readFileSync('bench_new.txt', 'utf8'),
122+
path: 'Commits'
122123
})
123124
124125
gcs-push:

.github/workflows/main.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,11 @@ jobs:
6666
- uses: ./.github/actions/install_rust
6767
with:
6868
components: clippy
69+
70+
- name: Set up Native Dependencies
71+
uses: ./.github/actions/setup-native-deps
72+
id: native-deps
73+
6974
- uses: Swatinem/rust-cache@v2
7075
with:
7176
prefix-key: "v0-rust-ubuntu-20.04"
@@ -89,6 +94,9 @@ jobs:
8994
steps:
9095
- uses: actions/checkout@v4
9196
- uses: ./.github/actions/install_rust
97+
- name: Set up Native Dependencies
98+
uses: ./.github/actions/setup-native-deps
99+
id: native-deps
92100
- uses: Swatinem/rust-cache@v2
93101
- uses: Noelware/setup-protoc@1.1.0
94102
with:
@@ -100,17 +108,23 @@ jobs:
100108
steps:
101109
- uses: actions/checkout@v4
102110
- uses: ./.github/actions/install_rust
111+
- name: Set up Native Dependencies
112+
uses: ./.github/actions/setup-native-deps
113+
id: native-deps
103114
- uses: Swatinem/rust-cache@v2
104115
- run: cargo test -p workspace_tests
105116

106117
run-tests:
107-
runs-on: starkware-ubuntu-20-04-medium
118+
runs-on: starkware-ubuntu-latest-large
108119
steps:
109120
- uses: actions/checkout@v4
110121
with:
111122
# Fetch the entire history.
112123
fetch-depth: 0
113124
- uses: ./.github/actions/install_rust
125+
- name: Set up Native Dependencies
126+
uses: ./.github/actions/setup-native-deps
127+
id: native-deps
114128
- uses: Noelware/setup-protoc@1.1.0
115129
- uses: Swatinem/rust-cache@v2
116130
with:
@@ -175,6 +189,9 @@ jobs:
175189
- uses: Noelware/setup-protoc@1.1.0
176190
with:
177191
version: ${{env.PROTOC_VERSION}}
192+
- name: Set up Native Dependencies
193+
uses: ./.github/actions/setup-native-deps
194+
id: native-deps
178195
- run: cargo check --workspace -r --all-features
179196

180197
merge-gatekeeper:
@@ -190,7 +207,7 @@ jobs:
190207
uses: upsidr/merge-gatekeeper@v1
191208
with:
192209
token: ${{ secrets.GITHUB_TOKEN }}
193-
timeout: 1200
210+
timeout: 1500
194211
interval: 30
195212
ignored: "code-review/reviewable"
196213

@@ -200,7 +217,7 @@ jobs:
200217
with:
201218
token: ${{ secrets.GITHUB_TOKEN }}
202219
ref: ${{github.ref}}
203-
timeout: 1200
220+
timeout: 1500
204221
interval: 30
205222
ignored: "code-review/reviewable"
206223

@@ -216,6 +233,9 @@ jobs:
216233
run: |
217234
sudo apt-get update
218235
sudo apt-get install -y clang llvm libudev-dev
236+
- name: Set up Native Dependencies
237+
uses: ./.github/actions/setup-native-deps
238+
id: native-deps
219239
- uses: Noelware/setup-protoc@1.1.0
220240
with:
221241
version: ${{env.PROTOC_VERSION}}

.github/workflows/papyrus_benchmark.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ on:
44
workflow_dispatch:
55
# TODO: Uncomment and run this automatically when the storage benchmark is fixed.
66
# push:
7-
# branches: [main]
7+
# branches: [main]
88

99
jobs:
1010
storage-benchmark:

.github/workflows/papyrus_ci.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ name: Papyrus-CI
22

33
on:
44
push:
5-
branches: [main]
5+
branches: [ main ]
66
paths:
77
- '.github/workflows/papyrus_ci.yml'
88
- 'Dockerfile'
@@ -31,7 +31,7 @@ on:
3131
- 'crates/starknet_client/**'
3232

3333
merge_group:
34-
types: [checks_requested]
34+
types: [ checks_requested ]
3535

3636
# On PR events, cancel existing CI runs on this same PR for this workflow.
3737
concurrency:
@@ -48,6 +48,9 @@ jobs:
4848
- uses: actions/checkout@v4
4949
- uses: ./.github/actions/install_rust
5050
- uses: Swatinem/rust-cache@v2
51+
- name: Set up Native Dependencies
52+
uses: ./.github/actions/setup-native-deps
53+
id: native-deps
5154
- uses: Noelware/setup-protoc@1.1.0
5255
with:
5356
version: ${{env.PROTOC_VERSION}}
@@ -67,6 +70,9 @@ jobs:
6770
- uses: actions/checkout@v4
6871
- uses: ./.github/actions/install_rust
6972
- uses: Swatinem/rust-cache@v2
73+
- name: Set up Native Dependencies
74+
uses: ./.github/actions/setup-native-deps
75+
id: native-deps
7076
- uses: Noelware/setup-protoc@1.1.0
7177
with:
7278
version: ${{env.PROTOC_VERSION}}
@@ -86,6 +92,9 @@ jobs:
8692
- uses: actions/checkout@v4
8793
- uses: dtolnay/rust-toolchain@stable
8894
- uses: Swatinem/rust-cache@v2
95+
- name: Set up Native Dependencies
96+
uses: ./.github/actions/setup-native-deps
97+
id: native-deps
8998
- uses: Noelware/setup-protoc@1.1.0
9099
with:
91100
version: ${{env.PROTOC_VERSION}}
@@ -107,6 +116,9 @@ jobs:
107116
- uses: Noelware/setup-protoc@1.1.0
108117
with:
109118
version: ${{env.PROTOC_VERSION}}
119+
- name: Set up Native Dependencies
120+
uses: ./.github/actions/setup-native-deps
121+
id: native-deps
110122
- run: >
111123
cargo test -r
112124
--test latency_histogram
@@ -122,6 +134,9 @@ jobs:
122134
- uses: ./.github/actions/install_rust
123135
- uses: Swatinem/rust-cache@v2
124136
- uses: Noelware/setup-protoc@1.1.0
137+
- name: Set up Native Dependencies
138+
uses: ./.github/actions/setup-native-deps
139+
id: native-deps
125140

126141
- run: |
127142
cargo test -p papyrus_node --no-default-features
@@ -140,7 +155,9 @@ jobs:
140155
- uses: Noelware/setup-protoc@1.1.0
141156
with:
142157
version: ${{env.PROTOC_VERSION}}
143-
158+
- name: Set up Native Dependencies
159+
uses: ./.github/actions/setup-native-deps
160+
id: native-deps
144161
- name: Install cargo-llvm-cov
145162
uses: taiki-e/install-action@cargo-llvm-cov
146163
- uses: Swatinem/rust-cache@v2
@@ -197,6 +214,9 @@ jobs:
197214
target_directory:
198215
- 'crates/papyrus_storage/src/db/**'
199216
- uses: ./.github/actions/install_rust
217+
- name: Set up Native Dependencies
218+
uses: ./.github/actions/setup-native-deps
219+
id: native-deps
200220
- uses: Swatinem/rust-cache@v2
201221
# repeat this job 32 times. this is a random test for part of the code that may cause a corrupted database.
202222
- run: for run in {1..32}; do cargo test -r -p papyrus_storage -- --include-ignored common_prefix_compare_with_simple_table_random; done

.github/workflows/papyrus_docker-publish.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ name: Papyrus-Docker-Publish
33
on:
44
workflow_dispatch:
55
push:
6-
branches: [main]
7-
tags: ["v*.*.*"]
6+
branches: [ main ]
7+
tags: [ "v*.*.*" ]
88
paths:
99
- '.github/workflows/papyrus_docker-publish.yml'
1010
- 'crates/papyrus**/**'
@@ -25,7 +25,7 @@ env:
2525

2626
jobs:
2727
docker-build-push:
28-
runs-on: starkware-ubuntu-latest-medium
28+
runs-on: starkware-ubuntu-latest-large
2929

3030
steps:
3131
- name: Checkout repository

.github/workflows/papyrus_nightly-tests-call.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ jobs:
2222
steps:
2323
- uses: actions/checkout@v4
2424
- uses: ./.github/actions/install_rust
25+
- name: Set up Native Dependencies
26+
uses: ./.github/actions/setup-native-deps
27+
id: native-deps
2528
- uses: Swatinem/rust-cache@v2
2629
- run: sudo apt update; sudo apt -y install libclang-dev
2730
# Install libclang-dev that is not a part of the ubuntu vm in github actions.

.github/workflows/papyrus_nightly-tests.yml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,10 @@ jobs:
4444

4545
- run: brew install protobuf@$PROTOC_VERSION
4646

47+
- name: Set up Native Dependencies
48+
uses: ./.github/actions/setup-native-deps
49+
id: native-deps
50+
4751
- name: Build node
4852
run: cargo build -r -p papyrus_node
4953

@@ -58,6 +62,9 @@ jobs:
5862
steps:
5963
- uses: actions/checkout@v4
6064
- uses: ./.github/actions/install_rust
65+
- name: Set up Native Dependencies
66+
uses: ./.github/actions/setup-native-deps
67+
id: native-deps
6168
- uses: Swatinem/rust-cache@v2
6269
- run: npm install -g ganache@7.4.3
6370

@@ -75,6 +82,9 @@ jobs:
7582
- uses: actions/checkout@v4
7683
- uses: ./.github/actions/install_rust
7784
- uses: Swatinem/rust-cache@v2
85+
- name: Set up Native Dependencies
86+
uses: ./.github/actions/setup-native-deps
87+
id: native-deps
7888
- run: cargo build -r -p papyrus_load_test
7989

8090
integration-test:
@@ -84,6 +94,9 @@ jobs:
8494
- uses: actions/checkout@v4
8595
- uses: ./.github/actions/install_rust
8696
- uses: Swatinem/rust-cache@v2
97+
- name: Set up Native Dependencies
98+
uses: ./.github/actions/setup-native-deps
99+
id: native-deps
87100
- run: >
88101
cargo test -r
89102
--test latency_histogram
@@ -100,4 +113,7 @@ jobs:
100113
- uses: actions/checkout@v4
101114
- uses: ./.github/actions/install_rust
102115
- uses: Swatinem/rust-cache@v2
116+
- name: Set up Native Dependencies
117+
uses: ./.github/actions/setup-native-deps
118+
id: native-deps
103119
- run: for run in {1..100}; do cargo test -r -p papyrus_storage -- --include-ignored common_prefix_compare_with_simple_table_random; done

.github/workflows/verify-deps.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,9 @@ jobs:
1212
steps:
1313
- uses: actions/checkout@v4
1414
- uses: ./.github/actions/install_rust
15+
- name: Set up Native Dependencies
16+
uses: ./.github/actions/setup-native-deps
17+
id: native-deps
1518
- name: Update Dependencies
1619
run: cargo update --verbose
1720
- name: Build

0 commit comments

Comments
 (0)