Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions .github/workflows/kubernetes-test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ jobs:
runs-on: ubuntu-20.04

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@a37ce9120846195fa4ece8f58b268e6043cb2f26 # v3.7.0
- name: Create Kind Cluster
uses: helm/kind-action@v1.1.0
uses: helm/kind-action@7a937c0fb648064a83b8b9354151e5e543d9fcec # v1.1.0
- name: Install Spilo
run: kubectl apply -f kubernetes/spilo_kubernetes.yaml
14 changes: 7 additions & 7 deletions .github/workflows/publish-ghcr-container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
shell: bash
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0

- name: Set up packages
run: sudo apt-get install -y docker-compose

- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.10'

Expand All @@ -46,20 +46,20 @@ jobs:
echo "NAME=$IMAGE" >> $GITHUB_OUTPUT

- name: Set up QEMU
uses: docker/setup-qemu-action@v3
uses: docker/setup-qemu-action@c7c53464625b32c7a7e944ae62b3e17d2b600130 # v3.7.0

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
uses: docker/setup-buildx-action@8d2750c68a42422c14e847fe6c8ac0403b4cbd6f # v3.12.0

- name: Login to GHCR
uses: docker/login-action@v3
uses: docker/login-action@c94ce9fb468520275223c153574b00df6fe4bcc9 # v3.7.0
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and export to local docker for testing
uses: docker/build-push-action@v6
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
with:
context: "postgres-appliance/"
load: true
Expand All @@ -72,7 +72,7 @@ jobs:
bash postgres-appliance/tests/test_spilo.sh

- name: Build arm64 additionaly and push multiarch image to ghcr
uses: docker/build-push-action@v6
uses: docker/build-push-action@10e90e3645eae34f1e60eeb005ba3a3d33f178e8 # v6.19.2
with:
context: "postgres-appliance/"
push: true
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ jobs:
runs-on: ubuntu-22.04

steps:
- uses: actions/checkout@v4
- uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0
- name: Set up packages
run: sudo apt-get install -y shellcheck docker-compose
- name: Set up Python
uses: actions/setup-python@v5
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
with:
python-version: '3.10'
- name: Install flake8
Expand Down
2 changes: 1 addition & 1 deletion postgres-appliance/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ ARG WITH_PERL=false
ARG DEB_PG_SUPPORTED_VERSIONS="$PGOLDVERSIONS $PGVERSION"

# Install PostgreSQL, extensions and contribs
ENV POSTGIS_VERSION=3.5 \
ENV POSTGIS_VERSION=3.6 \
BG_MON_COMMIT=7f5887218790b263fe3f42f85f4ddc9c8400b154 \
PG_AUTH_MON_COMMIT=fe099eef7662cbc85b0b79191f47f52f1e96b779 \
PG_MON_COMMIT=ead1de70794ed62ca1e34d4022f6165ff36e9a91 \
Expand Down
31 changes: 29 additions & 2 deletions postgres-appliance/build_scripts/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,10 +121,32 @@ for version in $DEB_PG_SUPPORTED_VERSIONS; do
"postgresql-${version}-pg-stat-kcache" \
"${EXTRAS[@]}"

# Clean up timescaledb versions except the last 5 minor versions
# Clean up timescaledb versions - keep at least 5 minor versions, but ensure compatibility with the lowest/oldest PG version (where possible)

exclude_patterns=()
versions=$(find "/usr/lib/postgresql/$version/lib/" -name 'timescaledb-2.*.so' | sed -rn 's/.*timescaledb-([1-9]+\.[0-9]+\.[0-9]+)\.so$/\1/p' | sort -rV)
latest_minor_versions=$(echo "$versions" | awk -F. '{print $1"."$2}' | uniq | head -n 5)

# Calculate the number of versions dynamically based on the lowest PG version's latest minor
num_versions=5
if [ -n "$first_latest_minor" ]; then
minor_versions=$(echo "$versions" | awk -F. '{print $1"."$2}' | uniq)
position=0
found=0
while IFS= read -r minor; do
position=$((position + 1))
if [ "$minor" = "$first_latest_minor" ]; then
found=1
break
fi
done <<< "$minor_versions"

# if found, keep max(5, position) versions (so all versions have at least 1 version in common with lowest PG version)
if [ $found -eq 1 ] && [ $position -gt $num_versions ]; then
num_versions=$position
fi
fi

latest_minor_versions=$(echo "$versions" | awk -F. '{print $1"."$2}' | uniq | head -n "$num_versions")
for minor in $latest_minor_versions; do
for full_version in $(echo "$versions" | grep "^$minor"); do
exclude_patterns+=(! -name timescaledb-"${full_version}".so)
Expand All @@ -133,6 +155,11 @@ for version in $DEB_PG_SUPPORTED_VERSIONS; do
done
find "/usr/lib/postgresql/$version/lib/" \( -name 'timescaledb-2.*.so' -o -name 'timescaledb-tsl-2.*.so' \) "${exclude_patterns[@]}" -delete

# Save the latest minor version from the first PG version
if [ -z "$first_latest_minor" ]; then
first_latest_minor=$(echo "$latest_minor_versions" | head -n 1)
fi

# Install 3rd party stuff

if [ "${TIMESCALEDB_APACHE_ONLY}" != "true" ] && [ "${TIMESCALEDB_TOOLKIT}" = "true" ]; then
Expand Down
18 changes: 9 additions & 9 deletions postgres-appliance/tests/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ networks:
demo:

services:
minio:
image: minio/minio:RELEASE.2021-09-03T03-56-13Z
rustfs:
image: rustfs/rustfs:1.0.0
networks: [ demo ]
environment:
MINIO_ACCESS_KEY: &access_key Eeghei0uVej1Wea8mato
MINIO_SECRET_KEY: &secret_key lecheidohbah7aThohziezah3iev7ima4eeXu9gu
hostname: minio
container_name: demo-minio
RUSTFS_ACCESS_KEY: &access_key Eeghei0uVej1Wea8mato
RUSTFS_SECRET_KEY: &secret_key lecheidohbah7aThohziezah3iev7ima4eeXu9gu
hostname: rustfs
container_name: demo-rustfs
entrypoint: sh
command: -c 'mkdir -p /export/testbucket && /usr/bin/minio server /export'
command: -c 'mkdir -p /data/testbucket && exec /entrypoint.sh rustfs'

etcd:
image: ${SPILO_TEST_IMAGE:-spilo}
Expand All @@ -23,14 +23,14 @@ services:
command: "sh -c 'export ETCD_UNSUPPORTED_ARCH=$$(dpkg --print-architecture) && exec etcd -name etcd1 -listen-client-urls http://0.0.0.0:2379 -advertise-client-urls http://$$(hostname --ip-address):2379'"

spilo1: &spilo
depends_on: [ minio ]
depends_on: [ rustfs ]
image: ${SPILO_TEST_IMAGE:-spilo}
networks: [ demo ]
environment:
SPILO_PROVIDER: 'local'
AWS_ACCESS_KEY_ID: *access_key
AWS_SECRET_ACCESS_KEY: *secret_key
AWS_ENDPOINT: &aws_endpoint 'http://minio:9000'
AWS_ENDPOINT: &aws_endpoint 'http://rustfs:9000'
AWS_S3_FORCE_PATH_STYLE: &aws_s3_force_path_style 'true'
WAL_S3_BUCKET: &bucket testbucket
# USE_WALG: 'true' # wal-e is used and tested by default, wal-g is used automatically for restore in case of S3
Expand Down
Loading