Skip to content

Commit 23352dc

Browse files
Merge pull request #10802 from neondatabase/rc/release-proxy/2025-02-13
Proxy release 2025-02-13
2 parents 3e62458 + c65fc5a commit 23352dc

File tree

170 files changed

+5387
-3840
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

+5387
-3840
lines changed

.dockerignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,4 @@
2424
!storage_controller/
2525
!vendor/postgres-*/
2626
!workspace_hack/
27+
!build_tools/patches

.github/actions/run-python-test-set/action.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,8 @@ runs:
121121
export DEFAULT_PG_VERSION=${PG_VERSION#v}
122122
export LD_LIBRARY_PATH=${POSTGRES_DISTRIB_DIR}/v${DEFAULT_PG_VERSION}/lib
123123
export BENCHMARK_CONNSTR=${BENCHMARK_CONNSTR:-}
124+
export ASAN_OPTIONS=detect_leaks=0:detect_stack_use_after_return=0:abort_on_error=1:strict_string_checks=1:check_initialization_order=1:strict_init_order=1
125+
export UBSAN_OPTIONS=abort_on_error=1:print_stacktrace=1
124126
125127
if [ "${BUILD_TYPE}" = "remote" ]; then
126128
export REMOTE_ENV=1

.github/workflows/_build-and-test-locally.yml

Lines changed: 28 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,11 @@ on:
2323
description: 'a json object of postgres versions and lfc states to run regression tests on'
2424
required: true
2525
type: string
26+
sanitizers:
27+
description: 'enabled or disabled'
28+
required: false
29+
default: 'disabled'
30+
type: string
2631

2732
defaults:
2833
run:
@@ -87,6 +92,7 @@ jobs:
8792
- name: Set env variables
8893
env:
8994
ARCH: ${{ inputs.arch }}
95+
SANITIZERS: ${{ inputs.sanitizers }}
9096
run: |
9197
CARGO_FEATURES="--features testing"
9298
if [[ $BUILD_TYPE == "debug" && $ARCH == 'x64' ]]; then
@@ -99,8 +105,14 @@ jobs:
99105
cov_prefix=""
100106
CARGO_FLAGS="--locked --release"
101107
fi
108+
if [[ $SANITIZERS == 'enabled' ]]; then
109+
make_vars="WITH_SANITIZERS=yes"
110+
else
111+
make_vars=""
112+
fi
102113
{
103114
echo "cov_prefix=${cov_prefix}"
115+
echo "make_vars=${make_vars}"
104116
echo "CARGO_FEATURES=${CARGO_FEATURES}"
105117
echo "CARGO_FLAGS=${CARGO_FLAGS}"
106118
echo "CARGO_HOME=${GITHUB_WORKSPACE}/.cargo"
@@ -136,35 +148,39 @@ jobs:
136148

137149
- name: Build postgres v14
138150
if: steps.cache_pg_14.outputs.cache-hit != 'true'
139-
run: mold -run make postgres-v14 -j$(nproc)
151+
run: mold -run make ${make_vars} postgres-v14 -j$(nproc)
140152

141153
- name: Build postgres v15
142154
if: steps.cache_pg_15.outputs.cache-hit != 'true'
143-
run: mold -run make postgres-v15 -j$(nproc)
155+
run: mold -run make ${make_vars} postgres-v15 -j$(nproc)
144156

145157
- name: Build postgres v16
146158
if: steps.cache_pg_16.outputs.cache-hit != 'true'
147-
run: mold -run make postgres-v16 -j$(nproc)
159+
run: mold -run make ${make_vars} postgres-v16 -j$(nproc)
148160

149161
- name: Build postgres v17
150162
if: steps.cache_pg_17.outputs.cache-hit != 'true'
151-
run: mold -run make postgres-v17 -j$(nproc)
163+
run: mold -run make ${make_vars} postgres-v17 -j$(nproc)
152164

153165
- name: Build neon extensions
154-
run: mold -run make neon-pg-ext -j$(nproc)
166+
run: mold -run make ${make_vars} neon-pg-ext -j$(nproc)
155167

156168
- name: Build walproposer-lib
157-
run: mold -run make walproposer-lib -j$(nproc)
169+
run: mold -run make ${make_vars} walproposer-lib -j$(nproc)
158170

159171
- name: Run cargo build
172+
env:
173+
WITH_TESTS: ${{ inputs.sanitizers != 'enabled' && '--tests' || '' }}
160174
run: |
161-
${cov_prefix} mold -run cargo build $CARGO_FLAGS $CARGO_FEATURES --bins --tests
175+
export ASAN_OPTIONS=detect_leaks=0
176+
${cov_prefix} mold -run cargo build $CARGO_FLAGS $CARGO_FEATURES --bins ${WITH_TESTS}
162177
163178
# Do install *before* running rust tests because they might recompile the
164179
# binaries with different features/flags.
165180
- name: Install rust binaries
166181
env:
167182
ARCH: ${{ inputs.arch }}
183+
SANITIZERS: ${{ inputs.sanitizers }}
168184
run: |
169185
# Install target binaries
170186
mkdir -p /tmp/neon/bin/
@@ -179,7 +195,7 @@ jobs:
179195
done
180196
181197
# Install test executables and write list of all binaries (for code coverage)
182-
if [[ $BUILD_TYPE == "debug" && $ARCH == 'x64' ]]; then
198+
if [[ $BUILD_TYPE == "debug" && $ARCH == 'x64' && $SANITIZERS != 'enabled' ]]; then
183199
# Keep bloated coverage data files away from the rest of the artifact
184200
mkdir -p /tmp/coverage/
185201
@@ -212,6 +228,7 @@ jobs:
212228
role-duration-seconds: 18000 # 5 hours
213229

214230
- name: Run rust tests
231+
if: ${{ inputs.sanitizers != 'enabled' }}
215232
env:
216233
NEXTEST_RETRIES: 3
217234
run: |
@@ -273,6 +290,7 @@ jobs:
273290
DATABASE_URL: postgresql://localhost:1235/storage_controller
274291
POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install
275292
run: |
293+
export ASAN_OPTIONS=detect_leaks=0
276294
/tmp/neon/bin/neon_local init
277295
/tmp/neon/bin/neon_local storage_controller start
278296
@@ -319,7 +337,7 @@ jobs:
319337
- name: Pytest regression tests
320338
continue-on-error: ${{ matrix.lfc_state == 'with-lfc' && inputs.build-type == 'debug' }}
321339
uses: ./.github/actions/run-python-test-set
322-
timeout-minutes: 60
340+
timeout-minutes: ${{ inputs.sanitizers != 'enabled' && 60 || 180 }}
323341
with:
324342
build_type: ${{ inputs.build-type }}
325343
test_selection: regress
@@ -337,6 +355,7 @@ jobs:
337355
PAGESERVER_VIRTUAL_FILE_IO_ENGINE: tokio-epoll-uring
338356
PAGESERVER_GET_VECTORED_CONCURRENT_IO: sidecar-task
339357
USE_LFC: ${{ matrix.lfc_state == 'with-lfc' && 'true' || 'false' }}
358+
SANITIZERS: ${{ inputs.sanitizers }}
340359

341360
# Temporary disable this step until we figure out why it's so flaky
342361
# Ref https://github.com/neondatabase/neon/issues/4540

.github/workflows/_push-to-acr.yml

Lines changed: 0 additions & 56 deletions
This file was deleted.
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
name: Push images to Container Registry
2+
on:
3+
workflow_call:
4+
inputs:
5+
# Example: {"docker.io/neondatabase/neon:13196061314":["369495373322.dkr.ecr.eu-central-1.amazonaws.com/neon:13196061314","neoneastus2.azurecr.io/neondatabase/neon:13196061314"]}
6+
image-map:
7+
description: JSON map of images, mapping from a source image to an array of target images that should be pushed.
8+
required: true
9+
type: string
10+
aws-region:
11+
description: AWS region to log in to. Required when pushing to ECR.
12+
required: false
13+
type: string
14+
aws-account-ids:
15+
description: Comma separated AWS account IDs to log in to for pushing to ECR. Required when pushing to ECR.
16+
required: false
17+
type: string
18+
azure-client-id:
19+
description: Client ID of Azure managed identity or Entra app. Required when pushing to ACR.
20+
required: false
21+
type: string
22+
azure-subscription-id:
23+
description: Azure subscription ID. Required when pushing to ACR.
24+
required: false
25+
type: string
26+
azure-tenant-id:
27+
description: Azure tenant ID. Required when pushing to ACR.
28+
required: false
29+
type: string
30+
acr-registry-name:
31+
description: ACR registry name. Required when pushing to ACR.
32+
required: false
33+
type: string
34+
secrets:
35+
docker-hub-username:
36+
description: Docker Hub username. Required when pushing to Docker Hub.
37+
required: false
38+
docker-hub-password:
39+
description: Docker Hub password. Required when pushing to Docker Hub.
40+
required: false
41+
aws-role-to-assume:
42+
description: AWS role to assume. Required when pushing to ECR.
43+
required: false
44+
45+
permissions: {}
46+
47+
defaults:
48+
run:
49+
shell: bash -euo pipefail {0}
50+
51+
jobs:
52+
push-to-container-registry:
53+
runs-on: ubuntu-22.04
54+
permissions:
55+
id-token: write # Required for aws/azure login
56+
steps:
57+
- uses: actions/checkout@v4
58+
with:
59+
sparse-checkout: scripts/push_with_image_map.py
60+
sparse-checkout-cone-mode: false
61+
62+
- name: Print image-map
63+
run: echo '${{ inputs.image-map }}' | jq
64+
65+
- name: Configure AWS credentials
66+
if: contains(inputs.image-map, 'amazonaws.com/')
67+
uses: aws-actions/configure-aws-credentials@v4
68+
with:
69+
aws-region: "${{ inputs.aws-region }}"
70+
role-to-assume: "${{ secrets.aws-role-to-assume }}"
71+
role-duration-seconds: 3600
72+
73+
- name: Login to ECR
74+
if: contains(inputs.image-map, 'amazonaws.com/')
75+
uses: aws-actions/amazon-ecr-login@v2
76+
with:
77+
registries: "${{ inputs.aws-account-ids }}"
78+
79+
- name: Configure Azure credentials
80+
if: contains(inputs.image-map, 'azurecr.io/')
81+
uses: azure/login@6c251865b4e6290e7b78be643ea2d005bc51f69a # @v2.1.1
82+
with:
83+
client-id: ${{ inputs.azure-client-id }}
84+
subscription-id: ${{ inputs.azure-subscription-id }}
85+
tenant-id: ${{ inputs.azure-tenant-id }}
86+
87+
- name: Login to ACR
88+
if: contains(inputs.image-map, 'azurecr.io/')
89+
run: |
90+
az acr login --name=${{ inputs.acr-registry-name }}
91+
92+
- name: Log in to Docker Hub
93+
uses: docker/login-action@v3
94+
with:
95+
username: ${{ secrets.docker-hub-username }}
96+
password: ${{ secrets.docker-hub-password }}
97+
98+
- name: Copy docker images to target registries
99+
run: python scripts/push_with_image_map.py
100+
env:
101+
IMAGE_MAP: ${{ inputs.image-map }}

.github/workflows/approved-for-ci-run.yml

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,17 +67,17 @@ jobs:
6767

6868
- uses: actions/checkout@v4
6969
with:
70-
ref: main
70+
ref: ${{ github.event.pull_request.head.sha }}
7171
token: ${{ secrets.CI_ACCESS_TOKEN }}
72-
72+
7373
- name: Look for existing PR
7474
id: get-pr
7575
env:
7676
GH_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }}
7777
run: |
7878
ALREADY_CREATED="$(gh pr --repo ${GITHUB_REPOSITORY} list --head ${BRANCH} --base main --json number --jq '.[].number')"
7979
echo "ALREADY_CREATED=${ALREADY_CREATED}" >> ${GITHUB_OUTPUT}
80-
80+
8181
- name: Get changed labels
8282
id: get-labels
8383
if: steps.get-pr.outputs.ALREADY_CREATED != ''
@@ -94,18 +94,14 @@ jobs:
9494
echo "LABELS_TO_ADD=${LABELS_TO_ADD}" >> ${GITHUB_OUTPUT}
9595
echo "LABELS_TO_REMOVE=${LABELS_TO_REMOVE}" >> ${GITHUB_OUTPUT}
9696
97-
- uses: actions/checkout@v4
98-
with:
99-
ref: ${{ github.event.pull_request.head.sha }}
100-
10197
- run: git checkout -b "${BRANCH}"
10298

10399
- run: git push --force origin "${BRANCH}"
104100
if: steps.get-pr.outputs.ALREADY_CREATED == ''
105101

106102
- name: Create a Pull Request for CI run (if required)
107103
if: steps.get-pr.outputs.ALREADY_CREATED == ''
108-
env:
104+
env:
109105
GH_TOKEN: ${{ secrets.CI_ACCESS_TOKEN }}
110106
run: |
111107
cat << EOF > body.md
@@ -142,7 +138,7 @@ jobs:
142138
143139
- run: git push --force origin "${BRANCH}"
144140
if: steps.get-pr.outputs.ALREADY_CREATED != ''
145-
141+
146142
cleanup:
147143
# Close PRs and delete branchs if the original PR is closed.
148144

0 commit comments

Comments
 (0)