mirror of
https://github.com/neondatabase/neon.git
synced 2026-02-06 04:00:37 +00:00
Compare commits
314 Commits
initdb-cac
...
remove-pos
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dc8ca6aaa1 | ||
|
|
af50fd76b7 | ||
|
|
da16233f64 | ||
|
|
80466bdca2 | ||
|
|
248558dee8 | ||
|
|
3bad52543f | ||
|
|
3d64a7ddcd | ||
|
|
25f1e5cfeb | ||
|
|
8dd555d396 | ||
|
|
01b6843e12 | ||
|
|
93987b5a4a | ||
|
|
33baca07b6 | ||
|
|
923974d4da | ||
|
|
e7277885b3 | ||
|
|
80262e724f | ||
|
|
85b954f449 | ||
|
|
76328ada05 | ||
|
|
b54b632c6a | ||
|
|
9909551f47 | ||
|
|
700b102b0f | ||
|
|
dbadb0f9bb | ||
|
|
8297f7a181 | ||
|
|
2090e928d1 | ||
|
|
05eff3a67e | ||
|
|
c6cf5e7c0f | ||
|
|
e0c7f1ce15 | ||
|
|
6f5c262684 | ||
|
|
9768f09f6b | ||
|
|
db900ae9d0 | ||
|
|
4d9036bf1f | ||
|
|
b3bedda6fd | ||
|
|
b782b11b33 | ||
|
|
5069123b6d | ||
|
|
fb0406e9d2 | ||
|
|
b8a311131e | ||
|
|
d589498c6f | ||
|
|
6f34f97573 | ||
|
|
b86432c29e | ||
|
|
ac1205c14c | ||
|
|
e3ff87ce3b | ||
|
|
0595320c87 | ||
|
|
92d5e0e87a | ||
|
|
3a3bd34a28 | ||
|
|
64949a37a9 | ||
|
|
6f8fcdf9ea | ||
|
|
fcb55a2aa2 | ||
|
|
f36cf3f885 | ||
|
|
8dca188974 | ||
|
|
b7fa93f6b7 | ||
|
|
1e8e04bb2c | ||
|
|
94369af782 | ||
|
|
34b6bd416a | ||
|
|
49d5e56c08 | ||
|
|
aca81f5fa4 | ||
|
|
2dcac94194 | ||
|
|
ababa50cce | ||
|
|
163beaf9ad | ||
|
|
5b37485c99 | ||
|
|
ed958da38a | ||
|
|
cc25ef7342 | ||
|
|
71d09c78d4 | ||
|
|
62a334871f | ||
|
|
e162ab8b53 | ||
|
|
5cbdec9c79 | ||
|
|
ec6d3422a5 | ||
|
|
fecff15f18 | ||
|
|
3532ae76ef | ||
|
|
15fecffe6b | ||
|
|
98fee7a97d | ||
|
|
b7173b1ef0 | ||
|
|
24654b8eee | ||
|
|
b8304f90d6 | ||
|
|
d762ad0883 | ||
|
|
928d98b6dc | ||
|
|
24398bf060 | ||
|
|
63b3491c1b | ||
|
|
858867c627 | ||
|
|
299cde899b | ||
|
|
4c9835f4a3 | ||
|
|
f3a3eefd26 | ||
|
|
a7c05686cc | ||
|
|
8b47938140 | ||
|
|
35e7d91bc9 | ||
|
|
22d8834474 | ||
|
|
db68e82235 | ||
|
|
934dbb61f5 | ||
|
|
67d5d98b19 | ||
|
|
e0fa6bcf1a | ||
|
|
409a286eaa | ||
|
|
0551cfb6a7 | ||
|
|
ed694732e7 | ||
|
|
8a114e3aed | ||
|
|
55b246085e | ||
|
|
9668601f46 | ||
|
|
3140c14d60 | ||
|
|
d6281cbe65 | ||
|
|
d490ad23e0 | ||
|
|
f14e45f0ce | ||
|
|
89a65a9e5a | ||
|
|
bc6b8cee01 | ||
|
|
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 |
@@ -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-bookworm
|
||||||
|
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 \
|
||||||
|
|||||||
36
.github/workflows/_build-and-test-locally.yml
vendored
36
.github/workflows/_build-and-test-locally.yml
vendored
@@ -53,20 +53,6 @@ jobs:
|
|||||||
BUILD_TAG: ${{ inputs.build-tag }}
|
BUILD_TAG: ${{ inputs.build-tag }}
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Fix git ownership
|
|
||||||
run: |
|
|
||||||
# Workaround for `fatal: detected dubious ownership in repository at ...`
|
|
||||||
#
|
|
||||||
# Use both ${{ github.workspace }} and ${GITHUB_WORKSPACE} because they're different on host and in containers
|
|
||||||
# Ref https://github.com/actions/checkout/issues/785
|
|
||||||
#
|
|
||||||
git config --global --add safe.directory ${{ github.workspace }}
|
|
||||||
git config --global --add safe.directory ${GITHUB_WORKSPACE}
|
|
||||||
for r in 14 15 16 17; do
|
|
||||||
git config --global --add safe.directory "${{ github.workspace }}/vendor/postgres-v$r"
|
|
||||||
git config --global --add safe.directory "${GITHUB_WORKSPACE}/vendor/postgres-v$r"
|
|
||||||
done
|
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
submodules: true
|
submodules: true
|
||||||
@@ -124,28 +110,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', 'build-tools.Dockerfile') }}
|
||||||
|
|
||||||
- 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', 'build-tools.Dockerfile') }}
|
||||||
|
|
||||||
- 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', 'build-tools.Dockerfile') }}
|
||||||
|
|
||||||
- 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', 'build-tools.Dockerfile') }}
|
||||||
|
|
||||||
- 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 +222,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 +241,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
|
||||||
|
|||||||
125
.github/workflows/benchmarking.yml
vendored
125
.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-bookworm
|
||||||
|
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-bookworm
|
||||||
|
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-bookworm"
|
||||||
matrix='{
|
matrix='{
|
||||||
"pg_version" : [
|
"pg_version" : [
|
||||||
16
|
16
|
||||||
@@ -286,9 +299,9 @@ jobs:
|
|||||||
"include": [{ "pg_version": 16, "region_id": "'"$region_id_default"'", "platform": "neonvm-captest-freetier", "db_size": "3gb" ,"runner": '"$runner_default"', "image": "'"$image_default"'" },
|
"include": [{ "pg_version": 16, "region_id": "'"$region_id_default"'", "platform": "neonvm-captest-freetier", "db_size": "3gb" ,"runner": '"$runner_default"', "image": "'"$image_default"'" },
|
||||||
{ "pg_version": 16, "region_id": "'"$region_id_default"'", "platform": "neonvm-captest-new", "db_size": "10gb","runner": '"$runner_default"', "image": "'"$image_default"'" },
|
{ "pg_version": 16, "region_id": "'"$region_id_default"'", "platform": "neonvm-captest-new", "db_size": "10gb","runner": '"$runner_default"', "image": "'"$image_default"'" },
|
||||||
{ "pg_version": 16, "region_id": "'"$region_id_default"'", "platform": "neonvm-captest-new", "db_size": "50gb","runner": '"$runner_default"', "image": "'"$image_default"'" },
|
{ "pg_version": 16, "region_id": "'"$region_id_default"'", "platform": "neonvm-captest-new", "db_size": "50gb","runner": '"$runner_default"', "image": "'"$image_default"'" },
|
||||||
{ "pg_version": 16, "region_id": "azure-eastus2", "platform": "neonvm-azure-captest-freetier", "db_size": "3gb" ,"runner": '"$runner_azure"', "image": "neondatabase/build-tools:pinned" },
|
{ "pg_version": 16, "region_id": "azure-eastus2", "platform": "neonvm-azure-captest-freetier", "db_size": "3gb" ,"runner": '"$runner_azure"', "image": "neondatabase/build-tools:pinned-bookworm" },
|
||||||
{ "pg_version": 16, "region_id": "azure-eastus2", "platform": "neonvm-azure-captest-new", "db_size": "10gb","runner": '"$runner_azure"', "image": "neondatabase/build-tools:pinned" },
|
{ "pg_version": 16, "region_id": "azure-eastus2", "platform": "neonvm-azure-captest-new", "db_size": "10gb","runner": '"$runner_azure"', "image": "neondatabase/build-tools:pinned-bookworm" },
|
||||||
{ "pg_version": 16, "region_id": "azure-eastus2", "platform": "neonvm-azure-captest-new", "db_size": "50gb","runner": '"$runner_azure"', "image": "neondatabase/build-tools:pinned" },
|
{ "pg_version": 16, "region_id": "azure-eastus2", "platform": "neonvm-azure-captest-new", "db_size": "50gb","runner": '"$runner_azure"', "image": "neondatabase/build-tools:pinned-bookworm" },
|
||||||
{ "pg_version": 16, "region_id": "'"$region_id_default"'", "platform": "neonvm-captest-sharding-reuse", "db_size": "50gb","runner": '"$runner_default"', "image": "'"$image_default"'" }]
|
{ "pg_version": 16, "region_id": "'"$region_id_default"'", "platform": "neonvm-captest-sharding-reuse", "db_size": "50gb","runner": '"$runner_default"', "image": "'"$image_default"'" }]
|
||||||
}'
|
}'
|
||||||
|
|
||||||
@@ -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-bookworm
|
||||||
|
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-bookworm
|
||||||
|
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-bookworm
|
||||||
|
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: build-tools.Dockerfile
|
||||||
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
|
||||||
|
|||||||
284
.github/workflows/build_and_test.yml
vendored
284
.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
|
||||||
@@ -209,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
|
||||||
@@ -224,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 }}
|
||||||
@@ -237,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
|
||||||
@@ -257,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 }}
|
||||||
@@ -288,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
|
||||||
|
|
||||||
@@ -315,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 }}
|
||||||
@@ -363,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 }}
|
||||||
@@ -507,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 ]
|
||||||
@@ -530,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:
|
||||||
@@ -549,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')) }}
|
||||||
@@ -592,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/compute-node.Dockerfile
|
||||||
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/compute-node.Dockerfile
|
||||||
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
|
||||||
@@ -634,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/compute-node.Dockerfile
|
||||||
|
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 ]
|
||||||
@@ -648,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
|
||||||
@@ -658,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:
|
||||||
@@ -682,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 }}
|
||||||
@@ -699,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
|
||||||
@@ -721,18 +834,19 @@ 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 \
|
-size=2G \
|
||||||
-src=neondatabase/compute-node-${{ matrix.version }}:${{ needs.tag.outputs.build-tag }} \
|
-spec=compute/vm-image-spec-${{ matrix.version.debian }}.yaml \
|
||||||
-dst=neondatabase/vm-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.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 ]
|
||||||
@@ -790,6 +904,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
|
||||||
|
|
||||||
@@ -834,13 +951,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'
|
||||||
@@ -956,20 +1079,6 @@ jobs:
|
|||||||
runs-on: [ self-hosted, small ]
|
runs-on: [ self-hosted, small ]
|
||||||
container: 369495373322.dkr.ecr.eu-central-1.amazonaws.com/ansible:latest
|
container: 369495373322.dkr.ecr.eu-central-1.amazonaws.com/ansible:latest
|
||||||
steps:
|
steps:
|
||||||
- name: Fix git ownership
|
|
||||||
run: |
|
|
||||||
# Workaround for `fatal: detected dubious ownership in repository at ...`
|
|
||||||
#
|
|
||||||
# Use both ${{ github.workspace }} and ${GITHUB_WORKSPACE} because they're different on host and in containers
|
|
||||||
# Ref https://github.com/actions/checkout/issues/785
|
|
||||||
#
|
|
||||||
git config --global --add safe.directory ${{ github.workspace }}
|
|
||||||
git config --global --add safe.directory ${GITHUB_WORKSPACE}
|
|
||||||
for r in 14 15 16 17; do
|
|
||||||
git config --global --add safe.directory "${{ github.workspace }}/vendor/postgres-v$r"
|
|
||||||
git config --global --add safe.directory "${GITHUB_WORKSPACE}/vendor/postgres-v$r"
|
|
||||||
done
|
|
||||||
|
|
||||||
- uses: actions/checkout@v4
|
- uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Trigger deploy workflow
|
- name: Trigger deploy workflow
|
||||||
@@ -978,7 +1087,6 @@ jobs:
|
|||||||
run: |
|
run: |
|
||||||
if [[ "$GITHUB_REF_NAME" == "main" ]]; then
|
if [[ "$GITHUB_REF_NAME" == "main" ]]; then
|
||||||
gh workflow --repo neondatabase/infra run deploy-dev.yml --ref main -f branch=main -f dockerTag=${{needs.tag.outputs.build-tag}} -f deployPreprodRegion=false
|
gh workflow --repo neondatabase/infra run deploy-dev.yml --ref main -f branch=main -f dockerTag=${{needs.tag.outputs.build-tag}} -f deployPreprodRegion=false
|
||||||
gh workflow --repo neondatabase/azure run deploy.yml -f dockerTag=${{needs.tag.outputs.build-tag}}
|
|
||||||
elif [[ "$GITHUB_REF_NAME" == "release" ]]; then
|
elif [[ "$GITHUB_REF_NAME" == "release" ]]; then
|
||||||
gh workflow --repo neondatabase/infra run deploy-dev.yml --ref main \
|
gh workflow --repo neondatabase/infra run deploy-dev.yml --ref main \
|
||||||
-f deployPgSniRouter=false \
|
-f deployPgSniRouter=false \
|
||||||
@@ -1009,7 +1117,10 @@ jobs:
|
|||||||
|
|
||||||
gh workflow --repo neondatabase/infra run deploy-proxy-prod.yml --ref main \
|
gh workflow --repo neondatabase/infra run deploy-proxy-prod.yml --ref main \
|
||||||
-f deployPgSniRouter=true \
|
-f deployPgSniRouter=true \
|
||||||
-f deployProxy=true \
|
-f deployProxyLink=true \
|
||||||
|
-f deployPrivatelinkProxy=true \
|
||||||
|
-f deployProxyScram=true \
|
||||||
|
-f deployProxyAuthBroker=true \
|
||||||
-f branch=main \
|
-f branch=main \
|
||||||
-f dockerTag=${{needs.tag.outputs.build-tag}}
|
-f dockerTag=${{needs.tag.outputs.build-tag}}
|
||||||
else
|
else
|
||||||
@@ -1109,10 +1220,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
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ jobs:
|
|||||||
id: get-build-tools-tag
|
id: get-build-tools-tag
|
||||||
env:
|
env:
|
||||||
IMAGE_TAG: |
|
IMAGE_TAG: |
|
||||||
${{ hashFiles('Dockerfile.build-tools',
|
${{ hashFiles('build-tools.Dockerfile',
|
||||||
'.github/workflows/check-build-tools-image.yml',
|
'.github/workflows/check-build-tools-image.yml',
|
||||||
'.github/workflows/build-build-tools-image.yml') }}
|
'.github/workflows/build-build-tools-image.yml') }}
|
||||||
run: |
|
run: |
|
||||||
|
|||||||
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-bookworm
|
||||||
|
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/compute-node.Dockerfile)
|
||||||
platforms=$(echo "${platforms}" | jq --compact-output '. += ["k8s-neonvm"] | unique')
|
platforms=$(echo "${platforms}" | jq --compact-output '. += ["k8s-neonvm"] | unique')
|
||||||
;;
|
;;
|
||||||
*)
|
*)
|
||||||
|
|||||||
2
.gitignore
vendored
2
.gitignore
vendored
@@ -6,6 +6,8 @@ __pycache__/
|
|||||||
test_output/
|
test_output/
|
||||||
.vscode
|
.vscode
|
||||||
.idea
|
.idea
|
||||||
|
*.swp
|
||||||
|
tags
|
||||||
neon.iml
|
neon.iml
|
||||||
/.neon
|
/.neon
|
||||||
/integration_tests/.neon
|
/integration_tests/.neon
|
||||||
|
|||||||
@@ -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
|
||||||
|
|||||||
972
Cargo.lock
generated
972
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
62
Cargo.toml
62
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,20 +131,19 @@ 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"
|
||||||
rpds = "0.13"
|
rpds = "0.13"
|
||||||
rustc-hash = "1.1.0"
|
rustc-hash = "1.1.0"
|
||||||
rustls = "0.22"
|
rustls = "0.23"
|
||||||
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"
|
||||||
@@ -172,18 +172,18 @@ tikv-jemalloc-ctl = "0.5"
|
|||||||
tokio = { version = "1.17", features = ["macros"] }
|
tokio = { version = "1.17", features = ["macros"] }
|
||||||
tokio-epoll-uring = { git = "https://github.com/neondatabase/tokio-epoll-uring.git" , branch = "main" }
|
tokio-epoll-uring = { git = "https://github.com/neondatabase/tokio-epoll-uring.git" , branch = "main" }
|
||||||
tokio-io-timeout = "1.2.0"
|
tokio-io-timeout = "1.2.0"
|
||||||
tokio-postgres-rustls = "0.11.0"
|
tokio-postgres-rustls = "0.12.0"
|
||||||
tokio-rustls = "0.25"
|
tokio-rustls = "0.26"
|
||||||
tokio-stream = "0.1"
|
tokio-stream = "0.1"
|
||||||
tokio-tar = "0.3"
|
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 }
|
||||||
@@ -192,8 +192,8 @@ url = "2.2"
|
|||||||
urlencoding = "2.1"
|
urlencoding = "2.1"
|
||||||
uuid = { version = "1.6.1", features = ["v4", "v7", "serde"] }
|
uuid = { version = "1.6.1", features = ["v4", "v7", "serde"] }
|
||||||
walkdir = "2.3.2"
|
walkdir = "2.3.2"
|
||||||
rustls-native-certs = "0.7"
|
rustls-native-certs = "0.8"
|
||||||
x509-parser = "0.15"
|
x509-parser = "0.16"
|
||||||
whoami = "1.5.1"
|
whoami = "1.5.1"
|
||||||
|
|
||||||
## TODO replace this with tracing
|
## TODO replace this with tracing
|
||||||
@@ -244,10 +244,10 @@ workspace_hack = { version = "0.1", path = "./workspace_hack/" }
|
|||||||
|
|
||||||
## Build dependencies
|
## Build dependencies
|
||||||
criterion = "0.5.1"
|
criterion = "0.5.1"
|
||||||
rcgen = "0.12"
|
rcgen = "0.13"
|
||||||
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
|
||||||
|
|
||||||
|
|||||||
19
Makefile
19
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,12 +291,13 @@ 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
|
||||||
.PHONY: distclean
|
.PHONY: distclean
|
||||||
distclean:
|
distclean:
|
||||||
rm -rf $(POSTGRES_INSTALL_DIR)
|
$(RM) -r $(POSTGRES_INSTALL_DIR)
|
||||||
$(CARGO_CMD_PREFIX) cargo clean
|
$(CARGO_CMD_PREFIX) cargo clean
|
||||||
|
|
||||||
.PHONY: fmt
|
.PHONY: fmt
|
||||||
@@ -328,12 +329,12 @@ postgres-%-pgindent: postgres-%-pg-bsd-indent postgres-%-typedefs.list
|
|||||||
$(ROOT_PROJECT_DIR)/vendor/postgres-$*/src/tools/pgindent/pgindent --typedefs postgres-$*-typedefs-full.list \
|
$(ROOT_PROJECT_DIR)/vendor/postgres-$*/src/tools/pgindent/pgindent --typedefs postgres-$*-typedefs-full.list \
|
||||||
$(ROOT_PROJECT_DIR)/vendor/postgres-$*/src/ \
|
$(ROOT_PROJECT_DIR)/vendor/postgres-$*/src/ \
|
||||||
--excludes $(ROOT_PROJECT_DIR)/vendor/postgres-$*/src/tools/pgindent/exclude_file_patterns
|
--excludes $(ROOT_PROJECT_DIR)/vendor/postgres-$*/src/tools/pgindent/exclude_file_patterns
|
||||||
rm -f pg*.BAK
|
$(RM) pg*.BAK
|
||||||
|
|
||||||
# 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 \
|
||||||
|
|||||||
@@ -31,7 +31,7 @@ See developer documentation in [SUMMARY.md](/docs/SUMMARY.md) for more informati
|
|||||||
```bash
|
```bash
|
||||||
apt install build-essential libtool libreadline-dev zlib1g-dev flex bison libseccomp-dev \
|
apt install build-essential libtool libreadline-dev zlib1g-dev flex bison libseccomp-dev \
|
||||||
libssl-dev clang pkg-config libpq-dev cmake postgresql-client protobuf-compiler \
|
libssl-dev clang pkg-config libpq-dev cmake postgresql-client protobuf-compiler \
|
||||||
libcurl4-openssl-dev openssl python3-poetry lsof libicu-dev
|
libprotobuf-dev libcurl4-openssl-dev openssl python3-poetry lsof libicu-dev
|
||||||
```
|
```
|
||||||
* On Fedora, these packages are needed:
|
* On Fedora, these packages are needed:
|
||||||
```bash
|
```bash
|
||||||
@@ -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
|
||||||
|
|||||||
@@ -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 \
|
||||||
@@ -72,9 +72,9 @@ RUN curl -sL "https://github.com/peak/s5cmd/releases/download/v${S5CMD_VERSION}/
|
|||||||
&& mv s5cmd /usr/local/bin/s5cmd
|
&& mv s5cmd /usr/local/bin/s5cmd
|
||||||
|
|
||||||
# LLVM
|
# LLVM
|
||||||
ENV LLVM_VERSION=18
|
ENV LLVM_VERSION=19
|
||||||
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/*
|
||||||
@@ -99,7 +99,7 @@ RUN curl "https://awscli.amazonaws.com/awscli-exe-linux-$(uname -m).zip" -o "aws
|
|||||||
&& rm awscliv2.zip
|
&& rm awscliv2.zip
|
||||||
|
|
||||||
# Mold: A Modern Linker
|
# Mold: A Modern Linker
|
||||||
ENV MOLD_VERSION=v2.33.0
|
ENV MOLD_VERSION=v2.34.1
|
||||||
RUN set -e \
|
RUN set -e \
|
||||||
&& git clone https://github.com/rui314/mold.git \
|
&& git clone https://github.com/rui314/mold.git \
|
||||||
&& mkdir mold/build \
|
&& mkdir mold/build \
|
||||||
@@ -142,7 +142,7 @@ RUN wget -O /tmp/openssl-${OPENSSL_VERSION}.tar.gz https://www.openssl.org/sourc
|
|||||||
# Use the same version of libicu as the compute nodes so that
|
# Use the same version of libicu as the compute nodes so that
|
||||||
# clusters created using inidb on pageserver can be used by computes.
|
# clusters created using inidb on pageserver can be used by computes.
|
||||||
#
|
#
|
||||||
# TODO: at this time, Dockerfile.compute-node uses the debian bullseye libicu
|
# TODO: at this time, compute-node.Dockerfile uses the debian bullseye libicu
|
||||||
# package, which is 67.1. We're duplicating that knowledge here, and also, technically,
|
# package, which is 67.1. We're duplicating that knowledge here, and also, technically,
|
||||||
# Debian has a few patches on top of 67.1 that we're not adding here.
|
# Debian has a few patches on top of 67.1 that we're not adding here.
|
||||||
ENV ICU_VERSION=67.1
|
ENV ICU_VERSION=67.1
|
||||||
@@ -192,7 +192,7 @@ WORKDIR /home/nonroot
|
|||||||
|
|
||||||
# Rust
|
# Rust
|
||||||
# Please keep the version of llvm (installed above) in sync with rust llvm (`rustc --version --verbose | grep LLVM`)
|
# Please keep the version of llvm (installed above) in sync with rust llvm (`rustc --version --verbose | grep LLVM`)
|
||||||
ENV RUSTC_VERSION=1.81.0
|
ENV RUSTC_VERSION=1.82.0
|
||||||
ENV RUSTUP_HOME="/home/nonroot/.rustup"
|
ENV RUSTUP_HOME="/home/nonroot/.rustup"
|
||||||
ENV PATH="/home/nonroot/.cargo/bin:${PATH}"
|
ENV PATH="/home/nonroot/.cargo/bin:${PATH}"
|
||||||
ARG RUSTFILT_VERSION=0.2.1
|
ARG RUSTFILT_VERSION=0.2.1
|
||||||
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
|
||||||
49
compute/Makefile
Normal file
49
compute/Makefile
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
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=jsonnet:etc jsonnet \
|
||||||
|
--output-file etc/$@ \
|
||||||
|
--ext-str pg_version=$(PG_VERSION) \
|
||||||
|
etc/neon_collector.jsonnet
|
||||||
|
|
||||||
|
neon_collector_autoscaling.yml: $(jsonnet_files)
|
||||||
|
JSONNET_PATH=jsonnet:etc jsonnet \
|
||||||
|
--output-file etc/$@ \
|
||||||
|
--ext-str pg_version=$(PG_VERSION) \
|
||||||
|
etc/neon_collector_autoscaling.jsonnet
|
||||||
|
|
||||||
|
sql_exporter.yml: $(jsonnet_files)
|
||||||
|
JSONNET_PATH=etc jsonnet \
|
||||||
|
--output-file etc/$@ \
|
||||||
|
--tla-str collector_name=neon_collector \
|
||||||
|
--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_name=neon_collector_autoscaling \
|
||||||
|
--tla-str collector_file=neon_collector_autoscaling.yml \
|
||||||
|
--tla-str application_name=sql_exporter_autoscaling \
|
||||||
|
etc/sql_exporter.jsonnet
|
||||||
|
|
||||||
|
.PHONY: clean
|
||||||
|
clean:
|
||||||
|
$(RM) \
|
||||||
|
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.
|
||||||
|
|
||||||
|
compute-node.Dockerfile
|
||||||
|
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 compute-node.Dockerfile
|
||||||
|
|
||||||
|
In addition to these, postgres itself, the neon postgres extension,
|
||||||
|
and compute_ctl are built and copied into the compute image by
|
||||||
|
compute-node.Dockerfile.
|
||||||
@@ -3,17 +3,39 @@ 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.
|
||||||
|
# libstdc++-10-dev is required for plv8
|
||||||
|
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 libstdc++-10-dev"; \
|
||||||
|
;; \
|
||||||
|
# Version-specific installs for Bookworm (PG17):
|
||||||
|
bookworm) \
|
||||||
|
VERSION_INSTALLS="cmake libstdc++-12-dev"; \
|
||||||
|
;; \
|
||||||
|
*) \
|
||||||
|
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 +109,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 +145,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 +186,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 .. && \
|
||||||
@@ -161,18 +228,33 @@ FROM build-deps AS plv8-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") \
|
RUN apt update && \
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
apt install --no-install-recommends -y ninja-build python3-dev libncurses5 binutils clang
|
||||||
esac && \
|
|
||||||
apt update && \
|
|
||||||
apt install -y ninja-build python3-dev libncurses5 binutils clang
|
|
||||||
|
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
# plv8 3.2.3 supports v17
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
# last release v3.2.3 - Sep 7, 2024
|
||||||
|
#
|
||||||
|
# clone the repo instead of downloading the release tarball because plv8 has submodule dependencies
|
||||||
|
# and the release tarball doesn't include them
|
||||||
|
#
|
||||||
|
# Use new version only for v17
|
||||||
|
# because since v3.2, plv8 doesn't include plcoffee and plls extensions
|
||||||
|
ENV PLV8_TAG=v3.2.3
|
||||||
|
|
||||||
|
RUN case "${PG_VERSION}" in \
|
||||||
|
"v17") \
|
||||||
|
export PLV8_TAG=v3.2.3 \
|
||||||
|
;; \
|
||||||
|
"v14" | "v15" | "v16") \
|
||||||
|
export PLV8_TAG=v3.1.10 \
|
||||||
|
;; \
|
||||||
|
*) \
|
||||||
|
echo "unexpected PostgreSQL version" && exit 1 \
|
||||||
|
;; \
|
||||||
esac && \
|
esac && \
|
||||||
wget https://github.com/plv8/plv8/archive/refs/tags/v3.1.10.tar.gz -O plv8.tar.gz && \
|
git clone --recurse-submodules --depth 1 --branch ${PLV8_TAG} https://github.com/plv8/plv8.git plv8-src && \
|
||||||
echo "7096c3290928561f0d4901b7a52794295dc47f6303102fae3f8e42dd575ad97d plv8.tar.gz" | sha256sum --check && \
|
tar -czf plv8.tar.gz --exclude .git plv8-src && \
|
||||||
mkdir plv8-src && cd plv8-src && tar xzf ../plv8.tar.gz --strip-components=1 -C . && \
|
cd plv8-src && \
|
||||||
# generate and copy upgrade scripts
|
# generate and copy upgrade scripts
|
||||||
mkdir -p upgrade && ./generate_upgrade.sh 3.1.10 && \
|
mkdir -p upgrade && ./generate_upgrade.sh 3.1.10 && \
|
||||||
cp upgrade/* /usr/local/pgsql/share/extension/ && \
|
cp upgrade/* /usr/local/pgsql/share/extension/ && \
|
||||||
@@ -182,8 +264,17 @@ RUN case "${PG_VERSION}" in "v17") \
|
|||||||
find /usr/local/pgsql/ -name "plv8-*.so" | xargs strip && \
|
find /usr/local/pgsql/ -name "plv8-*.so" | xargs strip && \
|
||||||
# don't break computes with installed old version of plv8
|
# don't break computes with installed old version of plv8
|
||||||
cd /usr/local/pgsql/lib/ && \
|
cd /usr/local/pgsql/lib/ && \
|
||||||
ln -s plv8-3.1.10.so plv8-3.1.5.so && \
|
case "${PG_VERSION}" in \
|
||||||
ln -s plv8-3.1.10.so plv8-3.1.8.so && \
|
"v17") \
|
||||||
|
ln -s plv8-3.2.3.so plv8-3.1.8.so && \
|
||||||
|
ln -s plv8-3.2.3.so plv8-3.1.5.so && \
|
||||||
|
ln -s plv8-3.2.3.so plv8-3.1.10.so \
|
||||||
|
;; \
|
||||||
|
"v14" | "v15" | "v16") \
|
||||||
|
ln -s plv8-3.1.10.so plv8-3.1.5.so && \
|
||||||
|
ln -s plv8-3.1.10.so plv8-3.1.8.so \
|
||||||
|
;; \
|
||||||
|
esac && \
|
||||||
echo 'trusted = true' >> /usr/local/pgsql/share/extension/plv8.control && \
|
echo 'trusted = true' >> /usr/local/pgsql/share/extension/plv8.control && \
|
||||||
echo 'trusted = true' >> /usr/local/pgsql/share/extension/plcoffee.control && \
|
echo 'trusted = true' >> /usr/local/pgsql/share/extension/plcoffee.control && \
|
||||||
echo 'trusted = true' >> /usr/local/pgsql/share/extension/plls.control
|
echo 'trusted = true' >> /usr/local/pgsql/share/extension/plls.control
|
||||||
@@ -198,31 +289,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 +302,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 +323,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,16 +347,16 @@ 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.
|
||||||
# Pass OPTFLAGS="" to remove it.
|
# Pass OPTFLAGS="" to remove it.
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
#
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
# vector 0.7.4 supports v17
|
||||||
esac && \
|
# last release v0.7.4 - Aug 5, 2024
|
||||||
wget https://github.com/pgvector/pgvector/archive/refs/tags/v0.7.2.tar.gz -O pgvector.tar.gz && \
|
RUN wget https://github.com/pgvector/pgvector/archive/refs/tags/v0.7.4.tar.gz -O pgvector.tar.gz && \
|
||||||
echo "617fba855c9bcb41a2a9bc78a78567fd2e147c72afd5bf9d37b31b9591632b30 pgvector.tar.gz" | sha256sum --check && \
|
echo "0341edf89b1924ae0d552f617e14fb7f8867c0194ed775bcc44fa40288642583 pgvector.tar.gz" | sha256sum --check && \
|
||||||
mkdir pgvector-src && cd pgvector-src && tar xzf ../pgvector.tar.gz --strip-components=1 -C . && \
|
mkdir pgvector-src && cd pgvector-src && tar xzf ../pgvector.tar.gz --strip-components=1 -C . && \
|
||||||
patch -p1 < /pgvector.patch && \
|
patch -p1 < /pgvector.patch && \
|
||||||
make -j $(getconf _NPROCESSORS_ONLN) OPTFLAGS="" PG_CONFIG=/usr/local/pgsql/bin/pg_config && \
|
make -j $(getconf _NPROCESSORS_ONLN) OPTFLAGS="" PG_CONFIG=/usr/local/pgsql/bin/pg_config && \
|
||||||
@@ -306,12 +373,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
|
||||||
@@ -326,11 +391,10 @@ FROM build-deps AS hypopg-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") \
|
# HypoPG 1.4.1 supports v17
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
# last release 1.4.1 - Apr 28, 2024
|
||||||
esac && \
|
RUN wget https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.1.tar.gz -O hypopg.tar.gz && \
|
||||||
wget https://github.com/HypoPG/hypopg/archive/refs/tags/1.4.0.tar.gz -O hypopg.tar.gz && \
|
echo "9afe6357fd389d8d33fad81703038ce520b09275ec00153c6c89282bcdedd6bc hypopg.tar.gz" | sha256sum --check && \
|
||||||
echo "0821011743083226fc9b813c1f2ef5897a91901b57b6bea85a78e466187c6819 hypopg.tar.gz" | sha256sum --check && \
|
|
||||||
mkdir hypopg-src && cd hypopg-src && tar xzf ../hypopg.tar.gz --strip-components=1 -C . && \
|
mkdir hypopg-src && cd hypopg-src && tar xzf ../hypopg.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 && \
|
||||||
@@ -346,10 +410,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,8 +429,11 @@ 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
|
||||||
|
|
||||||
|
# maybe version-specific
|
||||||
|
# support for v17 is unknown
|
||||||
|
# last release 1.3.13 - Sep 19, 2022
|
||||||
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 && \
|
||||||
@@ -389,11 +455,10 @@ FROM build-deps AS pgtap-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") \
|
# pgtap 1.3.3 supports v17
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
# last release v1.3.3 - Apr 8, 2024
|
||||||
esac && \
|
RUN wget https://github.com/theory/pgtap/archive/refs/tags/v1.3.3.tar.gz -O pgtap.tar.gz && \
|
||||||
wget https://github.com/theory/pgtap/archive/refs/tags/v1.2.0.tar.gz -O pgtap.tar.gz && \
|
echo "325ea79d0d2515bce96bce43f6823dcd3effbd6c54cb2a4d6c2384fffa3a14c7 pgtap.tar.gz" | sha256sum --check && \
|
||||||
echo "9c7c3de67ea41638e14f06da5da57bac6f5bd03fea05c165a0ec862205a5c052 pgtap.tar.gz" | sha256sum --check && \
|
|
||||||
mkdir pgtap-src && cd pgtap-src && tar xzf ../pgtap.tar.gz --strip-components=1 -C . && \
|
mkdir pgtap-src && cd pgtap-src && tar xzf ../pgtap.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 && \
|
||||||
@@ -409,10 +474,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 +493,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 +512,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 && \
|
||||||
@@ -469,11 +531,10 @@ FROM build-deps AS plpgsql-check-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") \
|
# plpgsql_check v2.7.11 supports v17
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
# last release v2.7.11 - Sep 16, 2024
|
||||||
esac && \
|
RUN wget https://github.com/okbob/plpgsql_check/archive/refs/tags/v2.7.11.tar.gz -O plpgsql_check.tar.gz && \
|
||||||
wget https://github.com/okbob/plpgsql_check/archive/refs/tags/v2.5.3.tar.gz -O plpgsql_check.tar.gz && \
|
echo "208933f8dbe8e0d2628eb3851e9f52e6892b8e280c63700c0f1ce7883625d172 plpgsql_check.tar.gz" | sha256sum --check && \
|
||||||
echo "6631ec3e7fb3769eaaf56e3dfedb829aa761abf163d13dba354b4c218508e1c0 plpgsql_check.tar.gz" | sha256sum --check && \
|
|
||||||
mkdir plpgsql_check-src && cd plpgsql_check-src && tar xzf ../plpgsql_check.tar.gz --strip-components=1 -C . && \
|
mkdir plpgsql_check-src && cd plpgsql_check-src && tar xzf ../plpgsql_check.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 && \
|
||||||
make -j $(getconf _NPROCESSORS_ONLN) install PG_CONFIG=/usr/local/pgsql/bin/pg_config USE_PGXS=1 && \
|
make -j $(getconf _NPROCESSORS_ONLN) install PG_CONFIG=/usr/local/pgsql/bin/pg_config USE_PGXS=1 && \
|
||||||
@@ -491,21 +552,20 @@ COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
|||||||
ARG PG_VERSION
|
ARG PG_VERSION
|
||||||
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 extensions are not supported yet. Quit" && exit 0;; \
|
|
||||||
esac && \
|
|
||||||
case "${PG_VERSION}" in \
|
|
||||||
"v14" | "v15") \
|
"v14" | "v15") \
|
||||||
export TIMESCALEDB_VERSION=2.10.1 \
|
export TIMESCALEDB_VERSION=2.10.1 \
|
||||||
export TIMESCALEDB_CHECKSUM=6fca72a6ed0f6d32d2b3523951ede73dc5f9b0077b38450a029a5f411fdb8c73 \
|
export TIMESCALEDB_CHECKSUM=6fca72a6ed0f6d32d2b3523951ede73dc5f9b0077b38450a029a5f411fdb8c73 \
|
||||||
;; \
|
;; \
|
||||||
*) \
|
"v16") \
|
||||||
export TIMESCALEDB_VERSION=2.13.0 \
|
export TIMESCALEDB_VERSION=2.13.0 \
|
||||||
export TIMESCALEDB_CHECKSUM=584a351c7775f0e067eaa0e7277ea88cab9077cc4c455cbbf09a5d9723dce95d \
|
export TIMESCALEDB_CHECKSUM=584a351c7775f0e067eaa0e7277ea88cab9077cc4c455cbbf09a5d9723dce95d \
|
||||||
;; \
|
;; \
|
||||||
|
"v17") \
|
||||||
|
export TIMESCALEDB_VERSION=2.17.0 \
|
||||||
|
export TIMESCALEDB_CHECKSUM=155bf64391d3558c42f31ca0e523cfc6252921974f75298c9039ccad1c89811a \
|
||||||
|
;; \
|
||||||
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 . && \
|
||||||
@@ -527,10 +587,8 @@ COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
|||||||
ARG PG_VERSION
|
ARG PG_VERSION
|
||||||
ENV PATH="/usr/local/pgsql/bin:$PATH"
|
ENV PATH="/usr/local/pgsql/bin:$PATH"
|
||||||
|
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
# version-specific, has separate releases for each version
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
RUN case "${PG_VERSION}" in \
|
||||||
esac && \
|
|
||||||
case "${PG_VERSION}" in \
|
|
||||||
"v14") \
|
"v14") \
|
||||||
export PG_HINT_PLAN_VERSION=14_1_4_1 \
|
export PG_HINT_PLAN_VERSION=14_1_4_1 \
|
||||||
export PG_HINT_PLAN_CHECKSUM=c3501becf70ead27f70626bce80ea401ceac6a77e2083ee5f3ff1f1444ec1ad1 \
|
export PG_HINT_PLAN_CHECKSUM=c3501becf70ead27f70626bce80ea401ceac6a77e2083ee5f3ff1f1444ec1ad1 \
|
||||||
@@ -544,7 +602,8 @@ RUN case "${PG_VERSION}" in "v17") \
|
|||||||
export PG_HINT_PLAN_CHECKSUM=fc85a9212e7d2819d4ae4ac75817481101833c3cfa9f0fe1f980984e12347d00 \
|
export PG_HINT_PLAN_CHECKSUM=fc85a9212e7d2819d4ae4ac75817481101833c3cfa9f0fe1f980984e12347d00 \
|
||||||
;; \
|
;; \
|
||||||
"v17") \
|
"v17") \
|
||||||
echo "TODO: PG17 pg_hint_plan support" && exit 0 \
|
export PG_HINT_PLAN_VERSION=17_1_7_0 \
|
||||||
|
export PG_HINT_PLAN_CHECKSUM=06dd306328c67a4248f48403c50444f30959fb61ebe963248dbc2afb396fe600 \
|
||||||
;; \
|
;; \
|
||||||
*) \
|
*) \
|
||||||
echo "Export the valid PG_HINT_PLAN_VERSION variable" && exit 1 \
|
echo "Export the valid PG_HINT_PLAN_VERSION variable" && exit 1 \
|
||||||
@@ -568,6 +627,10 @@ FROM build-deps AS pg-cron-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/
|
||||||
|
|
||||||
|
# 1.6.4 available, supports v17
|
||||||
|
# This is an experimental extension that we do not support on prod yet.
|
||||||
|
# !Do not remove!
|
||||||
|
# We set it in shared_preload_libraries and computes will fail to start if library is not found.
|
||||||
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 "v17") \
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
||||||
@@ -589,24 +652,37 @@ FROM build-deps AS rdkit-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") \
|
RUN apt-get update && \
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
apt-get install --no-install-recommends -y \
|
||||||
esac && \
|
|
||||||
apt-get update && \
|
|
||||||
apt-get install -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 \
|
||||||
libboost-system1.74-dev \
|
libboost-system1.74-dev \
|
||||||
libeigen3-dev
|
libeigen3-dev \
|
||||||
|
libboost-all-dev
|
||||||
|
|
||||||
|
# rdkit Release_2024_09_1 supports v17
|
||||||
|
# last release Release_2024_09_1 - Sep 27, 2024
|
||||||
|
#
|
||||||
|
# Use new version only for v17
|
||||||
|
# because Release_2024_09_1 has some backward incompatible changes
|
||||||
|
# https://github.com/rdkit/rdkit/releases/tag/Release_2024_09_1
|
||||||
ENV PATH="/usr/local/pgsql/bin/:/usr/local/pgsql/:$PATH"
|
ENV PATH="/usr/local/pgsql/bin/:/usr/local/pgsql/:$PATH"
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
RUN case "${PG_VERSION}" in \
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
"v17") \
|
||||||
|
export RDKIT_VERSION=Release_2024_09_1 \
|
||||||
|
export RDKIT_CHECKSUM=034c00d6e9de323506834da03400761ed8c3721095114369d06805409747a60f \
|
||||||
|
;; \
|
||||||
|
"v14" | "v15" | "v16") \
|
||||||
|
export RDKIT_VERSION=Release_2023_03_3 \
|
||||||
|
export RDKIT_CHECKSUM=bdbf9a2e6988526bfeb8c56ce3cdfe2998d60ac289078e2215374288185e8c8d \
|
||||||
|
;; \
|
||||||
|
*) \
|
||||||
|
echo "unexpected PostgreSQL version" && exit 1 \
|
||||||
|
;; \
|
||||||
esac && \
|
esac && \
|
||||||
wget https://github.com/rdkit/rdkit/archive/refs/tags/Release_2023_03_3.tar.gz -O rdkit.tar.gz && \
|
wget https://github.com/rdkit/rdkit/archive/refs/tags/${RDKIT_VERSION}.tar.gz -O rdkit.tar.gz && \
|
||||||
echo "bdbf9a2e6988526bfeb8c56ce3cdfe2998d60ac289078e2215374288185e8c8d rdkit.tar.gz" | sha256sum --check && \
|
echo "${RDKIT_CHECKSUM} rdkit.tar.gz" | sha256sum --check && \
|
||||||
mkdir rdkit-src && cd rdkit-src && tar xzf ../rdkit.tar.gz --strip-components=1 -C . && \
|
mkdir rdkit-src && cd rdkit-src && tar xzf ../rdkit.tar.gz --strip-components=1 -C . && \
|
||||||
cmake \
|
cmake \
|
||||||
-D RDK_BUILD_CAIRO_SUPPORT=OFF \
|
-D RDK_BUILD_CAIRO_SUPPORT=OFF \
|
||||||
@@ -645,12 +721,11 @@ FROM build-deps AS pg-uuidv7-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 v1.6.0 - Oct 9, 2024
|
||||||
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/fboulnois/pg_uuidv7/archive/refs/tags/v1.6.0.tar.gz -O pg_uuidv7.tar.gz && \
|
||||||
echo "v17 extensions are not supported yet. Quit" && exit 0;; \
|
echo "0fa6c710929d003f6ce276a7de7a864e9d1667b2d78be3dc2c07f2409eb55867 pg_uuidv7.tar.gz" | sha256sum --check && \
|
||||||
esac && \
|
|
||||||
wget https://github.com/fboulnois/pg_uuidv7/archive/refs/tags/v1.0.1.tar.gz -O pg_uuidv7.tar.gz && \
|
|
||||||
echo "0d0759ab01b7fb23851ecffb0bce27822e1868a4a5819bfd276101c716637a7a pg_uuidv7.tar.gz" | sha256sum --check && \
|
|
||||||
mkdir pg_uuidv7-src && cd pg_uuidv7-src && tar xzf ../pg_uuidv7.tar.gz --strip-components=1 -C . && \
|
mkdir pg_uuidv7-src && cd pg_uuidv7-src && tar xzf ../pg_uuidv7.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 && \
|
||||||
@@ -666,11 +741,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 +761,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 && \
|
||||||
@@ -707,6 +796,8 @@ RUN case "${PG_VERSION}" in "v17") \
|
|||||||
FROM build-deps AS pg-embedding-pg-build
|
FROM build-deps AS pg-embedding-pg-build
|
||||||
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
|
|
||||||
|
# This is our extension, support stopped in favor of pgvector
|
||||||
|
# TODO: deprecate it
|
||||||
ARG PG_VERSION
|
ARG PG_VERSION
|
||||||
ENV PATH="/usr/local/pgsql/bin/:$PATH"
|
ENV PATH="/usr/local/pgsql/bin/:$PATH"
|
||||||
RUN case "${PG_VERSION}" in \
|
RUN case "${PG_VERSION}" in \
|
||||||
@@ -733,6 +824,8 @@ FROM build-deps AS pg-anon-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/
|
||||||
|
|
||||||
|
# This is an experimental extension, never got to real production.
|
||||||
|
# !Do not remove! It can be present in shared_preload_libraries and compute will fail to start if library is not found.
|
||||||
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 "v17") \
|
||||||
echo "postgresql_anonymizer does not yet support PG17" && exit 0;; \
|
echo "postgresql_anonymizer does not yet support PG17" && exit 0;; \
|
||||||
@@ -759,7 +852,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
|
||||||
@@ -767,13 +860,14 @@ ENV PATH="/home/nonroot/.cargo/bin:/usr/local/pgsql/bin/:$PATH"
|
|||||||
USER nonroot
|
USER nonroot
|
||||||
WORKDIR /home/nonroot
|
WORKDIR /home/nonroot
|
||||||
|
|
||||||
RUN case "${PG_VERSION}" in "v17") \
|
RUN curl -sSO https://static.rust-lang.org/rustup/dist/$(uname -m)-unknown-linux-gnu/rustup-init && \
|
||||||
echo "v17 is not supported yet by pgrx. Quit" && exit 0;; \
|
|
||||||
esac && \
|
|
||||||
curl -sSO https://static.rust-lang.org/rustup/dist/$(uname -m)-unknown-linux-gnu/rustup-init && \
|
|
||||||
chmod +x rustup-init && \
|
chmod +x rustup-init && \
|
||||||
./rustup-init -y --no-modify-path --profile minimal --default-toolchain stable && \
|
./rustup-init -y --no-modify-path --profile minimal --default-toolchain stable && \
|
||||||
rm rustup-init && \
|
rm rustup-init && \
|
||||||
|
case "${PG_VERSION}" in \
|
||||||
|
'v17') \
|
||||||
|
echo 'v17 is not supported yet by pgrx. Quit' && exit 0;; \
|
||||||
|
esac && \
|
||||||
cargo install --locked --version 0.11.3 cargo-pgrx && \
|
cargo install --locked --version 0.11.3 cargo-pgrx && \
|
||||||
/bin/bash -c 'cargo pgrx init --pg${PG_VERSION:1}=/usr/local/pgsql/bin/pg_config'
|
/bin/bash -c 'cargo pgrx init --pg${PG_VERSION:1}=/usr/local/pgsql/bin/pg_config'
|
||||||
|
|
||||||
@@ -869,6 +963,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/e1310b08ba51377a19e0559e4d1194883b9b2ba2.tar.gz -O pg_session_jwt.tar.gz && \
|
||||||
|
echo "837932a077888d5545fd54b0abcc79e5f8e37017c2769a930afc2f5c94df6f4e 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"
|
||||||
@@ -880,13 +993,12 @@ FROM build-deps AS wal2json-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/
|
||||||
|
|
||||||
|
# wal2json wal2json_2_6 supports v17
|
||||||
|
# last release wal2json_2_6 - Apr 25, 2024
|
||||||
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/eulerto/wal2json/archive/refs/tags/wal2json_2_6.tar.gz -O wal2json.tar.gz && \
|
||||||
echo "We'll need to update wal2json to 2.6+ for pg17 support" && exit 0;; \
|
echo "18b4bdec28c74a8fc98a11c72de38378a760327ef8e5e42e975b0029eb96ba0d wal2json.tar.gz" | sha256sum --check && \
|
||||||
esac && \
|
mkdir wal2json-src && cd wal2json-src && tar xzf ../wal2json.tar.gz --strip-components=1 -C . && \
|
||||||
wget https://github.com/eulerto/wal2json/archive/refs/tags/wal2json_2_5.tar.gz && \
|
|
||||||
echo "b516653575541cf221b99cf3f8be9b6821f6dbcfc125675c85f35090f824f00e wal2json_2_5.tar.gz" | sha256sum --check && \
|
|
||||||
mkdir wal2json-src && cd wal2json-src && tar xzf ../wal2json_2_5.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
|
||||||
|
|
||||||
@@ -900,12 +1012,11 @@ FROM build-deps AS pg-ivm-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/
|
||||||
|
|
||||||
|
# pg_ivm v1.9 supports v17
|
||||||
|
# last release v1.9 - Jul 31
|
||||||
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/sraoss/pg_ivm/archive/refs/tags/v1.9.tar.gz -O pg_ivm.tar.gz && \
|
||||||
echo "We'll need to update pg_ivm to 1.9+ for pg17 support" && exit 0;; \
|
echo "59e15722939f274650abf637f315dd723c87073496ca77236b044cb205270d8b pg_ivm.tar.gz" | sha256sum --check && \
|
||||||
esac && \
|
|
||||||
wget https://github.com/sraoss/pg_ivm/archive/refs/tags/v1.7.tar.gz -O pg_ivm.tar.gz && \
|
|
||||||
echo "ebfde04f99203c7be4b0e873f91104090e2e83e5429c32ac242d00f334224d5e pg_ivm.tar.gz" | sha256sum --check && \
|
|
||||||
mkdir pg_ivm-src && cd pg_ivm-src && tar xzf ../pg_ivm.tar.gz --strip-components=1 -C . && \
|
mkdir pg_ivm-src && cd pg_ivm-src && tar xzf ../pg_ivm.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 && \
|
||||||
@@ -921,17 +1032,41 @@ FROM build-deps AS pg-partman-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/
|
||||||
|
|
||||||
|
# should support v17 https://github.com/pgpartman/pg_partman/discussions/693
|
||||||
|
# last release 5.1.0 Apr 2, 2024
|
||||||
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/pgpartman/pg_partman/archive/refs/tags/v5.1.0.tar.gz -O pg_partman.tar.gz && \
|
||||||
echo "pg_partman doesn't support PG17 yet" && exit 0;; \
|
echo "3e3a27d7ff827295d5c55ef72f07a49062d6204b3cb0b9a048645d6db9f3cb9f pg_partman.tar.gz" | sha256sum --check && \
|
||||||
esac && \
|
|
||||||
wget https://github.com/pgpartman/pg_partman/archive/refs/tags/v5.0.1.tar.gz -O pg_partman.tar.gz && \
|
|
||||||
echo "75b541733a9659a6c90dbd40fccb904a630a32880a6e3044d0c4c5f4c8a65525 pg_partman.tar.gz" | sha256sum --check && \
|
|
||||||
mkdir pg_partman-src && cd pg_partman-src && tar xzf ../pg_partman.tar.gz --strip-components=1 -C . && \
|
mkdir pg_partman-src && cd pg_partman-src && tar xzf ../pg_partman.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 && \
|
||||||
echo 'trusted = true' >> /usr/local/pgsql/share/extension/pg_partman.control
|
echo 'trusted = true' >> /usr/local/pgsql/share/extension/pg_partman.control
|
||||||
|
|
||||||
|
#########################################################################################
|
||||||
|
#
|
||||||
|
# Layer "pg_mooncake"
|
||||||
|
# compile pg_mooncake extension
|
||||||
|
#
|
||||||
|
#########################################################################################
|
||||||
|
FROM rust-extensions-build AS pg-mooncake-build
|
||||||
|
ARG PG_VERSION
|
||||||
|
COPY --from=pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
|
|
||||||
|
ENV PG_MOONCAKE_VERSION=0a7de4c0b5c7b1a5e2175e1c5f4625b97b7346f1
|
||||||
|
ENV PATH="/usr/local/pgsql/bin/:$PATH"
|
||||||
|
|
||||||
|
RUN case "${PG_VERSION}" in \
|
||||||
|
'v14') \
|
||||||
|
echo "pg_mooncake is not supported on Postgres ${PG_VERSION}" && exit 0;; \
|
||||||
|
esac && \
|
||||||
|
git clone --depth 1 --branch neon https://github.com/Mooncake-Labs/pg_mooncake.git pg_mooncake-src && \
|
||||||
|
cd pg_mooncake-src && \
|
||||||
|
git checkout "${PG_MOONCAKE_VERSION}" && \
|
||||||
|
git submodule update --init --depth 1 --recursive && \
|
||||||
|
make BUILD_TYPE=release -j $(getconf _NPROCESSORS_ONLN) && \
|
||||||
|
make BUILD_TYPE=release -j $(getconf _NPROCESSORS_ONLN) install && \
|
||||||
|
echo 'trusted = true' >> /usr/local/pgsql/share/extension/pg_mooncake.control
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
#
|
#
|
||||||
# Layer "neon-pg-ext-build"
|
# Layer "neon-pg-ext-build"
|
||||||
@@ -965,6 +1100,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/
|
||||||
@@ -974,6 +1110,7 @@ COPY --from=wal2json-pg-build /usr/local/pgsql /usr/local/pgsql
|
|||||||
COPY --from=pg-anon-pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-anon-pg-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
COPY --from=pg-ivm-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-ivm-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
COPY --from=pg-partman-build /usr/local/pgsql/ /usr/local/pgsql/
|
COPY --from=pg-partman-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
|
COPY --from=pg-mooncake-build /usr/local/pgsql/ /usr/local/pgsql/
|
||||||
COPY pgxn/ pgxn/
|
COPY pgxn/ pgxn/
|
||||||
|
|
||||||
RUN make -j $(getconf _NPROCESSORS_ONLN) \
|
RUN make -j $(getconf _NPROCESSORS_ONLN) \
|
||||||
@@ -1027,10 +1164,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 +1239,19 @@ 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
|
||||||
|
ARG PG_VERSION
|
||||||
|
|
||||||
|
USER nonroot
|
||||||
|
|
||||||
|
COPY --chown=nonroot compute compute
|
||||||
|
|
||||||
|
RUN make PG_VERSION="${PG_VERSION}" -C compute
|
||||||
|
|
||||||
#########################################################################################
|
#########################################################################################
|
||||||
#
|
#
|
||||||
@@ -1078,7 +1280,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 +1288,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 +1299,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 +1317,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 +1341,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 +1358,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 +1417,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
|
||||||
|
|
||||||
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_name, 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: [
|
||||||
|
collector_name,
|
||||||
|
],
|
||||||
|
},
|
||||||
|
|
||||||
|
// 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,
|
||||||
|
],
|
||||||
|
}
|
||||||
1
compute/etc/sql_exporter/checkpoints_req.17.sql
Normal file
1
compute/etc/sql_exporter/checkpoints_req.17.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
SELECT num_requested AS checkpoints_req FROM pg_stat_checkpointer;
|
||||||
15
compute/etc/sql_exporter/checkpoints_req.libsonnet
Normal file
15
compute/etc/sql_exporter/checkpoints_req.libsonnet
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
local neon = import 'neon.libsonnet';
|
||||||
|
|
||||||
|
local pg_stat_bgwriter = importstr 'sql_exporter/checkpoints_req.sql';
|
||||||
|
local pg_stat_checkpointer = importstr 'sql_exporter/checkpoints_req.17.sql';
|
||||||
|
|
||||||
|
{
|
||||||
|
metric_name: 'checkpoints_req',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'Number of requested checkpoints',
|
||||||
|
key_labels: null,
|
||||||
|
values: [
|
||||||
|
'checkpoints_req',
|
||||||
|
],
|
||||||
|
query: if neon.PG_MAJORVERSION_NUM < 17 then pg_stat_bgwriter else pg_stat_checkpointer,
|
||||||
|
}
|
||||||
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;
|
||||||
1
compute/etc/sql_exporter/checkpoints_timed.17.sql
Normal file
1
compute/etc/sql_exporter/checkpoints_timed.17.sql
Normal file
@@ -0,0 +1 @@
|
|||||||
|
SELECT num_timed AS checkpoints_timed FROM pg_stat_checkpointer;
|
||||||
15
compute/etc/sql_exporter/checkpoints_timed.libsonnet
Normal file
15
compute/etc/sql_exporter/checkpoints_timed.libsonnet
Normal file
@@ -0,0 +1,15 @@
|
|||||||
|
local neon = import 'neon.libsonnet';
|
||||||
|
|
||||||
|
local pg_stat_bgwriter = importstr 'sql_exporter/checkpoints_timed.sql';
|
||||||
|
local pg_stat_checkpointer = importstr 'sql_exporter/checkpoints_timed.17.sql';
|
||||||
|
|
||||||
|
{
|
||||||
|
metric_name: 'checkpoints_timed',
|
||||||
|
type: 'gauge',
|
||||||
|
help: 'Number of scheduled checkpoints',
|
||||||
|
key_labels: null,
|
||||||
|
values: [
|
||||||
|
'checkpoints_timed',
|
||||||
|
],
|
||||||
|
query: if neon.PG_MAJORVERSION_NUM < 17 then pg_stat_bgwriter else pg_stat_checkpointer,
|
||||||
|
}
|
||||||
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',
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user