Skip to content

Commit 3399eea

Browse files
authored
Merge pull request #10436 from neondatabase/rc/release/2025-01-17
Storage release 2025-01-17
2 parents 4c093c6 + 6a29c80 commit 3399eea

File tree

170 files changed

+10403
-4192
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

170 files changed

+10403
-4192
lines changed

Diff for: .github/actionlint.yml

+1
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,4 @@ config-variables:
2525
- PGREGRESS_PG17_PROJECT_ID
2626
- SLACK_ON_CALL_QA_STAGING_STREAM
2727
- DEV_AWS_OIDC_ROLE_MANAGE_BENCHMARK_EC2_VMS_ARN
28+
- SLACK_ON_CALL_STORAGE_STAGING_STREAM

Diff for: .github/workflows/_check-codestyle-rust.yml

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
name: Check Codestyle Rust
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
build-tools-image:
7+
description: "build-tools image"
8+
required: true
9+
type: string
10+
archs:
11+
description: "Json array of architectures to run on"
12+
type: string
13+
14+
15+
defaults:
16+
run:
17+
shell: bash -euxo pipefail {0}
18+
19+
jobs:
20+
check-codestyle-rust:
21+
strategy:
22+
matrix:
23+
arch: ${{ fromJson(inputs.archs) }}
24+
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'small-arm64' || 'small')) }}
25+
26+
container:
27+
image: ${{ inputs.build-tools-image }}
28+
credentials:
29+
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
30+
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
31+
options: --init
32+
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@v4
36+
with:
37+
submodules: true
38+
39+
- name: Cache cargo deps
40+
uses: actions/cache@v4
41+
with:
42+
path: |
43+
~/.cargo/registry
44+
!~/.cargo/registry/src
45+
~/.cargo/git
46+
target
47+
key: v1-${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('./Cargo.lock') }}-${{ hashFiles('./rust-toolchain.toml') }}-rust
48+
49+
# Some of our rust modules use FFI and need those to be checked
50+
- name: Get postgres headers
51+
run: make postgres-headers -j$(nproc)
52+
53+
# cargo hack runs the given cargo subcommand (clippy in this case) for all feature combinations.
54+
# This will catch compiler & clippy warnings in all feature combinations.
55+
# TODO: use cargo hack for build and test as well, but, that's quite expensive.
56+
# NB: keep clippy args in sync with ./run_clippy.sh
57+
#
58+
# The only difference between "clippy --debug" and "clippy --release" is that in --release mode,
59+
# #[cfg(debug_assertions)] blocks are not built. It's not worth building everything for second
60+
# time just for that, so skip "clippy --release".
61+
- run: |
62+
CLIPPY_COMMON_ARGS="$( source .neon_clippy_args; echo "$CLIPPY_COMMON_ARGS")"
63+
if [ "$CLIPPY_COMMON_ARGS" = "" ]; then
64+
echo "No clippy args found in .neon_clippy_args"
65+
exit 1
66+
fi
67+
echo "CLIPPY_COMMON_ARGS=${CLIPPY_COMMON_ARGS}" >> $GITHUB_ENV
68+
- name: Run cargo clippy (debug)
69+
run: cargo hack --features default --ignore-unknown-features --feature-powerset clippy $CLIPPY_COMMON_ARGS
70+
71+
- name: Check documentation generation
72+
run: cargo doc --workspace --no-deps --document-private-items
73+
env:
74+
RUSTDOCFLAGS: "-Dwarnings -Arustdoc::private_intra_doc_links"
75+
76+
# Use `${{ !cancelled() }}` to run quck tests after the longer clippy run
77+
- name: Check formatting
78+
if: ${{ !cancelled() }}
79+
run: cargo fmt --all -- --check
80+
81+
# https://github.com/facebookincubator/cargo-guppy/tree/bec4e0eb29dcd1faac70b1b5360267fc02bf830e/tools/cargo-hakari#2-keep-the-workspace-hack-up-to-date-in-ci
82+
- name: Check rust dependencies
83+
if: ${{ !cancelled() }}
84+
run: |
85+
cargo hakari generate --diff # workspace-hack Cargo.toml is up-to-date
86+
cargo hakari manage-deps --dry-run # all workspace crates depend on workspace-hack
87+
88+
# https://github.com/EmbarkStudios/cargo-deny
89+
- name: Check rust licenses/bans/advisories/sources
90+
if: ${{ !cancelled() }}
91+
run: cargo deny check --hide-inclusion-graph

