Skip to content

Commit 2ea1ca5

Browse files
committed
chore(ci): use aws ec2 as runner provider for cargo builds
1 parent 164fc26 commit 2ea1ca5

File tree

3 files changed

+289
-140
lines changed

3 files changed

+289
-140
lines changed

.github/workflows/cargo_build.yml

Lines changed: 76 additions & 133 deletions
Original file line numberDiff line numberDiff line change
@@ -39,157 +39,100 @@ jobs:
3939
parallel-pcc-cpu:
4040
name: cargo_build/parallel-pcc-cpu
4141
needs: prepare-parallel-pcc-matrix
42-
runs-on: large_ubuntu_16
4342
strategy:
4443
matrix:
45-
command: ${{fromJson(needs.prepare-parallel-pcc-matrix.outputs.matrix_command)}}
44+
command: ${{ fromJson(needs.prepare-parallel-pcc-matrix.outputs.matrix_command)}}
4645
fail-fast: false
47-
steps:
48-
- name: Checkout tfhe-rs repo
49-
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
50-
with:
51-
persist-credentials: 'false'
52-
token: ${{ env.CHECKOUT_TOKEN }}
53-
54-
- name: Install latest stable
55-
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # zizmor: ignore[stale-action-refs] this action doesn't create releases
56-
with:
57-
toolchain: stable
58-
59-
- name: Run pcc checks batch
60-
run: |
61-
make "${COMMAND}"
62-
env:
63-
COMMAND: ${{ matrix.command }}
46+
uses: ./.github/workflows/cargo_build_common.yml
47+
with:
48+
run-pcc-cpu-batch: ${{ matrix.command }}
49+
secrets:
50+
BOT_USERNAME: ${{ secrets.BOT_USERNAME }}
51+
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
52+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
53+
REPO_CHECKOUT_TOKEN: ${{ secrets.REPO_CHECKOUT_TOKEN }}
54+
JOB_SECRET: ${{ secrets.JOB_SECRET }}
55+
SLAB_ACTION_TOKEN: ${{ secrets.SLAB_ACTION_TOKEN }}
56+
SLAB_URL: ${{ secrets.SLAB_URL }}
57+
SLAB_BASE_URL: ${{ secrets.SLAB_BASE_URL }}
6458

6559
pcc-hpu:
6660
name: cargo_build/pcc-hpu
67-
runs-on: large_ubuntu_16
68-
steps:
69-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
70-
with:
71-
persist-credentials: 'false'
72-
token: ${{ env.CHECKOUT_TOKEN }}
73-
74-
- name: Install latest stable
75-
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # zizmor: ignore[stale-action-refs] this action doesn't create releases
76-
with:
77-
toolchain: stable
78-
79-
- name: Run Hpu pcc checks
80-
run: |
81-
make pcc_hpu
61+
uses: ./.github/workflows/cargo_build_common.yml
62+
with:
63+
run-pcc-hpu: true
64+
secrets:
65+
BOT_USERNAME: ${{ secrets.BOT_USERNAME }}
66+
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
67+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
68+
REPO_CHECKOUT_TOKEN: ${{ secrets.REPO_CHECKOUT_TOKEN }}
69+
JOB_SECRET: ${{ secrets.JOB_SECRET }}
70+
SLAB_ACTION_TOKEN: ${{ secrets.SLAB_ACTION_TOKEN }}
71+
SLAB_URL: ${{ secrets.SLAB_URL }}
72+
SLAB_BASE_URL: ${{ secrets.SLAB_BASE_URL }}
8273

8374
build-tfhe-full:
8475
name: cargo_build/build-tfhe-full
85-
runs-on: ${{ matrix.os }}
86-
strategy:
87-
matrix:
88-
# GitHub macos-latest are now M1 macs, so use ours, we limit what runs so it will be fast
89-
# even with a few PRs
90-
os: [large_ubuntu_16, macos-latest-xlarge, large_windows_16_latest]
91-
fail-fast: false
92-
steps:
93-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
94-
with:
95-
persist-credentials: 'false'
96-
token: ${{ env.CHECKOUT_TOKEN }}
97-
98-
- name: Install latest stable
99-
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # zizmor: ignore[stale-action-refs] this action doesn't create releases
100-
with:
101-
toolchain: stable
102-
103-
- name: Build Release tfhe full
104-
run: |
105-
make build_tfhe_full
76+
uses: ./.github/workflows/cargo_build_common.yml
77+
with:
78+
run-build-tfhe-full: true
79+
# GitHub macos-latest are now M1 macs, so use ours, we limit what runs so it will be fast
80+
# even with a few PRs
81+
runners-to-use: macos-latest-xlarge,large_windows_16_latest
82+
secrets:
83+
BOT_USERNAME: ${{ secrets.BOT_USERNAME }}
84+
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
85+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
86+
REPO_CHECKOUT_TOKEN: ${{ secrets.REPO_CHECKOUT_TOKEN }}
87+
JOB_SECRET: ${{ secrets.JOB_SECRET }}
88+
SLAB_ACTION_TOKEN: ${{ secrets.SLAB_ACTION_TOKEN }}
89+
SLAB_URL: ${{ secrets.SLAB_URL }}
90+
SLAB_BASE_URL: ${{ secrets.SLAB_BASE_URL }}
10691

