Skip to content

Commit

Permalink
moving timescaledb to pkg instead of building
Browse files Browse the repository at this point in the history
  • Loading branch information
idanovinda committed Oct 16, 2024
1 parent 07bbb08 commit 237486e
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 23 deletions.
4 changes: 0 additions & 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.17.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 Down Expand Up @@ -92,7 +90,6 @@ FROM builder-${COMPRESS}
LABEL maintainer="Team ACID @ Zalando <[email protected]>"

ARG PGVERSION
ARG TIMESCALEDB
ARG DEMO
ARG COMPRESS

Expand All @@ -102,7 +99,6 @@ ENV LC_ALL=en_US.utf-8 \
PATH=$PATH:/usr/lib/postgresql/$PGVERSION/bin \
PGHOME=/home/postgres \
RW_DIR=/run \
TIMESCALEDB=$TIMESCALEDB \
DEMO=$DEMO

ENV WALE_ENV_DIR=$RW_DIR/etc/wal-e.d/env \
Expand Down
26 changes: 7 additions & 19 deletions postgres-appliance/build_scripts/base.sh
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ curl -sL "https://github.com/zalando-pg/pg_auth_mon/archive/$PG_AUTH_MON_COMMIT.
curl -sL "https://github.com/cybertec-postgresql/pg_permissions/archive/$PG_PERMISSIONS_COMMIT.tar.gz" | tar xz
curl -sL "https://github.com/zubkov-andrei/pg_profile/archive/$PG_PROFILE.tar.gz" | tar xz
git clone -b "$SET_USER" https://github.com/pgaudit/set_user.git
git clone https://github.com/timescale/timescaledb.git

apt-get install -y \
postgresql-common \
Expand All @@ -70,6 +69,11 @@ apt-get install -y \
# forbid creation of a main cluster when package is installed
sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf

DISTRIB_CODENAME=$(sed -n 's/DISTRIB_CODENAME=//p' /etc/lsb-release)
# add TimescaleDB repository
echo "deb [signed-by=/etc/apt/keyrings/timescale_timescaledb-archive-keyring.gpg] https://packagecloud.io/timescale/timescaledb/ubuntu/ ${DISTRIB_CODENAME} main" | tee /etc/apt/sources.list.d/timescaledb.list
curl -fsSL https://packagecloud.io/timescale/timescaledb/gpgkey | gpg --dearmor | tee /etc/apt/keyrings/timescale_timescaledb-archive-keyring.gpg > /dev/null

for version in $DEB_PG_SUPPORTED_VERSIONS; do
sed -i "s/ main.*$/ main $version/g" /etc/apt/sources.list.d/pgdg.list
apt-get update
Expand All @@ -96,7 +100,8 @@ for version in $DEB_PG_SUPPORTED_VERSIONS; do
"postgresql-${version}-repack"
"postgresql-${version}-wal2json"
"postgresql-${version}-pllua"
"postgresql-${version}-pgvector")
"postgresql-${version}-pgvector"
"timescaledb-2-postgresql-${version}")

if [ "$version" != "17" ]; then
EXTRAS+=("postgresql-${version}-decoderbufs")
Expand All @@ -121,23 +126,6 @@ for version in $DEB_PG_SUPPORTED_VERSIONS; do

# Install 3rd party stuff

# use subshell to avoid having to cd back (SC2103)
(
cd timescaledb
for v in $TIMESCALEDB; do
git checkout "$v"
sed -i "s/VERSION 3.11/VERSION 3.10/" CMakeLists.txt
if BUILD_FORCE_REMOVE=true ./bootstrap -DREGRESS_CHECKS=OFF -DWARNINGS_AS_ERRORS=OFF \
-DTAP_CHECKS=OFF -DPG_CONFIG="/usr/lib/postgresql/$version/bin/pg_config" \
-DAPACHE_ONLY="$TIMESCALEDB_APACHE_ONLY" -DSEND_TELEMETRY_DEFAULT=NO; then
make -C build install
strip /usr/lib/postgresql/"$version"/lib/timescaledb*.so
fi
git reset --hard
git clean -f -d
done
)

if [ "${TIMESCALEDB_APACHE_ONLY}" != "true" ] && [ "${TIMESCALEDB_TOOLKIT}" = "true" ]; then
__versionCodename=$(sed </etc/os-release -ne 's/^VERSION_CODENAME=//p')
echo "deb [signed-by=/usr/share/keyrings/timescale_E7391C94080429FF.gpg] https://packagecloud.io/timescale/timescaledb/ubuntu/ ${__versionCodename} main" | tee /etc/apt/sources.list.d/timescaledb.list
Expand Down

0 comments on commit 237486e

Please sign in to comment.