Diff for: .github/workflows/build_and_test.yml

+19-129
Original file line numberDiff line numberDiff line change
@@ -164,77 +164,11 @@ jobs:
164164

165165
check-codestyle-rust:
166166
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
238172

239173
build-and-test-locally:
240174
needs: [ tag, build-build-tools-image ]
@@ -346,25 +280,22 @@ jobs:
346280
# XXX: no coverage data handling here, since benchmarks are run on release builds,
347281
# while coverage is currently collected for the debug ones
348282

349-
report-benchmarks-failures:
283+
report-benchmarks-results-to-slack:
350284
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)
357286
runs-on: ubuntu-22.04
358287

359288
steps:
360-
- uses: slackapi/slack-github-action@v1
289+
- uses: slackapi/slack-github-action@v2
361290
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 }}>
368299
369300
create-test-report:
370301
needs: [ check-permissions, build-and-test-locally, coverage-report, build-build-tools-image, benchmarks ]
@@ -728,30 +659,6 @@ jobs:
728659
tags: |
729660
neondatabase/neon-test-extensions-${{ matrix.version.pg }}:${{needs.tag.outputs.build-tag}}-${{ matrix.version.debian }}-${{ matrix.arch }}
730661
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-
755662
compute-node-image:
756663
needs: [ compute-node-image-arch, tag ]
757664
permissions:
@@ -794,14 +701,6 @@ jobs:
794701
neondatabase/neon-test-extensions-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }}-${{ matrix.version.debian }}-x64 \
795702
neondatabase/neon-test-extensions-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }}-${{ matrix.version.debian }}-arm64
796703
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-
805704
- name: Configure AWS credentials
806705
uses: aws-actions/configure-aws-credentials@v4
807706
with:
@@ -817,12 +716,6 @@ jobs:
817716
docker buildx imagetools create -t 369495373322.dkr.ecr.eu-central-1.amazonaws.com/compute-node-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }} \
818717
neondatabase/compute-node-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }}
819718
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-
826719
vm-compute-node-image:
827720
needs: [ check-permissions, tag, compute-node-image ]
828721
runs-on: [ self-hosted, large ]
@@ -1001,9 +894,6 @@ jobs:
1001894
docker buildx imagetools create -t $repo/neon:latest \
1002895
$repo/neon:${{ needs.tag.outputs.build-tag }}
1003896
1004-
docker buildx imagetools create -t $repo/compute-tools:latest \
1005-
$repo/compute-tools:${{ needs.tag.outputs.build-tag }}
1006-
1007897
for version in ${VERSIONS}; do
1008898
docker buildx imagetools create -t $repo/compute-node-${version}:latest \
1009899
$repo/compute-node-${version}:${{ needs.tag.outputs.build-tag }}
@@ -1032,7 +922,7 @@ jobs:
1032922
- name: Copy all images to prod ECR
1033923
if: github.ref_name == 'release' || github.ref_name == 'release-proxy' || github.ref_name == 'release-compute'
1034924
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
1036926
docker buildx imagetools create -t 093970136003.dkr.ecr.eu-central-1.amazonaws.com/${image}:${{ needs.tag.outputs.build-tag }} \
1037927
369495373322.dkr.ecr.eu-central-1.amazonaws.com/${image}:${{ needs.tag.outputs.build-tag }}
1038928
done
@@ -1044,7 +934,7 @@ jobs:
1044934
with:
1045935
client_id: ${{ vars.AZURE_DEV_CLIENT_ID }}
1046936
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
1048938
registry_name: ${{ vars.AZURE_DEV_REGISTRY_NAME }}
1049939
subscription_id: ${{ vars.AZURE_DEV_SUBSCRIPTION_ID }}
1050940
tenant_id: ${{ vars.AZURE_TENANT_ID }}
@@ -1056,7 +946,7 @@ jobs:
1056946
with:
1057947
client_id: ${{ vars.AZURE_PROD_CLIENT_ID }}
1058948
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
1060950
registry_name: ${{ vars.AZURE_PROD_REGISTRY_NAME }}
1061951
subscription_id: ${{ vars.AZURE_PROD_SUBSCRIPTION_ID }}
1062952
tenant_id: ${{ vars.AZURE_TENANT_ID }}

