mirror of
https://github.com/neondatabase/neon.git
synced 2026-06-02 13:00:37 +00:00
Compare commits
240 Commits
release-pr
...
lfc_hll_te
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
3e8cb25e53 | ||
|
|
061ea0de7a | ||
|
|
be5d6a69dc | ||
|
|
18f4e5f10c | ||
|
|
f1eb703256 | ||
|
|
cf7a596a15 | ||
|
|
614c3aef72 | ||
|
|
fb74c21e8c | ||
|
|
d92d36a315 | ||
|
|
ec4cc30de9 | ||
|
|
73c6626b38 | ||
|
|
0fc4ada3ca | ||
|
|
dab96a6eb1 | ||
|
|
f54e3e9147 | ||
|
|
f4f7ea247c | ||
|
|
d92ff578c4 | ||
|
|
31b7703fa8 | ||
|
|
d056ae9be5 | ||
|
|
cb9ab7463c | ||
|
|
ab5bbb445b | ||
|
|
5ef805e12c | ||
|
|
091a175a3e | ||
|
|
326cd80f0d | ||
|
|
6baf1aae33 | ||
|
|
184935619e | ||
|
|
b2ecbf3e80 | ||
|
|
53147b51f9 | ||
|
|
006d9dfb6b | ||
|
|
1f7904c917 | ||
|
|
07c714343f | ||
|
|
264c34dfb7 | ||
|
|
9dd80b9b4c | ||
|
|
c2623ffef4 | ||
|
|
426b1c5f08 | ||
|
|
306094a87d | ||
|
|
d3464584a6 | ||
|
|
878135fe9c | ||
|
|
75434060a5 | ||
|
|
721803a0e7 | ||
|
|
108a211917 | ||
|
|
72ef0e0fa1 | ||
|
|
eb23d355a9 | ||
|
|
bee04b8a69 | ||
|
|
63e7fab990 | ||
|
|
a181392738 | ||
|
|
fc7397122c | ||
|
|
cc599e23c1 | ||
|
|
54d1185789 | ||
|
|
8a138db8b7 | ||
|
|
211970f0e0 | ||
|
|
f87f5a383e | ||
|
|
e8ae37652b | ||
|
|
5bd8e2363a | ||
|
|
618680c299 | ||
|
|
baf27ba6a3 | ||
|
|
16417d919d | ||
|
|
18b97150b2 | ||
|
|
17c59ed786 | ||
|
|
d7b960c9b5 | ||
|
|
2ff6d2b6b5 | ||
|
|
30f7fbc88d | ||
|
|
09f2000f91 | ||
|
|
e553ca9e4f | ||
|
|
0a80dbce83 | ||
|
|
e763256448 | ||
|
|
129d4480bb | ||
|
|
776df963ba | ||
|
|
11dc5feb36 | ||
|
|
dbbe57a837 | ||
|
|
cc29def544 | ||
|
|
912d47ec02 | ||
|
|
6eba29c732 | ||
|
|
99d4c1877b | ||
|
|
2272dc8a48 | ||
|
|
323bd018cd | ||
|
|
ad267d849f | ||
|
|
8cd7b5bf54 | ||
|
|
47c3c9a413 | ||
|
|
eae4470bb6 | ||
|
|
2d248aea6f | ||
|
|
6c05f89f7d | ||
|
|
db53f98725 | ||
|
|
04a6222418 | ||
|
|
dcf7af5a16 | ||
|
|
37158d0424 | ||
|
|
60fb840e1f | ||
|
|
52232dd85c | ||
|
|
8ef0c38b23 | ||
|
|
56bb1ac458 | ||
|
|
19db9e9aad | ||
|
|
4e9b32c442 | ||
|
|
2fac0b7fac | ||
|
|
e3d6ecaeee | ||
|
|
d785fcb5ff | ||
|
|
552fa2b972 | ||
|
|
9d93dd4807 | ||
|
|
53b6e1a01c | ||
|
|
dbef1b064c | ||
|
|
6a9e2d657c | ||
|
|
2d8f6d7906 | ||
|
|
1b176fe74a | ||
|
|
1dec93f129 | ||
|
|
16002f5e45 | ||
|
|
09d4bad1be | ||
|
|
d20448986c | ||
|
|
d54624153d | ||
|
|
700885471f | ||
|
|
38a8dcab9f | ||
|
|
8dbfda98d4 | ||
|
|
f875e107aa | ||
|
|
1e90e792d6 | ||
|
|
ea32f1d0a3 | ||
|
|
2e3b7862d0 | ||
|
|
387e569259 | ||
|
|
31f12f6426 | ||
|
|
8861e8a323 | ||
|
|
62e22dfd85 | ||
|
|
17672c88ff | ||
|
|
6efdb1d0f3 | ||
|
|
325de52e73 | ||
|
|
ce73db9316 | ||
|
|
b675997f48 | ||
|
|
49f99eb729 | ||
|
|
0d500bbd5b | ||
|
|
1b8b50755c | ||
|
|
4391b25d01 | ||
|
|
40b10b878a | ||
|
|
d6c6b0a509 | ||
|
|
d515727e94 | ||
|
|
2e508b1ff9 | ||
|
|
651ae44569 | ||
|
|
65bda19051 | ||
|
|
94a5ca2817 | ||
|
|
c07cea80bd | ||
|
|
a2e2362ee9 | ||
|
|
0a567acdb9 | ||
|
|
69ea2776e9 | ||
|
|
4dc9cb7cf9 | ||
|
|
7424e7269c | ||
|
|
5dc68e4e6a | ||
|
|
7cfd116856 | ||
|
|
d696c41807 | ||
|
|
3c72192065 | ||
|
|
d2d9921761 | ||
|
|
ba498a630a | ||
|
|
e989a5e4a2 | ||
|
|
cde1654d7b | ||
|
|
cf6a776fcf | ||
|
|
5c5871111a | ||
|
|
d56c4e7a38 | ||
|
|
43b2445d0b | ||
|
|
42ef08db47 | ||
|
|
fc962c9605 | ||
|
|
357fa070a3 | ||
|
|
02cdd37b56 | ||
|
|
fa354a65ab | ||
|
|
40f7930a7d | ||
|
|
ec07a1ecc9 | ||
|
|
c4cdfe66ac | ||
|
|
42e19e952f | ||
|
|
3d255d601b | ||
|
|
80e974d05b | ||
|
|
7fdf1ab5b6 | ||
|
|
7bae78186b | ||
|
|
7e560dd00e | ||
|
|
684e924211 | ||
|
|
8ace9ea25f | ||
|
|
6a4f49b08b | ||
|
|
c6e89445e2 | ||
|
|
04f32b9526 | ||
|
|
6f2333f52b | ||
|
|
d447f49bc3 | ||
|
|
c5972389aa | ||
|
|
c4f5736d5a | ||
|
|
518f598e2d | ||
|
|
4b711caf5e | ||
|
|
2cf47b1477 | ||
|
|
7dcfcccf7c | ||
|
|
a26cc29d92 | ||
|
|
5f2f31e879 | ||
|
|
938b163b42 | ||
|
|
5cbf5b45ae | ||
|
|
af5c54ed14 | ||
|
|
523cf71721 | ||
|
|
c47f355ec1 | ||
|
|
4f67b0225b | ||
|
|
2f7cecaf6a | ||
|
|
589594c2e1 | ||
|
|
70fe007519 | ||
|
|
b224a5a377 | ||
|
|
a65d437930 | ||
|
|
fc67f8dc60 | ||
|
|
2b65a2b53e | ||
|
|
9490360df4 | ||
|
|
91d947654e | ||
|
|
37aa6fd953 | ||
|
|
3ad567290c | ||
|
|
3a110e45ed | ||
|
|
e7e6319e20 | ||
|
|
d865881d59 | ||
|
|
1c5d6e59a0 | ||
|
|
263dfba6ee | ||
|
|
df3996265f | ||
|
|
29699529df | ||
|
|
f446e08fb8 | ||
|
|
4d5add9ca0 | ||
|
|
59b4c2eaf9 | ||
|
|
5432155b0d | ||
|
|
e16e82749f | ||
|
|
9f653893b9 | ||
|
|
913af44219 | ||
|
|
ecd615ab6d | ||
|
|
c9b2ec9ff1 | ||
|
|
a3800dcb0c | ||
|
|
9a32aa828d | ||
|
|
f03f7b3868 | ||
|
|
ec5dce04eb | ||
|
|
6014f15157 | ||
|
|
e675a21346 | ||
|
|
6b93230270 | ||
|
|
797aa4ffaa | ||
|
|
c45b56e0bb | ||
|
|
3104f0f250 | ||
|
|
f2c08195f0 | ||
|
|
d0cbfda15c | ||
|
|
1708743e78 | ||
|
|
0a1ca7670c | ||
|
|
ff9f065c43 | ||
|
|
21eeafaaa5 | ||
|
|
32a0e759bd | ||
|
|
7c489092b7 | ||
|
|
06d55a3b12 | ||
|
|
5c68e6a172 | ||
|
|
2753abc0d8 | ||
|
|
a523548ed1 | ||
|
|
2d4e5af18b | ||
|
|
5da2340e74 | ||
|
|
7b34c2d7af | ||
|
|
15ae1fc3df | ||
|
|
728b79b9dd |
@@ -5,26 +5,22 @@
|
|||||||
!Cargo.toml
|
!Cargo.toml
|
||||||
!Makefile
|
!Makefile
|
||||||
!rust-toolchain.toml
|
!rust-toolchain.toml
|
||||||
!scripts/combine_control_files.py
|
|
||||||
!scripts/ninstall.sh
|
!scripts/ninstall.sh
|
||||||
!vm-cgconfig.conf
|
|
||||||
!docker-compose/run-tests.sh
|
!docker-compose/run-tests.sh
|
||||||
|
|
||||||
# Directories
|
# Directories
|
||||||
!.cargo/
|
!.cargo/
|
||||||
!.config/
|
!.config/
|
||||||
|
!compute/
|
||||||
!compute_tools/
|
!compute_tools/
|
||||||
!control_plane/
|
!control_plane/
|
||||||
!libs/
|
!libs/
|
||||||
!neon_local/
|
|
||||||
!pageserver/
|
!pageserver/
|
||||||
!patches/
|
|
||||||
!pgxn/
|
!pgxn/
|
||||||
!proxy/
|
!proxy/
|
||||||
!storage_scrubber/
|
!storage_scrubber/
|
||||||
!safekeeper/
|
!safekeeper/
|
||||||
!storage_broker/
|
!storage_broker/
|
||||||
!storage_controller/
|
!storage_controller/
|
||||||
!trace/
|
|
||||||
!vendor/postgres-*/
|
!vendor/postgres-*/
|
||||||
!workspace_hack/
|
!workspace_hack/
|
||||||
|
|||||||
@@ -183,7 +183,7 @@ runs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/pypoetry/virtualenvs
|
path: ~/.cache/pypoetry/virtualenvs
|
||||||
key: v2-${{ runner.os }}-${{ runner.arch }}-python-deps-${{ hashFiles('poetry.lock') }}
|
key: v2-${{ runner.os }}-${{ runner.arch }}-python-deps-bookworm-${{ hashFiles('poetry.lock') }}
|
||||||
|
|
||||||
- name: Store Allure test stat in the DB (new)
|
- name: Store Allure test stat in the DB (new)
|
||||||
if: ${{ !cancelled() && inputs.store-test-results-into-db == 'true' }}
|
if: ${{ !cancelled() && inputs.store-test-results-into-db == 'true' }}
|
||||||
|
|||||||
@@ -88,7 +88,7 @@ runs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/pypoetry/virtualenvs
|
path: ~/.cache/pypoetry/virtualenvs
|
||||||
key: v2-${{ runner.os }}-${{ runner.arch }}-python-deps-${{ hashFiles('poetry.lock') }}
|
key: v2-${{ runner.os }}-${{ runner.arch }}-python-deps-bookworm-${{ hashFiles('poetry.lock') }}
|
||||||
|
|
||||||
- name: Install Python deps
|
- name: Install Python deps
|
||||||
shell: bash -euxo pipefail {0}
|
shell: bash -euxo pipefail {0}
|
||||||
@@ -218,6 +218,9 @@ runs:
|
|||||||
name: compatibility-snapshot-${{ runner.arch }}-${{ inputs.build_type }}-pg${{ inputs.pg_version }}
|
name: compatibility-snapshot-${{ runner.arch }}-${{ inputs.build_type }}-pg${{ inputs.pg_version }}
|
||||||
# Directory is created by test_compatibility.py::test_create_snapshot, keep the path in sync with the test
|
# Directory is created by test_compatibility.py::test_create_snapshot, keep the path in sync with the test
|
||||||
path: /tmp/test_output/compatibility_snapshot_pg${{ inputs.pg_version }}/
|
path: /tmp/test_output/compatibility_snapshot_pg${{ inputs.pg_version }}/
|
||||||
|
# The lack of compatibility snapshot shouldn't fail the job
|
||||||
|
# (for example if we didn't run the test for non build-and-test workflow)
|
||||||
|
skip-if-does-not-exist: true
|
||||||
|
|
||||||
- name: Upload test results
|
- name: Upload test results
|
||||||
if: ${{ !cancelled() }}
|
if: ${{ !cancelled() }}
|
||||||
|
|||||||
18
.github/actions/upload/action.yml
vendored
18
.github/actions/upload/action.yml
vendored
@@ -7,6 +7,10 @@ inputs:
|
|||||||
path:
|
path:
|
||||||
description: "A directory or file to upload"
|
description: "A directory or file to upload"
|
||||||
required: true
|
required: true
|
||||||
|
skip-if-does-not-exist:
|
||||||
|
description: "Allow to skip if path doesn't exist, fail otherwise"
|
||||||
|
default: false
|
||||||
|
required: false
|
||||||
prefix:
|
prefix:
|
||||||
description: "S3 prefix. Default is '${GITHUB_SHA}/${GITHUB_RUN_ID}/${GITHUB_RUN_ATTEMPT}'"
|
description: "S3 prefix. Default is '${GITHUB_SHA}/${GITHUB_RUN_ID}/${GITHUB_RUN_ATTEMPT}'"
|
||||||
required: false
|
required: false
|
||||||
@@ -15,10 +19,12 @@ runs:
|
|||||||
using: "composite"
|
using: "composite"
|
||||||
steps:
|
steps:
|
||||||
- name: Prepare artifact
|
- name: Prepare artifact
|
||||||
|
id: prepare-artifact
|
||||||
shell: bash -euxo pipefail {0}
|
shell: bash -euxo pipefail {0}
|
||||||
env:
|
env:
|
||||||
SOURCE: ${{ inputs.path }}
|
SOURCE: ${{ inputs.path }}
|
||||||
ARCHIVE: /tmp/uploads/${{ inputs.name }}.tar.zst
|
ARCHIVE: /tmp/uploads/${{ inputs.name }}.tar.zst
|
||||||
|
SKIP_IF_DOES_NOT_EXIST: ${{ inputs.skip-if-does-not-exist }}
|
||||||
run: |
|
run: |
|
||||||
mkdir -p $(dirname $ARCHIVE)
|
mkdir -p $(dirname $ARCHIVE)
|
||||||
|
|
||||||
@@ -33,14 +39,22 @@ runs:
|
|||||||
elif [ -f ${SOURCE} ]; then
|
elif [ -f ${SOURCE} ]; then
|
||||||
time tar -cf ${ARCHIVE} --zstd ${SOURCE}
|
time tar -cf ${ARCHIVE} --zstd ${SOURCE}
|
||||||
elif ! ls ${SOURCE} > /dev/null 2>&1; then
|
elif ! ls ${SOURCE} > /dev/null 2>&1; then
|
||||||
echo >&2 "${SOURCE} does not exist"
|
if [ "${SKIP_IF_DOES_NOT_EXIST}" = "true" ]; then
|
||||||
exit 2
|
echo 'SKIPPED=true' >> $GITHUB_OUTPUT
|
||||||
|
exit 0
|
||||||
|
else
|
||||||
|
echo >&2 "${SOURCE} does not exist"
|
||||||
|
exit 2
|
||||||
|
fi
|
||||||
else
|
else
|
||||||
echo >&2 "${SOURCE} is neither a directory nor a file, do not know how to handle it"
|
echo >&2 "${SOURCE} is neither a directory nor a file, do not know how to handle it"
|
||||||
exit 3
|
exit 3
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
echo 'SKIPPED=false' >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Upload artifact
|
- name: Upload artifact
|
||||||
|
if: ${{ steps.prepare-artifact.outputs.SKIPPED == 'false' }}
|
||||||
shell: bash -euxo pipefail {0}
|
shell: bash -euxo pipefail {0}
|
||||||
env:
|
env:
|
||||||
SOURCE: ${{ inputs.path }}
|
SOURCE: ${{ inputs.path }}
|
||||||
|
|||||||
46
.github/workflows/_benchmarking_preparation.yml
vendored
46
.github/workflows/_benchmarking_preparation.yml
vendored
@@ -3,19 +3,23 @@ name: Prepare benchmarking databases by restoring dumps
|
|||||||
on:
|
on:
|
||||||
workflow_call:
|
workflow_call:
|
||||||
# no inputs needed
|
# no inputs needed
|
||||||
|
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
shell: bash -euxo pipefail {0}
|
shell: bash -euxo pipefail {0}
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
setup-databases:
|
setup-databases:
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
statuses: write
|
||||||
|
id-token: write # aws-actions/configure-aws-credentials
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
platform: [ aws-rds-postgres, aws-aurora-serverless-v2-postgres, neon ]
|
platform: [ aws-rds-postgres, aws-aurora-serverless-v2-postgres, neon ]
|
||||||
database: [ clickbench, tpch, userexample ]
|
database: [ clickbench, tpch, userexample ]
|
||||||
|
|
||||||
env:
|
env:
|
||||||
LD_LIBRARY_PATH: /tmp/neon/pg_install/v16/lib
|
LD_LIBRARY_PATH: /tmp/neon/pg_install/v16/lib
|
||||||
PLATFORM: ${{ matrix.platform }}
|
PLATFORM: ${{ matrix.platform }}
|
||||||
@@ -23,7 +27,10 @@ jobs:
|
|||||||
|
|
||||||
runs-on: [ self-hosted, us-east-2, x64 ]
|
runs-on: [ self-hosted, us-east-2, x64 ]
|
||||||
container:
|
container:
|
||||||
image: 369495373322.dkr.ecr.eu-central-1.amazonaws.com/build-tools:pinned
|
image: neondatabase/build-tools:pinned
|
||||||
|
credentials:
|
||||||
|
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
||||||
options: --init
|
options: --init
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -32,13 +39,13 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
case "${PLATFORM}" in
|
case "${PLATFORM}" in
|
||||||
neon)
|
neon)
|
||||||
CONNSTR=${{ secrets.BENCHMARK_CAPTEST_CONNSTR }}
|
CONNSTR=${{ secrets.BENCHMARK_CAPTEST_CONNSTR }}
|
||||||
;;
|
;;
|
||||||
aws-rds-postgres)
|
aws-rds-postgres)
|
||||||
CONNSTR=${{ secrets.BENCHMARK_RDS_POSTGRES_CONNSTR }}
|
CONNSTR=${{ secrets.BENCHMARK_RDS_POSTGRES_CONNSTR }}
|
||||||
;;
|
;;
|
||||||
aws-aurora-serverless-v2-postgres)
|
aws-aurora-serverless-v2-postgres)
|
||||||
CONNSTR=${{ secrets.BENCHMARK_RDS_AURORA_CONNSTR }}
|
CONNSTR=${{ secrets.BENCHMARK_RDS_AURORA_CONNSTR }}
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
echo >&2 "Unknown PLATFORM=${PLATFORM}"
|
echo >&2 "Unknown PLATFORM=${PLATFORM}"
|
||||||
@@ -46,10 +53,17 @@ jobs:
|
|||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
echo "connstr=${CONNSTR}" >> $GITHUB_OUTPUT
|
echo "connstr=${CONNSTR}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Configure AWS credentials
|
||||||
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
|
with:
|
||||||
|
aws-region: eu-central-1
|
||||||
|
role-to-assume: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
|
||||||
|
role-duration-seconds: 18000 # 5 hours
|
||||||
|
|
||||||
- name: Download Neon artifact
|
- name: Download Neon artifact
|
||||||
uses: ./.github/actions/download
|
uses: ./.github/actions/download
|
||||||
with:
|
with:
|
||||||
@@ -57,23 +71,23 @@ jobs:
|
|||||||
path: /tmp/neon/
|
path: /tmp/neon/
|
||||||
prefix: latest
|
prefix: latest
|
||||||
|
|
||||||
# we create a table that has one row for each database that we want to restore with the status whether the restore is done
|
# we create a table that has one row for each database that we want to restore with the status whether the restore is done
|
||||||
- name: Create benchmark_restore_status table if it does not exist
|
- name: Create benchmark_restore_status table if it does not exist
|
||||||
env:
|
env:
|
||||||
BENCHMARK_CONNSTR: ${{ steps.set-up-prep-connstr.outputs.connstr }}
|
BENCHMARK_CONNSTR: ${{ steps.set-up-prep-connstr.outputs.connstr }}
|
||||||
DATABASE_NAME: ${{ matrix.database }}
|
DATABASE_NAME: ${{ matrix.database }}
|
||||||
# to avoid a race condition of multiple jobs trying to create the table at the same time,
|
# to avoid a race condition of multiple jobs trying to create the table at the same time,
|
||||||
# we use an advisory lock
|
# we use an advisory lock
|
||||||
run: |
|
run: |
|
||||||
${PG_BINARIES}/psql "${{ env.BENCHMARK_CONNSTR }}" -c "
|
${PG_BINARIES}/psql "${{ env.BENCHMARK_CONNSTR }}" -c "
|
||||||
SELECT pg_advisory_lock(4711);
|
SELECT pg_advisory_lock(4711);
|
||||||
CREATE TABLE IF NOT EXISTS benchmark_restore_status (
|
CREATE TABLE IF NOT EXISTS benchmark_restore_status (
|
||||||
databasename text primary key,
|
databasename text primary key,
|
||||||
restore_done boolean
|
restore_done boolean
|
||||||
);
|
);
|
||||||
SELECT pg_advisory_unlock(4711);
|
SELECT pg_advisory_unlock(4711);
|
||||||
"
|
"
|
||||||
|
|
||||||
- name: Check if restore is already done
|
- name: Check if restore is already done
|
||||||
id: check-restore-done
|
id: check-restore-done
|
||||||
env:
|
env:
|
||||||
@@ -107,7 +121,7 @@ jobs:
|
|||||||
DATABASE_NAME: ${{ matrix.database }}
|
DATABASE_NAME: ${{ matrix.database }}
|
||||||
run: |
|
run: |
|
||||||
mkdir -p /tmp/dumps
|
mkdir -p /tmp/dumps
|
||||||
aws s3 cp s3://neon-github-dev/performance/pgdumps/$DATABASE_NAME/$DATABASE_NAME.pg_dump /tmp/dumps/
|
aws s3 cp s3://neon-github-dev/performance/pgdumps/$DATABASE_NAME/$DATABASE_NAME.pg_dump /tmp/dumps/
|
||||||
|
|
||||||
- name: Replace database name in connection string
|
- name: Replace database name in connection string
|
||||||
if: steps.check-restore-done.outputs.skip != 'true'
|
if: steps.check-restore-done.outputs.skip != 'true'
|
||||||
@@ -126,17 +140,17 @@ jobs:
|
|||||||
else
|
else
|
||||||
new_connstr="${base_connstr}/${DATABASE_NAME}"
|
new_connstr="${base_connstr}/${DATABASE_NAME}"
|
||||||
fi
|
fi
|
||||||
echo "database_connstr=${new_connstr}" >> $GITHUB_OUTPUT
|
echo "database_connstr=${new_connstr}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Restore dump
|
- name: Restore dump
|
||||||
if: steps.check-restore-done.outputs.skip != 'true'
|
if: steps.check-restore-done.outputs.skip != 'true'
|
||||||
env:
|
env:
|
||||||
DATABASE_NAME: ${{ matrix.database }}
|
DATABASE_NAME: ${{ matrix.database }}
|
||||||
DATABASE_CONNSTR: ${{ steps.replace-dbname.outputs.database_connstr }}
|
DATABASE_CONNSTR: ${{ steps.replace-dbname.outputs.database_connstr }}
|
||||||
# the following works only with larger computes:
|
# the following works only with larger computes:
|
||||||
# PGOPTIONS: "-c maintenance_work_mem=8388608 -c max_parallel_maintenance_workers=7"
|
# PGOPTIONS: "-c maintenance_work_mem=8388608 -c max_parallel_maintenance_workers=7"
|
||||||
# we add the || true because:
|
# we add the || true because:
|
||||||
# the dumps were created with Neon and contain neon extensions that are not
|
# the dumps were created with Neon and contain neon extensions that are not
|
||||||
# available in RDS, so we will always report an error, but we can ignore it
|
# available in RDS, so we will always report an error, but we can ignore it
|
||||||
run: |
|
run: |
|
||||||
${PG_BINARIES}/pg_restore --clean --if-exists --no-owner --jobs=4 \
|
${PG_BINARIES}/pg_restore --clean --if-exists --no-owner --jobs=4 \
|
||||||
|
|||||||
22
.github/workflows/_build-and-test-locally.yml
vendored
22
.github/workflows/_build-and-test-locally.yml
vendored
@@ -124,28 +124,28 @@ jobs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: pg_install/v14
|
path: pg_install/v14
|
||||||
key: v1-${{ runner.os }}-${{ runner.arch }}-${{ inputs.build-type }}-pg-${{ steps.pg_v14_rev.outputs.pg_rev }}-${{ hashFiles('Makefile', 'Dockerfile.build-tools') }}
|
key: v1-${{ runner.os }}-${{ runner.arch }}-${{ inputs.build-type }}-pg-${{ steps.pg_v14_rev.outputs.pg_rev }}-bookworm-${{ hashFiles('Makefile', 'Dockerfile.build-tools') }}
|
||||||
|
|
||||||
- name: Cache postgres v15 build
|
- name: Cache postgres v15 build
|
||||||
id: cache_pg_15
|
id: cache_pg_15
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: pg_install/v15
|
path: pg_install/v15
|
||||||
key: v1-${{ runner.os }}-${{ runner.arch }}-${{ inputs.build-type }}-pg-${{ steps.pg_v15_rev.outputs.pg_rev }}-${{ hashFiles('Makefile', 'Dockerfile.build-tools') }}
|
key: v1-${{ runner.os }}-${{ runner.arch }}-${{ inputs.build-type }}-pg-${{ steps.pg_v15_rev.outputs.pg_rev }}-bookworm-${{ hashFiles('Makefile', 'Dockerfile.build-tools') }}
|
||||||
|
|
||||||
- name: Cache postgres v16 build
|
- name: Cache postgres v16 build
|
||||||
id: cache_pg_16
|
id: cache_pg_16
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: pg_install/v16
|
path: pg_install/v16
|
||||||
key: v1-${{ runner.os }}-${{ runner.arch }}-${{ inputs.build-type }}-pg-${{ steps.pg_v16_rev.outputs.pg_rev }}-${{ hashFiles('Makefile', 'Dockerfile.build-tools') }}
|
key: v1-${{ runner.os }}-${{ runner.arch }}-${{ inputs.build-type }}-pg-${{ steps.pg_v16_rev.outputs.pg_rev }}-bookworm-${{ hashFiles('Makefile', 'Dockerfile.build-tools') }}
|
||||||
|
|
||||||
- name: Cache postgres v17 build
|
- name: Cache postgres v17 build
|
||||||
id: cache_pg_17
|
id: cache_pg_17
|
||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: pg_install/v17
|
path: pg_install/v17
|
||||||
key: v1-${{ runner.os }}-${{ runner.arch }}-${{ inputs.build-type }}-pg-${{ steps.pg_v17_rev.outputs.pg_rev }}-${{ hashFiles('Makefile', 'Dockerfile.build-tools') }}
|
key: v1-${{ runner.os }}-${{ runner.arch }}-${{ inputs.build-type }}-pg-${{ steps.pg_v17_rev.outputs.pg_rev }}-bookworm-${{ hashFiles('Makefile', 'Dockerfile.build-tools') }}
|
||||||
|
|
||||||
- name: Build postgres v14
|
- name: Build postgres v14
|
||||||
if: steps.cache_pg_14.outputs.cache-hit != 'true'
|
if: steps.cache_pg_14.outputs.cache-hit != 'true'
|
||||||
@@ -236,9 +236,7 @@ jobs:
|
|||||||
|
|
||||||
# run pageserver tests with different settings
|
# run pageserver tests with different settings
|
||||||
for io_engine in std-fs tokio-epoll-uring ; do
|
for io_engine in std-fs tokio-epoll-uring ; do
|
||||||
for io_buffer_alignment in 0 1 512 ; do
|
NEON_PAGESERVER_UNIT_TEST_VIRTUAL_FILE_IOENGINE=$io_engine ${cov_prefix} cargo nextest run $CARGO_FLAGS $CARGO_FEATURES -E 'package(pageserver)'
|
||||||
NEON_PAGESERVER_UNIT_TEST_VIRTUAL_FILE_IOENGINE=$io_engine NEON_PAGESERVER_UNIT_TEST_IO_BUFFER_ALIGNMENT=$io_buffer_alignment ${cov_prefix} cargo nextest run $CARGO_FLAGS $CARGO_FEATURES -E 'package(pageserver)'
|
|
||||||
done
|
|
||||||
done
|
done
|
||||||
|
|
||||||
# Run separate tests for real S3
|
# Run separate tests for real S3
|
||||||
@@ -257,7 +255,15 @@ jobs:
|
|||||||
${cov_prefix} cargo nextest run $CARGO_FLAGS $CARGO_FEATURES -E 'package(remote_storage)' -E 'test(test_real_azure)'
|
${cov_prefix} cargo nextest run $CARGO_FLAGS $CARGO_FEATURES -E 'package(remote_storage)' -E 'test(test_real_azure)'
|
||||||
|
|
||||||
- name: Install postgres binaries
|
- name: Install postgres binaries
|
||||||
run: cp -a pg_install /tmp/neon/pg_install
|
run: |
|
||||||
|
# Use tar to copy files matching the pattern, preserving the paths in the destionation
|
||||||
|
tar c \
|
||||||
|
pg_install/v* \
|
||||||
|
pg_install/build/*/src/test/regress/*.so \
|
||||||
|
pg_install/build/*/src/test/regress/pg_regress \
|
||||||
|
pg_install/build/*/src/test/isolation/isolationtester \
|
||||||
|
pg_install/build/*/src/test/isolation/pg_isolation_regress \
|
||||||
|
| tar x -C /tmp/neon
|
||||||
|
|
||||||
- name: Upload Neon artifact
|
- name: Upload Neon artifact
|
||||||
uses: ./.github/actions/upload
|
uses: ./.github/actions/upload
|
||||||
|
|||||||
119
.github/workflows/benchmarking.yml
vendored
119
.github/workflows/benchmarking.yml
vendored
@@ -12,7 +12,6 @@ on:
|
|||||||
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
|
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
|
||||||
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
|
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
|
||||||
- cron: '0 3 * * *' # run once a day, timezone is utc
|
- cron: '0 3 * * *' # run once a day, timezone is utc
|
||||||
|
|
||||||
workflow_dispatch: # adds ability to run this manually
|
workflow_dispatch: # adds ability to run this manually
|
||||||
inputs:
|
inputs:
|
||||||
region_id:
|
region_id:
|
||||||
@@ -59,7 +58,7 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
statuses: write
|
statuses: write
|
||||||
id-token: write # Required for OIDC authentication in azure runners
|
id-token: write # aws-actions/configure-aws-credentials
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
@@ -68,12 +67,10 @@ jobs:
|
|||||||
PLATFORM: "neon-staging"
|
PLATFORM: "neon-staging"
|
||||||
region_id: ${{ github.event.inputs.region_id || 'aws-us-east-2' }}
|
region_id: ${{ github.event.inputs.region_id || 'aws-us-east-2' }}
|
||||||
RUNNER: [ self-hosted, us-east-2, x64 ]
|
RUNNER: [ self-hosted, us-east-2, x64 ]
|
||||||
IMAGE: 369495373322.dkr.ecr.eu-central-1.amazonaws.com/build-tools:pinned
|
|
||||||
- DEFAULT_PG_VERSION: 16
|
- DEFAULT_PG_VERSION: 16
|
||||||
PLATFORM: "azure-staging"
|
PLATFORM: "azure-staging"
|
||||||
region_id: 'azure-eastus2'
|
region_id: 'azure-eastus2'
|
||||||
RUNNER: [ self-hosted, eastus2, x64 ]
|
RUNNER: [ self-hosted, eastus2, x64 ]
|
||||||
IMAGE: neondatabase/build-tools:pinned
|
|
||||||
env:
|
env:
|
||||||
TEST_PG_BENCH_DURATIONS_MATRIX: "300"
|
TEST_PG_BENCH_DURATIONS_MATRIX: "300"
|
||||||
TEST_PG_BENCH_SCALES_MATRIX: "10,100"
|
TEST_PG_BENCH_SCALES_MATRIX: "10,100"
|
||||||
@@ -86,7 +83,10 @@ jobs:
|
|||||||
|
|
||||||
runs-on: ${{ matrix.RUNNER }}
|
runs-on: ${{ matrix.RUNNER }}
|
||||||
container:
|
container:
|
||||||
image: ${{ matrix.IMAGE }}
|
image: neondatabase/build-tools:pinned
|
||||||
|
credentials:
|
||||||
|
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
||||||
options: --init
|
options: --init
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -164,6 +164,10 @@ jobs:
|
|||||||
|
|
||||||
replication-tests:
|
replication-tests:
|
||||||
if: ${{ github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null }}
|
if: ${{ github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null }}
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
statuses: write
|
||||||
|
id-token: write # aws-actions/configure-aws-credentials
|
||||||
env:
|
env:
|
||||||
POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install
|
POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install
|
||||||
DEFAULT_PG_VERSION: 16
|
DEFAULT_PG_VERSION: 16
|
||||||
@@ -174,12 +178,21 @@ jobs:
|
|||||||
|
|
||||||
runs-on: [ self-hosted, us-east-2, x64 ]
|
runs-on: [ self-hosted, us-east-2, x64 ]
|
||||||
container:
|
container:
|
||||||
image: 369495373322.dkr.ecr.eu-central-1.amazonaws.com/build-tools:pinned
|
image: neondatabase/build-tools:pinned
|
||||||
|
credentials:
|
||||||
|
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
||||||
options: --init
|
options: --init
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Configure AWS credentials
|
||||||
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
|
with:
|
||||||
|
aws-region: eu-central-1
|
||||||
|
role-to-assume: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
|
||||||
|
role-duration-seconds: 18000 # 5 hours
|
||||||
|
|
||||||
- name: Download Neon artifact
|
- name: Download Neon artifact
|
||||||
uses: ./.github/actions/download
|
uses: ./.github/actions/download
|
||||||
@@ -267,7 +280,7 @@ jobs:
|
|||||||
region_id_default=${{ env.DEFAULT_REGION_ID }}
|
region_id_default=${{ env.DEFAULT_REGION_ID }}
|
||||||
runner_default='["self-hosted", "us-east-2", "x64"]'
|
runner_default='["self-hosted", "us-east-2", "x64"]'
|
||||||
runner_azure='["self-hosted", "eastus2", "x64"]'
|
runner_azure='["self-hosted", "eastus2", "x64"]'
|
||||||
image_default="369495373322.dkr.ecr.eu-central-1.amazonaws.com/build-tools:pinned"
|
image_default="neondatabase/build-tools:pinned"
|
||||||
matrix='{
|
matrix='{
|
||||||
"pg_version" : [
|
"pg_version" : [
|
||||||
16
|
16
|
||||||
@@ -344,7 +357,7 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
statuses: write
|
statuses: write
|
||||||
id-token: write # Required for OIDC authentication in azure runners
|
id-token: write # aws-actions/configure-aws-credentials
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
@@ -371,7 +384,7 @@ jobs:
|
|||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Configure AWS credentials # necessary on Azure runners
|
- name: Configure AWS credentials
|
||||||
uses: aws-actions/configure-aws-credentials@v4
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
with:
|
with:
|
||||||
aws-region: eu-central-1
|
aws-region: eu-central-1
|
||||||
@@ -492,17 +505,15 @@ jobs:
|
|||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
statuses: write
|
statuses: write
|
||||||
id-token: write # Required for OIDC authentication in azure runners
|
id-token: write # aws-actions/configure-aws-credentials
|
||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
include:
|
include:
|
||||||
- PLATFORM: "neonvm-captest-pgvector"
|
- PLATFORM: "neonvm-captest-pgvector"
|
||||||
RUNNER: [ self-hosted, us-east-2, x64 ]
|
RUNNER: [ self-hosted, us-east-2, x64 ]
|
||||||
IMAGE: 369495373322.dkr.ecr.eu-central-1.amazonaws.com/build-tools:pinned
|
|
||||||
- PLATFORM: "azure-captest-pgvector"
|
- PLATFORM: "azure-captest-pgvector"
|
||||||
RUNNER: [ self-hosted, eastus2, x64 ]
|
RUNNER: [ self-hosted, eastus2, x64 ]
|
||||||
IMAGE: neondatabase/build-tools:pinned
|
|
||||||
|
|
||||||
env:
|
env:
|
||||||
TEST_PG_BENCH_DURATIONS_MATRIX: "15m"
|
TEST_PG_BENCH_DURATIONS_MATRIX: "15m"
|
||||||
@@ -511,13 +522,16 @@ jobs:
|
|||||||
DEFAULT_PG_VERSION: 16
|
DEFAULT_PG_VERSION: 16
|
||||||
TEST_OUTPUT: /tmp/test_output
|
TEST_OUTPUT: /tmp/test_output
|
||||||
BUILD_TYPE: remote
|
BUILD_TYPE: remote
|
||||||
LD_LIBRARY_PATH: /home/nonroot/pg/usr/lib/x86_64-linux-gnu
|
|
||||||
SAVE_PERF_REPORT: ${{ github.event.inputs.save_perf_report || ( github.ref_name == 'main' ) }}
|
SAVE_PERF_REPORT: ${{ github.event.inputs.save_perf_report || ( github.ref_name == 'main' ) }}
|
||||||
PLATFORM: ${{ matrix.PLATFORM }}
|
PLATFORM: ${{ matrix.PLATFORM }}
|
||||||
|
|
||||||
runs-on: ${{ matrix.RUNNER }}
|
runs-on: ${{ matrix.RUNNER }}
|
||||||
container:
|
container:
|
||||||
image: ${{ matrix.IMAGE }}
|
image: neondatabase/build-tools:pinned
|
||||||
|
credentials:
|
||||||
|
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
||||||
options: --init
|
options: --init
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
@@ -527,17 +541,26 @@ jobs:
|
|||||||
# instead of using Neon artifacts containing pgbench
|
# instead of using Neon artifacts containing pgbench
|
||||||
- name: Install postgresql-16 where pytest expects it
|
- name: Install postgresql-16 where pytest expects it
|
||||||
run: |
|
run: |
|
||||||
|
# Just to make it easier to test things locally on macOS (with arm64)
|
||||||
|
arch=$(uname -m | sed 's/x86_64/amd64/g' | sed 's/aarch64/arm64/g')
|
||||||
|
|
||||||
cd /home/nonroot
|
cd /home/nonroot
|
||||||
wget -q https://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-16/libpq5_16.4-1.pgdg110%2B1_amd64.deb
|
wget -q "https://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-17/libpq5_17.0-1.pgdg110+1_${arch}.deb"
|
||||||
wget -q https://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-16/postgresql-client-16_16.4-1.pgdg110%2B1_amd64.deb
|
wget -q "https://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-16/postgresql-client-16_16.4-1.pgdg110+2_${arch}.deb"
|
||||||
wget -q https://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-16/postgresql-16_16.4-1.pgdg110%2B1_amd64.deb
|
wget -q "https://apt.postgresql.org/pub/repos/apt/pool/main/p/postgresql-16/postgresql-16_16.4-1.pgdg110+2_${arch}.deb"
|
||||||
dpkg -x libpq5_16.4-1.pgdg110+1_amd64.deb pg
|
dpkg -x libpq5_17.0-1.pgdg110+1_${arch}.deb pg
|
||||||
dpkg -x postgresql-client-16_16.4-1.pgdg110+1_amd64.deb pg
|
dpkg -x postgresql-16_16.4-1.pgdg110+2_${arch}.deb pg
|
||||||
dpkg -x postgresql-16_16.4-1.pgdg110+1_amd64.deb pg
|
dpkg -x postgresql-client-16_16.4-1.pgdg110+2_${arch}.deb pg
|
||||||
|
|
||||||
mkdir -p /tmp/neon/pg_install/v16/bin
|
mkdir -p /tmp/neon/pg_install/v16/bin
|
||||||
ln -s /home/nonroot/pg/usr/lib/postgresql/16/bin/pgbench /tmp/neon/pg_install/v16/bin/pgbench
|
ln -s /home/nonroot/pg/usr/lib/postgresql/16/bin/pgbench /tmp/neon/pg_install/v16/bin/pgbench
|
||||||
ln -s /home/nonroot/pg/usr/lib/postgresql/16/bin/psql /tmp/neon/pg_install/v16/bin/psql
|
ln -s /home/nonroot/pg/usr/lib/postgresql/16/bin/psql /tmp/neon/pg_install/v16/bin/psql
|
||||||
ln -s /home/nonroot/pg/usr/lib/x86_64-linux-gnu /tmp/neon/pg_install/v16/lib
|
ln -s /home/nonroot/pg/usr/lib/$(uname -m)-linux-gnu /tmp/neon/pg_install/v16/lib
|
||||||
|
|
||||||
|
LD_LIBRARY_PATH="/home/nonroot/pg/usr/lib/$(uname -m)-linux-gnu:${LD_LIBRARY_PATH:-}"
|
||||||
|
export LD_LIBRARY_PATH
|
||||||
|
echo "LD_LIBRARY_PATH=${LD_LIBRARY_PATH}" >> ${GITHUB_ENV}
|
||||||
|
|
||||||
/tmp/neon/pg_install/v16/bin/pgbench --version
|
/tmp/neon/pg_install/v16/bin/pgbench --version
|
||||||
/tmp/neon/pg_install/v16/bin/psql --version
|
/tmp/neon/pg_install/v16/bin/psql --version
|
||||||
|
|
||||||
@@ -559,7 +582,7 @@ jobs:
|
|||||||
|
|
||||||
echo "connstr=${CONNSTR}" >> $GITHUB_OUTPUT
|
echo "connstr=${CONNSTR}" >> $GITHUB_OUTPUT
|
||||||
|
|
||||||
- name: Configure AWS credentials # necessary on Azure runners to read/write from/to S3
|
- name: Configure AWS credentials
|
||||||
uses: aws-actions/configure-aws-credentials@v4
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
with:
|
with:
|
||||||
aws-region: eu-central-1
|
aws-region: eu-central-1
|
||||||
@@ -620,6 +643,10 @@ jobs:
|
|||||||
# *_CLICKBENCH_CONNSTR: Genuine ClickBench DB with ~100M rows
|
# *_CLICKBENCH_CONNSTR: Genuine ClickBench DB with ~100M rows
|
||||||
# *_CLICKBENCH_10M_CONNSTR: DB with the first 10M rows of ClickBench DB
|
# *_CLICKBENCH_10M_CONNSTR: DB with the first 10M rows of ClickBench DB
|
||||||
if: ${{ !cancelled() && (github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null) }}
|
if: ${{ !cancelled() && (github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null) }}
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
statuses: write
|
||||||
|
id-token: write # aws-actions/configure-aws-credentials
|
||||||
needs: [ generate-matrices, pgbench-compare, prepare_AWS_RDS_databases ]
|
needs: [ generate-matrices, pgbench-compare, prepare_AWS_RDS_databases ]
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
@@ -638,12 +665,22 @@ jobs:
|
|||||||
|
|
||||||
runs-on: [ self-hosted, us-east-2, x64 ]
|
runs-on: [ self-hosted, us-east-2, x64 ]
|
||||||
container:
|
container:
|
||||||
image: 369495373322.dkr.ecr.eu-central-1.amazonaws.com/build-tools:pinned
|
image: neondatabase/build-tools:pinned
|
||||||
|
credentials:
|
||||||
|
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
||||||
options: --init
|
options: --init
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Configure AWS credentials
|
||||||
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
|
with:
|
||||||
|
aws-region: eu-central-1
|
||||||
|
role-to-assume: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
|
||||||
|
role-duration-seconds: 18000 # 5 hours
|
||||||
|
|
||||||
- name: Download Neon artifact
|
- name: Download Neon artifact
|
||||||
uses: ./.github/actions/download
|
uses: ./.github/actions/download
|
||||||
with:
|
with:
|
||||||
@@ -714,6 +751,10 @@ jobs:
|
|||||||
#
|
#
|
||||||
# *_TPCH_S10_CONNSTR: DB generated with scale factor 10 (~10 GB)
|
# *_TPCH_S10_CONNSTR: DB generated with scale factor 10 (~10 GB)
|
||||||
if: ${{ !cancelled() && (github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null) }}
|
if: ${{ !cancelled() && (github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null) }}
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
statuses: write
|
||||||
|
id-token: write # aws-actions/configure-aws-credentials
|
||||||
needs: [ generate-matrices, clickbench-compare, prepare_AWS_RDS_databases ]
|
needs: [ generate-matrices, clickbench-compare, prepare_AWS_RDS_databases ]
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
@@ -731,12 +772,22 @@ jobs:
|
|||||||
|
|
||||||
runs-on: [ self-hosted, us-east-2, x64 ]
|
runs-on: [ self-hosted, us-east-2, x64 ]
|
||||||
container:
|
container:
|
||||||
image: 369495373322.dkr.ecr.eu-central-1.amazonaws.com/build-tools:pinned
|
image: neondatabase/build-tools:pinned
|
||||||
|
credentials:
|
||||||
|
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
||||||
options: --init
|
options: --init
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Configure AWS credentials
|
||||||
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
|
with:
|
||||||
|
aws-region: eu-central-1
|
||||||
|
role-to-assume: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
|
||||||
|
role-duration-seconds: 18000 # 5 hours
|
||||||
|
|
||||||
- name: Download Neon artifact
|
- name: Download Neon artifact
|
||||||
uses: ./.github/actions/download
|
uses: ./.github/actions/download
|
||||||
with:
|
with:
|
||||||
@@ -806,6 +857,10 @@ jobs:
|
|||||||
|
|
||||||
user-examples-compare:
|
user-examples-compare:
|
||||||
if: ${{ !cancelled() && (github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null) }}
|
if: ${{ !cancelled() && (github.event.inputs.run_only_pgvector_tests == 'false' || github.event.inputs.run_only_pgvector_tests == null) }}
|
||||||
|
permissions:
|
||||||
|
contents: write
|
||||||
|
statuses: write
|
||||||
|
id-token: write # aws-actions/configure-aws-credentials
|
||||||
needs: [ generate-matrices, tpch-compare, prepare_AWS_RDS_databases ]
|
needs: [ generate-matrices, tpch-compare, prepare_AWS_RDS_databases ]
|
||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
@@ -822,12 +877,22 @@ jobs:
|
|||||||
|
|
||||||
runs-on: [ self-hosted, us-east-2, x64 ]
|
runs-on: [ self-hosted, us-east-2, x64 ]
|
||||||
container:
|
container:
|
||||||
image: 369495373322.dkr.ecr.eu-central-1.amazonaws.com/build-tools:pinned
|
image: neondatabase/build-tools:pinned
|
||||||
|
credentials:
|
||||||
|
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
||||||
options: --init
|
options: --init
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Configure AWS credentials
|
||||||
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
|
with:
|
||||||
|
aws-region: eu-central-1
|
||||||
|
role-to-assume: ${{ vars.DEV_AWS_OIDC_ROLE_ARN }}
|
||||||
|
role-duration-seconds: 18000 # 5 hours
|
||||||
|
|
||||||
- name: Download Neon artifact
|
- name: Download Neon artifact
|
||||||
uses: ./.github/actions/download
|
uses: ./.github/actions/download
|
||||||
with:
|
with:
|
||||||
|
|||||||
44
.github/workflows/build-build-tools-image.yml
vendored
44
.github/workflows/build-build-tools-image.yml
vendored
@@ -19,9 +19,16 @@ defaults:
|
|||||||
run:
|
run:
|
||||||
shell: bash -euo pipefail {0}
|
shell: bash -euo pipefail {0}
|
||||||
|
|
||||||
concurrency:
|
# The initial idea was to prevent the waste of resources by not re-building the `build-tools` image
|
||||||
group: build-build-tools-image-${{ inputs.image-tag }}
|
# for the same tag in parallel workflow runs, and queue them to be skipped once we have
|
||||||
cancel-in-progress: false
|
# the first image pushed to Docker registry, but GitHub's concurrency mechanism is not working as expected.
|
||||||
|
# GitHub can't have more than 1 job in a queue and removes the previous one, it causes failures if the dependent jobs.
|
||||||
|
#
|
||||||
|
# Ref https://github.com/orgs/community/discussions/41518
|
||||||
|
#
|
||||||
|
# concurrency:
|
||||||
|
# group: build-build-tools-image-${{ inputs.image-tag }}
|
||||||
|
# cancel-in-progress: false
|
||||||
|
|
||||||
# No permission for GITHUB_TOKEN by default; the **minimal required** set of permissions should be granted in each job.
|
# No permission for GITHUB_TOKEN by default; the **minimal required** set of permissions should be granted in each job.
|
||||||
permissions: {}
|
permissions: {}
|
||||||
@@ -36,6 +43,7 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
|
debian-version: [ bullseye, bookworm ]
|
||||||
arch: [ x64, arm64 ]
|
arch: [ x64, arm64 ]
|
||||||
|
|
||||||
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'large-arm64' || 'large')) }}
|
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'large-arm64' || 'large')) }}
|
||||||
@@ -74,22 +82,22 @@ jobs:
|
|||||||
|
|
||||||
- uses: docker/build-push-action@v6
|
- uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
|
file: Dockerfile.build-tools
|
||||||
context: .
|
context: .
|
||||||
provenance: false
|
provenance: false
|
||||||
push: true
|
push: true
|
||||||
pull: true
|
pull: true
|
||||||
file: Dockerfile.build-tools
|
build-args: |
|
||||||
cache-from: type=registry,ref=cache.neon.build/build-tools:cache-${{ matrix.arch }}
|
DEBIAN_VERSION=${{ matrix.debian-version }}
|
||||||
cache-to: ${{ github.ref_name == 'main' && format('type=registry,ref=cache.neon.build/build-tools:cache-{0},mode=max', matrix.arch) || '' }}
|
cache-from: type=registry,ref=cache.neon.build/build-tools:cache-${{ matrix.debian-version }}-${{ matrix.arch }}
|
||||||
tags: neondatabase/build-tools:${{ inputs.image-tag }}-${{ matrix.arch }}
|
cache-to: ${{ github.ref_name == 'main' && format('type=registry,ref=cache.neon.build/build-tools:cache-{0}-{1},mode=max', matrix.debian-version, matrix.arch) || '' }}
|
||||||
|
tags: |
|
||||||
|
neondatabase/build-tools:${{ inputs.image-tag }}-${{ matrix.debian-version }}-${{ matrix.arch }}
|
||||||
|
|
||||||
merge-images:
|
merge-images:
|
||||||
needs: [ build-image ]
|
needs: [ build-image ]
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
env:
|
|
||||||
IMAGE_TAG: ${{ inputs.image-tag }}
|
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: docker/login-action@v3
|
- uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
@@ -97,7 +105,17 @@ jobs:
|
|||||||
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
||||||
|
|
||||||
- name: Create multi-arch image
|
- name: Create multi-arch image
|
||||||
|
env:
|
||||||
|
DEFAULT_DEBIAN_VERSION: bullseye
|
||||||
|
IMAGE_TAG: ${{ inputs.image-tag }}
|
||||||
run: |
|
run: |
|
||||||
docker buildx imagetools create -t neondatabase/build-tools:${IMAGE_TAG} \
|
for debian_version in bullseye bookworm; do
|
||||||
neondatabase/build-tools:${IMAGE_TAG}-x64 \
|
tags=("-t" "neondatabase/build-tools:${IMAGE_TAG}-${debian_version}")
|
||||||
neondatabase/build-tools:${IMAGE_TAG}-arm64
|
if [ "${debian_version}" == "${DEFAULT_DEBIAN_VERSION}" ]; then
|
||||||
|
tags+=("-t" "neondatabase/build-tools:${IMAGE_TAG}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker buildx imagetools create "${tags[@]}" \
|
||||||
|
neondatabase/build-tools:${IMAGE_TAG}-${debian_version}-x64 \
|
||||||
|
neondatabase/build-tools:${IMAGE_TAG}-${debian_version}-arm64
|
||||||
|
done
|
||||||
|
|||||||
269
.github/workflows/build_and_test.yml
vendored
269
.github/workflows/build_and_test.yml
vendored
@@ -92,7 +92,7 @@ jobs:
|
|||||||
needs: [ check-permissions, build-build-tools-image ]
|
needs: [ check-permissions, build-build-tools-image ]
|
||||||
runs-on: [ self-hosted, small ]
|
runs-on: [ self-hosted, small ]
|
||||||
container:
|
container:
|
||||||
image: ${{ needs.build-build-tools-image.outputs.image }}
|
image: ${{ needs.build-build-tools-image.outputs.image }}-bookworm
|
||||||
credentials:
|
credentials:
|
||||||
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
||||||
@@ -106,7 +106,7 @@ jobs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/pypoetry/virtualenvs
|
path: ~/.cache/pypoetry/virtualenvs
|
||||||
key: v2-${{ runner.os }}-${{ runner.arch }}-python-deps-${{ hashFiles('poetry.lock') }}
|
key: v2-${{ runner.os }}-${{ runner.arch }}-python-deps-bookworm-${{ hashFiles('poetry.lock') }}
|
||||||
|
|
||||||
- name: Install Python deps
|
- name: Install Python deps
|
||||||
run: ./scripts/pysync
|
run: ./scripts/pysync
|
||||||
@@ -120,6 +120,77 @@ jobs:
|
|||||||
- name: Run mypy to check types
|
- name: Run mypy to check types
|
||||||
run: poetry run mypy .
|
run: poetry run mypy .
|
||||||
|
|
||||||
|
check-codestyle-jsonnet:
|
||||||
|
needs: [ check-permissions, build-build-tools-image ]
|
||||||
|
runs-on: [ self-hosted, small ]
|
||||||
|
container:
|
||||||
|
image: ${{ needs.build-build-tools-image.outputs.image }}
|
||||||
|
credentials:
|
||||||
|
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
||||||
|
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
||||||
|
options: --init
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Check Jsonnet code formatting
|
||||||
|
run: |
|
||||||
|
make -C compute jsonnetfmt-test
|
||||||
|
|
||||||
|
# Check that the vendor/postgres-* submodules point to the
|
||||||
|
# corresponding REL_*_STABLE_neon branches.
|
||||||
|
check-submodules:
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- uses: dorny/paths-filter@v3
|
||||||
|
id: check-if-submodules-changed
|
||||||
|
with:
|
||||||
|
filters: |
|
||||||
|
vendor:
|
||||||
|
- 'vendor/**'
|
||||||
|
|
||||||
|
- name: Check vendor/postgres-v14 submodule reference
|
||||||
|
if: steps.check-if-submodules-changed.outputs.vendor == 'true'
|
||||||
|
uses: jtmullen/submodule-branch-check-action@v1
|
||||||
|
with:
|
||||||
|
path: "vendor/postgres-v14"
|
||||||
|
fetch_depth: "50"
|
||||||
|
sub_fetch_depth: "50"
|
||||||
|
pass_if_unchanged: true
|
||||||
|
|
||||||
|
- name: Check vendor/postgres-v15 submodule reference
|
||||||
|
if: steps.check-if-submodules-changed.outputs.vendor == 'true'
|
||||||
|
uses: jtmullen/submodule-branch-check-action@v1
|
||||||
|
with:
|
||||||
|
path: "vendor/postgres-v15"
|
||||||
|
fetch_depth: "50"
|
||||||
|
sub_fetch_depth: "50"
|
||||||
|
pass_if_unchanged: true
|
||||||
|
|
||||||
|
- name: Check vendor/postgres-v16 submodule reference
|
||||||
|
if: steps.check-if-submodules-changed.outputs.vendor == 'true'
|
||||||
|
uses: jtmullen/submodule-branch-check-action@v1
|
||||||
|
with:
|
||||||
|
path: "vendor/postgres-v16"
|
||||||
|
fetch_depth: "50"
|
||||||
|
sub_fetch_depth: "50"
|
||||||
|
pass_if_unchanged: true
|
||||||
|
|
||||||
|
- name: Check vendor/postgres-v17 submodule reference
|
||||||
|
if: steps.check-if-submodules-changed.outputs.vendor == 'true'
|
||||||
|
uses: jtmullen/submodule-branch-check-action@v1
|
||||||
|
with:
|
||||||
|
path: "vendor/postgres-v17"
|
||||||
|
fetch_depth: "50"
|
||||||
|
sub_fetch_depth: "50"
|
||||||
|
pass_if_unchanged: true
|
||||||
|
|
||||||
check-codestyle-rust:
|
check-codestyle-rust:
|
||||||
needs: [ check-permissions, build-build-tools-image ]
|
needs: [ check-permissions, build-build-tools-image ]
|
||||||
strategy:
|
strategy:
|
||||||
@@ -128,7 +199,7 @@ jobs:
|
|||||||
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'small-arm64' || 'small')) }}
|
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'small-arm64' || 'small')) }}
|
||||||
|
|
||||||
container:
|
container:
|
||||||
image: ${{ needs.build-build-tools-image.outputs.image }}
|
image: ${{ needs.build-build-tools-image.outputs.image }}-bookworm
|
||||||
credentials:
|
credentials:
|
||||||
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
||||||
@@ -140,16 +211,15 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
|
|
||||||
# Disabled for now
|
- name: Cache cargo deps
|
||||||
# - name: Restore cargo deps cache
|
uses: actions/cache@v4
|
||||||
# id: cache_cargo
|
with:
|
||||||
# uses: actions/cache@v4
|
path: |
|
||||||
# with:
|
~/.cargo/registry
|
||||||
# path: |
|
!~/.cargo/registry/src
|
||||||
# !~/.cargo/registry/src
|
~/.cargo/git
|
||||||
# ~/.cargo/git/
|
target
|
||||||
# target/
|
key: v1-${{ runner.os }}-${{ runner.arch }}-cargo-${{ hashFiles('./Cargo.lock') }}-${{ hashFiles('./rust-toolchain.toml') }}-rust
|
||||||
# key: v1-${{ runner.os }}-${{ runner.arch }}-cargo-clippy-${{ hashFiles('rust-toolchain.toml') }}-${{ hashFiles('Cargo.lock') }}
|
|
||||||
|
|
||||||
# Some of our rust modules use FFI and need those to be checked
|
# Some of our rust modules use FFI and need those to be checked
|
||||||
- name: Get postgres headers
|
- name: Get postgres headers
|
||||||
@@ -159,6 +229,10 @@ jobs:
|
|||||||
# This will catch compiler & clippy warnings in all feature combinations.
|
# This will catch compiler & clippy warnings in all feature combinations.
|
||||||
# TODO: use cargo hack for build and test as well, but, that's quite expensive.
|
# TODO: use cargo hack for build and test as well, but, that's quite expensive.
|
||||||
# NB: keep clippy args in sync with ./run_clippy.sh
|
# NB: keep clippy args in sync with ./run_clippy.sh
|
||||||
|
#
|
||||||
|
# The only difference between "clippy --debug" and "clippy --release" is that in --release mode,
|
||||||
|
# #[cfg(debug_assertions)] blocks are not built. It's not worth building everything for second
|
||||||
|
# time just for that, so skip "clippy --release".
|
||||||
- run: |
|
- run: |
|
||||||
CLIPPY_COMMON_ARGS="$( source .neon_clippy_args; echo "$CLIPPY_COMMON_ARGS")"
|
CLIPPY_COMMON_ARGS="$( source .neon_clippy_args; echo "$CLIPPY_COMMON_ARGS")"
|
||||||
if [ "$CLIPPY_COMMON_ARGS" = "" ]; then
|
if [ "$CLIPPY_COMMON_ARGS" = "" ]; then
|
||||||
@@ -168,8 +242,6 @@ jobs:
|
|||||||
echo "CLIPPY_COMMON_ARGS=${CLIPPY_COMMON_ARGS}" >> $GITHUB_ENV
|
echo "CLIPPY_COMMON_ARGS=${CLIPPY_COMMON_ARGS}" >> $GITHUB_ENV
|
||||||
- name: Run cargo clippy (debug)
|
- name: Run cargo clippy (debug)
|
||||||
run: cargo hack --feature-powerset clippy $CLIPPY_COMMON_ARGS
|
run: cargo hack --feature-powerset clippy $CLIPPY_COMMON_ARGS
|
||||||
- name: Run cargo clippy (release)
|
|
||||||
run: cargo hack --feature-powerset clippy --release $CLIPPY_COMMON_ARGS
|
|
||||||
|
|
||||||
- name: Check documentation generation
|
- name: Check documentation generation
|
||||||
run: cargo doc --workspace --no-deps --document-private-items
|
run: cargo doc --workspace --no-deps --document-private-items
|
||||||
@@ -207,7 +279,7 @@ jobs:
|
|||||||
uses: ./.github/workflows/_build-and-test-locally.yml
|
uses: ./.github/workflows/_build-and-test-locally.yml
|
||||||
with:
|
with:
|
||||||
arch: ${{ matrix.arch }}
|
arch: ${{ matrix.arch }}
|
||||||
build-tools-image: ${{ needs.build-build-tools-image.outputs.image }}
|
build-tools-image: ${{ needs.build-build-tools-image.outputs.image }}-bookworm
|
||||||
build-tag: ${{ needs.tag.outputs.build-tag }}
|
build-tag: ${{ needs.tag.outputs.build-tag }}
|
||||||
build-type: ${{ matrix.build-type }}
|
build-type: ${{ matrix.build-type }}
|
||||||
# Run tests on all Postgres versions in release builds and only on the latest version in debug builds
|
# Run tests on all Postgres versions in release builds and only on the latest version in debug builds
|
||||||
@@ -222,7 +294,7 @@ jobs:
|
|||||||
needs: [ check-permissions, build-build-tools-image ]
|
needs: [ check-permissions, build-build-tools-image ]
|
||||||
runs-on: [ self-hosted, small ]
|
runs-on: [ self-hosted, small ]
|
||||||
container:
|
container:
|
||||||
image: ${{ needs.build-build-tools-image.outputs.image }}
|
image: ${{ needs.build-build-tools-image.outputs.image }}-bookworm
|
||||||
credentials:
|
credentials:
|
||||||
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
||||||
@@ -235,7 +307,7 @@ jobs:
|
|||||||
uses: actions/cache@v4
|
uses: actions/cache@v4
|
||||||
with:
|
with:
|
||||||
path: ~/.cache/pypoetry/virtualenvs
|
path: ~/.cache/pypoetry/virtualenvs
|
||||||
key: v1-${{ runner.os }}-${{ runner.arch }}-python-deps-${{ hashFiles('poetry.lock') }}
|
key: v2-${{ runner.os }}-${{ runner.arch }}-python-deps-bookworm-${{ hashFiles('poetry.lock') }}
|
||||||
|
|
||||||
- name: Install Python deps
|
- name: Install Python deps
|
||||||
run: ./scripts/pysync
|
run: ./scripts/pysync
|
||||||
@@ -255,7 +327,7 @@ jobs:
|
|||||||
needs: [ check-permissions, build-and-test-locally, build-build-tools-image, get-benchmarks-durations ]
|
needs: [ check-permissions, build-and-test-locally, build-build-tools-image, get-benchmarks-durations ]
|
||||||
runs-on: [ self-hosted, small ]
|
runs-on: [ self-hosted, small ]
|
||||||
container:
|
container:
|
||||||
image: ${{ needs.build-build-tools-image.outputs.image }}
|
image: ${{ needs.build-build-tools-image.outputs.image }}-bookworm
|
||||||
credentials:
|
credentials:
|
||||||
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
||||||
@@ -286,7 +358,7 @@ jobs:
|
|||||||
PERF_TEST_RESULT_CONNSTR: "${{ secrets.PERF_TEST_RESULT_CONNSTR }}"
|
PERF_TEST_RESULT_CONNSTR: "${{ secrets.PERF_TEST_RESULT_CONNSTR }}"
|
||||||
TEST_RESULT_CONNSTR: "${{ secrets.REGRESS_TEST_RESULT_CONNSTR_NEW }}"
|
TEST_RESULT_CONNSTR: "${{ secrets.REGRESS_TEST_RESULT_CONNSTR_NEW }}"
|
||||||
PAGESERVER_VIRTUAL_FILE_IO_ENGINE: tokio-epoll-uring
|
PAGESERVER_VIRTUAL_FILE_IO_ENGINE: tokio-epoll-uring
|
||||||
SYNC_AFTER_EACH_TEST: true
|
SYNC_BETWEEN_TESTS: true
|
||||||
# XXX: no coverage data handling here, since benchmarks are run on release builds,
|
# XXX: no coverage data handling here, since benchmarks are run on release builds,
|
||||||
# while coverage is currently collected for the debug ones
|
# while coverage is currently collected for the debug ones
|
||||||
|
|
||||||
@@ -313,7 +385,7 @@ jobs:
|
|||||||
|
|
||||||
runs-on: [ self-hosted, small ]
|
runs-on: [ self-hosted, small ]
|
||||||
container:
|
container:
|
||||||
image: ${{ needs.build-build-tools-image.outputs.image }}
|
image: ${{ needs.build-build-tools-image.outputs.image }}-bookworm
|
||||||
credentials:
|
credentials:
|
||||||
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
||||||
@@ -361,7 +433,7 @@ jobs:
|
|||||||
needs: [ check-permissions, build-build-tools-image, build-and-test-locally ]
|
needs: [ check-permissions, build-build-tools-image, build-and-test-locally ]
|
||||||
runs-on: [ self-hosted, small ]
|
runs-on: [ self-hosted, small ]
|
||||||
container:
|
container:
|
||||||
image: ${{ needs.build-build-tools-image.outputs.image }}
|
image: ${{ needs.build-build-tools-image.outputs.image }}-bookworm
|
||||||
credentials:
|
credentials:
|
||||||
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
||||||
@@ -505,15 +577,16 @@ jobs:
|
|||||||
ADDITIONAL_RUSTFLAGS=${{ matrix.arch == 'arm64' && '-Ctarget-feature=+lse -Ctarget-cpu=neoverse-n1' || '' }}
|
ADDITIONAL_RUSTFLAGS=${{ matrix.arch == 'arm64' && '-Ctarget-feature=+lse -Ctarget-cpu=neoverse-n1' || '' }}
|
||||||
GIT_VERSION=${{ github.event.pull_request.head.sha || github.sha }}
|
GIT_VERSION=${{ github.event.pull_request.head.sha || github.sha }}
|
||||||
BUILD_TAG=${{ needs.tag.outputs.build-tag }}
|
BUILD_TAG=${{ needs.tag.outputs.build-tag }}
|
||||||
TAG=${{ needs.build-build-tools-image.outputs.image-tag }}
|
TAG=${{ needs.build-build-tools-image.outputs.image-tag }}-bookworm
|
||||||
|
DEBIAN_VERSION=bookworm
|
||||||
provenance: false
|
provenance: false
|
||||||
push: true
|
push: true
|
||||||
pull: true
|
pull: true
|
||||||
file: Dockerfile
|
file: Dockerfile
|
||||||
cache-from: type=registry,ref=cache.neon.build/neon:cache-${{ matrix.arch }}
|
cache-from: type=registry,ref=cache.neon.build/neon:cache-bookworm-${{ matrix.arch }}
|
||||||
cache-to: ${{ github.ref_name == 'main' && format('type=registry,ref=cache.neon.build/neon:cache-{0},mode=max', matrix.arch) || '' }}
|
cache-to: ${{ github.ref_name == 'main' && format('type=registry,ref=cache.neon.build/neon:cache-{0}-{1},mode=max', 'bookworm', matrix.arch) || '' }}
|
||||||
tags: |
|
tags: |
|
||||||
neondatabase/neon:${{ needs.tag.outputs.build-tag }}-${{ matrix.arch }}
|
neondatabase/neon:${{ needs.tag.outputs.build-tag }}-bookworm-${{ matrix.arch }}
|
||||||
|
|
||||||
neon-image:
|
neon-image:
|
||||||
needs: [ neon-image-arch, tag ]
|
needs: [ neon-image-arch, tag ]
|
||||||
@@ -528,8 +601,9 @@ jobs:
|
|||||||
- name: Create multi-arch image
|
- name: Create multi-arch image
|
||||||
run: |
|
run: |
|
||||||
docker buildx imagetools create -t neondatabase/neon:${{ needs.tag.outputs.build-tag }} \
|
docker buildx imagetools create -t neondatabase/neon:${{ needs.tag.outputs.build-tag }} \
|
||||||
neondatabase/neon:${{ needs.tag.outputs.build-tag }}-x64 \
|
-t neondatabase/neon:${{ needs.tag.outputs.build-tag }}-bookworm \
|
||||||
neondatabase/neon:${{ needs.tag.outputs.build-tag }}-arm64
|
neondatabase/neon:${{ needs.tag.outputs.build-tag }}-bookworm-x64 \
|
||||||
|
neondatabase/neon:${{ needs.tag.outputs.build-tag }}-bookworm-arm64
|
||||||
|
|
||||||
- uses: docker/login-action@v3
|
- uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
@@ -547,7 +621,19 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
version: [ v14, v15, v16, v17 ]
|
version:
|
||||||
|
# Much data was already generated on old PG versions with bullseye's
|
||||||
|
# libraries, the locales of which can cause data incompatibilities.
|
||||||
|
# However, new PG versions should be build on newer images,
|
||||||
|
# as that reduces the support burden of old and ancient distros.
|
||||||
|
- pg: v14
|
||||||
|
debian: bullseye
|
||||||
|
- pg: v15
|
||||||
|
debian: bullseye
|
||||||
|
- pg: v16
|
||||||
|
debian: bullseye
|
||||||
|
- pg: v17
|
||||||
|
debian: bookworm
|
||||||
arch: [ x64, arm64 ]
|
arch: [ x64, arm64 ]
|
||||||
|
|
||||||
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'large-arm64' || 'large')) }}
|
runs-on: ${{ fromJson(format('["self-hosted", "{0}"]', matrix.arch == 'arm64' && 'large-arm64' || 'large')) }}
|
||||||
@@ -590,41 +676,46 @@ jobs:
|
|||||||
context: .
|
context: .
|
||||||
build-args: |
|
build-args: |
|
||||||
GIT_VERSION=${{ github.event.pull_request.head.sha || github.sha }}
|
GIT_VERSION=${{ github.event.pull_request.head.sha || github.sha }}
|
||||||
PG_VERSION=${{ matrix.version }}
|
PG_VERSION=${{ matrix.version.pg }}
|
||||||
BUILD_TAG=${{ needs.tag.outputs.build-tag }}
|
BUILD_TAG=${{ needs.tag.outputs.build-tag }}
|
||||||
TAG=${{ needs.build-build-tools-image.outputs.image-tag }}
|
TAG=${{ needs.build-build-tools-image.outputs.image-tag }}-${{ matrix.version.debian }}
|
||||||
|
DEBIAN_VERSION=${{ matrix.version.debian }}
|
||||||
provenance: false
|
provenance: false
|
||||||
push: true
|
push: true
|
||||||
pull: true
|
pull: true
|
||||||
file: Dockerfile.compute-node
|
file: compute/Dockerfile.compute-node
|
||||||
cache-from: type=registry,ref=cache.neon.build/compute-node-${{ matrix.version }}:cache-${{ matrix.arch }}
|
cache-from: type=registry,ref=cache.neon.build/compute-node-${{ matrix.version.pg }}:cache-${{ matrix.version.debian }}-${{ matrix.arch }}
|
||||||
cache-to: ${{ github.ref_name == 'main' && format('type=registry,ref=cache.neon.build/compute-node-{0}:cache-{1},mode=max', matrix.version, matrix.arch) || '' }}
|
cache-to: ${{ github.ref_name == 'main' && format('type=registry,ref=cache.neon.build/compute-node-{0}:cache-{1}-{2},mode=max', matrix.version.pg, matrix.version.debian, matrix.arch) || '' }}
|
||||||
tags: |
|
tags: |
|
||||||
neondatabase/compute-node-${{ matrix.version }}:${{ needs.tag.outputs.build-tag }}-${{ matrix.arch }}
|
neondatabase/compute-node-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }}-${{ matrix.version.debian }}-${{ matrix.arch }}
|
||||||
|
|
||||||
- name: Build neon extensions test image
|
- name: Build neon extensions test image
|
||||||
if: matrix.version == 'v16'
|
if: matrix.version.pg == 'v16'
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
context: .
|
context: .
|
||||||
build-args: |
|
build-args: |
|
||||||
GIT_VERSION=${{ github.event.pull_request.head.sha || github.sha }}
|
GIT_VERSION=${{ github.event.pull_request.head.sha || github.sha }}
|
||||||
PG_VERSION=${{ matrix.version }}
|
PG_VERSION=${{ matrix.version.pg }}
|
||||||
BUILD_TAG=${{ needs.tag.outputs.build-tag }}
|
BUILD_TAG=${{ needs.tag.outputs.build-tag }}
|
||||||
TAG=${{ needs.build-build-tools-image.outputs.image-tag }}
|
TAG=${{ needs.build-build-tools-image.outputs.image-tag }}-${{ matrix.version.debian }}
|
||||||
|
DEBIAN_VERSION=${{ matrix.version.debian }}
|
||||||
provenance: false
|
provenance: false
|
||||||
push: true
|
push: true
|
||||||
pull: true
|
pull: true
|
||||||
file: Dockerfile.compute-node
|
file: compute/Dockerfile.compute-node
|
||||||
target: neon-pg-ext-test
|
target: neon-pg-ext-test
|
||||||
cache-from: type=registry,ref=cache.neon.build/neon-test-extensions-${{ matrix.version }}:cache-${{ matrix.arch }}
|
cache-from: type=registry,ref=cache.neon.build/neon-test-extensions-${{ matrix.version.pg }}:cache-${{ matrix.version.debian }}-${{ matrix.arch }}
|
||||||
cache-to: ${{ github.ref_name == 'main' && format('type=registry,ref=cache.neon.build/neon-test-extensions-{0}:cache-{1},mode=max', matrix.version, matrix.arch) || '' }}
|
cache-to: ${{ github.ref_name == 'main' && format('type=registry,ref=cache.neon.build/neon-test-extensions-{0}:cache-{1}-{2},mode=max', matrix.version.pg, matrix.version.debian, matrix.arch) || '' }}
|
||||||
tags: |
|
tags: |
|
||||||
neondatabase/neon-test-extensions-${{ matrix.version }}:${{needs.tag.outputs.build-tag}}-${{ matrix.arch }}
|
neondatabase/neon-test-extensions-${{ matrix.version.pg }}:${{needs.tag.outputs.build-tag}}-${{ matrix.version.debian }}-${{ matrix.arch }}
|
||||||
|
|
||||||
- name: Build compute-tools image
|
- name: Build compute-tools image
|
||||||
# compute-tools are Postgres independent, so build it only once
|
# compute-tools are Postgres independent, so build it only once
|
||||||
if: matrix.version == 'v17'
|
# We pick 16, because that builds on debian 11 with older glibc (and is
|
||||||
|
# thus compatible with newer glibc), rather than 17 on Debian 12, as
|
||||||
|
# that isn't guaranteed to be compatible with Debian 11
|
||||||
|
if: matrix.version.pg == 'v16'
|
||||||
uses: docker/build-push-action@v6
|
uses: docker/build-push-action@v6
|
||||||
with:
|
with:
|
||||||
target: compute-tools-image
|
target: compute-tools-image
|
||||||
@@ -632,13 +723,16 @@ jobs:
|
|||||||
build-args: |
|
build-args: |
|
||||||
GIT_VERSION=${{ github.event.pull_request.head.sha || github.sha }}
|
GIT_VERSION=${{ github.event.pull_request.head.sha || github.sha }}
|
||||||
BUILD_TAG=${{ needs.tag.outputs.build-tag }}
|
BUILD_TAG=${{ needs.tag.outputs.build-tag }}
|
||||||
TAG=${{ needs.build-build-tools-image.outputs.image-tag }}
|
TAG=${{ needs.build-build-tools-image.outputs.image-tag }}-${{ matrix.version.debian }}
|
||||||
|
DEBIAN_VERSION=${{ matrix.version.debian }}
|
||||||
provenance: false
|
provenance: false
|
||||||
push: true
|
push: true
|
||||||
pull: true
|
pull: true
|
||||||
file: Dockerfile.compute-node
|
file: compute/Dockerfile.compute-node
|
||||||
|
cache-from: type=registry,ref=cache.neon.build/neon-test-extensions-${{ matrix.version.pg }}:cache-${{ matrix.version.debian }}-${{ matrix.arch }}
|
||||||
|
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) || '' }}
|
||||||
tags: |
|
tags: |
|
||||||
neondatabase/compute-tools:${{ needs.tag.outputs.build-tag }}-${{ matrix.arch }}
|
neondatabase/compute-tools:${{ needs.tag.outputs.build-tag }}-${{ matrix.version.debian }}-${{ matrix.arch }}
|
||||||
|
|
||||||
compute-node-image:
|
compute-node-image:
|
||||||
needs: [ compute-node-image-arch, tag ]
|
needs: [ compute-node-image-arch, tag ]
|
||||||
@@ -646,7 +740,16 @@ jobs:
|
|||||||
|
|
||||||
strategy:
|
strategy:
|
||||||
matrix:
|
matrix:
|
||||||
version: [ v14, v15, v16, v17 ]
|
version:
|
||||||
|
# see the comment for `compute-node-image-arch` job
|
||||||
|
- pg: v14
|
||||||
|
debian: bullseye
|
||||||
|
- pg: v15
|
||||||
|
debian: bullseye
|
||||||
|
- pg: v16
|
||||||
|
debian: bullseye
|
||||||
|
- pg: v17
|
||||||
|
debian: bookworm
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: docker/login-action@v3
|
- uses: docker/login-action@v3
|
||||||
@@ -656,23 +759,26 @@ jobs:
|
|||||||
|
|
||||||
- name: Create multi-arch compute-node image
|
- name: Create multi-arch compute-node image
|
||||||
run: |
|
run: |
|
||||||
docker buildx imagetools create -t neondatabase/compute-node-${{ matrix.version }}:${{ needs.tag.outputs.build-tag }} \
|
docker buildx imagetools create -t neondatabase/compute-node-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }} \
|
||||||
neondatabase/compute-node-${{ matrix.version }}:${{ needs.tag.outputs.build-tag }}-x64 \
|
-t neondatabase/compute-node-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }}-${{ matrix.version.debian }} \
|
||||||
neondatabase/compute-node-${{ matrix.version }}:${{ needs.tag.outputs.build-tag }}-arm64
|
neondatabase/compute-node-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }}-${{ matrix.version.debian }}-x64 \
|
||||||
|
neondatabase/compute-node-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }}-${{ matrix.version.debian }}-arm64
|
||||||
|
|
||||||
- name: Create multi-arch neon-test-extensions image
|
- name: Create multi-arch neon-test-extensions image
|
||||||
if: matrix.version == 'v16'
|
if: matrix.version.pg == 'v16'
|
||||||
run: |
|
run: |
|
||||||
docker buildx imagetools create -t neondatabase/neon-test-extensions-${{ matrix.version }}:${{ needs.tag.outputs.build-tag }} \
|
docker buildx imagetools create -t neondatabase/neon-test-extensions-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }} \
|
||||||
neondatabase/neon-test-extensions-${{ matrix.version }}:${{ needs.tag.outputs.build-tag }}-x64 \
|
-t neondatabase/neon-test-extensions-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }}-${{ matrix.version.debian }} \
|
||||||
neondatabase/neon-test-extensions-${{ matrix.version }}:${{ needs.tag.outputs.build-tag }}-arm64
|
neondatabase/neon-test-extensions-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }}-${{ matrix.version.debian }}-x64 \
|
||||||
|
neondatabase/neon-test-extensions-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }}-${{ matrix.version.debian }}-arm64
|
||||||
|
|
||||||
- name: Create multi-arch compute-tools image
|
- name: Create multi-arch compute-tools image
|
||||||
if: matrix.version == 'v17'
|
if: matrix.version.pg == 'v16'
|
||||||
run: |
|
run: |
|
||||||
docker buildx imagetools create -t neondatabase/compute-tools:${{ needs.tag.outputs.build-tag }} \
|
docker buildx imagetools create -t neondatabase/compute-tools:${{ needs.tag.outputs.build-tag }} \
|
||||||
neondatabase/compute-tools:${{ needs.tag.outputs.build-tag }}-x64 \
|
-t neondatabase/compute-tools:${{ needs.tag.outputs.build-tag }}-${{ matrix.version.debian }} \
|
||||||
neondatabase/compute-tools:${{ needs.tag.outputs.build-tag }}-arm64
|
neondatabase/compute-tools:${{ needs.tag.outputs.build-tag }}-${{ matrix.version.debian }}-x64 \
|
||||||
|
neondatabase/compute-tools:${{ needs.tag.outputs.build-tag }}-${{ matrix.version.debian }}-arm64
|
||||||
|
|
||||||
- uses: docker/login-action@v3
|
- uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
@@ -680,13 +786,13 @@ jobs:
|
|||||||
username: ${{ secrets.AWS_ACCESS_KEY_DEV }}
|
username: ${{ secrets.AWS_ACCESS_KEY_DEV }}
|
||||||
password: ${{ secrets.AWS_SECRET_KEY_DEV }}
|
password: ${{ secrets.AWS_SECRET_KEY_DEV }}
|
||||||
|
|
||||||
- name: Push multi-arch compute-node-${{ matrix.version }} image to ECR
|
- name: Push multi-arch compute-node-${{ matrix.version.pg }} image to ECR
|
||||||
run: |
|
run: |
|
||||||
docker buildx imagetools create -t 369495373322.dkr.ecr.eu-central-1.amazonaws.com/compute-node-${{ matrix.version }}:${{ needs.tag.outputs.build-tag }} \
|
docker buildx imagetools create -t 369495373322.dkr.ecr.eu-central-1.amazonaws.com/compute-node-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }} \
|
||||||
neondatabase/compute-node-${{ matrix.version }}:${{ needs.tag.outputs.build-tag }}
|
neondatabase/compute-node-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }}
|
||||||
|
|
||||||
- name: Push multi-arch compute-tools image to ECR
|
- name: Push multi-arch compute-tools image to ECR
|
||||||
if: matrix.version == 'v17'
|
if: matrix.version.pg == 'v16'
|
||||||
run: |
|
run: |
|
||||||
docker buildx imagetools create -t 369495373322.dkr.ecr.eu-central-1.amazonaws.com/compute-tools:${{ needs.tag.outputs.build-tag }} \
|
docker buildx imagetools create -t 369495373322.dkr.ecr.eu-central-1.amazonaws.com/compute-tools:${{ needs.tag.outputs.build-tag }} \
|
||||||
neondatabase/compute-tools:${{ needs.tag.outputs.build-tag }}
|
neondatabase/compute-tools:${{ needs.tag.outputs.build-tag }}
|
||||||
@@ -697,9 +803,18 @@ jobs:
|
|||||||
strategy:
|
strategy:
|
||||||
fail-fast: false
|
fail-fast: false
|
||||||
matrix:
|
matrix:
|
||||||
version: [ v14, v15, v16, v17 ]
|
version:
|
||||||
|
# see the comment for `compute-node-image-arch` job
|
||||||
|
- pg: v14
|
||||||
|
debian: bullseye
|
||||||
|
- pg: v15
|
||||||
|
debian: bullseye
|
||||||
|
- pg: v16
|
||||||
|
debian: bullseye
|
||||||
|
- pg: v17
|
||||||
|
debian: bookworm
|
||||||
env:
|
env:
|
||||||
VM_BUILDER_VERSION: v0.29.3
|
VM_BUILDER_VERSION: v0.35.0
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
@@ -719,18 +834,18 @@ jobs:
|
|||||||
# it won't have the proper authentication (written at v0.6.0)
|
# it won't have the proper authentication (written at v0.6.0)
|
||||||
- name: Pulling compute-node image
|
- name: Pulling compute-node image
|
||||||
run: |
|
run: |
|
||||||
docker pull neondatabase/compute-node-${{ matrix.version }}:${{ needs.tag.outputs.build-tag }}
|
docker pull neondatabase/compute-node-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }}
|
||||||
|
|
||||||
- name: Build vm image
|
- name: Build vm image
|
||||||
run: |
|
run: |
|
||||||
./vm-builder \
|
./vm-builder \
|
||||||
-spec=vm-image-spec.yaml \
|
-spec=compute/vm-image-spec-${{ matrix.version.debian }}.yaml \
|
||||||
-src=neondatabase/compute-node-${{ matrix.version }}:${{ needs.tag.outputs.build-tag }} \
|
-src=neondatabase/compute-node-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }} \
|
||||||
-dst=neondatabase/vm-compute-node-${{ matrix.version }}:${{ needs.tag.outputs.build-tag }}
|
-dst=neondatabase/vm-compute-node-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }}
|
||||||
|
|
||||||
- name: Pushing vm-compute-node image
|
- name: Pushing vm-compute-node image
|
||||||
run: |
|
run: |
|
||||||
docker push neondatabase/vm-compute-node-${{ matrix.version }}:${{ needs.tag.outputs.build-tag }}
|
docker push neondatabase/vm-compute-node-${{ matrix.version.pg }}:${{ needs.tag.outputs.build-tag }}
|
||||||
|
|
||||||
test-images:
|
test-images:
|
||||||
needs: [ check-permissions, tag, neon-image, compute-node-image ]
|
needs: [ check-permissions, tag, neon-image, compute-node-image ]
|
||||||
@@ -788,6 +903,9 @@ jobs:
|
|||||||
needs: [ check-permissions, tag, test-images, vm-compute-node-image ]
|
needs: [ check-permissions, tag, test-images, vm-compute-node-image ]
|
||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
|
permissions:
|
||||||
|
id-token: write # for `aws-actions/configure-aws-credentials`
|
||||||
|
|
||||||
env:
|
env:
|
||||||
VERSIONS: v14 v15 v16 v17
|
VERSIONS: v14 v15 v16 v17
|
||||||
|
|
||||||
@@ -832,13 +950,19 @@ jobs:
|
|||||||
docker buildx imagetools create -t neondatabase/neon-test-extensions-v16:latest \
|
docker buildx imagetools create -t neondatabase/neon-test-extensions-v16:latest \
|
||||||
neondatabase/neon-test-extensions-v16:${{ needs.tag.outputs.build-tag }}
|
neondatabase/neon-test-extensions-v16:${{ needs.tag.outputs.build-tag }}
|
||||||
|
|
||||||
|
- name: Configure AWS-prod credentials
|
||||||
|
if: github.ref_name == 'release'|| github.ref_name == 'release-proxy'
|
||||||
|
uses: aws-actions/configure-aws-credentials@v4
|
||||||
|
with:
|
||||||
|
aws-region: eu-central-1
|
||||||
|
mask-aws-account-id: true
|
||||||
|
role-to-assume: ${{ secrets.PROD_GHA_OIDC_ROLE }}
|
||||||
|
|
||||||
- name: Login to prod ECR
|
- name: Login to prod ECR
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
if: github.ref_name == 'release'|| github.ref_name == 'release-proxy'
|
if: github.ref_name == 'release'|| github.ref_name == 'release-proxy'
|
||||||
with:
|
with:
|
||||||
registry: 093970136003.dkr.ecr.eu-central-1.amazonaws.com
|
registry: 093970136003.dkr.ecr.eu-central-1.amazonaws.com
|
||||||
username: ${{ secrets.PROD_GHA_RUNNER_LIMITED_AWS_ACCESS_KEY_ID }}
|
|
||||||
password: ${{ secrets.PROD_GHA_RUNNER_LIMITED_AWS_SECRET_ACCESS_KEY }}
|
|
||||||
|
|
||||||
- name: Copy all images to prod ECR
|
- name: Copy all images to prod ECR
|
||||||
if: github.ref_name == 'release'|| github.ref_name == 'release-proxy'
|
if: github.ref_name == 'release'|| github.ref_name == 'release-proxy'
|
||||||
@@ -1107,10 +1231,9 @@ jobs:
|
|||||||
|
|
||||||
files_to_promote+=("s3://${BUCKET}/${s3_key}")
|
files_to_promote+=("s3://${BUCKET}/${s3_key}")
|
||||||
|
|
||||||
# TODO Add v17
|
for pg_version in v14 v15 v16 v17; do
|
||||||
for pg_version in v14 v15 v16; do
|
|
||||||
# We run less tests for debug builds, so we don't need to promote them
|
# We run less tests for debug builds, so we don't need to promote them
|
||||||
if [ "${build_type}" == "debug" ] && { [ "${arch}" == "ARM64" ] || [ "${pg_version}" != "v16" ] ; }; then
|
if [ "${build_type}" == "debug" ] && { [ "${arch}" == "ARM64" ] || [ "${pg_version}" != "v17" ] ; }; then
|
||||||
continue
|
continue
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|||||||
102
.github/workflows/cloud-regress.yml
vendored
Normal file
102
.github/workflows/cloud-regress.yml
vendored
Normal file
@@ -0,0 +1,102 @@
|
|||||||
|
name: Cloud Regression Test
|
||||||
|
on:
|
||||||
|
schedule:
|
||||||
|
# * is a special character in YAML so you have to quote this string
|
||||||
|
# ┌───────────── minute (0 - 59)
|
||||||
|
# │ ┌───────────── hour (0 - 23)
|
||||||
|
# │ │ ┌───────────── day of the month (1 - 31)
|
||||||
|
# │ │ │ ┌───────────── month (1 - 12 or JAN-DEC)
|
||||||
|
# │ │ │ │ ┌───────────── day of the week (0 - 6 or SUN-SAT)
|
||||||
|
- cron: '45 1 * * *' # run once a day, timezone is utc
|
||||||
|
workflow_dispatch: # adds ability to run this manually
|
||||||
|
|
||||||
|
defaults:
|
||||||
|
run:
|
||||||
|
shell: bash -euxo pipefail {0}
|
||||||
|
|
||||||
|
concurrency:
|
||||||
|
# Allow only one workflow
|
||||||
|
group: ${{ github.workflow }}
|
||||||
|
cancel-in-progress: true
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
regress:
|
||||||
|
env:
|
||||||
|
POSTGRES_DISTRIB_DIR: /tmp/neon/pg_install
|
||||||
|
DEFAULT_PG_VERSION: 16
|
||||||
|
TEST_OUTPUT: /tmp/test_output
|
||||||
|
BUILD_TYPE: remote
|
||||||
|
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_DEV }}
|
||||||
|
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_KEY_DEV }}
|
||||||
|
|
||||||
|
runs-on: us-east-2
|
||||||
|
container:
|
||||||
|
image: neondatabase/build-tools:pinned
|
||||||
|
options: --init
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- uses: actions/checkout@v4
|
||||||
|
with:
|
||||||
|
submodules: true
|
||||||
|
|
||||||
|
- name: Patch the test
|
||||||
|
run: |
|
||||||
|
cd "vendor/postgres-v${DEFAULT_PG_VERSION}"
|
||||||
|
patch -p1 < "../../compute/patches/cloud_regress_pg${DEFAULT_PG_VERSION}.patch"
|
||||||
|
|
||||||
|
- name: Generate a random password
|
||||||
|
id: pwgen
|
||||||
|
run: |
|
||||||
|
set +x
|
||||||
|
DBPASS=$(dd if=/dev/random bs=48 count=1 2>/dev/null | base64)
|
||||||
|
echo "::add-mask::${DBPASS//\//}"
|
||||||
|
echo DBPASS="${DBPASS//\//}" >> "${GITHUB_OUTPUT}"
|
||||||
|
|
||||||
|
- name: Change tests according to the generated password
|
||||||
|
env:
|
||||||
|
DBPASS: ${{ steps.pwgen.outputs.DBPASS }}
|
||||||
|
run: |
|
||||||
|
cd vendor/postgres-v"${DEFAULT_PG_VERSION}"/src/test/regress
|
||||||
|
for fname in sql/*.sql expected/*.out; do
|
||||||
|
sed -i.bak s/NEON_PASSWORD_PLACEHOLDER/"'${DBPASS}'"/ "${fname}"
|
||||||
|
done
|
||||||
|
for ph in $(grep NEON_MD5_PLACEHOLDER expected/password.out | awk '{print $3;}' | sort | uniq); do
|
||||||
|
USER=$(echo "${ph}" | cut -c 22-)
|
||||||
|
MD5=md5$(echo -n "${DBPASS}${USER}" | md5sum | awk '{print $1;}')
|
||||||
|
sed -i.bak "s/${ph}/${MD5}/" expected/password.out
|
||||||
|
done
|
||||||
|
|
||||||
|
- name: Download Neon artifact
|
||||||
|
uses: ./.github/actions/download
|
||||||
|
with:
|
||||||
|
name: neon-${{ runner.os }}-${{ runner.arch }}-release-artifact
|
||||||
|
path: /tmp/neon/
|
||||||
|
prefix: latest
|
||||||
|
|
||||||
|
- name: Run the regression tests
|
||||||
|
uses: ./.github/actions/run-python-test-set
|
||||||
|
with:
|
||||||
|
build_type: ${{ env.BUILD_TYPE }}
|
||||||
|
test_selection: cloud_regress
|
||||||
|
pg_version: ${{ env.DEFAULT_PG_VERSION }}
|
||||||
|
extra_params: -m remote_cluster
|
||||||
|
env:
|
||||||
|
BENCHMARK_CONNSTR: ${{ secrets.PG_REGRESS_CONNSTR }}
|
||||||
|
|
||||||
|
- name: Create Allure report
|
||||||
|
id: create-allure-report
|
||||||
|
if: ${{ !cancelled() }}
|
||||||
|
uses: ./.github/actions/allure-report-generate
|
||||||
|
|
||||||
|
- name: Post to a Slack channel
|
||||||
|
if: ${{ github.event.schedule && failure() }}
|
||||||
|
uses: slackapi/slack-github-action@v1
|
||||||
|
with:
|
||||||
|
channel-id: "C033QLM5P7D" # on-call-staging-stream
|
||||||
|
slack-message: |
|
||||||
|
Periodic pg_regress on staging: ${{ job.status }}
|
||||||
|
<${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}|GitHub Run>
|
||||||
|
<${{ steps.create-allure-report.outputs.report-url }}|Allure report>
|
||||||
|
env:
|
||||||
|
SLACK_BOT_TOKEN: ${{ secrets.SLACK_BOT_TOKEN }}
|
||||||
|
|
||||||
2
.github/workflows/neon_extra_builds.yml
vendored
2
.github/workflows/neon_extra_builds.yml
vendored
@@ -155,7 +155,7 @@ jobs:
|
|||||||
github.ref_name == 'main'
|
github.ref_name == 'main'
|
||||||
runs-on: [ self-hosted, large ]
|
runs-on: [ self-hosted, large ]
|
||||||
container:
|
container:
|
||||||
image: ${{ needs.build-build-tools-image.outputs.image }}
|
image: ${{ needs.build-build-tools-image.outputs.image }}-bookworm
|
||||||
credentials:
|
credentials:
|
||||||
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
||||||
|
|||||||
4
.github/workflows/pg-clients.yml
vendored
4
.github/workflows/pg-clients.yml
vendored
@@ -55,7 +55,7 @@ jobs:
|
|||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
container:
|
container:
|
||||||
image: ${{ needs.build-build-tools-image.outputs.image }}
|
image: ${{ needs.build-build-tools-image.outputs.image }}-bookworm
|
||||||
credentials:
|
credentials:
|
||||||
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
||||||
@@ -150,7 +150,7 @@ jobs:
|
|||||||
runs-on: ubuntu-22.04
|
runs-on: ubuntu-22.04
|
||||||
|
|
||||||
container:
|
container:
|
||||||
image: ${{ needs.build-build-tools-image.outputs.image }}
|
image: ${{ needs.build-build-tools-image.outputs.image }}-bookworm
|
||||||
credentials:
|
credentials:
|
||||||
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
||||||
|
|||||||
23
.github/workflows/pin-build-tools-image.yml
vendored
23
.github/workflows/pin-build-tools-image.yml
vendored
@@ -71,7 +71,6 @@ jobs:
|
|||||||
|
|
||||||
steps:
|
steps:
|
||||||
- uses: docker/login-action@v3
|
- uses: docker/login-action@v3
|
||||||
|
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
username: ${{ secrets.NEON_DOCKERHUB_USERNAME }}
|
||||||
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
password: ${{ secrets.NEON_DOCKERHUB_PASSWORD }}
|
||||||
@@ -94,8 +93,22 @@ jobs:
|
|||||||
az acr login --name=neoneastus2
|
az acr login --name=neoneastus2
|
||||||
|
|
||||||
- name: Tag build-tools with `${{ env.TO_TAG }}` in Docker Hub, ECR, and ACR
|
- name: Tag build-tools with `${{ env.TO_TAG }}` in Docker Hub, ECR, and ACR
|
||||||
|
env:
|
||||||
|
DEFAULT_DEBIAN_VERSION: bullseye
|
||||||
run: |
|
run: |
|
||||||
docker buildx imagetools create -t 369495373322.dkr.ecr.eu-central-1.amazonaws.com/build-tools:${TO_TAG} \
|
for debian_version in bullseye bookworm; do
|
||||||
-t neoneastus2.azurecr.io/neondatabase/build-tools:${TO_TAG} \
|
tags=()
|
||||||
-t neondatabase/build-tools:${TO_TAG} \
|
|
||||||
neondatabase/build-tools:${FROM_TAG}
|
tags+=("-t" "neondatabase/build-tools:${TO_TAG}-${debian_version}")
|
||||||
|
tags+=("-t" "369495373322.dkr.ecr.eu-central-1.amazonaws.com/build-tools:${TO_TAG}-${debian_version}")
|
||||||
|
tags+=("-t" "neoneastus2.azurecr.io/neondatabase/build-tools:${TO_TAG}-${debian_version}")
|
||||||
|
|
||||||
|
if [ "${debian_version}" == "${DEFAULT_DEBIAN_VERSION}" ]; then
|
||||||
|
tags+=("-t" "neondatabase/build-tools:${TO_TAG}")
|
||||||
|
tags+=("-t" "369495373322.dkr.ecr.eu-central-1.amazonaws.com/build-tools:${TO_TAG}")
|
||||||
|
tags+=("-t" "neoneastus2.azurecr.io/neondatabase/build-tools:${TO_TAG}")
|
||||||
|
fi
|
||||||
|
|
||||||
|
docker buildx imagetools create "${tags[@]}" \
|
||||||
|
neondatabase/build-tools:${FROM_TAG}-${debian_version}
|
||||||
|
done
|
||||||
|
|||||||
41
.github/workflows/report-workflow-stats.yml
vendored
Normal file
41
.github/workflows/report-workflow-stats.yml
vendored
Normal file
@@ -0,0 +1,41 @@
|
|||||||
|
name: Report Workflow Stats
|
||||||
|
|
||||||
|
on:
|
||||||
|
workflow_run:
|
||||||
|
workflows:
|
||||||
|
- Add `external` label to issues and PRs created by external users
|
||||||
|
- Benchmarking
|
||||||
|
- Build and Test
|
||||||
|
- Build and Test Locally
|
||||||
|
- Build build-tools image
|
||||||
|
- Check Permissions
|
||||||
|
- Check build-tools image
|
||||||
|
- Check neon with extra platform builds
|
||||||
|
- Cloud Regression Test
|
||||||
|
- Create Release Branch
|
||||||
|
- Handle `approved-for-ci-run` label
|
||||||
|
- Lint GitHub Workflows
|
||||||
|
- Notify Slack channel about upcoming release
|
||||||
|
- Periodic pagebench performance test on dedicated EC2 machine in eu-central-1 region
|
||||||
|
- Pin build-tools image
|
||||||
|
- Prepare benchmarking databases by restoring dumps
|
||||||
|
- Push images to ACR
|
||||||
|
- Test Postgres client libraries
|
||||||
|
- Trigger E2E Tests
|
||||||
|
- cleanup caches by a branch
|
||||||
|
types: [completed]
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
gh-workflow-stats:
|
||||||
|
name: Github Workflow Stats
|
||||||
|
runs-on: ubuntu-22.04
|
||||||
|
permissions:
|
||||||
|
actions: read
|
||||||
|
steps:
|
||||||
|
- name: Export GH Workflow Stats
|
||||||
|
uses: neondatabase/gh-workflow-stats-action@v0.1.4
|
||||||
|
with:
|
||||||
|
DB_URI: ${{ secrets.GH_REPORT_STATS_DB_RW_CONNSTR }}
|
||||||
|
DB_TABLE: "gh_workflow_stats_neon"
|
||||||
|
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
GH_RUN_ID: ${{ github.event.workflow_run.id }}
|
||||||
9
.github/workflows/trigger-e2e-tests.yml
vendored
9
.github/workflows/trigger-e2e-tests.yml
vendored
@@ -102,12 +102,17 @@ jobs:
|
|||||||
# Default set of platforms to run e2e tests on
|
# Default set of platforms to run e2e tests on
|
||||||
platforms='["docker", "k8s"]'
|
platforms='["docker", "k8s"]'
|
||||||
|
|
||||||
# If the PR changes vendor/, pgxn/ or libs/vm_monitor/ directories, or Dockerfile.compute-node, add k8s-neonvm to the list of platforms.
|
# If a PR changes anything that affects computes, add k8s-neonvm to the list of platforms.
|
||||||
# If the workflow run is not a pull request, add k8s-neonvm to the list.
|
# If the workflow run is not a pull request, add k8s-neonvm to the list.
|
||||||
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
|
if [ "$GITHUB_EVENT_NAME" == "pull_request" ]; then
|
||||||
for f in $(gh api "/repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/files" --paginate --jq '.[].filename'); do
|
for f in $(gh api "/repos/${GITHUB_REPOSITORY}/pulls/${PR_NUMBER}/files" --paginate --jq '.[].filename'); do
|
||||||
case "$f" in
|
case "$f" in
|
||||||
vendor/*|pgxn/*|libs/vm_monitor/*|Dockerfile.compute-node)
|
# List of directories that contain code which affect compute images.
|
||||||
|
#
|
||||||
|
# This isn't exhaustive, just the paths that are most directly compute-related.
|
||||||
|
# For example, compute_ctl also depends on libs/utils, but we don't trigger
|
||||||
|
# an e2e run on that.
|
||||||
|
vendor/*|pgxn/*|compute_tools/*|libs/vm_monitor/*|compute/Dockerfile.compute-node)
|
||||||
platforms=$(echo "${platforms}" | jq --compact-output '. += ["k8s-neonvm"] | unique')
|
platforms=$(echo "${platforms}" | jq --compact-output '. += ["k8s-neonvm"] | unique')
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
/compute_tools/ @neondatabase/control-plane @neondatabase/compute
|
/compute_tools/ @neondatabase/control-plane @neondatabase/compute
|
||||||
/storage_controller @neondatabase/storage
|
/storage_controller @neondatabase/storage
|
||||||
|
/storage_scrubber @neondatabase/storage
|
||||||
/libs/pageserver_api/ @neondatabase/storage
|
/libs/pageserver_api/ @neondatabase/storage
|
||||||
/libs/postgres_ffi/ @neondatabase/compute @neondatabase/storage
|
/libs/postgres_ffi/ @neondatabase/compute @neondatabase/storage
|
||||||
/libs/remote_storage/ @neondatabase/storage
|
/libs/remote_storage/ @neondatabase/storage
|
||||||
|
|||||||
787
Cargo.lock
generated
787
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
50
Cargo.toml
50
Cargo.toml
@@ -53,15 +53,15 @@ azure_storage_blobs = { version = "0.19", default-features = false, features = [
|
|||||||
flate2 = "1.0.26"
|
flate2 = "1.0.26"
|
||||||
async-stream = "0.3"
|
async-stream = "0.3"
|
||||||
async-trait = "0.1"
|
async-trait = "0.1"
|
||||||
aws-config = { version = "1.3", default-features = false, features=["rustls"] }
|
aws-config = { version = "1.5", default-features = false, features=["rustls", "sso"] }
|
||||||
aws-sdk-s3 = "1.26"
|
aws-sdk-s3 = "1.52"
|
||||||
aws-sdk-iam = "1.15.0"
|
aws-sdk-iam = "1.46.0"
|
||||||
aws-smithy-async = { version = "1.2.1", default-features = false, features=["rt-tokio"] }
|
aws-smithy-async = { version = "1.2.1", default-features = false, features=["rt-tokio"] }
|
||||||
aws-smithy-types = "1.1.9"
|
aws-smithy-types = "1.2"
|
||||||
aws-credential-types = "1.2.0"
|
aws-credential-types = "1.2.0"
|
||||||
aws-sigv4 = { version = "1.2.1", features = ["sign-http"] }
|
aws-sigv4 = { version = "1.2", features = ["sign-http"] }
|
||||||
aws-types = "1.2.0"
|
aws-types = "1.3"
|
||||||
axum = { version = "0.6.20", features = ["ws"] }
|
axum = { version = "0.7.5", features = ["ws"] }
|
||||||
base64 = "0.13.0"
|
base64 = "0.13.0"
|
||||||
bincode = "1.3"
|
bincode = "1.3"
|
||||||
bindgen = "0.70"
|
bindgen = "0.70"
|
||||||
@@ -76,8 +76,6 @@ clap = { version = "4.0", features = ["derive"] }
|
|||||||
comfy-table = "7.1"
|
comfy-table = "7.1"
|
||||||
const_format = "0.2"
|
const_format = "0.2"
|
||||||
crc32c = "0.6"
|
crc32c = "0.6"
|
||||||
crossbeam-deque = "0.8.5"
|
|
||||||
crossbeam-utils = "0.8.5"
|
|
||||||
dashmap = { version = "5.5.0", features = ["raw-api"] }
|
dashmap = { version = "5.5.0", features = ["raw-api"] }
|
||||||
either = "1.8"
|
either = "1.8"
|
||||||
enum-map = "2.4.2"
|
enum-map = "2.4.2"
|
||||||
@@ -95,33 +93,37 @@ hdrhistogram = "7.5.2"
|
|||||||
hex = "0.4"
|
hex = "0.4"
|
||||||
hex-literal = "0.4"
|
hex-literal = "0.4"
|
||||||
hmac = "0.12.1"
|
hmac = "0.12.1"
|
||||||
hostname = "0.3.1"
|
hostname = "0.4"
|
||||||
http = {version = "1.1.0", features = ["std"]}
|
http = {version = "1.1.0", features = ["std"]}
|
||||||
http-types = { version = "2", default-features = false }
|
http-types = { version = "2", default-features = false }
|
||||||
|
http-body-util = "0.1.2"
|
||||||
humantime = "2.1"
|
humantime = "2.1"
|
||||||
humantime-serde = "1.1.1"
|
humantime-serde = "1.1.1"
|
||||||
hyper = "0.14"
|
hyper0 = { package = "hyper", version = "0.14" }
|
||||||
tokio-tungstenite = "0.20.0"
|
hyper = "1.4"
|
||||||
|
hyper-util = "0.1"
|
||||||
|
tokio-tungstenite = "0.21.0"
|
||||||
indexmap = "2"
|
indexmap = "2"
|
||||||
indoc = "2"
|
indoc = "2"
|
||||||
inotify = "0.10.2"
|
|
||||||
ipnet = "2.9.0"
|
ipnet = "2.9.0"
|
||||||
itertools = "0.10"
|
itertools = "0.10"
|
||||||
|
itoa = "1.0.11"
|
||||||
jsonwebtoken = "9"
|
jsonwebtoken = "9"
|
||||||
lasso = "0.7"
|
lasso = "0.7"
|
||||||
libc = "0.2"
|
libc = "0.2"
|
||||||
md5 = "0.7.0"
|
md5 = "0.7.0"
|
||||||
measured = { version = "0.0.22", features=["lasso"] }
|
measured = { version = "0.0.22", features=["lasso"] }
|
||||||
measured-process = { version = "0.0.22" }
|
measured-process = { version = "0.0.22" }
|
||||||
memoffset = "0.8"
|
memoffset = "0.9"
|
||||||
nix = { version = "0.27", features = ["dir", "fs", "process", "socket", "signal", "poll"] }
|
nix = { version = "0.27", features = ["dir", "fs", "process", "socket", "signal", "poll"] }
|
||||||
notify = "6.0.0"
|
notify = "6.0.0"
|
||||||
num_cpus = "1.15"
|
num_cpus = "1.15"
|
||||||
num-traits = "0.2.15"
|
num-traits = "0.2.15"
|
||||||
once_cell = "1.13"
|
once_cell = "1.13"
|
||||||
opentelemetry = "0.20.0"
|
opentelemetry = "0.24"
|
||||||
opentelemetry-otlp = { version = "0.13.0", default-features=false, features = ["http-proto", "trace", "http", "reqwest-client"] }
|
opentelemetry_sdk = "0.24"
|
||||||
opentelemetry-semantic-conventions = "0.12.0"
|
opentelemetry-otlp = { version = "0.17", default-features=false, features = ["http-proto", "trace", "http", "reqwest-client"] }
|
||||||
|
opentelemetry-semantic-conventions = "0.16"
|
||||||
parking_lot = "0.12"
|
parking_lot = "0.12"
|
||||||
parquet = { version = "53", default-features = false, features = ["zstd"] }
|
parquet = { version = "53", default-features = false, features = ["zstd"] }
|
||||||
parquet_derive = "53"
|
parquet_derive = "53"
|
||||||
@@ -129,12 +131,12 @@ pbkdf2 = { version = "0.12.1", features = ["simple", "std"] }
|
|||||||
pin-project-lite = "0.2"
|
pin-project-lite = "0.2"
|
||||||
procfs = "0.16"
|
procfs = "0.16"
|
||||||
prometheus = {version = "0.13", default-features=false, features = ["process"]} # removes protobuf dependency
|
prometheus = {version = "0.13", default-features=false, features = ["process"]} # removes protobuf dependency
|
||||||
prost = "0.11"
|
prost = "0.13"
|
||||||
rand = "0.8"
|
rand = "0.8"
|
||||||
redis = { version = "0.25.2", features = ["tokio-rustls-comp", "keep-alive"] }
|
redis = { version = "0.25.2", features = ["tokio-rustls-comp", "keep-alive"] }
|
||||||
regex = "1.10.2"
|
regex = "1.10.2"
|
||||||
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls"] }
|
reqwest = { version = "0.12", default-features = false, features = ["rustls-tls"] }
|
||||||
reqwest-tracing = { version = "0.5", features = ["opentelemetry_0_20"] }
|
reqwest-tracing = { version = "0.5", features = ["opentelemetry_0_24"] }
|
||||||
reqwest-middleware = "0.3.0"
|
reqwest-middleware = "0.3.0"
|
||||||
reqwest-retry = "0.5"
|
reqwest-retry = "0.5"
|
||||||
routerify = "3"
|
routerify = "3"
|
||||||
@@ -142,7 +144,6 @@ rpds = "0.13"
|
|||||||
rustc-hash = "1.1.0"
|
rustc-hash = "1.1.0"
|
||||||
rustls = "0.22"
|
rustls = "0.22"
|
||||||
rustls-pemfile = "2"
|
rustls-pemfile = "2"
|
||||||
rustls-split = "0.3"
|
|
||||||
scopeguard = "1.1"
|
scopeguard = "1.1"
|
||||||
sysinfo = "0.29.2"
|
sysinfo = "0.29.2"
|
||||||
sd-notify = "0.4.1"
|
sd-notify = "0.4.1"
|
||||||
@@ -164,7 +165,6 @@ strum_macros = "0.26"
|
|||||||
svg_fmt = "0.4.3"
|
svg_fmt = "0.4.3"
|
||||||
sync_wrapper = "0.1.2"
|
sync_wrapper = "0.1.2"
|
||||||
tar = "0.4"
|
tar = "0.4"
|
||||||
task-local-extensions = "0.1.4"
|
|
||||||
test-context = "0.3"
|
test-context = "0.3"
|
||||||
thiserror = "1.0"
|
thiserror = "1.0"
|
||||||
tikv-jemallocator = "0.5"
|
tikv-jemallocator = "0.5"
|
||||||
@@ -179,11 +179,11 @@ tokio-tar = "0.3"
|
|||||||
tokio-util = { version = "0.7.10", features = ["io", "rt"] }
|
tokio-util = { version = "0.7.10", features = ["io", "rt"] }
|
||||||
toml = "0.8"
|
toml = "0.8"
|
||||||
toml_edit = "0.22"
|
toml_edit = "0.22"
|
||||||
tonic = {version = "0.9", features = ["tls", "tls-roots"]}
|
tonic = {version = "0.12.3", features = ["tls", "tls-roots"]}
|
||||||
tower-service = "0.3.2"
|
tower-service = "0.3.2"
|
||||||
tracing = "0.1"
|
tracing = "0.1"
|
||||||
tracing-error = "0.2.0"
|
tracing-error = "0.2"
|
||||||
tracing-opentelemetry = "0.21.0"
|
tracing-opentelemetry = "0.25"
|
||||||
tracing-subscriber = { version = "0.3", default-features = false, features = ["smallvec", "fmt", "tracing-log", "std", "env-filter", "json"] }
|
tracing-subscriber = { version = "0.3", default-features = false, features = ["smallvec", "fmt", "tracing-log", "std", "env-filter", "json"] }
|
||||||
try-lock = "0.2.5"
|
try-lock = "0.2.5"
|
||||||
twox-hash = { version = "1.6.3", default-features = false }
|
twox-hash = { version = "1.6.3", default-features = false }
|
||||||
@@ -247,7 +247,7 @@ criterion = "0.5.1"
|
|||||||
rcgen = "0.12"
|
rcgen = "0.12"
|
||||||
rstest = "0.18"
|
rstest = "0.18"
|
||||||
camino-tempfile = "1.0.2"
|
camino-tempfile = "1.0.2"
|
||||||
tonic-build = "0.9"
|
tonic-build = "0.12"
|
||||||
|
|
||||||
[patch.crates-io]
|
[patch.crates-io]
|
||||||
|
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ ARG IMAGE=build-tools
|
|||||||
ARG TAG=pinned
|
ARG TAG=pinned
|
||||||
ARG DEFAULT_PG_VERSION=17
|
ARG DEFAULT_PG_VERSION=17
|
||||||
ARG STABLE_PG_VERSION=16
|
ARG STABLE_PG_VERSION=16
|
||||||
|
ARG DEBIAN_VERSION=bullseye
|
||||||
|
ARG DEBIAN_FLAVOR=${DEBIAN_VERSION}-slim
|
||||||
|
|
||||||
# Build Postgres
|
# Build Postgres
|
||||||
FROM $REPOSITORY/$IMAGE:$TAG AS pg-build
|
FROM $REPOSITORY/$IMAGE:$TAG AS pg-build
|
||||||
@@ -57,7 +59,7 @@ RUN set -e \
|
|||||||
|
|
||||||
# Build final image
|
# Build final image
|
||||||
#
|
#
|
||||||
FROM debian:bullseye-slim
|
FROM debian:${DEBIAN_FLAVOR}
|
||||||
ARG DEFAULT_PG_VERSION
|
ARG DEFAULT_PG_VERSION
|
||||||
WORKDIR /data
|
WORKDIR /data
|
||||||
|
|
||||||
|
|||||||
@@ -1,18 +1,16 @@
|
|||||||
FROM debian:bullseye-slim
|
ARG DEBIAN_VERSION=bullseye
|
||||||
|
|
||||||
# Use ARG as a build-time environment variable here to allow.
|
FROM debian:${DEBIAN_VERSION}-slim
|
||||||
# It's not supposed to be set outside.
|
ARG DEBIAN_VERSION
|
||||||
# Alternatively it can be obtained using the following command
|
|
||||||
# ```
|
|
||||||
# . /etc/os-release && echo "${VERSION_CODENAME}"
|
|
||||||
# ```
|
|
||||||
ARG DEBIAN_VERSION_CODENAME=bullseye
|
|
||||||
|
|
||||||
# Add nonroot user
|
# Add nonroot user
|
||||||
RUN useradd -ms /bin/bash nonroot -b /home
|
RUN useradd -ms /bin/bash nonroot -b /home
|
||||||
SHELL ["/bin/bash", "-c"]
|
SHELL ["/bin/bash", "-c"]
|
||||||
|
|
||||||
# System deps
|
# System deps
|
||||||
|
#
|
||||||
|
# 'gdb' is included so that we get backtraces of core dumps produced in
|
||||||
|
# regression tests
|
||||||
RUN set -e \
|
RUN set -e \
|
||||||
&& apt update \
|
&& apt update \
|
||||||
&& apt install -y \
|
&& apt install -y \
|
||||||
@@ -24,10 +22,12 @@ RUN set -e \
|
|||||||
cmake \
|
cmake \
|
||||||
curl \
|
curl \
|
||||||
flex \
|
flex \
|
||||||
|
gdb \
|
||||||
git \
|
git \
|
||||||
gnupg \
|
gnupg \
|
||||||
gzip \
|
gzip \
|
||||||
jq \
|
jq \
|
||||||
|
jsonnet \
|
||||||
libcurl4-openssl-dev \
|
libcurl4-openssl-dev \
|
||||||
libbz2-dev \
|
libbz2-dev \
|
||||||
libffi-dev \
|
libffi-dev \
|
||||||
@@ -38,14 +38,14 @@ RUN set -e \
|
|||||||
libseccomp-dev \
|
libseccomp-dev \
|
||||||
libsqlite3-dev \
|
libsqlite3-dev \
|
||||||
libssl-dev \
|
libssl-dev \
|
||||||
libstdc++-10-dev \
|
$([[ "${DEBIAN_VERSION}" = "bullseye" ]] && libstdc++-10-dev || libstdc++-11-dev) \
|
||||||
libtool \
|
libtool \
|
||||||
libxml2-dev \
|
libxml2-dev \
|
||||||
libxmlsec1-dev \
|
libxmlsec1-dev \
|
||||||
libxxhash-dev \
|
libxxhash-dev \
|
||||||
lsof \
|
lsof \
|
||||||
make \
|
make \
|
||||||
netcat \
|
netcat-openbsd \
|
||||||
net-tools \
|
net-tools \
|
||||||
openssh-client \
|
openssh-client \
|
||||||
parallel \
|
parallel \
|
||||||
@@ -74,7 +74,7 @@ RUN curl -sL "https://github.com/peak/s5cmd/releases/download/v${S5CMD_VERSION}/
|
|||||||
# LLVM
|
# LLVM
|
||||||
ENV LLVM_VERSION=18
|
ENV LLVM_VERSION=18
|
||||||
RUN curl -fsSL 'https://apt.llvm.org/llvm-snapshot.gpg.key' | apt-key add - \
|
RUN curl -fsSL 'https://apt.llvm.org/llvm-snapshot.gpg.key' | apt-key add - \
|
||||||
&& echo "deb http://apt.llvm.org/${DEBIAN_VERSION_CODENAME}/ llvm-toolchain-${DEBIAN_VERSION_CODENAME}-${LLVM_VERSION} main" > /etc/apt/sources.list.d/llvm.stable.list \
|
&& echo "deb http://apt.llvm.org/${DEBIAN_VERSION}/ llvm-toolchain-${DEBIAN_VERSION}-${LLVM_VERSION} main" > /etc/apt/sources.list.d/llvm.stable.list \
|
||||||
&& apt update \
|
&& apt update \
|
||||||
&& apt install -y clang-${LLVM_VERSION} llvm-${LLVM_VERSION} \
|
&& apt install -y clang-${LLVM_VERSION} llvm-${LLVM_VERSION} \
|
||||||
&& bash -c 'for f in /usr/bin/clang*-${LLVM_VERSION} /usr/bin/llvm*-${LLVM_VERSION}; do ln -s "${f}" "${f%-${LLVM_VERSION}}"; done' \
|
&& bash -c 'for f in /usr/bin/clang*-${LLVM_VERSION} /usr/bin/llvm*-${LLVM_VERSION}; do ln -s "${f}" "${f%-${LLVM_VERSION}}"; done' \
|
||||||
@@ -82,7 +82,7 @@ RUN curl -fsSL 'https://apt.llvm.org/llvm-snapshot.gpg.key' | apt-key add - \
|
|||||||
|
|
||||||
# Install docker
|
# Install docker
|
||||||
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg \
|
RUN curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg \
|
||||||
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian ${DEBIAN_VERSION_CODENAME} stable" > /etc/apt/sources.list.d/docker.list \
|
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/debian ${DEBIAN_VERSION} stable" > /etc/apt/sources.list.d/docker.list \
|
||||||
&& apt update \
|
&& apt update \
|
||||||
&& apt install -y docker-ce docker-ce-cli \
|
&& apt install -y docker-ce docker-ce-cli \
|
||||||
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
&& rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
|
||||||
|
|||||||
15
Makefile
15
Makefile
@@ -168,27 +168,27 @@ postgres-check-%: postgres-%
|
|||||||
neon-pg-ext-%: postgres-%
|
neon-pg-ext-%: postgres-%
|
||||||
+@echo "Compiling neon $*"
|
+@echo "Compiling neon $*"
|
||||||
mkdir -p $(POSTGRES_INSTALL_DIR)/build/neon-$*
|
mkdir -p $(POSTGRES_INSTALL_DIR)/build/neon-$*
|
||||||
$(MAKE) PG_CONFIG=$(POSTGRES_INSTALL_DIR)/$*/bin/pg_config CFLAGS='$(PG_CFLAGS) $(COPT)' \
|
$(MAKE) PG_CONFIG=$(POSTGRES_INSTALL_DIR)/$*/bin/pg_config COPT='$(COPT)' \
|
||||||
-C $(POSTGRES_INSTALL_DIR)/build/neon-$* \
|
-C $(POSTGRES_INSTALL_DIR)/build/neon-$* \
|
||||||
-f $(ROOT_PROJECT_DIR)/pgxn/neon/Makefile install
|
-f $(ROOT_PROJECT_DIR)/pgxn/neon/Makefile install
|
||||||
+@echo "Compiling neon_walredo $*"
|
+@echo "Compiling neon_walredo $*"
|
||||||
mkdir -p $(POSTGRES_INSTALL_DIR)/build/neon-walredo-$*
|
mkdir -p $(POSTGRES_INSTALL_DIR)/build/neon-walredo-$*
|
||||||
$(MAKE) PG_CONFIG=$(POSTGRES_INSTALL_DIR)/$*/bin/pg_config CFLAGS='$(PG_CFLAGS) $(COPT)' \
|
$(MAKE) PG_CONFIG=$(POSTGRES_INSTALL_DIR)/$*/bin/pg_config COPT='$(COPT)' \
|
||||||
-C $(POSTGRES_INSTALL_DIR)/build/neon-walredo-$* \
|
-C $(POSTGRES_INSTALL_DIR)/build/neon-walredo-$* \
|
||||||
-f $(ROOT_PROJECT_DIR)/pgxn/neon_walredo/Makefile install
|
-f $(ROOT_PROJECT_DIR)/pgxn/neon_walredo/Makefile install
|
||||||
+@echo "Compiling neon_rmgr $*"
|
+@echo "Compiling neon_rmgr $*"
|
||||||
mkdir -p $(POSTGRES_INSTALL_DIR)/build/neon-rmgr-$*
|
mkdir -p $(POSTGRES_INSTALL_DIR)/build/neon-rmgr-$*
|
||||||
$(MAKE) PG_CONFIG=$(POSTGRES_INSTALL_DIR)/$*/bin/pg_config CFLAGS='$(PG_CFLAGS) $(COPT)' \
|
$(MAKE) PG_CONFIG=$(POSTGRES_INSTALL_DIR)/$*/bin/pg_config COPT='$(COPT)' \
|
||||||
-C $(POSTGRES_INSTALL_DIR)/build/neon-rmgr-$* \
|
-C $(POSTGRES_INSTALL_DIR)/build/neon-rmgr-$* \
|
||||||
-f $(ROOT_PROJECT_DIR)/pgxn/neon_rmgr/Makefile install
|
-f $(ROOT_PROJECT_DIR)/pgxn/neon_rmgr/Makefile install
|
||||||
+@echo "Compiling neon_test_utils $*"
|
+@echo "Compiling neon_test_utils $*"
|
||||||
mkdir -p $(POSTGRES_INSTALL_DIR)/build/neon-test-utils-$*
|
mkdir -p $(POSTGRES_INSTALL_DIR)/build/neon-test-utils-$*
|
||||||
$(MAKE) PG_CONFIG=$(POSTGRES_INSTALL_DIR)/$*/bin/pg_config CFLAGS='$(PG_CFLAGS) $(COPT)' \
|
$(MAKE) PG_CONFIG=$(POSTGRES_INSTALL_DIR)/$*/bin/pg_config COPT='$(COPT)' \
|
||||||
-C $(POSTGRES_INSTALL_DIR)/build/neon-test-utils-$* \
|
-C $(POSTGRES_INSTALL_DIR)/build/neon-test-utils-$* \
|
||||||
-f $(ROOT_PROJECT_DIR)/pgxn/neon_test_utils/Makefile install
|
-f $(ROOT_PROJECT_DIR)/pgxn/neon_test_utils/Makefile install
|
||||||
+@echo "Compiling neon_utils $*"
|
+@echo "Compiling neon_utils $*"
|
||||||
mkdir -p $(POSTGRES_INSTALL_DIR)/build/neon-utils-$*
|
mkdir -p $(POSTGRES_INSTALL_DIR)/build/neon-utils-$*
|
||||||
$(MAKE) PG_CONFIG=$(POSTGRES_INSTALL_DIR)/$*/bin/pg_config CFLAGS='$(PG_CFLAGS) $(COPT)' \
|
$(MAKE) PG_CONFIG=$(POSTGRES_INSTALL_DIR)/$*/bin/pg_config COPT='$(COPT)' \
|
||||||
-C $(POSTGRES_INSTALL_DIR)/build/neon-utils-$* \
|
-C $(POSTGRES_INSTALL_DIR)/build/neon-utils-$* \
|
||||||
-f $(ROOT_PROJECT_DIR)/pgxn/neon_utils/Makefile install
|
-f $(ROOT_PROJECT_DIR)/pgxn/neon_utils/Makefile install
|
||||||
|
|
||||||
@@ -220,7 +220,7 @@ neon-pg-clean-ext-%:
|
|||||||
walproposer-lib: neon-pg-ext-v17
|
walproposer-lib: neon-pg-ext-v17
|
||||||
+@echo "Compiling walproposer-lib"
|
+@echo "Compiling walproposer-lib"
|
||||||
mkdir -p $(POSTGRES_INSTALL_DIR)/build/walproposer-lib
|
mkdir -p $(POSTGRES_INSTALL_DIR)/build/walproposer-lib
|
||||||
$(MAKE) PG_CONFIG=$(POSTGRES_INSTALL_DIR)/v17/bin/pg_config CFLAGS='$(PG_CFLAGS) $(COPT)' \
|
$(MAKE) PG_CONFIG=$(POSTGRES_INSTALL_DIR)/v17/bin/pg_config COPT='$(COPT)' \
|
||||||
-C $(POSTGRES_INSTALL_DIR)/build/walproposer-lib \
|
-C $(POSTGRES_INSTALL_DIR)/build/walproposer-lib \
|
||||||
-f $(ROOT_PROJECT_DIR)/pgxn/neon/Makefile walproposer-lib
|
-f $(ROOT_PROJECT_DIR)/pgxn/neon/Makefile walproposer-lib
|
||||||
cp $(POSTGRES_INSTALL_DIR)/v17/lib/libpgport.a $(POSTGRES_INSTALL_DIR)/build/walproposer-lib
|
cp $(POSTGRES_INSTALL_DIR)/v17/lib/libpgport.a $(POSTGRES_INSTALL_DIR)/build/walproposer-lib
|
||||||
@@ -291,6 +291,7 @@ postgres-check: \
|
|||||||
# This doesn't remove the effects of 'configure'.
|
# This doesn't remove the effects of 'configure'.
|
||||||
.PHONY: clean
|
.PHONY: clean
|
||||||
clean: postgres-clean neon-pg-clean-ext
|
clean: postgres-clean neon-pg-clean-ext
|
||||||
|
$(MAKE) -C compute clean
|
||||||
$(CARGO_CMD_PREFIX) cargo clean
|
$(CARGO_CMD_PREFIX) cargo clean
|
||||||
|
|
||||||
# This removes everything
|
# This removes everything
|
||||||
@@ -333,7 +334,7 @@ postgres-%-pgindent: postgres-%-pg-bsd-indent postgres-%-typedefs.list
|
|||||||
# Indent pxgn/neon.
|
# Indent pxgn/neon.
|
||||||
.PHONY: neon-pgindent
|
.PHONY: neon-pgindent
|
||||||
neon-pgindent: postgres-v17-pg-bsd-indent neon-pg-ext-v17
|
neon-pgindent: postgres-v17-pg-bsd-indent neon-pg-ext-v17
|
||||||
$(MAKE) PG_CONFIG=$(POSTGRES_INSTALL_DIR)/v17/bin/pg_config CFLAGS='$(PG_CFLAGS) $(COPT)' \
|
$(MAKE) PG_CONFIG=$(POSTGRES_INSTALL_DIR)/v17/bin/pg_config COPT='$(COPT)' \
|
||||||
FIND_TYPEDEF=$(ROOT_PROJECT_DIR)/vendor/postgres-v17/src/tools/find_typedef \
|
FIND_TYPEDEF=$(ROOT_PROJECT_DIR)/vendor/postgres-v17/src/tools/find_typedef \
|
||||||
INDENT=$(POSTGRES_INSTALL_DIR)/build/v17/src/tools/pg_bsd_indent/pg_bsd_indent \
|
INDENT=$(POSTGRES_INSTALL_DIR)/build/v17/src/tools/pg_bsd_indent/pg_bsd_indent \
|
||||||
PGINDENT_SCRIPT=$(ROOT_PROJECT_DIR)/vendor/postgres-v17/src/tools/pgindent/pgindent \
|
PGINDENT_SCRIPT=$(ROOT_PROJECT_DIR)/vendor/postgres-v17/src/tools/pgindent/pgindent \
|
||||||
|
|||||||
@@ -58,7 +58,7 @@ curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
|
|||||||
1. Install XCode and dependencies
|
1. Install XCode and dependencies
|
||||||
```
|
```
|
||||||
xcode-select --install
|
xcode-select --install
|
||||||
brew install protobuf openssl flex bison icu4c pkg-config
|
brew install protobuf openssl flex bison icu4c pkg-config m4
|
||||||
|
|
||||||
# add openssl to PATH, required for ed25519 keys generation in neon_local
|
# add openssl to PATH, required for ed25519 keys generation in neon_local
|
||||||
echo 'export PATH="$(brew --prefix openssl)/bin:$PATH"' >> ~/.zshrc
|
echo 'export PATH="$(brew --prefix openssl)/bin:$PATH"' >> ~/.zshrc
|
||||||
|
|||||||
5
compute/.gitignore
vendored
Normal file
5
compute/.gitignore
vendored
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
# sql_exporter config files generated from Jsonnet
|
||||||
|
etc/neon_collector.yml
|
||||||
|
etc/neon_collector_autoscaling.yml
|
||||||
|
etc/sql_exporter.yml
|
||||||
|
etc/sql_exporter_autoscaling.yml
|
||||||
@@ -3,17 +3,38 @@ ARG REPOSITORY=neondatabase
|
|||||||
ARG IMAGE=build-tools
|
ARG IMAGE=build-tools
|
||||||
ARG TAG=pinned
|
ARG TAG=pinned
|
||||||
ARG BUILD_TAG
|
ARG BUILD_TAG
|
||||||
|
ARG DEBIAN_VERSION=bullseye
|
||||||
|
ARG DEBIAN_FLAVOR=${DEBIAN_VERSION}-slim
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
#
|
#
|
||||||
# Layer "build-deps"
|
# Layer "build-deps"
|
||||||
#
|
#
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
FROM debian:bullseye-slim AS build-deps
|
FROM debian:$DEBIAN_FLAVOR AS build-deps
|
||||||
RUN apt update && \
|
ARG DEBIAN_VERSION
|
||||||
apt install -y git autoconf automake libtool build-essential bison flex libreadline-dev \
|
|
||||||
zlib1g-dev libxml2-dev libcurl4-openssl-dev libossp-uuid-dev wget pkg-config libssl-dev \
|
RUN case $DEBIAN_VERSION in \
|
||||||
libicu-dev libxslt1-dev liblz4-dev libzstd-dev zstd
|
# Version-specific installs for Bullseye (PG14-PG16):
|
||||||
|
# The h3_pg extension needs a cmake 3.20+, but Debian bullseye has 3.18.
|
||||||
|
# Install newer version (3.25) from backports.
|
||||||
|
bullseye) \
|
||||||
|
echo "deb http://deb.debian.org/debian bullseye-backports main" > /etc/apt/sources.list.d/bullseye-backports.list; \
|
||||||
|
VERSION_INSTALLS="cmake/bullseye-backports cmake-data/bullseye-backports"; \
|
||||||
|
;; \
|
||||||
|
# Version-specific installs for Bookworm (PG17):
|
||||||
|
bookworm) \
|
||||||
|
VERSION_INSTALLS="cmake"; \
|
||||||
|
;; \
|
||||||
|
*) \
|
||||||
|
echo "Unknown Debian version ${DEBIAN_VERSION}" && exit 1 \
|
||||||
|
;; \
|
||||||
|
esac && \
|
||||||
|
apt update && \
|
||||||
|
apt install --no-install-recommends -y git autoconf automake libtool build-essential bison flex libreadline-dev \
|
||||||
|
zlib1g-dev libxml2-dev libcurl4-openssl-dev libossp-uuid-dev wget ca-certificates pkg-config libssl-dev \
|
||||||
|
libicu-dev libxslt1-dev liblz4-dev libzstd-dev zstd \
|
||||||
|
$VERSION_INSTALLS
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
#
|
#
|
||||||
@@ -87,18 +108,35 @@ FROM build-deps AS postgis-build
|
|||||||
ARG PG_VERSION
|
ARG PG_VERSION
|
||||||
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
RUN apt update && \
|
RUN apt update && \
|
||||||
apt install -y cmake gdal-bin libboost-dev libboost-thread-dev libboost-filesystem-dev \
|
apt install --no-install-recommends -y gdal-bin libboost-dev libboost-thread-dev libboost-filesystem-dev \
|
||||||
libboost-system-dev libboost-iostreams-dev libboost-program-options-dev libboost-timer-dev \
|
libboost-system-dev libboost-iostreams-dev libboost-program-options-dev libboost-timer-dev \
|
||||||
libcgal-dev libgdal-dev libgmp-dev libmpfr-dev libopenscenegraph-dev libprotobuf-c-dev \
|
libcgal-dev libgdal-dev libgmp-dev libmpfr-dev libopenscenegraph-dev libprotobuf-c-dev \
|
||||||
protobuf-c-compiler xsltproc
|
protobuf-c-compiler xsltproc
|
||||||
|
|
||||||
|
|
||||||
|
# Postgis 3.5.0 requires SFCGAL 1.4+
|
||||||
|
#
|
||||||
|
# It would be nice to update all versions together, but we must solve the SFCGAL dependency first.
|
||||||
# SFCGAL > 1.3 requires CGAL > 5.2, Bullseye's libcgal-dev is 5.2
|
# SFCGAL > 1.3 requires CGAL > 5.2, Bullseye's libcgal-dev is 5.2
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
# and also we must check backward compatibility with older versions of PostGIS.
|
||||||
mkdir -p /sfcgal && \
|
#
|
||||||
echo "Postgis doensn't yet support PG17 (needs 3.4.3, if not higher)" && exit 0;; \
|
# Use new version only for v17
|
||||||
|
RUN case "${PG_VERSION}" in \
|
||||||
|
"v17") \
|
||||||
|
export SFCGAL_VERSION=1.4.1 \
|
||||||
|
export SFCGAL_CHECKSUM=1800c8a26241588f11cddcf433049e9b9aea902e923414d2ecef33a3295626c3 \
|
||||||
|
;; \
|
||||||
|
"v14" | "v15" | "v16") \
|
||||||
|
export SFCGAL_VERSION=1.3.10 \
|
||||||
|
export SFCGAL_CHECKSUM=4e39b3b2adada6254a7bdba6d297bb28e1a9835a9f879b74f37e2dab70203232 \
|
||||||
|
;; \
|
||||||
|
*) \
|
||||||
|
echo "unexpected PostgreSQL version" && exit 1 \
|
||||||
|
;; \
|
||||||
esac && \
|
esac && \
|
||||||
wget https://gitlab.com/Oslandia/SFCGAL/-/archive/v1.3.10/SFCGAL-v1.3.10.tar.gz -O SFCGAL.tar.gz && \
|
mkdir -p /sfcgal && \
|
||||||
echo "4e39b3b2adada6254a7bdba6d297bb28e1a9835a9f879b74f37e2dab70203232 SFCGAL.tar.gz" | sha256sum --check && \
|
wget https://gitlab.com/sfcgal/SFCGAL/-/archive/v${SFCGAL_VERSION}/SFCGAL-v${SFCGAL_VERSION}.tar.gz -O SFCGAL.tar.gz && \
|
||||||
|
echo "${SFCGAL_CHECKSUM} SFCGAL.tar.gz" | sha256sum --check && \
|
||||||
mkdir sfcgal-src && cd sfcgal-src && tar xzf ../SFCGAL.tar.gz --strip-components=1 -C . && \
|
mkdir sfcgal-src && cd sfcgal-src && tar xzf ../SFCGAL.tar.gz --strip-components=1 -C . && \
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release . && make -j $(getconf _NPROCESSORS_ONLN) && \
|
cmake -DCMAKE_BUILD_TYPE=Release . && make -j $(getconf _NPROCESSORS_ONLN) && \
|
||||||
DESTDIR=/sfcgal make install -j $(getconf _NPROCESSORS_ONLN) && \
|
DESTDIR=/sfcgal make install -j $(getconf _NPROCESSORS_ONLN) && \
|
||||||
@@ -106,15 +144,27 @@ RUN case "${PG_VERSION}" in "v17") \
|
|||||||
|
|
||||||
ENV PATH="/usr/local/pgsql/bin:$PATH"
|
ENV PATH="/usr/local/pgsql/bin:$PATH"
|
||||||
|
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
# Postgis 3.5.0 supports v17
|
||||||
echo "Postgis doensn't yet support PG17 (needs 3.4.3, if not higher)" && exit 0;; \
|
RUN case "${PG_VERSION}" in \
|
||||||
|
"v17") \
|
||||||
|
export POSTGIS_VERSION=3.5.0 \
|
||||||
|
export POSTGIS_CHECKSUM=ca698a22cc2b2b3467ac4e063b43a28413f3004ddd505bdccdd74c56a647f510 \
|
||||||
|
;; \
|
||||||
|
"v14" | "v15" | "v16") \
|
||||||
|
export POSTGIS_VERSION=3.3.3 \
|
||||||
|
export POSTGIS_CHECKSUM=74eb356e3f85f14233791013360881b6748f78081cc688ff9d6f0f673a762d13 \
|
||||||
|
;; \
|
||||||
|
*) \
|
||||||
|
echo "unexpected PostgreSQL version" && exit 1 \
|
||||||
|
;; \
|
||||||
esac && \
|
esac && \
|
||||||
wget https://download.osgeo.org/postgis/source/postgis-3.3.3.tar.gz -O postgis.tar.gz && \
|
wget https://download.osgeo.org/postgis/source/postgis-${POSTGIS_VERSION}.tar.gz -O postgis.tar.gz && \
|
||||||
echo "74eb356e3f85f14233791013360881b6748f78081cc688ff9d6f0f673a762d13 postgis.tar.gz" | sha256sum --check && \
|
echo "${POSTGIS_CHECKSUM} postgis.tar.gz" | sha256sum --check && \
|
||||||
mkdir postgis-src && cd postgis-src && tar xzf ../postgis.tar.gz --strip-components=1 -C . && \
|
mkdir postgis-src && cd postgis-src && tar xzf ../postgis.tar.gz --strip-components=1 -C . && \
|
||||||
find /usr/local/pgsql -type f | sed 's|^/usr/local/pgsql/||' > /before.txt &&\
|
find /usr/local/pgsql -type f | sed 's|^/usr/local/pgsql/||' > /before.txt &&\
|
||||||
./autogen.sh && \
|
./autogen.sh && \
|
||||||
./configure --with-sfcgal=/usr/local/bin/sfcgal-config && \
|
./configure --with-sfcgal=/usr/local/bin/sfcgal-config && \
|
||||||
|
make -j $(getconf _NPROCESSORS_ONLN) && \
|
||||||
make -j $(getconf _NPROCESSORS_ONLN) install && \
|
make -j $(getconf _NPROCESSORS_ONLN) install && \
|
||||||
cd extensions/postgis && \
|
cd extensions/postgis && \
|
||||||
make clean && \
|
make clean && \
|
||||||
@@ -135,11 +185,27 @@ RUN case "${PG_VERSION}" in "v17") \
|
|||||||
cp /usr/local/pgsql/share/extension/address_standardizer.control /extensions/postgis && \
|
cp /usr/local/pgsql/share/extension/address_standardizer.control /extensions/postgis && \
|
||||||
cp /usr/local/pgsql/share/extension/address_standardizer_data_us.control /extensions/postgis
|
cp /usr/local/pgsql/share/extension/address_standardizer_data_us.control /extensions/postgis
|
||||||
|
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
# Uses versioned libraries, i.e. libpgrouting-3.4
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
# and may introduce function signature changes between releases
|
||||||
|
# i.e. release 3.5.0 has new signature for pg_dijkstra function
|
||||||
|
#
|
||||||
|
# Use new version only for v17
|
||||||
|
# last release v3.6.2 - Mar 30, 2024
|
||||||
|
RUN case "${PG_VERSION}" in \
|
||||||
|
"v17") \
|
||||||
|
export PGROUTING_VERSION=3.6.2 \
|
||||||
|
export PGROUTING_CHECKSUM=f4a1ed79d6f714e52548eca3bb8e5593c6745f1bde92eb5fb858efd8984dffa2 \
|
||||||
|
;; \
|
||||||
|
"v14" | "v15" | "v16") \
|
||||||
|
export PGROUTING_VERSION=3.4.2 \
|
||||||
|
export PGROUTING_CHECKSUM=cac297c07d34460887c4f3b522b35c470138760fe358e351ad1db4edb6ee306e \
|
||||||
|
;; \
|
||||||
|
*) \
|
||||||
|
echo "unexpected PostgreSQL version" && exit 1 \
|
||||||
|
;; \
|
||||||
esac && \
|
esac && \
|
||||||
wget https://github.com/pgRouting/pgrouting/archive/v3.4.2.tar.gz -O pgrouting.tar.gz && \
|
wget https://github.com/pgRouting/pgrouting/archive/v${PGROUTING_VERSION}.tar.gz -O pgrouting.tar.gz && \
|
||||||
echo "cac297c07d34460887c4f3b522b35c470138760fe358e351ad1db4edb6ee306e pgrouting.tar.gz" | sha256sum --check && \
|
echo "${PGROUTING_CHECKSUM} pgrouting.tar.gz" | sha256sum --check && \
|
||||||
mkdir pgrouting-src && cd pgrouting-src && tar xzf ../pgrouting.tar.gz --strip-components=1 -C . && \
|
mkdir pgrouting-src && cd pgrouting-src && tar xzf ../pgrouting.tar.gz --strip-components=1 -C . && \
|
||||||
mkdir build && cd build && \
|
mkdir build && cd build && \
|
||||||
cmake -DCMAKE_BUILD_TYPE=Release .. && \
|
cmake -DCMAKE_BUILD_TYPE=Release .. && \
|
||||||
@@ -165,7 +231,7 @@ RUN case "${PG_VERSION}" in "v17") \
|
|||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
||||||
esac && \
|
esac && \
|
||||||
apt update && \
|
apt update && \
|
||||||
apt install -y ninja-build python3-dev libncurses5 binutils clang
|
apt install --no-install-recommends -y ninja-build python3-dev libncurses5 binutils clang
|
||||||
|
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
RUN case "${PG_VERSION}" in "v17") \
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
||||||
@@ -198,31 +264,9 @@ FROM build-deps AS h3-pg-build
|
|||||||
ARG PG_VERSION
|
ARG PG_VERSION
|
||||||
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
|
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
# not version-specific
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
# last release v4.1.0 - Jan 18, 2023
|
||||||
esac && \
|
RUN mkdir -p /h3/usr/ && \
|
||||||
case "$(uname -m)" in \
|
|
||||||
"x86_64") \
|
|
||||||
export CMAKE_CHECKSUM=739d372726cb23129d57a539ce1432453448816e345e1545f6127296926b6754 \
|
|
||||||
;; \
|
|
||||||
"aarch64") \
|
|
||||||
export CMAKE_CHECKSUM=281b42627c9a1beed03e29706574d04c6c53fae4994472e90985ef018dd29c02 \
|
|
||||||
;; \
|
|
||||||
*) \
|
|
||||||
echo "Unsupported architecture '$(uname -m)'. Supported are x86_64 and aarch64" && exit 1 \
|
|
||||||
;; \
|
|
||||||
esac && \
|
|
||||||
wget https://github.com/Kitware/CMake/releases/download/v3.24.2/cmake-3.24.2-linux-$(uname -m).sh \
|
|
||||||
-q -O /tmp/cmake-install.sh \
|
|
||||||
&& echo "${CMAKE_CHECKSUM} /tmp/cmake-install.sh" | sha256sum --check \
|
|
||||||
&& chmod u+x /tmp/cmake-install.sh \
|
|
||||||
&& /tmp/cmake-install.sh --skip-license --prefix=/usr/local/ \
|
|
||||||
&& rm /tmp/cmake-install.sh
|
|
||||||
|
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
|
||||||
mkdir -p /h3/usr/ && \
|
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
|
||||||
esac && \
|
|
||||||
wget https://github.com/uber/h3/archive/refs/tags/v4.1.0.tar.gz -O h3.tar.gz && \
|
wget https://github.com/uber/h3/archive/refs/tags/v4.1.0.tar.gz -O h3.tar.gz && \
|
||||||
echo "ec99f1f5974846bde64f4513cf8d2ea1b8d172d2218ab41803bf6a63532272bc h3.tar.gz" | sha256sum --check && \
|
echo "ec99f1f5974846bde64f4513cf8d2ea1b8d172d2218ab41803bf6a63532272bc h3.tar.gz" | sha256sum --check && \
|
||||||
mkdir h3-src && cd h3-src && tar xzf ../h3.tar.gz --strip-components=1 -C . && \
|
mkdir h3-src && cd h3-src && tar xzf ../h3.tar.gz --strip-components=1 -C . && \
|
||||||
@@ -233,10 +277,9 @@ RUN case "${PG_VERSION}" in "v17") \
|
|||||||
cp -R /h3/usr / && \
|
cp -R /h3/usr / && \
|
||||||
rm -rf build
|
rm -rf build
|
||||||
|
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
# not version-specific
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
# last release v4.1.3 - Jul 26, 2023
|
||||||
esac && \
|
RUN wget https://github.com/zachasme/h3-pg/archive/refs/tags/v4.1.3.tar.gz -O h3-pg.tar.gz && \
|
||||||
wget https://github.com/zachasme/h3-pg/archive/refs/tags/v4.1.3.tar.gz -O h3-pg.tar.gz && \
|
|
||||||
echo "5c17f09a820859ffe949f847bebf1be98511fb8f1bd86f94932512c00479e324 h3-pg.tar.gz" | sha256sum --check && \
|
echo "5c17f09a820859ffe949f847bebf1be98511fb8f1bd86f94932512c00479e324 h3-pg.tar.gz" | sha256sum --check && \
|
||||||
mkdir h3-pg-src && cd h3-pg-src && tar xzf ../h3-pg.tar.gz --strip-components=1 -C . && \
|
mkdir h3-pg-src && cd h3-pg-src && tar xzf ../h3-pg.tar.gz --strip-components=1 -C . && \
|
||||||
export PATH="/usr/local/pgsql/bin:$PATH" && \
|
export PATH="/usr/local/pgsql/bin:$PATH" && \
|
||||||
@@ -255,11 +298,10 @@ FROM build-deps AS unit-pg-build
|
|||||||
ARG PG_VERSION
|
ARG PG_VERSION
|
||||||
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
|
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
# not version-specific
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
# last release 7.9 - Sep 15, 2024
|
||||||
esac && \
|
RUN wget https://github.com/df7cb/postgresql-unit/archive/refs/tags/7.9.tar.gz -O postgresql-unit.tar.gz && \
|
||||||
wget https://github.com/df7cb/postgresql-unit/archive/refs/tags/7.7.tar.gz -O postgresql-unit.tar.gz && \
|
echo "e46de6245dcc8b2c2ecf29873dbd43b2b346773f31dd5ce4b8315895a052b456 postgresql-unit.tar.gz" | sha256sum --check && \
|
||||||
echo "411d05beeb97e5a4abf17572bfcfbb5a68d98d1018918feff995f6ee3bb03e79 postgresql-unit.tar.gz" | sha256sum --check && \
|
|
||||||
mkdir postgresql-unit-src && cd postgresql-unit-src && tar xzf ../postgresql-unit.tar.gz --strip-components=1 -C . && \
|
mkdir postgresql-unit-src && cd postgresql-unit-src && tar xzf ../postgresql-unit.tar.gz --strip-components=1 -C . && \
|
||||||
make -j $(getconf _NPROCESSORS_ONLN) PG_CONFIG=/usr/local/pgsql/bin/pg_config && \
|
make -j $(getconf _NPROCESSORS_ONLN) PG_CONFIG=/usr/local/pgsql/bin/pg_config && \
|
||||||
make -j $(getconf _NPROCESSORS_ONLN) install PG_CONFIG=/usr/local/pgsql/bin/pg_config && \
|
make -j $(getconf _NPROCESSORS_ONLN) install PG_CONFIG=/usr/local/pgsql/bin/pg_config && \
|
||||||
@@ -280,7 +322,7 @@ FROM build-deps AS vector-pg-build
|
|||||||
ARG PG_VERSION
|
ARG PG_VERSION
|
||||||
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
|
|
||||||
COPY patches/pgvector.patch /pgvector.patch
|
COPY compute/patches/pgvector.patch /pgvector.patch
|
||||||
|
|
||||||
# By default, pgvector Makefile uses `-march=native`. We don't want that,
|
# By default, pgvector Makefile uses `-march=native`. We don't want that,
|
||||||
# because we build the images on different machines than where we run them.
|
# because we build the images on different machines than where we run them.
|
||||||
@@ -306,12 +348,10 @@ FROM build-deps AS pgjwt-pg-build
|
|||||||
ARG PG_VERSION
|
ARG PG_VERSION
|
||||||
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
|
|
||||||
# 9742dab1b2f297ad3811120db7b21451bca2d3c9 made on 13/11/2021
|
# not version-specific
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
# doesn't use releases, last commit f3d82fd - Mar 2, 2023
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
RUN wget https://github.com/michelp/pgjwt/archive/f3d82fd30151e754e19ce5d6a06c71c20689ce3d.tar.gz -O pgjwt.tar.gz && \
|
||||||
esac && \
|
echo "dae8ed99eebb7593b43013f6532d772b12dfecd55548d2673f2dfd0163f6d2b9 pgjwt.tar.gz" | sha256sum --check && \
|
||||||
wget https://github.com/michelp/pgjwt/archive/9742dab1b2f297ad3811120db7b21451bca2d3c9.tar.gz -O pgjwt.tar.gz && \
|
|
||||||
echo "cfdefb15007286f67d3d45510f04a6a7a495004be5b3aecb12cda667e774203f pgjwt.tar.gz" | sha256sum --check && \
|
|
||||||
mkdir pgjwt-src && cd pgjwt-src && tar xzf ../pgjwt.tar.gz --strip-components=1 -C . && \
|
mkdir pgjwt-src && cd pgjwt-src && tar xzf ../pgjwt.tar.gz --strip-components=1 -C . && \
|
||||||
make -j $(getconf _NPROCESSORS_ONLN) install PG_CONFIG=/usr/local/pgsql/bin/pg_config && \
|
make -j $(getconf _NPROCESSORS_ONLN) install PG_CONFIG=/usr/local/pgsql/bin/pg_config && \
|
||||||
echo 'trusted = true' >> /usr/local/pgsql/share/extension/pgjwt.control
|
echo 'trusted = true' >> /usr/local/pgsql/share/extension/pgjwt.control
|
||||||
@@ -346,10 +386,9 @@ FROM build-deps AS pg-hashids-pg-build
|
|||||||
ARG PG_VERSION
|
ARG PG_VERSION
|
||||||
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
|
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
# not version-specific
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
# last release v1.2.1 -Jan 12, 2018
|
||||||
esac && \
|
RUN wget https://github.com/iCyberon/pg_hashids/archive/refs/tags/v1.2.1.tar.gz -O pg_hashids.tar.gz && \
|
||||||
wget https://github.com/iCyberon/pg_hashids/archive/refs/tags/v1.2.1.tar.gz -O pg_hashids.tar.gz && \
|
|
||||||
echo "74576b992d9277c92196dd8d816baa2cc2d8046fe102f3dcd7f3c3febed6822a pg_hashids.tar.gz" | sha256sum --check && \
|
echo "74576b992d9277c92196dd8d816baa2cc2d8046fe102f3dcd7f3c3febed6822a pg_hashids.tar.gz" | sha256sum --check && \
|
||||||
mkdir pg_hashids-src && cd pg_hashids-src && tar xzf ../pg_hashids.tar.gz --strip-components=1 -C . && \
|
mkdir pg_hashids-src && cd pg_hashids-src && tar xzf ../pg_hashids.tar.gz --strip-components=1 -C . && \
|
||||||
make -j $(getconf _NPROCESSORS_ONLN) PG_CONFIG=/usr/local/pgsql/bin/pg_config USE_PGXS=1 && \
|
make -j $(getconf _NPROCESSORS_ONLN) PG_CONFIG=/usr/local/pgsql/bin/pg_config USE_PGXS=1 && \
|
||||||
@@ -366,7 +405,7 @@ FROM build-deps AS rum-pg-build
|
|||||||
ARG PG_VERSION
|
ARG PG_VERSION
|
||||||
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
|
|
||||||
COPY patches/rum.patch /rum.patch
|
COPY compute/patches/rum.patch /rum.patch
|
||||||
|
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
RUN case "${PG_VERSION}" in "v17") \
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
||||||
@@ -409,10 +448,9 @@ FROM build-deps AS ip4r-pg-build
|
|||||||
ARG PG_VERSION
|
ARG PG_VERSION
|
||||||
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
|
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
# not version-specific
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
# last release v2.4.2 - Jul 29, 2023
|
||||||
esac && \
|
RUN wget https://github.com/RhodiumToad/ip4r/archive/refs/tags/2.4.2.tar.gz -O ip4r.tar.gz && \
|
||||||
wget https://github.com/RhodiumToad/ip4r/archive/refs/tags/2.4.2.tar.gz -O ip4r.tar.gz && \
|
|
||||||
echo "0f7b1f159974f49a47842a8ab6751aecca1ed1142b6d5e38d81b064b2ead1b4b ip4r.tar.gz" | sha256sum --check && \
|
echo "0f7b1f159974f49a47842a8ab6751aecca1ed1142b6d5e38d81b064b2ead1b4b ip4r.tar.gz" | sha256sum --check && \
|
||||||
mkdir ip4r-src && cd ip4r-src && tar xzf ../ip4r.tar.gz --strip-components=1 -C . && \
|
mkdir ip4r-src && cd ip4r-src && tar xzf ../ip4r.tar.gz --strip-components=1 -C . && \
|
||||||
make -j $(getconf _NPROCESSORS_ONLN) PG_CONFIG=/usr/local/pgsql/bin/pg_config && \
|
make -j $(getconf _NPROCESSORS_ONLN) PG_CONFIG=/usr/local/pgsql/bin/pg_config && \
|
||||||
@@ -429,10 +467,9 @@ FROM build-deps AS prefix-pg-build
|
|||||||
ARG PG_VERSION
|
ARG PG_VERSION
|
||||||
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
|
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
# not version-specific
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
# last release v1.2.10 - Jul 5, 2023
|
||||||
esac && \
|
RUN wget https://github.com/dimitri/prefix/archive/refs/tags/v1.2.10.tar.gz -O prefix.tar.gz && \
|
||||||
wget https://github.com/dimitri/prefix/archive/refs/tags/v1.2.10.tar.gz -O prefix.tar.gz && \
|
|
||||||
echo "4342f251432a5f6fb05b8597139d3ccde8dcf87e8ca1498e7ee931ca057a8575 prefix.tar.gz" | sha256sum --check && \
|
echo "4342f251432a5f6fb05b8597139d3ccde8dcf87e8ca1498e7ee931ca057a8575 prefix.tar.gz" | sha256sum --check && \
|
||||||
mkdir prefix-src && cd prefix-src && tar xzf ../prefix.tar.gz --strip-components=1 -C . && \
|
mkdir prefix-src && cd prefix-src && tar xzf ../prefix.tar.gz --strip-components=1 -C . && \
|
||||||
make -j $(getconf _NPROCESSORS_ONLN) PG_CONFIG=/usr/local/pgsql/bin/pg_config && \
|
make -j $(getconf _NPROCESSORS_ONLN) PG_CONFIG=/usr/local/pgsql/bin/pg_config && \
|
||||||
@@ -449,10 +486,9 @@ FROM build-deps AS hll-pg-build
|
|||||||
ARG PG_VERSION
|
ARG PG_VERSION
|
||||||
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
|
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
# not version-specific
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
# last release v2.18 - Aug 29, 2023
|
||||||
esac && \
|
RUN wget https://github.com/citusdata/postgresql-hll/archive/refs/tags/v2.18.tar.gz -O hll.tar.gz && \
|
||||||
wget https://github.com/citusdata/postgresql-hll/archive/refs/tags/v2.18.tar.gz -O hll.tar.gz && \
|
|
||||||
echo "e2f55a6f4c4ab95ee4f1b4a2b73280258c5136b161fe9d059559556079694f0e hll.tar.gz" | sha256sum --check && \
|
echo "e2f55a6f4c4ab95ee4f1b4a2b73280258c5136b161fe9d059559556079694f0e hll.tar.gz" | sha256sum --check && \
|
||||||
mkdir hll-src && cd hll-src && tar xzf ../hll.tar.gz --strip-components=1 -C . && \
|
mkdir hll-src && cd hll-src && tar xzf ../hll.tar.gz --strip-components=1 -C . && \
|
||||||
make -j $(getconf _NPROCESSORS_ONLN) PG_CONFIG=/usr/local/pgsql/bin/pg_config && \
|
make -j $(getconf _NPROCESSORS_ONLN) PG_CONFIG=/usr/local/pgsql/bin/pg_config && \
|
||||||
@@ -504,8 +540,6 @@ RUN case "${PG_VERSION}" in "v17") \
|
|||||||
export TIMESCALEDB_CHECKSUM=584a351c7775f0e067eaa0e7277ea88cab9077cc4c455cbbf09a5d9723dce95d \
|
export TIMESCALEDB_CHECKSUM=584a351c7775f0e067eaa0e7277ea88cab9077cc4c455cbbf09a5d9723dce95d \
|
||||||
;; \
|
;; \
|
||||||
esac && \
|
esac && \
|
||||||
apt-get update && \
|
|
||||||
apt-get install -y cmake && \
|
|
||||||
wget https://github.com/timescale/timescaledb/archive/refs/tags/${TIMESCALEDB_VERSION}.tar.gz -O timescaledb.tar.gz && \
|
wget https://github.com/timescale/timescaledb/archive/refs/tags/${TIMESCALEDB_VERSION}.tar.gz -O timescaledb.tar.gz && \
|
||||||
echo "${TIMESCALEDB_CHECKSUM} timescaledb.tar.gz" | sha256sum --check && \
|
echo "${TIMESCALEDB_CHECKSUM} timescaledb.tar.gz" | sha256sum --check && \
|
||||||
mkdir timescaledb-src && cd timescaledb-src && tar xzf ../timescaledb.tar.gz --strip-components=1 -C . && \
|
mkdir timescaledb-src && cd timescaledb-src && tar xzf ../timescaledb.tar.gz --strip-components=1 -C . && \
|
||||||
@@ -593,8 +627,7 @@ RUN case "${PG_VERSION}" in "v17") \
|
|||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
||||||
esac && \
|
esac && \
|
||||||
apt-get update && \
|
apt-get update && \
|
||||||
apt-get install -y \
|
apt-get install --no-install-recommends -y \
|
||||||
cmake \
|
|
||||||
libboost-iostreams1.74-dev \
|
libboost-iostreams1.74-dev \
|
||||||
libboost-regex1.74-dev \
|
libboost-regex1.74-dev \
|
||||||
libboost-serialization1.74-dev \
|
libboost-serialization1.74-dev \
|
||||||
@@ -666,11 +699,10 @@ FROM build-deps AS pg-roaringbitmap-pg-build
|
|||||||
ARG PG_VERSION
|
ARG PG_VERSION
|
||||||
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
|
|
||||||
|
# not version-specific
|
||||||
|
# last release v0.5.4 - Jun 28, 2022
|
||||||
ENV PATH="/usr/local/pgsql/bin/:$PATH"
|
ENV PATH="/usr/local/pgsql/bin/:$PATH"
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
RUN wget https://github.com/ChenHuajun/pg_roaringbitmap/archive/refs/tags/v0.5.4.tar.gz -O pg_roaringbitmap.tar.gz && \
|
||||||
echo "v17 extensions is not supported yet by pg_roaringbitmap. Quit" && exit 0;; \
|
|
||||||
esac && \
|
|
||||||
wget https://github.com/ChenHuajun/pg_roaringbitmap/archive/refs/tags/v0.5.4.tar.gz -O pg_roaringbitmap.tar.gz && \
|
|
||||||
echo "b75201efcb1c2d1b014ec4ae6a22769cc7a224e6e406a587f5784a37b6b5a2aa pg_roaringbitmap.tar.gz" | sha256sum --check && \
|
echo "b75201efcb1c2d1b014ec4ae6a22769cc7a224e6e406a587f5784a37b6b5a2aa pg_roaringbitmap.tar.gz" | sha256sum --check && \
|
||||||
mkdir pg_roaringbitmap-src && cd pg_roaringbitmap-src && tar xzf ../pg_roaringbitmap.tar.gz --strip-components=1 -C . && \
|
mkdir pg_roaringbitmap-src && cd pg_roaringbitmap-src && tar xzf ../pg_roaringbitmap.tar.gz --strip-components=1 -C . && \
|
||||||
make -j $(getconf _NPROCESSORS_ONLN) && \
|
make -j $(getconf _NPROCESSORS_ONLN) && \
|
||||||
@@ -687,12 +719,27 @@ FROM build-deps AS pg-semver-pg-build
|
|||||||
ARG PG_VERSION
|
ARG PG_VERSION
|
||||||
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
|
|
||||||
|
# Release 0.40.0 breaks backward compatibility with previous versions
|
||||||
|
# see release note https://github.com/theory/pg-semver/releases/tag/v0.40.0
|
||||||
|
# Use new version only for v17
|
||||||
|
#
|
||||||
|
# last release v0.40.0 - Jul 22, 2024
|
||||||
ENV PATH="/usr/local/pgsql/bin/:$PATH"
|
ENV PATH="/usr/local/pgsql/bin/:$PATH"
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
RUN case "${PG_VERSION}" in \
|
||||||
echo "v17 is not supported yet by pg_semver. Quit" && exit 0;; \
|
"v17") \
|
||||||
|
export SEMVER_VERSION=0.40.0 \
|
||||||
|
export SEMVER_CHECKSUM=3e50bcc29a0e2e481e7b6d2bc937cadc5f5869f55d983b5a1aafeb49f5425cfc \
|
||||||
|
;; \
|
||||||
|
"v14" | "v15" | "v16") \
|
||||||
|
export SEMVER_VERSION=0.32.1 \
|
||||||
|
export SEMVER_CHECKSUM=fbdaf7512026d62eec03fad8687c15ed509b6ba395bff140acd63d2e4fbe25d7 \
|
||||||
|
;; \
|
||||||
|
*) \
|
||||||
|
echo "unexpected PostgreSQL version" && exit 1 \
|
||||||
|
;; \
|
||||||
esac && \
|
esac && \
|
||||||
wget https://github.com/theory/pg-semver/archive/refs/tags/v0.32.1.tar.gz -O pg_semver.tar.gz && \
|
wget https://github.com/theory/pg-semver/archive/refs/tags/v${SEMVER_VERSION}.tar.gz -O pg_semver.tar.gz && \
|
||||||
echo "fbdaf7512026d62eec03fad8687c15ed509b6ba395bff140acd63d2e4fbe25d7 pg_semver.tar.gz" | sha256sum --check && \
|
echo "${SEMVER_CHECKSUM} pg_semver.tar.gz" | sha256sum --check && \
|
||||||
mkdir pg_semver-src && cd pg_semver-src && tar xzf ../pg_semver.tar.gz --strip-components=1 -C . && \
|
mkdir pg_semver-src && cd pg_semver-src && tar xzf ../pg_semver.tar.gz --strip-components=1 -C . && \
|
||||||
make -j $(getconf _NPROCESSORS_ONLN) && \
|
make -j $(getconf _NPROCESSORS_ONLN) && \
|
||||||
make -j $(getconf _NPROCESSORS_ONLN) install && \
|
make -j $(getconf _NPROCESSORS_ONLN) install && \
|
||||||
@@ -759,7 +806,7 @@ ARG PG_VERSION
|
|||||||
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
|
|
||||||
RUN apt-get update && \
|
RUN apt-get update && \
|
||||||
apt-get install -y curl libclang-dev cmake && \
|
apt-get install --no-install-recommends -y curl libclang-dev && \
|
||||||
useradd -ms /bin/bash nonroot -b /home
|
useradd -ms /bin/bash nonroot -b /home
|
||||||
|
|
||||||
ENV HOME=/home/nonroot
|
ENV HOME=/home/nonroot
|
||||||
@@ -869,6 +916,25 @@ RUN case "${PG_VERSION}" in "v17") \
|
|||||||
cargo pgrx install --release && \
|
cargo pgrx install --release && \
|
||||||
echo "trusted = true" >> /usr/local/pgsql/share/extension/ulid.control
|
echo "trusted = true" >> /usr/local/pgsql/share/extension/ulid.control
|
||||||
|
|
||||||
|
#########################################################################################
|
||||||
|
#
|
||||||
|
# Layer "pg-session-jwt-build"
|
||||||
|
# Compile "pg_session_jwt" extension
|
||||||
|
#
|
||||||
|
#########################################################################################
|
||||||
|
|
||||||
|
FROM rust-extensions-build AS pg-session-jwt-build
|
||||||
|
ARG PG_VERSION
|
||||||
|
|
||||||
|
RUN case "${PG_VERSION}" in "v17") \
|
||||||
|
echo "pg_session_jwt does not yet have a release that supports pg17" && exit 0;; \
|
||||||
|
esac && \
|
||||||
|
wget https://github.com/neondatabase/pg_session_jwt/archive/5aee2625af38213650e1a07ae038fdc427250ee4.tar.gz -O pg_session_jwt.tar.gz && \
|
||||||
|
echo "5d91b10bc1347d36cffc456cb87bec25047935d6503dc652ca046f04760828e7 pg_session_jwt.tar.gz" | sha256sum --check && \
|
||||||
|
mkdir pg_session_jwt-src && cd pg_session_jwt-src && tar xzf ../pg_session_jwt.tar.gz --strip-components=1 -C . && \
|
||||||
|
sed -i 's/pgrx = "=0.11.3"/pgrx = { version = "=0.11.3", features = [ "unsafe-postgres" ] }/g' Cargo.toml && \
|
||||||
|
cargo pgrx install --release
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
#
|
#
|
||||||
# Layer "wal2json-build"
|
# Layer "wal2json-build"
|
||||||
@@ -965,6 +1031,7 @@ COPY --from=timescaledb-pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
|||||||
COPY --from=pg-hint-plan-pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-hint-plan-pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
COPY --from=pg-cron-pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-cron-pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
COPY --from=pg-pgx-ulid-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-pgx-ulid-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
|
COPY --from=pg-session-jwt-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
COPY --from=rdkit-pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=rdkit-pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
COPY --from=pg-uuidv7-pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-uuidv7-pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
COPY --from=pg-roaringbitmap-pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-roaringbitmap-pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
@@ -1027,10 +1094,62 @@ RUN cd compute_tools && mold -run cargo build --locked --profile release-line-de
|
|||||||
#
|
#
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
|
|
||||||
FROM debian:bullseye-slim AS compute-tools-image
|
FROM debian:$DEBIAN_FLAVOR AS compute-tools-image
|
||||||
|
|
||||||
COPY --from=compute-tools /home/nonroot/target/release-line-debug-size-lto/compute_ctl /usr/local/bin/compute_ctl
|
COPY --from=compute-tools /home/nonroot/target/release-line-debug-size-lto/compute_ctl /usr/local/bin/compute_ctl
|
||||||
|
|
||||||
|
#########################################################################################
|
||||||
|
#
|
||||||
|
# Layer "pgbouncer"
|
||||||
|
#
|
||||||
|
#########################################################################################
|
||||||
|
|
||||||
|
FROM debian:$DEBIAN_FLAVOR AS pgbouncer
|
||||||
|
RUN set -e \
|
||||||
|
&& apt-get update \
|
||||||
|
&& apt-get install --no-install-recommends -y \
|
||||||
|
build-essential \
|
||||||
|
git \
|
||||||
|
ca-certificates \
|
||||||
|
autoconf \
|
||||||
|
automake \
|
||||||
|
libevent-dev \
|
||||||
|
libtool \
|
||||||
|
pkg-config
|
||||||
|
|
||||||
|
# Use `dist_man_MANS=` to skip manpage generation (which requires python3/pandoc)
|
||||||
|
ENV PGBOUNCER_TAG=pgbouncer_1_22_1
|
||||||
|
RUN set -e \
|
||||||
|
&& git clone --recurse-submodules --depth 1 --branch ${PGBOUNCER_TAG} https://github.com/pgbouncer/pgbouncer.git pgbouncer \
|
||||||
|
&& cd pgbouncer \
|
||||||
|
&& ./autogen.sh \
|
||||||
|
&& LDFLAGS=-static ./configure --prefix=/usr/local/pgbouncer --without-openssl \
|
||||||
|
&& make -j $(nproc) dist_man_MANS= \
|
||||||
|
&& make install dist_man_MANS=
|
||||||
|
|
||||||
|
#########################################################################################
|
||||||
|
#
|
||||||
|
# Compile the Neon-specific `local_proxy` binary
|
||||||
|
#
|
||||||
|
#########################################################################################
|
||||||
|
FROM $REPOSITORY/$IMAGE:$TAG AS local_proxy
|
||||||
|
ARG BUILD_TAG
|
||||||
|
ENV BUILD_TAG=$BUILD_TAG
|
||||||
|
|
||||||
|
USER nonroot
|
||||||
|
# Copy entire project to get Cargo.* files with proper dependencies for the whole project
|
||||||
|
COPY --chown=nonroot . .
|
||||||
|
RUN mold -run cargo build --locked --profile release-line-debug-size-lto --bin local_proxy
|
||||||
|
|
||||||
|
#########################################################################################
|
||||||
|
#
|
||||||
|
# Layers "postgres-exporter" and "sql-exporter"
|
||||||
|
#
|
||||||
|
#########################################################################################
|
||||||
|
|
||||||
|
FROM quay.io/prometheuscommunity/postgres-exporter:v0.12.1 AS postgres-exporter
|
||||||
|
FROM burningalchemist/sql_exporter:0.13 AS sql-exporter
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
#
|
#
|
||||||
# Clean up postgres folder before inclusion
|
# Clean up postgres folder before inclusion
|
||||||
@@ -1050,6 +1169,18 @@ RUN rm -r /usr/local/pgsql/include
|
|||||||
# if they were to be used by other libraries.
|
# if they were to be used by other libraries.
|
||||||
RUN rm /usr/local/pgsql/lib/lib*.a
|
RUN rm /usr/local/pgsql/lib/lib*.a
|
||||||
|
|
||||||
|
#########################################################################################
|
||||||
|
#
|
||||||
|
# Preprocess the sql_exporter configuration files
|
||||||
|
#
|
||||||
|
#########################################################################################
|
||||||
|
FROM $REPOSITORY/$IMAGE:$TAG AS sql_exporter_preprocessor
|
||||||
|
|
||||||
|
USER nonroot
|
||||||
|
|
||||||
|
COPY --chown=nonroot compute compute
|
||||||
|
|
||||||
|
RUN make -C compute
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
#
|
#
|
||||||
@@ -1078,7 +1209,7 @@ COPY --from=pgjwt-pg-build /pgjwt.tar.gz /ext-src
|
|||||||
COPY --from=hypopg-pg-build /hypopg.tar.gz /ext-src
|
COPY --from=hypopg-pg-build /hypopg.tar.gz /ext-src
|
||||||
COPY --from=pg-hashids-pg-build /pg_hashids.tar.gz /ext-src
|
COPY --from=pg-hashids-pg-build /pg_hashids.tar.gz /ext-src
|
||||||
COPY --from=rum-pg-build /rum.tar.gz /ext-src
|
COPY --from=rum-pg-build /rum.tar.gz /ext-src
|
||||||
COPY patches/rum.patch /ext-src
|
COPY compute/patches/rum.patch /ext-src
|
||||||
#COPY --from=pgtap-pg-build /pgtap.tar.gz /ext-src
|
#COPY --from=pgtap-pg-build /pgtap.tar.gz /ext-src
|
||||||
COPY --from=ip4r-pg-build /ip4r.tar.gz /ext-src
|
COPY --from=ip4r-pg-build /ip4r.tar.gz /ext-src
|
||||||
COPY --from=prefix-pg-build /prefix.tar.gz /ext-src
|
COPY --from=prefix-pg-build /prefix.tar.gz /ext-src
|
||||||
@@ -1086,9 +1217,9 @@ COPY --from=hll-pg-build /hll.tar.gz /ext-src
|
|||||||
COPY --from=plpgsql-check-pg-build /plpgsql_check.tar.gz /ext-src
|
COPY --from=plpgsql-check-pg-build /plpgsql_check.tar.gz /ext-src
|
||||||
#COPY --from=timescaledb-pg-build /timescaledb.tar.gz /ext-src
|
#COPY --from=timescaledb-pg-build /timescaledb.tar.gz /ext-src
|
||||||
COPY --from=pg-hint-plan-pg-build /pg_hint_plan.tar.gz /ext-src
|
COPY --from=pg-hint-plan-pg-build /pg_hint_plan.tar.gz /ext-src
|
||||||
COPY patches/pg_hint_plan.patch /ext-src
|
COPY compute/patches/pg_hint_plan.patch /ext-src
|
||||||
COPY --from=pg-cron-pg-build /pg_cron.tar.gz /ext-src
|
COPY --from=pg-cron-pg-build /pg_cron.tar.gz /ext-src
|
||||||
COPY patches/pg_cron.patch /ext-src
|
COPY compute/patches/pg_cron.patch /ext-src
|
||||||
#COPY --from=pg-pgx-ulid-build /home/nonroot/pgx_ulid.tar.gz /ext-src
|
#COPY --from=pg-pgx-ulid-build /home/nonroot/pgx_ulid.tar.gz /ext-src
|
||||||
#COPY --from=rdkit-pg-build /rdkit.tar.gz /ext-src
|
#COPY --from=rdkit-pg-build /rdkit.tar.gz /ext-src
|
||||||
COPY --from=pg-uuidv7-pg-build /pg_uuidv7.tar.gz /ext-src
|
COPY --from=pg-uuidv7-pg-build /pg_uuidv7.tar.gz /ext-src
|
||||||
@@ -1097,7 +1228,7 @@ COPY --from=pg-semver-pg-build /pg_semver.tar.gz /ext-src
|
|||||||
#COPY --from=pg-embedding-pg-build /home/nonroot/pg_embedding-src/ /ext-src
|
#COPY --from=pg-embedding-pg-build /home/nonroot/pg_embedding-src/ /ext-src
|
||||||
#COPY --from=wal2json-pg-build /wal2json_2_5.tar.gz /ext-src
|
#COPY --from=wal2json-pg-build /wal2json_2_5.tar.gz /ext-src
|
||||||
COPY --from=pg-anon-pg-build /pg_anon.tar.gz /ext-src
|
COPY --from=pg-anon-pg-build /pg_anon.tar.gz /ext-src
|
||||||
COPY patches/pg_anon.patch /ext-src
|
COPY compute/patches/pg_anon.patch /ext-src
|
||||||
COPY --from=pg-ivm-build /pg_ivm.tar.gz /ext-src
|
COPY --from=pg-ivm-build /pg_ivm.tar.gz /ext-src
|
||||||
COPY --from=pg-partman-build /pg_partman.tar.gz /ext-src
|
COPY --from=pg-partman-build /pg_partman.tar.gz /ext-src
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
RUN case "${PG_VERSION}" in "v17") \
|
||||||
@@ -1115,11 +1246,6 @@ RUN case "${PG_VERSION}" in "v17") \
|
|||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
||||||
esac && \
|
esac && \
|
||||||
cd /ext-src/pgvector-src && patch -p1 <../pgvector.patch
|
cd /ext-src/pgvector-src && patch -p1 <../pgvector.patch
|
||||||
# cmake is required for the h3 test
|
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
|
||||||
esac && \
|
|
||||||
apt-get update && apt-get install -y cmake
|
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
RUN case "${PG_VERSION}" in "v17") \
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
||||||
esac && \
|
esac && \
|
||||||
@@ -1144,7 +1270,8 @@ ENV PGDATABASE=postgres
|
|||||||
# Put it all together into the final image
|
# Put it all together into the final image
|
||||||
#
|
#
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
FROM debian:bullseye-slim
|
FROM debian:$DEBIAN_FLAVOR
|
||||||
|
ARG DEBIAN_VERSION
|
||||||
# Add user postgres
|
# Add user postgres
|
||||||
RUN mkdir /var/db && useradd -m -d /var/db/postgres postgres && \
|
RUN mkdir /var/db && useradd -m -d /var/db/postgres postgres && \
|
||||||
echo "postgres:test_console_pass" | chpasswd && \
|
echo "postgres:test_console_pass" | chpasswd && \
|
||||||
@@ -1160,23 +1287,57 @@ RUN mkdir /var/db && useradd -m -d /var/db/postgres postgres && \
|
|||||||
COPY --from=postgres-cleanup-layer --chown=postgres /usr/local/pgsql /usr/local
|
COPY --from=postgres-cleanup-layer --chown=postgres /usr/local/pgsql /usr/local
|
||||||
COPY --from=compute-tools --chown=postgres /home/nonroot/target/release-line-debug-size-lto/compute_ctl /usr/local/bin/compute_ctl
|
COPY --from=compute-tools --chown=postgres /home/nonroot/target/release-line-debug-size-lto/compute_ctl /usr/local/bin/compute_ctl
|
||||||
|
|
||||||
|
# pgbouncer and its config
|
||||||
|
COPY --from=pgbouncer /usr/local/pgbouncer/bin/pgbouncer /usr/local/bin/pgbouncer
|
||||||
|
COPY --chmod=0666 --chown=postgres compute/etc/pgbouncer.ini /etc/pgbouncer.ini
|
||||||
|
|
||||||
|
# local_proxy and its config
|
||||||
|
COPY --from=local_proxy --chown=postgres /home/nonroot/target/release-line-debug-size-lto/local_proxy /usr/local/bin/local_proxy
|
||||||
|
RUN mkdir -p /etc/local_proxy && chown postgres:postgres /etc/local_proxy
|
||||||
|
|
||||||
|
# Metrics exporter binaries and configuration files
|
||||||
|
COPY --from=postgres-exporter /bin/postgres_exporter /bin/postgres_exporter
|
||||||
|
COPY --from=sql-exporter /bin/sql_exporter /bin/sql_exporter
|
||||||
|
|
||||||
|
COPY --from=sql_exporter_preprocessor --chmod=0644 /home/nonroot/compute/etc/sql_exporter.yml /etc/sql_exporter.yml
|
||||||
|
COPY --from=sql_exporter_preprocessor --chmod=0644 /home/nonroot/compute/etc/neon_collector.yml /etc/neon_collector.yml
|
||||||
|
COPY --from=sql_exporter_preprocessor --chmod=0644 /home/nonroot/compute/etc/sql_exporter_autoscaling.yml /etc/sql_exporter_autoscaling.yml
|
||||||
|
COPY --from=sql_exporter_preprocessor --chmod=0644 /home/nonroot/compute/etc/neon_collector_autoscaling.yml /etc/neon_collector_autoscaling.yml
|
||||||
|
|
||||||
# Create remote extension download directory
|
# Create remote extension download directory
|
||||||
RUN mkdir /usr/local/download_extensions && chown -R postgres:postgres /usr/local/download_extensions
|
RUN mkdir /usr/local/download_extensions && chown -R postgres:postgres /usr/local/download_extensions
|
||||||
|
|
||||||
# Install:
|
# Install:
|
||||||
# libreadline8 for psql
|
# libreadline8 for psql
|
||||||
# libicu67, locales for collations (including ICU and plpgsql_check)
|
|
||||||
# liblz4-1 for lz4
|
# liblz4-1 for lz4
|
||||||
# libossp-uuid16 for extension ossp-uuid
|
# libossp-uuid16 for extension ossp-uuid
|
||||||
# libgeos, libgdal, libsfcgal1, libproj and libprotobuf-c1 for PostGIS
|
# libgeos, libsfcgal1, and libprotobuf-c1 for PostGIS
|
||||||
# libxml2, libxslt1.1 for xml2
|
# libxml2, libxslt1.1 for xml2
|
||||||
# libzstd1 for zstd
|
# libzstd1 for zstd
|
||||||
# libboost* for rdkit
|
# libboost* for rdkit
|
||||||
# ca-certificates for communicating with s3 by compute_ctl
|
# ca-certificates for communicating with s3 by compute_ctl
|
||||||
RUN apt update && \
|
|
||||||
|
|
||||||
|
RUN apt update && \
|
||||||
|
case $DEBIAN_VERSION in \
|
||||||
|
# Version-specific installs for Bullseye (PG14-PG16):
|
||||||
|
# libicu67, locales for collations (including ICU and plpgsql_check)
|
||||||
|
# libgdal28, libproj19 for PostGIS
|
||||||
|
bullseye) \
|
||||||
|
VERSION_INSTALLS="libicu67 libgdal28 libproj19"; \
|
||||||
|
;; \
|
||||||
|
# Version-specific installs for Bookworm (PG17):
|
||||||
|
# libicu72, locales for collations (including ICU and plpgsql_check)
|
||||||
|
# libgdal32, libproj25 for PostGIS
|
||||||
|
bookworm) \
|
||||||
|
VERSION_INSTALLS="libicu72 libgdal32 libproj25"; \
|
||||||
|
;; \
|
||||||
|
*) \
|
||||||
|
echo "Unknown Debian version ${DEBIAN_VERSION}" && exit 1 \
|
||||||
|
;; \
|
||||||
|
esac && \
|
||||||
apt install --no-install-recommends -y \
|
apt install --no-install-recommends -y \
|
||||||
gdb \
|
gdb \
|
||||||
libicu67 \
|
|
||||||
liblz4-1 \
|
liblz4-1 \
|
||||||
libreadline8 \
|
libreadline8 \
|
||||||
libboost-iostreams1.74.0 \
|
libboost-iostreams1.74.0 \
|
||||||
@@ -1185,17 +1346,16 @@ RUN apt update && \
|
|||||||
libboost-system1.74.0 \
|
libboost-system1.74.0 \
|
||||||
libossp-uuid16 \
|
libossp-uuid16 \
|
||||||
libgeos-c1v5 \
|
libgeos-c1v5 \
|
||||||
libgdal28 \
|
|
||||||
libproj19 \
|
|
||||||
libprotobuf-c1 \
|
libprotobuf-c1 \
|
||||||
libsfcgal1 \
|
libsfcgal1 \
|
||||||
libxml2 \
|
libxml2 \
|
||||||
libxslt1.1 \
|
libxslt1.1 \
|
||||||
libzstd1 \
|
libzstd1 \
|
||||||
libcurl4-openssl-dev \
|
libcurl4 \
|
||||||
locales \
|
locales \
|
||||||
procps \
|
procps \
|
||||||
ca-certificates && \
|
ca-certificates \
|
||||||
|
$VERSION_INSTALLS && \
|
||||||
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
|
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/* && \
|
||||||
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
|
localedef -i en_US -c -f UTF-8 -A /usr/share/locale/locale.alias en_US.UTF-8
|
||||||
|
|
||||||
45
compute/Makefile
Normal file
45
compute/Makefile
Normal file
@@ -0,0 +1,45 @@
|
|||||||
|
jsonnet_files = $(wildcard \
|
||||||
|
etc/*.jsonnet \
|
||||||
|
etc/sql_exporter/*.libsonnet)
|
||||||
|
|
||||||
|
.PHONY: all
|
||||||
|
all: neon_collector.yml neon_collector_autoscaling.yml sql_exporter.yml sql_exporter_autoscaling.yml
|
||||||
|
|
||||||
|
neon_collector.yml: $(jsonnet_files)
|
||||||
|
JSONNET_PATH=etc jsonnet \
|
||||||
|
--output-file etc/$@ \
|
||||||
|
etc/neon_collector.jsonnet
|
||||||
|
|
||||||
|
neon_collector_autoscaling.yml: $(jsonnet_files)
|
||||||
|
JSONNET_PATH=etc jsonnet \
|
||||||
|
--output-file etc/$@ \
|
||||||
|
etc/neon_collector_autoscaling.jsonnet
|
||||||
|
|
||||||
|
sql_exporter.yml: $(jsonnet_files)
|
||||||
|
JSONNET_PATH=etc jsonnet \
|
||||||
|
--output-file etc/$@ \
|
||||||
|
--tla-str collector_file=neon_collector.yml \
|
||||||
|
etc/sql_exporter.jsonnet
|
||||||
|
|
||||||
|
sql_exporter_autoscaling.yml: $(jsonnet_files)
|
||||||
|
JSONNET_PATH=etc jsonnet \
|
||||||
|
--output-file etc/$@ \
|
||||||
|
--tla-str collector_file=neon_collector_autoscaling.yml \
|
||||||
|
--tla-str application_name=sql_exporter_autoscaling \
|
||||||
|
etc/sql_exporter.jsonnet
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
rm --force \
|
||||||
|
etc/neon_collector.yml \
|
||||||
|
etc/neon_collector_autoscaling.yml \
|
||||||
|
etc/sql_exporter.yml \
|
||||||
|
etc/sql_exporter_autoscaling.yml
|
||||||
|
|
||||||
|
.PHONY: jsonnetfmt-test
|
||||||
|
jsonnetfmt-test:
|
||||||
|
jsonnetfmt --test $(jsonnet_files)
|
||||||
|
|
||||||
|
.PHONY: jsonnetfmt-format
|
||||||
|
jsonnetfmt-format:
|
||||||
|
jsonnetfmt --in-place $(jsonnet_files)
|
||||||
21
compute/README.md
Normal file
21
compute/README.md
Normal file
@@ -0,0 +1,21 @@
|
|||||||
|
This directory contains files that are needed to build the compute
|
||||||
|
images, or included in the compute images.
|
||||||
|
|
||||||
|
Dockerfile.compute-node
|
||||||
|
To build the compute image
|
||||||
|
|
||||||
|
vm-image-spec.yaml
|
||||||
|
Instructions for vm-builder, to turn the compute-node image into
|
||||||
|
corresponding vm-compute-node image.
|
||||||
|
|
||||||
|
etc/
|
||||||
|
Configuration files included in /etc in the compute image
|
||||||
|
|
||||||
|
patches/
|
||||||
|
Some extensions need to be patched to work with Neon. This
|
||||||
|
directory contains such patches. They are applied to the extension
|
||||||
|
sources in Dockerfile.compute-node
|
||||||
|
|
||||||
|
In addition to these, postgres itself, the neon postgres extension,
|
||||||
|
and compute_ctl are built and copied into the compute image by
|
||||||
|
Dockerfile.compute-node.
|
||||||
17
compute/etc/README.md
Normal file
17
compute/etc/README.md
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
# Compute Configuration
|
||||||
|
|
||||||
|
These files are the configuration files for various other pieces of software
|
||||||
|
that will be running in the compute alongside Postgres.
|
||||||
|
|
||||||
|
## `sql_exporter`
|
||||||
|
|
||||||
|
### Adding a `sql_exporter` Metric
|
||||||
|
|
||||||
|
We use `sql_exporter` to export various metrics from Postgres. In order to add
|
||||||
|
a metric, you will need to create two files: a `libsonnet` and a `sql` file. You
|
||||||
|
will then import the `libsonnet` file in one of the collector files, and the
|
||||||
|
`sql` file will be imported in the `libsonnet` file.
|
||||||
|
|
||||||
|
In the event your statistic is an LSN, you may want to cast it to a `float8`
|
||||||
|
because Prometheus only supports floats. It's probably fine because `float8` can
|
||||||
|
store integers from `-2^53` to `+2^53` exactly.
|
||||||
51
compute/etc/neon_collector.jsonnet
Normal file
51
compute/etc/neon_collector.jsonnet
Normal file
@@ -0,0 +1,51 @@
|
|||||||
|
{
|
||||||
|
collector_name: 'neon_collector',
|
||||||
|
metrics: [
|
||||||
|
import 'sql_exporter/checkpoints_req.libsonnet',
|
||||||
|
import 'sql_exporter/checkpoints_timed.libsonnet',
|
||||||
|
import 'sql_exporter/compute_current_lsn.libsonnet',
|
||||||
|
import 'sql_exporter/compute_logical_snapshot_files.libsonnet',
|
||||||
|
import 'sql_exporter/compute_receive_lsn.libsonnet',
|
||||||
|
import 'sql_exporter/compute_subscriptions_count.libsonnet',
|
||||||
|
import 'sql_exporter/connection_counts.libsonnet',
|
||||||
|
import 'sql_exporter/db_total_size.libsonnet',
|
||||||
|
import 'sql_exporter/file_cache_read_wait_seconds_bucket.libsonnet',
|
||||||
|
import 'sql_exporter/file_cache_read_wait_seconds_count.libsonnet',
|
||||||
|
import 'sql_exporter/file_cache_read_wait_seconds_sum.libsonnet',
|
||||||
|
import 'sql_exporter/file_cache_write_wait_seconds_bucket.libsonnet',
|
||||||
|
import 'sql_exporter/file_cache_write_wait_seconds_count.libsonnet',
|
||||||
|
import 'sql_exporter/file_cache_write_wait_seconds_sum.libsonnet',
|
||||||
|
import 'sql_exporter/getpage_prefetch_discards_total.libsonnet',
|
||||||
|
import 'sql_exporter/getpage_prefetch_misses_total.libsonnet',
|
||||||
|
import 'sql_exporter/getpage_prefetch_requests_total.libsonnet',
|
||||||
|
import 'sql_exporter/getpage_prefetches_buffered.libsonnet',
|
||||||
|
import 'sql_exporter/getpage_sync_requests_total.libsonnet',
|
||||||
|
import 'sql_exporter/getpage_wait_seconds_bucket.libsonnet',
|
||||||
|
import 'sql_exporter/getpage_wait_seconds_count.libsonnet',
|
||||||
|
import 'sql_exporter/getpage_wait_seconds_sum.libsonnet',
|
||||||
|
import 'sql_exporter/lfc_approximate_working_set_size.libsonnet',
|
||||||
|
import 'sql_exporter/lfc_approximate_working_set_size_windows.libsonnet',
|
||||||
|
import 'sql_exporter/lfc_cache_size_limit.libsonnet',
|
||||||
|
import 'sql_exporter/lfc_hits.libsonnet',
|
||||||
|
import 'sql_exporter/lfc_misses.libsonnet',
|
||||||
|
import 'sql_exporter/lfc_used.libsonnet',
|
||||||
|
import 'sql_exporter/lfc_writes.libsonnet',
|
||||||
|
import 'sql_exporter/logical_slot_restart_lsn.libsonnet',
|
||||||
|
import 'sql_exporter/max_cluster_size.libsonnet',
|
||||||
|
import 'sql_exporter/pageserver_disconnects_total.libsonnet',
|
||||||
|
import 'sql_exporter/pageserver_requests_sent_total.libsonnet',
|
||||||
|
import 'sql_exporter/pageserver_send_flushes_total.libsonnet',
|
||||||
|
import 'sql_exporter/pageserver_open_requests.libsonnet',
|
||||||
|
import 'sql_exporter/pg_stats_userdb.libsonnet',
|
||||||
|
import 'sql_exporter/replication_delay_bytes.libsonnet',
|
||||||
|
import 'sql_exporter/replication_delay_seconds.libsonnet',
|
||||||
|
import 'sql_exporter/retained_wal.libsonnet',
|
||||||
|
import 'sql_exporter/wal_is_lost.libsonnet',
|
||||||
|
],
|
||||||
|
queries: [
|
||||||
|
{
|
||||||
|
query_name: 'neon_perf_counters',
|
||||||
|
query: importstr 'sql_exporter/neon_perf_counters.sql',
|
||||||
|
},
|
||||||
|
],
|
||||||
|
}
|
||||||
11
compute/etc/neon_collector_autoscaling.jsonnet
Normal file
11
compute/etc/neon_collector_autoscaling.jsonnet
Normal file
@@ -0,0 +1,11 @@
|
|||||||
|
{
|
||||||
|
collector_name: 'neon_collector_autoscaling',
|
||||||
|
metrics: [
|
||||||
|
import 'sql_exporter/lfc_approximate_working_set_size_windows.autoscaling.libsonnet',
|
||||||
|
import 'sql_exporter/lfc_cache_size_limit.libsonnet',
|
||||||
|
import 'sql_exporter/lfc_hits.libsonnet',
|
||||||
|
import 'sql_exporter/lfc_misses.libsonnet',
|
||||||
|
import 'sql_exporter/lfc_used.libsonnet',
|
||||||
|
import 'sql_exporter/lfc_writes.libsonnet',
|
||||||
|
],
|
||||||
|
}
|
||||||
17
compute/etc/pgbouncer.ini
Normal file
17
compute/etc/pgbouncer.ini
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
[databases]
|
||||||
|
*=host=localhost port=5432 auth_user=cloud_admin
|
||||||
|
[pgbouncer]
|
||||||
|
listen_port=6432
|
||||||
|
listen_addr=0.0.0.0
|
||||||
|
auth_type=scram-sha-256
|
||||||
|
auth_user=cloud_admin
|
||||||
|
auth_dbname=postgres
|
||||||
|
client_tls_sslmode=disable
|
||||||
|
server_tls_sslmode=disable
|
||||||
|
pool_mode=transaction
|
||||||
|
max_client_conn=10000
|
||||||
|
default_pool_size=64
|
||||||
|
max_prepared_statements=0
|
||||||
|
admin_users=postgres
|
||||||
|
unix_socket_dir=/tmp/
|
||||||
|
unix_socket_mode=0777
|
||||||
40
compute/etc/sql_exporter.jsonnet
Normal file
40
compute/etc/sql_exporter.jsonnet
Normal file
@@ -0,0 +1,40 @@
|
|||||||
|
function(collector_file, application_name='sql_exporter') {
|
||||||
|
// Configuration for sql_exporter for autoscaling-agent
|
||||||
|
// Global defaults.
|
||||||
|
global: {
|
||||||
|
// If scrape_timeout <= 0, no timeout is set unless Prometheus provides one. The default is 10s.
|
||||||
|
scrape_timeout: '10s',
|
||||||
|
// Subtracted from Prometheus' scrape_timeout to give us some headroom and prevent Prometheus from timing out first.
|
||||||
|
scrape_timeout_offset: '500ms',
|
||||||
|
// Minimum interval between collector runs: by default (0s) collectors are executed on every scrape.
|
||||||
|
min_interval: '0s',
|
||||||
|
// Maximum number of open connections to any one target. Metric queries will run concurrently on multiple connections,
|
||||||
|
// as will concurrent scrapes.
|
||||||
|
max_connections: 1,
|
||||||
|
// Maximum number of idle connections to any one target. Unless you use very long collection intervals, this should
|
||||||
|
// always be the same as max_connections.
|
||||||
|
max_idle_connections: 1,
|
||||||
|
// Maximum number of maximum amount of time a connection may be reused. Expired connections may be closed lazily before reuse.
|
||||||
|
// If 0, connections are not closed due to a connection's age.
|
||||||
|
max_connection_lifetime: '5m',
|
||||||
|
},
|
||||||
|
|
||||||
|
// The target to monitor and the collectors to execute on it.
|
||||||
|
target: {
|
||||||
|
// Data source name always has a URI schema that matches the driver name. In some cases (e.g. MySQL)
|
||||||
|
// the schema gets dropped or replaced to match the driver expected DSN format.
|
||||||
|
data_source_name: std.format('postgresql://cloud_admin@127.0.0.1:5432/postgres?sslmode=disable&application_name=%s', [application_name]),
|
||||||
|
|
||||||
|
// Collectors (referenced by name) to execute on the target.
|
||||||
|
// Glob patterns are supported (see <https://pkg.go.dev/path/filepath#Match> for syntax).
|
||||||
|
collectors: [
|
||||||
|
'neon_collector_autoscaling',
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
// Collector files specifies a list of globs. One collector definition is read from each matching file.
|
||||||
|
// Glob patterns are supported (see <https://pkg.go.dev/path/filepath#Match> for syntax).
|
||||||
|
collector_files: [
|
||||||
|
collector_file,
|
||||||
|
],
|
||||||
|
}
|
||||||
10
compute/etc/sql_exporter/checkpoints_req.libsonnet
Normal file
10
compute/etc/sql_exporter/checkpoints_req.libsonnet
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'checkpoints_req',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'Number of requested checkpoints',
|
||||||
|
key_labels: null,
|
||||||
|
values: [
|
||||||
|
'checkpoints_req',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/checkpoints_req.sql',
|
||||||
|
}
|
||||||
1
compute/etc/sql_exporter/checkpoints_req.sql
Normal file
1
compute/etc/sql_exporter/checkpoints_req.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
SELECT checkpoints_req FROM pg_stat_bgwriter;
|
||||||
10
compute/etc/sql_exporter/checkpoints_timed.libsonnet
Normal file
10
compute/etc/sql_exporter/checkpoints_timed.libsonnet
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'checkpoints_timed',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'Number of scheduled checkpoints',
|
||||||
|
key_labels: null,
|
||||||
|
values: [
|
||||||
|
'checkpoints_timed',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/checkpoints_timed.sql',
|
||||||
|
}
|
||||||
1
compute/etc/sql_exporter/checkpoints_timed.sql
Normal file
1
compute/etc/sql_exporter/checkpoints_timed.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
SELECT checkpoints_timed FROM pg_stat_bgwriter;
|
||||||
10
compute/etc/sql_exporter/compute_current_lsn.libsonnet
Normal file
10
compute/etc/sql_exporter/compute_current_lsn.libsonnet
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'compute_current_lsn',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'Current LSN of the database',
|
||||||
|
key_labels: null,
|
||||||
|
values: [
|
||||||
|
'lsn',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/compute_current_lsn.sql',
|
||||||
|
}
|
||||||
4
compute/etc/sql_exporter/compute_current_lsn.sql
Normal file
4
compute/etc/sql_exporter/compute_current_lsn.sql
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
SELECT CASE
|
||||||
|
WHEN pg_catalog.pg_is_in_recovery() THEN (pg_last_wal_replay_lsn() - '0/0')::FLOAT8
|
||||||
|
ELSE (pg_current_wal_lsn() - '0/0')::FLOAT8
|
||||||
|
END AS lsn;
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'compute_logical_snapshot_files',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'Number of snapshot files in pg_logical/snapshot',
|
||||||
|
key_labels: [
|
||||||
|
'timeline_id',
|
||||||
|
],
|
||||||
|
values: [
|
||||||
|
'num_logical_snapshot_files',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/compute_logical_snapshot_files.sql',
|
||||||
|
}
|
||||||
@@ -0,0 +1,7 @@
|
|||||||
|
SELECT
|
||||||
|
(SELECT setting FROM pg_settings WHERE name = 'neon.timeline_id') AS timeline_id,
|
||||||
|
-- Postgres creates temporary snapshot files of the form %X-%X.snap.%d.tmp.
|
||||||
|
-- These temporary snapshot files are renamed to the actual snapshot files
|
||||||
|
-- after they are completely built. We only WAL-log the completely built
|
||||||
|
-- snapshot files
|
||||||
|
(SELECT COUNT(*) FROM pg_ls_dir('pg_logical/snapshots') AS name WHERE name LIKE '%.snap') AS num_logical_snapshot_files;
|
||||||
10
compute/etc/sql_exporter/compute_receive_lsn.libsonnet
Normal file
10
compute/etc/sql_exporter/compute_receive_lsn.libsonnet
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'compute_receive_lsn',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'Returns the last write-ahead log location that has been received and synced to disk by streaming replication',
|
||||||
|
key_labels: null,
|
||||||
|
values: [
|
||||||
|
'lsn',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/compute_receive_lsn.sql',
|
||||||
|
}
|
||||||
4
compute/etc/sql_exporter/compute_receive_lsn.sql
Normal file
4
compute/etc/sql_exporter/compute_receive_lsn.sql
Normal file
@@ -0,0 +1,4 @@
|
|||||||
|
SELECT CASE
|
||||||
|
WHEN pg_catalog.pg_is_in_recovery() THEN (pg_last_wal_receive_lsn() - '0/0')::FLOAT8
|
||||||
|
ELSE 0
|
||||||
|
END AS lsn;
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'compute_subscriptions_count',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'Number of logical replication subscriptions grouped by enabled/disabled',
|
||||||
|
key_labels: [
|
||||||
|
'enabled',
|
||||||
|
],
|
||||||
|
values: [
|
||||||
|
'subscriptions_count',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/compute_subscriptions_count.sql',
|
||||||
|
}
|
||||||
1
compute/etc/sql_exporter/compute_subscriptions_count.sql
Normal file
1
compute/etc/sql_exporter/compute_subscriptions_count.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
SELECT subenabled::text AS enabled, count(*) AS subscriptions_count FROM pg_subscription GROUP BY subenabled;
|
||||||
13
compute/etc/sql_exporter/connection_counts.libsonnet
Normal file
13
compute/etc/sql_exporter/connection_counts.libsonnet
Normal file
@@ -0,0 +1,13 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'connection_counts',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'Connection counts',
|
||||||
|
key_labels: [
|
||||||
|
'datname',
|
||||||
|
'state',
|
||||||
|
],
|
||||||
|
values: [
|
||||||
|
'count',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/connection_counts.sql',
|
||||||
|
}
|
||||||
1
compute/etc/sql_exporter/connection_counts.sql
Normal file
1
compute/etc/sql_exporter/connection_counts.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
SELECT datname, state, count(*) AS count FROM pg_stat_activity WHERE state <> '' GROUP BY datname, state;
|
||||||
10
compute/etc/sql_exporter/db_total_size.libsonnet
Normal file
10
compute/etc/sql_exporter/db_total_size.libsonnet
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'db_total_size',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'Size of all databases',
|
||||||
|
key_labels: null,
|
||||||
|
values: [
|
||||||
|
'total',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/db_total_size.sql',
|
||||||
|
}
|
||||||
1
compute/etc/sql_exporter/db_total_size.sql
Normal file
1
compute/etc/sql_exporter/db_total_size.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
SELECT sum(pg_database_size(datname)) AS total FROM pg_database;
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'file_cache_read_wait_seconds_bucket',
|
||||||
|
type: 'counter',
|
||||||
|
help: 'Histogram buckets of LFC read operation latencies',
|
||||||
|
key_labels: [
|
||||||
|
'bucket_le',
|
||||||
|
],
|
||||||
|
values: [
|
||||||
|
'value',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/file_cache_read_wait_seconds_bucket.sql',
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
SELECT bucket_le, value FROM neon.neon_perf_counters WHERE metric = 'file_cache_read_wait_seconds_bucket';
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'file_cache_read_wait_seconds_count',
|
||||||
|
type: 'counter',
|
||||||
|
help: 'Number of read operations in LFC',
|
||||||
|
values: [
|
||||||
|
'file_cache_read_wait_seconds_count',
|
||||||
|
],
|
||||||
|
query_ref: 'neon_perf_counters',
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'file_cache_read_wait_seconds_sum',
|
||||||
|
type: 'counter',
|
||||||
|
help: 'Time spent in LFC read operations',
|
||||||
|
values: [
|
||||||
|
'file_cache_read_wait_seconds_sum',
|
||||||
|
],
|
||||||
|
query_ref: 'neon_perf_counters',
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'file_cache_write_wait_seconds_bucket',
|
||||||
|
type: 'counter',
|
||||||
|
help: 'Histogram buckets of LFC write operation latencies',
|
||||||
|
key_labels: [
|
||||||
|
'bucket_le',
|
||||||
|
],
|
||||||
|
values: [
|
||||||
|
'value',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/file_cache_write_wait_seconds_bucket.sql',
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
SELECT bucket_le, value FROM neon.neon_perf_counters WHERE metric = 'file_cache_write_wait_seconds_bucket';
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'file_cache_write_wait_seconds_count',
|
||||||
|
type: 'counter',
|
||||||
|
help: 'Number of write operations in LFC',
|
||||||
|
values: [
|
||||||
|
'file_cache_write_wait_seconds_count',
|
||||||
|
],
|
||||||
|
query_ref: 'neon_perf_counters',
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'file_cache_write_wait_seconds_sum',
|
||||||
|
type: 'counter',
|
||||||
|
help: 'Time spent in LFC write operations',
|
||||||
|
values: [
|
||||||
|
'file_cache_write_wait_seconds_sum',
|
||||||
|
],
|
||||||
|
query_ref: 'neon_perf_counters',
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'getpage_prefetch_discards_total',
|
||||||
|
type: 'counter',
|
||||||
|
help: 'Number of prefetch responses issued but not used',
|
||||||
|
values: [
|
||||||
|
'getpage_prefetch_discards_total',
|
||||||
|
],
|
||||||
|
query_ref: 'neon_perf_counters',
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'getpage_prefetch_misses_total',
|
||||||
|
type: 'counter',
|
||||||
|
help: "Total number of readahead misses; consisting of either prefetches that don't satisfy the LSN bounds once the prefetch got read by the backend, or cases where somehow no readahead was issued for the read",
|
||||||
|
values: [
|
||||||
|
'getpage_prefetch_misses_total',
|
||||||
|
],
|
||||||
|
query_ref: 'neon_perf_counters',
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'getpage_prefetch_requests_total',
|
||||||
|
type: 'counter',
|
||||||
|
help: 'Number of getpage issued for prefetching',
|
||||||
|
values: [
|
||||||
|
'getpage_prefetch_requests_total',
|
||||||
|
],
|
||||||
|
query_ref: 'neon_perf_counters',
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'getpage_prefetches_buffered',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'Number of prefetched pages buffered in neon',
|
||||||
|
values: [
|
||||||
|
'getpage_prefetches_buffered',
|
||||||
|
],
|
||||||
|
query_ref: 'neon_perf_counters',
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'getpage_sync_requests_total',
|
||||||
|
type: 'counter',
|
||||||
|
help: 'Number of synchronous getpage issued',
|
||||||
|
values: [
|
||||||
|
'getpage_sync_requests_total',
|
||||||
|
],
|
||||||
|
query_ref: 'neon_perf_counters',
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'getpage_wait_seconds_bucket',
|
||||||
|
type: 'counter',
|
||||||
|
help: 'Histogram buckets of getpage request latency',
|
||||||
|
key_labels: [
|
||||||
|
'bucket_le',
|
||||||
|
],
|
||||||
|
values: [
|
||||||
|
'value',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/getpage_wait_seconds_bucket.sql',
|
||||||
|
}
|
||||||
1
compute/etc/sql_exporter/getpage_wait_seconds_bucket.sql
Normal file
1
compute/etc/sql_exporter/getpage_wait_seconds_bucket.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
SELECT bucket_le, value FROM neon.neon_perf_counters WHERE metric = 'getpage_wait_seconds_bucket';
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'getpage_wait_seconds_count',
|
||||||
|
type: 'counter',
|
||||||
|
help: 'Number of getpage requests',
|
||||||
|
values: [
|
||||||
|
'getpage_wait_seconds_count',
|
||||||
|
],
|
||||||
|
query_ref: 'neon_perf_counters',
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'getpage_wait_seconds_sum',
|
||||||
|
type: 'counter',
|
||||||
|
help: 'Time spent in getpage requests',
|
||||||
|
values: [
|
||||||
|
'getpage_wait_seconds_sum',
|
||||||
|
],
|
||||||
|
query_ref: 'neon_perf_counters',
|
||||||
|
}
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
// DEPRECATED
|
||||||
|
|
||||||
|
{
|
||||||
|
metric_name: 'lfc_approximate_working_set_size',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'Approximate working set size in pages of 8192 bytes',
|
||||||
|
key_labels: null,
|
||||||
|
values: [
|
||||||
|
'approximate_working_set_size',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/lfc_approximate_working_set_size.sql',
|
||||||
|
}
|
||||||
@@ -0,0 +1 @@
|
|||||||
|
SELECT neon.approximate_working_set_size(false) AS approximate_working_set_size;
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'lfc_approximate_working_set_size_windows',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'Approximate working set size in pages of 8192 bytes',
|
||||||
|
key_labels: [
|
||||||
|
'duration_seconds',
|
||||||
|
],
|
||||||
|
values: [
|
||||||
|
'size',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/lfc_approximate_working_set_size_windows.autoscaling.sql',
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
-- NOTE: This is the "internal" / "machine-readable" version. This outputs the
|
||||||
|
-- working set size looking back 1..60 minutes, labeled with the number of
|
||||||
|
-- minutes.
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
x::text as duration_seconds,
|
||||||
|
neon.approximate_working_set_size_seconds(x) AS size
|
||||||
|
FROM (SELECT generate_series * 60 AS x FROM generate_series(1, 60)) AS t (x);
|
||||||
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'lfc_approximate_working_set_size_windows',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'Approximate working set size in pages of 8192 bytes',
|
||||||
|
key_labels: [
|
||||||
|
'duration',
|
||||||
|
],
|
||||||
|
values: [
|
||||||
|
'size',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/lfc_approximate_working_set_size_windows.sql',
|
||||||
|
}
|
||||||
@@ -0,0 +1,8 @@
|
|||||||
|
-- NOTE: This is the "public" / "human-readable" version. Here, we supply a
|
||||||
|
-- small selection of durations in a pretty-printed form.
|
||||||
|
|
||||||
|
SELECT
|
||||||
|
x AS duration,
|
||||||
|
neon.approximate_working_set_size_seconds(extract('epoch' FROM x::interval)::int) AS size FROM (
|
||||||
|
VALUES ('5m'), ('15m'), ('1h')
|
||||||
|
) AS t (x);
|
||||||
10
compute/etc/sql_exporter/lfc_cache_size_limit.libsonnet
Normal file
10
compute/etc/sql_exporter/lfc_cache_size_limit.libsonnet
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'lfc_cache_size_limit',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'LFC cache size limit in bytes',
|
||||||
|
key_labels: null,
|
||||||
|
values: [
|
||||||
|
'lfc_cache_size_limit',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/lfc_cache_size_limit.sql',
|
||||||
|
}
|
||||||
1
compute/etc/sql_exporter/lfc_cache_size_limit.sql
Normal file
1
compute/etc/sql_exporter/lfc_cache_size_limit.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
SELECT pg_size_bytes(current_setting('neon.file_cache_size_limit')) AS lfc_cache_size_limit;
|
||||||
10
compute/etc/sql_exporter/lfc_hits.libsonnet
Normal file
10
compute/etc/sql_exporter/lfc_hits.libsonnet
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'lfc_hits',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'lfc_hits',
|
||||||
|
key_labels: null,
|
||||||
|
values: [
|
||||||
|
'lfc_hits',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/lfc_hits.sql',
|
||||||
|
}
|
||||||
1
compute/etc/sql_exporter/lfc_hits.sql
Normal file
1
compute/etc/sql_exporter/lfc_hits.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
SELECT lfc_value AS lfc_hits FROM neon.neon_lfc_stats WHERE lfc_key = 'file_cache_hits';
|
||||||
10
compute/etc/sql_exporter/lfc_misses.libsonnet
Normal file
10
compute/etc/sql_exporter/lfc_misses.libsonnet
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'lfc_misses',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'lfc_misses',
|
||||||
|
key_labels: null,
|
||||||
|
values: [
|
||||||
|
'lfc_misses',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/lfc_misses.sql',
|
||||||
|
}
|
||||||
1
compute/etc/sql_exporter/lfc_misses.sql
Normal file
1
compute/etc/sql_exporter/lfc_misses.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
SELECT lfc_value AS lfc_misses FROM neon.neon_lfc_stats WHERE lfc_key = 'file_cache_misses';
|
||||||
10
compute/etc/sql_exporter/lfc_used.libsonnet
Normal file
10
compute/etc/sql_exporter/lfc_used.libsonnet
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'lfc_used',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'LFC chunks used (chunk = 1MB)',
|
||||||
|
key_labels: null,
|
||||||
|
values: [
|
||||||
|
'lfc_used',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/lfc_used.sql',
|
||||||
|
}
|
||||||
1
compute/etc/sql_exporter/lfc_used.sql
Normal file
1
compute/etc/sql_exporter/lfc_used.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
SELECT lfc_value AS lfc_used FROM neon.neon_lfc_stats WHERE lfc_key = 'file_cache_used';
|
||||||
10
compute/etc/sql_exporter/lfc_writes.libsonnet
Normal file
10
compute/etc/sql_exporter/lfc_writes.libsonnet
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'lfc_writes',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'lfc_writes',
|
||||||
|
key_labels: null,
|
||||||
|
values: [
|
||||||
|
'lfc_writes',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/lfc_writes.sql',
|
||||||
|
}
|
||||||
1
compute/etc/sql_exporter/lfc_writes.sql
Normal file
1
compute/etc/sql_exporter/lfc_writes.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
SELECT lfc_value AS lfc_writes FROM neon.neon_lfc_stats WHERE lfc_key = 'file_cache_writes';
|
||||||
15
compute/etc/sql_exporter/logical_slot_restart_lsn.libsonnet
Normal file
15
compute/etc/sql_exporter/logical_slot_restart_lsn.libsonnet
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
// Number of slots is limited by max_replication_slots, so collecting position
|
||||||
|
// for all of them shouldn't be bad.
|
||||||
|
|
||||||
|
{
|
||||||
|
metric_name: 'logical_slot_restart_lsn',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'restart_lsn of logical slots',
|
||||||
|
key_labels: [
|
||||||
|
'slot_name',
|
||||||
|
],
|
||||||
|
values: [
|
||||||
|
'restart_lsn',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/logical_slot_restart_lsn.sql',
|
||||||
|
}
|
||||||
3
compute/etc/sql_exporter/logical_slot_restart_lsn.sql
Normal file
3
compute/etc/sql_exporter/logical_slot_restart_lsn.sql
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
SELECT slot_name, (restart_lsn - '0/0')::FLOAT8 as restart_lsn
|
||||||
|
FROM pg_replication_slots
|
||||||
|
WHERE slot_type = 'logical';
|
||||||
10
compute/etc/sql_exporter/max_cluster_size.libsonnet
Normal file
10
compute/etc/sql_exporter/max_cluster_size.libsonnet
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'max_cluster_size',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'neon.max_cluster_size setting',
|
||||||
|
key_labels: null,
|
||||||
|
values: [
|
||||||
|
'max_cluster_size',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/max_cluster_size.sql',
|
||||||
|
}
|
||||||
1
compute/etc/sql_exporter/max_cluster_size.sql
Normal file
1
compute/etc/sql_exporter/max_cluster_size.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
SELECT setting::int AS max_cluster_size FROM pg_settings WHERE name = 'neon.max_cluster_size';
|
||||||
19
compute/etc/sql_exporter/neon_perf_counters.sql
Normal file
19
compute/etc/sql_exporter/neon_perf_counters.sql
Normal file
@@ -0,0 +1,19 @@
|
|||||||
|
WITH c AS (SELECT pg_catalog.jsonb_object_agg(metric, value) jb FROM neon.neon_perf_counters)
|
||||||
|
|
||||||
|
SELECT d.* FROM pg_catalog.jsonb_to_record((SELECT jb FROM c)) AS d(
|
||||||
|
file_cache_read_wait_seconds_count numeric,
|
||||||
|
file_cache_read_wait_seconds_sum numeric,
|
||||||
|
file_cache_write_wait_seconds_count numeric,
|
||||||
|
file_cache_write_wait_seconds_sum numeric,
|
||||||
|
getpage_wait_seconds_count numeric,
|
||||||
|
getpage_wait_seconds_sum numeric,
|
||||||
|
getpage_prefetch_requests_total numeric,
|
||||||
|
getpage_sync_requests_total numeric,
|
||||||
|
getpage_prefetch_misses_total numeric,
|
||||||
|
getpage_prefetch_discards_total numeric,
|
||||||
|
getpage_prefetches_buffered numeric,
|
||||||
|
pageserver_requests_sent_total numeric,
|
||||||
|
pageserver_disconnects_total numeric,
|
||||||
|
pageserver_send_flushes_total numeric,
|
||||||
|
pageserver_open_requests numeric
|
||||||
|
);
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'pageserver_disconnects_total',
|
||||||
|
type: 'counter',
|
||||||
|
help: 'Number of times that the connection to the pageserver was lost',
|
||||||
|
values: [
|
||||||
|
'pageserver_disconnects_total',
|
||||||
|
],
|
||||||
|
query_ref: 'neon_perf_counters',
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'pageserver_open_requests',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'Number of open requests to PageServer',
|
||||||
|
values: [
|
||||||
|
'pageserver_open_requests',
|
||||||
|
],
|
||||||
|
query_ref: 'neon_perf_counters',
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'pageserver_requests_sent_total',
|
||||||
|
type: 'counter',
|
||||||
|
help: 'Number of all requests sent to the pageserver (not just GetPage requests)',
|
||||||
|
values: [
|
||||||
|
'pageserver_requests_sent_total',
|
||||||
|
],
|
||||||
|
query_ref: 'neon_perf_counters',
|
||||||
|
}
|
||||||
@@ -0,0 +1,9 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'pageserver_send_flushes_total',
|
||||||
|
type: 'counter',
|
||||||
|
help: 'Number of flushes to the pageserver connection',
|
||||||
|
values: [
|
||||||
|
'pageserver_send_flushes_total',
|
||||||
|
],
|
||||||
|
query_ref: 'neon_perf_counters',
|
||||||
|
}
|
||||||
18
compute/etc/sql_exporter/pg_stats_userdb.libsonnet
Normal file
18
compute/etc/sql_exporter/pg_stats_userdb.libsonnet
Normal file
@@ -0,0 +1,18 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'pg_stats_userdb',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'Stats for several oldest non-system dbs',
|
||||||
|
key_labels: [
|
||||||
|
'datname',
|
||||||
|
],
|
||||||
|
value_label: 'kind',
|
||||||
|
values: [
|
||||||
|
'db_size',
|
||||||
|
'deadlocks',
|
||||||
|
// Rows
|
||||||
|
'inserted',
|
||||||
|
'updated',
|
||||||
|
'deleted',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/pg_stats_userdb.sql',
|
||||||
|
}
|
||||||
10
compute/etc/sql_exporter/pg_stats_userdb.sql
Normal file
10
compute/etc/sql_exporter/pg_stats_userdb.sql
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
-- We export stats for 10 non-system databases. Without this limit it is too
|
||||||
|
-- easy to abuse the system by creating lots of databases.
|
||||||
|
|
||||||
|
SELECT pg_database_size(datname) AS db_size, deadlocks, tup_inserted AS inserted,
|
||||||
|
tup_updated AS updated, tup_deleted AS deleted, datname
|
||||||
|
FROM pg_stat_database
|
||||||
|
WHERE datname IN (
|
||||||
|
SELECT datname FROM pg_database
|
||||||
|
WHERE datname <> 'postgres' AND NOT datistemplate ORDER BY oid LIMIT 10
|
||||||
|
);
|
||||||
10
compute/etc/sql_exporter/replication_delay_bytes.libsonnet
Normal file
10
compute/etc/sql_exporter/replication_delay_bytes.libsonnet
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'replication_delay_bytes',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'Bytes between received and replayed LSN',
|
||||||
|
key_labels: null,
|
||||||
|
values: [
|
||||||
|
'replication_delay_bytes',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/replication_delay_bytes.sql',
|
||||||
|
}
|
||||||
6
compute/etc/sql_exporter/replication_delay_bytes.sql
Normal file
6
compute/etc/sql_exporter/replication_delay_bytes.sql
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
-- We use a GREATEST call here because this calculation can be negative. The
|
||||||
|
-- calculation is not atomic, meaning after we've gotten the receive LSN, the
|
||||||
|
-- replay LSN may have advanced past the receive LSN we are using for the
|
||||||
|
-- calculation.
|
||||||
|
|
||||||
|
SELECT GREATEST(0, pg_wal_lsn_diff(pg_last_wal_receive_lsn(), pg_last_wal_replay_lsn())) AS replication_delay_bytes;
|
||||||
10
compute/etc/sql_exporter/replication_delay_seconds.libsonnet
Normal file
10
compute/etc/sql_exporter/replication_delay_seconds.libsonnet
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'replication_delay_seconds',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'Time since last LSN was replayed',
|
||||||
|
key_labels: null,
|
||||||
|
values: [
|
||||||
|
'replication_delay_seconds',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/replication_delay_seconds.sql',
|
||||||
|
}
|
||||||
5
compute/etc/sql_exporter/replication_delay_seconds.sql
Normal file
5
compute/etc/sql_exporter/replication_delay_seconds.sql
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
SELECT
|
||||||
|
CASE
|
||||||
|
WHEN pg_last_wal_receive_lsn() = pg_last_wal_replay_lsn() THEN 0
|
||||||
|
ELSE GREATEST(0, EXTRACT (EPOCH FROM now() - pg_last_xact_replay_timestamp()))
|
||||||
|
END AS replication_delay_seconds;
|
||||||
12
compute/etc/sql_exporter/retained_wal.libsonnet
Normal file
12
compute/etc/sql_exporter/retained_wal.libsonnet
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'retained_wal',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'Retained WAL in inactive replication slots',
|
||||||
|
key_labels: [
|
||||||
|
'slot_name',
|
||||||
|
],
|
||||||
|
values: [
|
||||||
|
'retained_wal',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/retained_wal.sql',
|
||||||
|
}
|
||||||
5
compute/etc/sql_exporter/retained_wal.sql
Normal file
5
compute/etc/sql_exporter/retained_wal.sql
Normal file
@@ -0,0 +1,5 @@
|
|||||||
|
SELECT
|
||||||
|
slot_name,
|
||||||
|
pg_wal_lsn_diff(pg_current_wal_lsn(), restart_lsn)::FLOAT8 AS retained_wal
|
||||||
|
FROM pg_replication_slots
|
||||||
|
WHERE active = false;
|
||||||
12
compute/etc/sql_exporter/wal_is_lost.libsonnet
Normal file
12
compute/etc/sql_exporter/wal_is_lost.libsonnet
Normal file
@@ -0,0 +1,12 @@
|
|||||||
|
{
|
||||||
|
metric_name: 'wal_is_lost',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'Whether or not the replication slot wal_status is lost',
|
||||||
|
key_labels: [
|
||||||
|
'slot_name',
|
||||||
|
],
|
||||||
|
values: [
|
||||||
|
'wal_is_lost',
|
||||||
|
],
|
||||||
|
query: importstr 'sql_exporter/wal_is_lost.sql',
|
||||||
|
}
|
||||||
7
compute/etc/sql_exporter/wal_is_lost.sql
Normal file
7
compute/etc/sql_exporter/wal_is_lost.sql
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
SELECT
|
||||||
|
slot_name,
|
||||||
|
CASE
|
||||||
|
WHEN wal_status = 'lost' THEN 1
|
||||||
|
ELSE 0
|
||||||
|
END AS wal_is_lost
|
||||||
|
FROM pg_replication_slots;
|
||||||
3949
compute/patches/cloud_regress_pg16.patch
Normal file
3949
compute/patches/cloud_regress_pg16.patch
Normal file
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user