Skip to content

Commit

Permalink
Sync with master branch
Browse files Browse the repository at this point in the history
- Fix timescaledb installation logic
  • Loading branch information
hughcapet committed Feb 3, 2025
2 parents f5a0ffc + 13948ae commit be3633b
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 16 deletions.
3 changes: 0 additions & 3 deletions delivery.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@ pipeline:
--build-arg PGVERSION="$PGVERSION" \
--build-arg BASE_IMAGE="$BASE_IMAGE" \
--build-arg PGOLDVERSIONS="14 15 16" \
--build-arg TIMESCALEDB="2.18.0" \
-t "$ECR_TEST_IMAGE" \
--push .
Expand Down Expand Up @@ -64,7 +63,6 @@ pipeline:
--build-arg PGVERSION="$PGVERSION" \
--build-arg BASE_IMAGE="$BASE_IMAGE" \
--build-arg PGOLDVERSIONS="14 15 16" \
--build-arg TIMESCALEDB="2.18.0" \
-t "$ECR_TEST_IMAGE" \
--push .
cdp-promote-image "$ECR_TEST_IMAGE"
Expand Down Expand Up @@ -96,7 +94,6 @@ pipeline:
--build-arg PGVERSION="$PGVERSION" \
--build-arg BASE_IMAGE="$BASE_IMAGE" \
--build-arg PGOLDVERSIONS="14 15 16" \
--build-arg TIMESCALEDB="2.18.0" \
-t "$ECR_TEST_IMAGE" \
--push .
cdp-promote-image "$ECR_TEST_IMAGE"
Expand Down
5 changes: 1 addition & 4 deletions postgres-appliance/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
ARG BASE_IMAGE=ubuntu:22.04
ARG PGVERSION=17
ARG TIMESCALEDB="2.15.3 2.18.0"
ARG DEMO=false
ARG COMPRESS=false
ARG ADDITIONAL_LOCALES=
Expand Down Expand Up @@ -44,7 +43,6 @@ COPY build_scripts/base.sh /builddeps/
COPY --from=dependencies-builder /builddeps/*.deb /builddeps/

ARG PGVERSION
ARG TIMESCALEDB
ARG TIMESCALEDB_APACHE_ONLY=true
ARG TIMESCALEDB_TOOLKIT=true
ARG COMPRESS
Expand All @@ -62,8 +60,7 @@ ENV POSTGIS_VERSION=3.5 \
PLPROFILER=REL4_2_5 \
PG_PROFILE=4.7 \
PAM_OAUTH2=v1.0.1 \
PG_PERMISSIONS_COMMIT=f4b7c18676fa64236a1c8e28d34a35764e4a70e2 \
TIMESCALEDB=$TIMESCALEDB
PG_PERMISSIONS_COMMIT=f4b7c18676fa64236a1c8e28d34a35764e4a70e2

WORKDIR /builddeps
RUN bash base.sh
Expand Down
18 changes: 9 additions & 9 deletions postgres-appliance/build_scripts/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,18 @@ for version in $DEB_PG_SUPPORTED_VERSIONS; do
"postgresql-${version}-pg-stat-kcache" \
"${EXTRAS[@]}"

# Clean up timescaledb versions except the highest compatible version
# Clean up timescaledb versions except the highest compatible and transition version
exclude_patterns=()
exclude_patterns_tsl=()
for ts_version in ${TIMESCALEDB}; do
prev_highest_ver="$ts_highest_ver"
ts_highest_ver=$(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 | head -n1)
if [ "$prev_highest_ver" != "$ts_highest_ver" ]; then
ts_transition_version="$prev_highest_ver"
fi
for ts_version in "$ts_transition_version" "$ts_highest_ver"; do
exclude_patterns+=(! -name timescaledb-"${ts_version}".so)
exclude_patterns_tsl+=(! -name timescaledb-tsl-"${ts_version}".so)
exclude_patterns+=(! -name timescaledb-tsl-"${ts_version}".so)
done
find /usr/lib/postgresql/"${version}"/lib/ -name 'timescaledb-2.*.so' "${exclude_patterns[@]}" -delete;

if [ "${TIMESCALEDB_APACHE_ONLY}" != "true" ]; then
find /usr/lib/postgresql/"${version}"/lib/ -name 'timescaledb-tsl-2.*.so' "${exclude_patterns_tsl[@]}" -delete;
fi
find "/usr/lib/postgresql/$version/lib/" \( -name 'timescaledb-2.*.so' -o -name 'timescaledb-tsl-2.*.so' \) "${exclude_patterns[@]}" -delete

# Install 3rd party stuff

Expand Down

0 comments on commit be3633b

Please sign in to comment.