Diff for: .github/workflows/pre-merge-checks.yml

+33
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
name: Pre-merge checks
22

33
on:
4+
pull_request:
5+
paths:
6+
- .github/workflows/_check-codestyle-python.yml
7+
- .github/workflows/_check-codestyle-rust.yml
8+
- .github/workflows/build-build-tools-image.yml
9+
- .github/workflows/pre-merge-checks.yml
410
merge_group:
511
branches:
612
- main
@@ -17,8 +23,10 @@ jobs:
1723
runs-on: ubuntu-22.04
1824
outputs:
1925
python-changed: ${{ steps.python-src.outputs.any_changed }}
26+
rust-changed: ${{ steps.rust-src.outputs.any_changed }}
2027
steps:
2128
- uses: actions/checkout@v4
29+
2230
- uses: tj-actions/changed-files@4edd678ac3f81e2dc578756871e4d00c19191daf # v45.0.4
2331
id: python-src
2432
with:
@@ -30,11 +38,25 @@ jobs:
3038
poetry.lock
3139
pyproject.toml
3240
41+
- uses: tj-actions/changed-files@4edd678ac3f81e2dc578756871e4d00c19191daf # v45.0.4
42+
id: rust-src
43+
with:
44+
files: |
45+
.github/workflows/_check-codestyle-rust.yml
46+
.github/workflows/build-build-tools-image.yml
47+
.github/workflows/pre-merge-checks.yml
48+
**/**.rs
49+
**/Cargo.toml
50+
Cargo.toml
51+
Cargo.lock
52+
3353
- name: PRINT ALL CHANGED FILES FOR DEBUG PURPOSES
3454
env:
3555
PYTHON_CHANGED_FILES: ${{ steps.python-src.outputs.all_changed_files }}
56+
RUST_CHANGED_FILES: ${{ steps.rust-src.outputs.all_changed_files }}
3657
run: |
3758
echo "${PYTHON_CHANGED_FILES}"
59+
echo "${RUST_CHANGED_FILES}"
3860
3961
build-build-tools-image:
4062
if: needs.get-changed-files.outputs.python-changed == 'true'
@@ -55,6 +77,16 @@ jobs:
5577
build-tools-image: ${{ needs.build-build-tools-image.outputs.image }}-bookworm-x64
5678
secrets: inherit
5779

80+
check-codestyle-rust:
81+
if: needs.get-changed-files.outputs.rust-changed == 'true'
82+
needs: [ get-changed-files, build-build-tools-image ]
83+
uses: ./.github/workflows/_check-codestyle-rust.yml
84+
with:
85+
# `-bookworm-x64` suffix should match the combination in `build-build-tools-image`
86+
build-tools-image: ${{ needs.build-build-tools-image.outputs.image }}-bookworm-x64
87+
archs: '["x64"]'
88+
secrets: inherit
89+
5890
# To get items from the merge queue merged into main we need to satisfy "Status checks that are required".
5991
# Currently we require 2 jobs (checks with exact name):
6092
# - conclusion
@@ -67,6 +99,7 @@ jobs:
6799
needs:
68100
- get-changed-files
69101
- check-codestyle-python
102+
- check-codestyle-rust
70103
runs-on: ubuntu-22.04
71104
steps:
72105
- name: Create fake `neon-cloud-e2e` check

0 commit comments

Comments
 (0)