10792
build:
10893
name: cargo_build/build
109-
runs-on: large_ubuntu_16
110-
steps:
111-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
112-
with:
113-
persist-credentials: 'false'
114-
token: ${{ env.CHECKOUT_TOKEN }}
115-
116-
- name: Install latest stable
117-
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # zizmor: ignore[stale-action-refs] this action doesn't create releases
118-
with:
119-
toolchain: stable
120-
121-
- name: Install and run newline linter checks
122-
run: |
123-
wget https://github.com/fernandrone/linelint/releases/download/0.0.6/linelint-linux-amd64
124-
echo "16b70fb7b471d6f95cbdc0b4e5dc2b0ac9e84ba9ecdc488f7bdf13df823aca4b linelint-linux-amd64" > checksum
125-
sha256sum -c checksum || exit 1
126-
chmod +x linelint-linux-amd64
127-
mv linelint-linux-amd64 /usr/local/bin/linelint
128-
make check_newline
129-
130-
- name: Build tfhe-csprng
131-
run: |
132-
make build_tfhe_csprng
133-
134-
- name: Build with MSRV
135-
run: |
136-
make build_tfhe_msrv
137-
138-
- name: Build coverage tests
139-
run: |
140-
make build_tfhe_coverage
94+
uses: ./.github/workflows/cargo_build_common.yml
95+
with:
96+
run-build: true
97+
secrets:
98+
BOT_USERNAME: ${{ secrets.BOT_USERNAME }}
99+
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
100+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
101+
REPO_CHECKOUT_TOKEN: ${{ secrets.REPO_CHECKOUT_TOKEN }}
102+
JOB_SECRET: ${{ secrets.JOB_SECRET }}
103+
SLAB_ACTION_TOKEN: ${{ secrets.SLAB_ACTION_TOKEN }}
104+
SLAB_URL: ${{ secrets.SLAB_URL }}
105+
SLAB_BASE_URL: ${{ secrets.SLAB_BASE_URL }}
141106

142107
build-layers:
143108
name: cargo_build/build-layers
144-
runs-on: large_ubuntu_16
145-
steps:
146-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
147-
with:
148-
persist-credentials: 'false'
149-
token: ${{ env.CHECKOUT_TOKEN }}
150-
151-
- name: Install latest stable
152-
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # zizmor: ignore[stale-action-refs] this action doesn't create releases
153-
with:
154-
toolchain: stable
155-
156-
- name: Build Release core
157-
run: |
158-
make build_core AVX512_SUPPORT=ON
159-
make build_core_experimental AVX512_SUPPORT=ON
160-
161-
- name: Build Release boolean
162-
run: |
163-
make build_boolean
164-
165-
- name: Build Release shortint
166-
run: |
167-
make build_shortint
168-
169-
- name: Build Release integer
170-
run: |
171-
make build_integer
109+
uses: ./.github/workflows/cargo_build_common.yml
110+
with:
111+
run-build-layers: true
112+
secrets:
113+
BOT_USERNAME: ${{ secrets.BOT_USERNAME }}
114+
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
115+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
116+
REPO_CHECKOUT_TOKEN: ${{ secrets.REPO_CHECKOUT_TOKEN }}
117+
JOB_SECRET: ${{ secrets.JOB_SECRET }}
118+
SLAB_ACTION_TOKEN: ${{ secrets.SLAB_ACTION_TOKEN }}
119+
SLAB_URL: ${{ secrets.SLAB_URL }}
120+
SLAB_BASE_URL: ${{ secrets.SLAB_BASE_URL }}
172121

173122
build-c-api:
174123
name: cargo_build/build-c-api
175-
runs-on: large_ubuntu_16
176-
steps:
177-
- uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8
178-
with:
179-
persist-credentials: 'false'
180-
token: ${{ env.CHECKOUT_TOKEN }}
181-
182-
- name: Install latest stable
183-
uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # zizmor: ignore[stale-action-refs] this action doesn't create releases
184-
with:
185-
toolchain: stable
186-
187-
- name: Build Release c_api
188-
run: |
189-
make build_c_api
190-
191-
# The wasm build check is a bit annoying to set-up here and is done during the tests in
192-
# aws_tfhe_tests.yml
124+
uses: ./.github/workflows/cargo_build_common.yml
125+
with:
126+
run-build-c-api: true
127+
secrets:
128+
BOT_USERNAME: ${{ secrets.BOT_USERNAME }}
129+
SLACK_CHANNEL: ${{ secrets.SLACK_CHANNEL }}
130+
SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }}
131+
REPO_CHECKOUT_TOKEN: ${{ secrets.REPO_CHECKOUT_TOKEN }}
132+
JOB_SECRET: ${{ secrets.JOB_SECRET }}
133+
SLAB_ACTION_TOKEN: ${{ secrets.SLAB_ACTION_TOKEN }}
134+
SLAB_URL: ${{ secrets.SLAB_URL }}
135+
SLAB_BASE_URL: ${{ secrets.SLAB_BASE_URL }}
193136

194137
cargo-builds:
195138
name: cargo_build/cargo-builds (bpr)

0 commit comments

Comments
 (0)