@@ -164,77 +164,11 @@ jobs:
164
164
165
165
check-codestyle-rust :
166
166
needs : [ check-permissions, build-build-tools-image ]
167
- strategy :
168
- matrix :
169
- arch : [ x64, arm64 ]
170
- runs-on : ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'small-arm64' || 'small')) }}
171
-
172
- container :
173
- image : ${{ needs.build-build-tools-image.outputs.image }}-bookworm
174
- credentials :
175
- username : ${{ secrets.NEON_DOCKERHUB_USERNAME }}
176
- password : ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
177
- options : --init
178
-
179
- steps :
180
- - name : Checkout
181
- uses : actions/checkout@v4
182
- with :
183
- submodules : true
184
-
185
- - name : Cache cargo deps
186
- uses : actions/cache@v4
187
- with :
188
- path : |
189
- ~/.cargo/registry
190
- !~/.cargo/registry/src
191
- ~/.cargo/git
192
- target
193
- key : v1-${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('./Cargo.lock') }}-${{ hashFiles('./rust-toolchain.toml') }}-rust
194
-
195
- # Some of our rust modules use FFI and need those to be checked
196
- - name : Get postgres headers
197
- run : make postgres-headers -j$(nproc)
198
-
199
- # cargo hack runs the given cargo subcommand (clippy in this case) for all feature combinations.
200
- # This will catch compiler & clippy warnings in all feature combinations.
201
- # TODO: use cargo hack for build and test as well, but, that's quite expensive.
202
- # NB: keep clippy args in sync with ./run_clippy.sh
203
- #
204
- # The only difference between "clippy --debug" and "clippy --release" is that in --release mode,
205
- # #[cfg(debug_assertions)] blocks are not built. It's not worth building everything for second
206
- # time just for that, so skip "clippy --release".
207
- - run : |
208
- CLIPPY_COMMON_ARGS="$( source .neon_clippy_args; echo "$CLIPPY_COMMON_ARGS")"
209
- if [ "$CLIPPY_COMMON_ARGS" = "" ]; then
210
- echo "No clippy args found in .neon_clippy_args"
211
- exit 1
212
- fi
213
- echo "CLIPPY_COMMON_ARGS=${CLIPPY_COMMON_ARGS}" >> $GITHUB_ENV
214
- - name : Run cargo clippy (debug)
215
- run : cargo hack --features default --ignore-unknown-features --feature-powerset clippy $CLIPPY_COMMON_ARGS
216
-
217
- - name : Check documentation generation
218
- run : cargo doc --workspace --no-deps --document-private-items
219
- env :
220
- RUSTDOCFLAGS : " -Dwarnings -Arustdoc::private_intra_doc_links"
221
-
222
- # Use `${{ !cancelled() }}` to run quck tests after the longer clippy run
223
- - name : Check formatting
224
- if : ${{ !cancelled() }}
225
- run : cargo fmt --all -- --check
226
-
227
- # https://github.com/facebookincubator/cargo-guppy/tree/bec4e0eb29dcd1faac70b1b5360267fc02bf830e/tools/cargo-hakari#2-keep-the-workspace-hack-up-to-date-in-ci
228
- - name : Check rust dependencies
229
- if : ${{ !cancelled() }}
230
- run : |
231
- cargo hakari generate --diff # workspace-hack Cargo.toml is up-to-date
232
- cargo hakari manage-deps --dry-run # all workspace crates depend on workspace-hack
233
-
234
- # https://github.com/EmbarkStudios/cargo-deny
235
- - name : Check rust licenses/bans/advisories/sources
236
- if : ${{ !cancelled() }}
237
- run : cargo deny check --hide-inclusion-graph
167
+ uses : ./.github/workflows/_check-codestyle-rust.yml
168
+ with :
169
+ build-tools-image : ${{ needs.build-build-tools-image.outputs.image }}-bookworm
170
+ archs : ' ["x64", "arm64"]'
171
+ secrets : inherit
238
172
239
173
build-and-test-locally :
240
174
needs : [ tag, build-build-tools-image ]
@@ -346,25 +280,22 @@ jobs:
346
280
# XXX: no coverage data handling here, since benchmarks are run on release builds,
347
281
# while coverage is currently collected for the debug ones
348
282
349
- report-benchmarks-failures :
283
+ report-benchmarks-results-to-slack :
350
284
needs : [ benchmarks, create-test-report ]
351
- if : github.ref_name == 'main' && failure() && needs.benchmarks.result == 'failure'
352
- permissions :
353
- id-token : write # aws-actions/configure-aws-credentials
354
- statuses : write
355
- contents : write
356
- pull-requests : write
285
+ if : github.ref_name == 'main' && !cancelled() && contains(fromJSON('["success", "failure"]'), needs.benchmarks.result)
357
286
runs-on : ubuntu-22.04
358
287
359
288
steps :
360
- - uses : slackapi/slack-github-action@v1
289
+ - uses : slackapi/slack-github-action@v2
361
290
with :
362
- channel-id : C060CNA47S9 # on-call-staging-storage-stream
363
- slack-message : |
364
- Benchmarks failed on main <${{ github.event.head_commit.url }}|${{ github.sha }}>
365
- <${{ needs.create-test-report.outputs.report-url }}|Allure report>
366
- env :
367
- SLACK_BOT_TOKEN : ${{ secrets.SLACK_BOT_TOKEN }}
291
+ method : chat.postMessage
292
+ token : ${{ secrets.SLACK_BOT_TOKEN }}
293
+ payload : |
294
+ channel: "${{ vars.SLACK_ON_CALL_STORAGE_STAGING_STREAM }}"
295
+ text: |
296
+ Benchmarks on main: *${{ needs.benchmarks.result }}*
297
+ - <${{ needs.create-test-report.outputs.report-url }}|Allure report>
298
+ - <${{ github.event.head_commit.url }}|${{ github.sha }}>
368
299
369
300
create-test-report :
370
301
needs : [ check-permissions, build-and-test-locally, coverage-report, build-build-tools-image, benchmarks ]
@@ -728,30 +659,6 @@ jobs:
728
659
tags : |
729
660
neondatabase/neon-test-extensions-${{ matrix.version.pg }}:${{needs.tag.outputs.build-tag}}-${{ matrix.version.debian }}-${{ matrix.arch }}
730
661
731
- - name : Build compute-tools image
732
- # compute-tools are Postgres independent, so build it only once
733
- # We pick 16, because that builds on debian 11 with older glibc (and is
734
- # thus compatible with newer glibc), rather than 17 on Debian 12, as
735
- # that isn't guaranteed to be compatible with Debian 11
736
- if : matrix.version.pg == 'v16'
737
- uses : docker/build-push-action@v6
738
- with :
739
- target : compute-tools-image
740
- context : .
741
- build-args : |
742
- GIT_VERSION=${{ github.event.pull_request.head.sha || github.sha }}
743
- BUILD_TAG=${{ needs.tag.outputs.build-tag }}
744
- TAG=${{ needs.build-build-tools-image.outputs.image-tag }}-${{ matrix.version.debian }}
745
- DEBIAN_VERSION=${{ matrix.version.debian }}
746
- provenance : false
747
- push : true
748
- pull : true
749
- file : compute/compute-node.Dockerfile
750
- cache-from : type=registry,ref=cache.neon.build/compute-node-${{ matrix.version.pg }}:cache-${{ matrix.version.debian }}-${{ matrix.arch }}
751
- cache-to : ${{ github.ref_name == 'main' && format('type=registry,ref=cache.neon.build/compute-tools-{0}:cache-{1}-{2},mode=max', matrix.version.pg, matrix.version.debian, matrix.arch) || '' }}
752
- tags : |
753
- neondatabase/compute-tools:${{ needs.tag.outputs.build-tag }}-${{ matrix.version.debian }}-${{ matrix.arch }}
754
-
755
662
compute-node-image :
756
663
needs : [ compute-node-image-arch, tag ]
757
664
permissions :
@@ -794,14 +701,6 @@ jobs:
794
701
neondatabase/neon-test-extensions-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }}-${{ matrix.version.debian }}-x64 \
795
702
neondatabase/neon-test-extensions-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }}-${{ matrix.version.debian }}-arm64
796
703
797
- - name : Create multi-arch compute-tools image
798
- if : matrix.version.pg == 'v16'
799
- run : |
800
- docker buildx imagetools create -t neondatabase/compute-tools:${{ needs.tag.outputs.build-tag }} \
801
- -t neondatabase/compute-tools:${{ needs.tag.outputs.build-tag }}-${{ matrix.version.debian }} \
802
- neondatabase/compute-tools:${{ needs.tag.outputs.build-tag }}-${{ matrix.version.debian }}-x64 \
803
- neondatabase/compute-tools:${{ needs.tag.outputs.build-tag }}-${{ matrix.version.debian }}-arm64
804
-
805
704
- name : Configure AWS credentials
806
705
uses : aws-actions/configure-aws-credentials@v4
807
706
with :
@@ -817,12 +716,6 @@ jobs:
817
716
docker buildx imagetools create -t 369495373322.dkr.ecr.eu-central-1.amazonaws.com/compute-node-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }} \
818
717
neondatabase/compute-node-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }}
819
718
820
- - name : Push multi-arch compute-tools image to ECR
821
- if : matrix.version.pg == 'v16'
822
- run : |
823
- docker buildx imagetools create -t 369495373322.dkr.ecr.eu-central-1.amazonaws.com/compute-tools:${{ needs.tag.outputs.build-tag }} \
824
- neondatabase/compute-tools:${{ needs.tag.outputs.build-tag }}
825
-
826
719
vm-compute-node-image :
827
720
needs : [ check-permissions, tag, compute-node-image ]
828
721
runs-on : [ self-hosted, large ]
@@ -1001,9 +894,6 @@ jobs:
1001
894
docker buildx imagetools create -t $repo/neon:latest \
1002
895
$repo/neon:${{ needs.tag.outputs.build-tag }}
1003
896
1004
- docker buildx imagetools create -t $repo/compute-tools:latest \
1005
- $repo/compute-tools:${{ needs.tag.outputs.build-tag }}
1006
-
1007
897
for version in ${VERSIONS}; do
1008
898
docker buildx imagetools create -t $repo/compute-node-${version}:latest \
1009
899
$repo/compute-node-${version}:${{ needs.tag.outputs.build-tag }}
@@ -1032,7 +922,7 @@ jobs:
1032
922
- name : Copy all images to prod ECR
1033
923
if : github.ref_name == 'release' || github.ref_name == 'release-proxy' || github.ref_name == 'release-compute'
1034
924
run : |
1035
- for image in neon compute-tools {vm-,}compute-node-{v14,v15,v16,v17}; do
925
+ for image in neon {vm-,}compute-node-{v14,v15,v16,v17}; do
1036
926
docker buildx imagetools create -t 093970136003.dkr.ecr.eu-central-1.amazonaws.com/${image}:${{ needs.tag.outputs.build-tag }} \
1037
927
369495373322.dkr.ecr.eu-central-1.amazonaws.com/${image}:${{ needs.tag.outputs.build-tag }}
1038
928
done
@@ -1044,7 +934,7 @@ jobs:
1044
934
with :
1045
935
client_id : ${{ vars.AZURE_DEV_CLIENT_ID }}
1046
936
image_tag : ${{ needs.tag.outputs.build-tag }}
1047
- images : neon compute-tools vm-compute-node-v14 vm-compute-node-v15 vm-compute-node-v16 vm-compute-node-v17 compute-node-v14 compute-node-v15 compute-node-v16 compute-node-v17
937
+ images : neon vm-compute-node-v14 vm-compute-node-v15 vm-compute-node-v16 vm-compute-node-v17 compute-node-v14 compute-node-v15 compute-node-v16 compute-node-v17
1048
938
registry_name : ${{ vars.AZURE_DEV_REGISTRY_NAME }}
1049
939
subscription_id : ${{ vars.AZURE_DEV_SUBSCRIPTION_ID }}
1050
940
tenant_id : ${{ vars.AZURE_TENANT_ID }}
@@ -1056,7 +946,7 @@ jobs:
1056
946
with :
1057
947
client_id : ${{ vars.AZURE_PROD_CLIENT_ID }}
1058
948
image_tag : ${{ needs.tag.outputs.build-tag }}
1059
- images : neon compute-tools vm-compute-node-v14 vm-compute-node-v15 vm-compute-node-v16 vm-compute-node-v17 compute-node-v14 compute-node-v15 compute-node-v16 compute-node-v17
949
+ images : neon vm-compute-node-v14 vm-compute-node-v15 vm-compute-node-v16 vm-compute-node-v17 compute-node-v14 compute-node-v15 compute-node-v16 compute-node-v17
1060
950
registry_name : ${{ vars.AZURE_PROD_REGISTRY_NAME }}
1061
951
subscription_id : ${{ vars.AZURE_PROD_SUBSCRIPTION_ID }}
1062
952
tenant_id : ${{ vars.AZURE_TENANT_ID }}
0 commit comments