Skip to content

Commit

Permalink
Remove promscale
Browse files Browse the repository at this point in the history
  • Loading branch information
graveland committed Dec 17, 2024
1 parent 1cb6b24 commit 7587a4f
Show file tree
Hide file tree
Showing 9 changed files with 9 additions and 169 deletions.
5 changes: 1 addition & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,7 @@ RUN set -ex; \
ARG INSTALL_METHOD=docker-ha
ARG OSS_ONLY

# RUST_RELEASE for some packages passes this to --profile, but for promscale, if anything is set that means use
# release mode, and if it's empty, then debug mode.
# RUST_RELEASE for some packages passes this to --profile
ARG RUST_RELEASE=release

# split the extension builds into two steps to allow caching of successful steps
Expand All @@ -376,12 +375,10 @@ RUN set -ex; \
/build/scripts/install_extensions timescaledb

# install all rust packages in the same step to allow it to optimize for cargo-pgx installs
ARG PROMSCALE_VERSIONS
ARG TOOLKIT_VERSIONS
RUN set -ex; \
OSS_ONLY="${OSS_ONLY}" \
RUST_RELEASE="${RUST_RELEASE}" \
PROMSCALE_VERSIONS="${PROMSCALE_VERSIONS}" \
TOOLKIT_VERSIONS="${TOOLKIT_VERSIONS}" \
/build/scripts/install_extensions rust

Expand Down
4 changes: 0 additions & 4 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ PG_STAT_MONITOR?=2.1.0
PG_LOGERRORS?=v2.1.3
PGVECTO_RS?=0.4.0
TIMESCALEDB_VERSIONS?=all
PROMSCALE_VERSIONS?=all
TOOLKIT_VERSIONS?=all
PGBOUNCER_EXPORTER_VERSION?=0.9.0
PGBACKREST_EXPORTER_VERSION?=0.18.0
Expand Down Expand Up @@ -158,7 +157,6 @@ DOCKER_BUILD_COMMAND=docker build \
--build-arg POSTGIS_VERSIONS=$(POSTGIS_VERSIONS) \
--build-arg OSS_ONLY="$(OSS_ONLY)" \
--build-arg TIMESCALEDB_VERSIONS="$(TIMESCALEDB_VERSIONS)" \
--build-arg PROMSCALE_VERSIONS="$(PROMSCALE_VERSIONS)" \
--build-arg TOOLKIT_VERSIONS="$(TOOLKIT_VERSIONS)" \
--build-arg PGVECTO_RS="$(PGVECTO_RS)" \
--build-arg RELEASE_URL="$(DOCKER_RELEASE_URL)" \
Expand All @@ -185,15 +183,13 @@ fast: PGAI_VERSION=
fast: PG_VERSIONS=17
fast: POSTGIS_VERSIONS=
fast: TOOLKIT_VERSIONS=
fast: PROMSCALE_VERSIONS=
fast: PGVECTORSCALE_VERSIONS=
fast: build

.PHONY: latest
latest: ALL_VERSIONS=false
latest: TIMESCALEDB_VERSIONS=latest
latest: TOOLKIT_VERSIONS=latest
latest: PROMSCALE_VERSIONS=latest
latest: PGVECTORSCALE_VERSIONS=latest
latest: build

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ POSTGIS_VERSIONS="" make build

For further environment variables that can be set, we point you to the [Makefile](Makefile) itself.

For updating changes in versions for timescaledb, promscale, pgvectorscale, or toolkit, update `build_scripts/versions.yaml`
For updating changes in versions for timescaledb, pgvectorscale, or toolkit, update `build_scripts/versions.yaml`

## Verify your work

Expand Down
12 changes: 4 additions & 8 deletions build_scripts/install_extensions
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,13 @@
SCRIPT_DIR="${BASH_SOURCE[0]%/*}"
. "$SCRIPT_DIR"/shared.sh

# This takes the requested toolkit and promscale extensions, figures out what versions of cargo-pgx/pgrx those
# This takes the requested toolkit and other extensions, figures out what versions of cargo-pgx/pgrx those
# versions want, and then build from the oldest pgx/pgrx to the newest so that `cargo install cargo-pgx/pgrx --version`
# commands are only ran once. Once cargo-pgrx has been installed, run the installation for the extensions,
# and then continue through the next cargo-pgrx version. At the end, we're left with the latest version of
# cargo-pgrx so that the builder image can be used to test master/main branches.

# we use the following variables to decide on if/what to install:
# - PROMSCALE_VERSIONS
# - TOOLKIT_VERSIONS

[ "$1" = -n ] && { DRYRUN=true; shift; }
Expand All @@ -19,8 +18,8 @@ SCRIPT_DIR="${BASH_SOURCE[0]%/*}"

what="$1"
[ -z "$what" ] && what=all
if [[ ! "$what" =~ ^versions|timescaledb|rust|all|promscale|pgvectorscale|toolkit$ ]]; then
echo "usage: $0 [-n] [versions|timescaledb|rust|all|promscale|pgvectorscale|toolkit]" >&2
if [[ ! "$what" =~ ^versions|timescaledb|rust|all|pgvectorscale|toolkit$ ]]; then
echo "usage: $0 [-n] [versions|timescaledb|rust|all|pgvectorscale|toolkit]" >&2
exit 1
fi

Expand All @@ -29,7 +28,6 @@ versions)
# this outputs the expanded versions
echo "TIMESCALEDB_VERSIONS=\"$TIMESCALEDB_VERSIONS\""
echo "TOOLKIT_VERSIONS=\"$TOOLKIT_VERSIONS\""
echo "PROMSCALE_VERSIONS=\"$PROMSCALE_VERSIONS\""
echo "PGVECTORSCALE_VERSIONS=\"$PGVECTORSCALE_VERSIONS\""
;;

Expand All @@ -48,8 +46,6 @@ pgvectorscale | all)

rust | all) install_rust_extensions;;

promscale) TOOLKIT_VERSIONS="" install_rust_extensions;;

toolkit) PROMSCALE_VERSIONS="" install_rust_extensions;;
toolkit) install_rust_extensions;;

esac
49 changes: 0 additions & 49 deletions build_scripts/shared_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -112,55 +112,6 @@ install_toolkit() {
PATH="$ORIGINAL_PATH"
}

install_promscale() {
local rust_release cargo_pgrx_version="$1" version="$2" pg pkg=promscale dpkg deb_version unsupported_reason pgrx_cmd
[ -n "$RUST_RELEASE" ] && rust_release=-r || rust_release=""
pgrx_cmd="$(cargo_pgrx_cmd "$cargo_pgrx_version")"

if [ "$OSS_ONLY" = true ]; then
log "skipped toolkit-$version due to OSS_ONLY"
return
fi

for pg in $(available_pg_versions); do
unsupported_reason="$(supported_promscale "$pg" "$version")"
if [ -n "$unsupported_reason" ]; then
log "$pkg-$version: $unsupported_reason"
continue
fi

read -rs dpkg deb_version <<< "$(find_deb "promscale-extension-postgresql-$pg" "$version")"
if [[ -n "$dpkg" && -n "$deb_version" ]]; then
[[ "$DRYRUN" = true ]] && { log "would install debian package $dpkg-$deb_version (cargo-$pgrx_cmd: $cargo_pgrx_version)"; continue; }
if install_deb "$dpkg" "$deb_version"; then continue; fi
log "failed installing $dpkg $deb_version"
else
log "couldn't find debian package for promscale-extension-postgresql-$pg $version"
fi

log "building $pkg version $version for pg$pg (cargo-$pgrx_cmd: $cargo_pgrx_version)"

[ "$DRYRUN" = true ] && continue

PATH="/usr/lib/postgresql/$pg/bin:${ORIGINAL_PATH}"
cargo_pgrx_init "$cargo_pgrx_version" "$pg" || continue
git_clone https://github.com/timescale/promscale_extension.git $pkg || continue
git_checkout $pkg "$version" || continue
(
cd /build/$pkg || exit 1
cp templates/promscale.control ./promscale.control
cargo "$pgrx_cmd" install ${rust_release} --features "pg$pg" || { echo "failed cargo $pgrx_cmd install for pg$pg, $pkg-$version"; exit 1; }
)
err=$?
if [ $err -eq 0 ]; then
log "installed $pkg-$version for pg$pg"
else
error "failed building $pkg-$version for pg$pg ($err)"
fi
done
PATH="$ORIGINAL_PATH"
}

timescaledb_post_install() {
local pg
# https://github.com/timescale/timescaledb/commit/6dddfaa54e8f29e3ea41dab2fe7d9f3e37cd3aae
Expand Down
24 changes: 0 additions & 24 deletions build_scripts/shared_versions.sh
Original file line number Diff line number Diff line change
Expand Up @@ -88,15 +88,6 @@ install_rust_extensions() {
pgrx_versions[$cargopgrx]+=" toolkit-$ver"
done

for ver in $PROMSCALE_VERSIONS; do
cargopgrx="$(pkg_cargo_pgrx_version "promscale" "$ver")"
if [ -z "$cargopgrx" ]; then
error "no cargo-pgrx version found for promscale-$ver"
continue
fi
pgrx_versions[$cargopgrx]+=" promscale-$ver"
done

sorted_pgrx_versions="$(for pgrx_ver in "${!pgrx_versions[@]}"; do echo "$pgrx_ver"; done | sort -Vu)"
for pgrx_ver in $sorted_pgrx_versions; do
ext_versions="$(for ext_ver in ${pgrx_versions[$pgrx_ver]}; do echo "$ext_ver"; done | sort -Vu)"
Expand All @@ -105,7 +96,6 @@ install_rust_extensions() {
ver="$(echo "$ext_ver" | cut -d- -f2-)"
case "$ext" in
toolkit) install_toolkit "$pgrx_ver" "$ver";;
promscale) install_promscale "$pgrx_ver" "$ver";;
esac
done
done
Expand Down Expand Up @@ -166,19 +156,6 @@ supported_toolkit() {
version_is_supported toolkit "$pg" "$ver"
}

supported_promscale() {
local pg="$1" ver="$2"

if [ "$ARCH" != amd64 ]; then echo "unsupported arch $ARCH"; return; fi

# just attempt the build for main/master/or other branch build
if [[ "$ver" = main || "$ver" = master || "$ver" =~ [a-z_-]*/[A-Za-z0-9_-]* ]]; then
return
fi

version_is_supported promscale "$pg" "$ver"
}

supported_pgvectorscale() {
local pg="$1" ver="$2"

Expand All @@ -199,5 +176,4 @@ require_supported_arch() {

TIMESCALEDB_VERSIONS="$(requested_pkg_versions timescaledb "$TIMESCALEDB_VERSIONS")"
TOOLKIT_VERSIONS="$(requested_pkg_versions toolkit "$TOOLKIT_VERSIONS")"
PROMSCALE_VERSIONS="$(requested_pkg_versions promscale "$PROMSCALE_VERSIONS")"
PGVECTORSCALE_VERSIONS="$(requested_pkg_versions pgvectorscale "$PGVECTORSCALE_VERSIONS")"
29 changes: 0 additions & 29 deletions build_scripts/versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -128,35 +128,6 @@ timescaledb:
pg-min: 14
pg-max: 17

promscale:
0.5.0:
arch: amd64
pg-max: 14
cargo-pgrx: 0.3.1
0.5.1:
arch: amd64
pg-max: 14
cargo-pgrx: 0.3.1
0.5.2:
arch: amd64
pg-max: 14
cargo-pgrx: 0.3.1
0.5.4:
arch: amd64
pg-max: 14
cargo-pgrx: 0.3.1
0.6.0:
arch: amd64
pg-max: 14
cargo-pgrx: 0.4.5
0.7.0:
arch: amd64
pg-max: 14
cargo-pgrx: 0.4.5
0.8.0:
arch: amd64
cargo-pgrx: 0.6.1

toolkit:
1.6.0:
arch: amd64
Expand Down
43 changes: 2 additions & 41 deletions cicd/shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@ check_base_components() {
local pg="$1" lib="$2"

check_timescaledb "$pg" "$lib"
check_promscale "$pg" "$lib"
check_pgvectorscale "$pg" "$lib"
check_toolkit "$pg" "$lib"
check_oss_extensions "$pg" "$lib"
Expand Down Expand Up @@ -119,56 +118,18 @@ check_oss_extensions() {
if [ "$OSS_ONLY" != true ]; then return 0; fi

local pg="$1" lib="$2"
for pattern in timescaledb_toolkit promscale; do
for pattern in timescaledb_toolkit; do
files="$(find "$lib" -maxdepth 1 -name "${pattern}*")"
if [ -n "$files" ]; then error "found $pattern files for pg$pg when OSS_ONLY is true"; fi
done
}

check_promscale() {
if [ -z "$PROMSCALE_VERSIONS" ]; then return; fi
local pg="$1" lib="$2" ver found=false

if [ "$OSS_ONLY" = true ]; then
# we don't do anything here as we depend on `check_oss_extensions` to flag on inappropriate versions of promscale
return
fi

if [ "$ARCH" != amd64 ]; then
# no arm64 promscale packages
return
fi

# record an empty version so we'll get an empty table row if we don't have any versions
record_ext_version promscale_extension "$pg" ""

for ver in $PROMSCALE_VERSIONS; do
if [[ "$ver" = master || "$ver" = main ]]; then
log "skipping looking for promscale-$ver"
continue
fi
if [ -s "$lib/promscale-$ver.so" ]; then
found=true
record_ext_version promscale_extension "$pg" "$ver"
else
unsupported_reason="$(supported_promscale "$pg" "$ver")"
if [ -n "$unsupported_reason" ]; then
log "skipped: promscale-$ver: $unsupported_reason"
else
error "promscale-$ver not found for pg$pg"
fi
fi
done

if [[ "$found" = false && "$pg" -lt 16 ]]; then error "no promscale versions found for pg$pg"; fi
}

check_toolkit() {
if [ -z "$TOOLKIT_VERSIONS" ]; then return; fi
local pg="$1" lib="$2" found=false

if [ "$OSS_ONLY" = true ]; then
# we don't do anything here as we depend on `check_oss_extensions` to flag on inappropriate versions of promscale
# we don't do anything here as we depend on `check_oss_extensions` to flag on inappropriate versions
return
fi

Expand Down
10 changes: 1 addition & 9 deletions cicd/version_info.sql
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ WITH versions(name, version) AS (
FROM
pg_available_extensions
WHERE
name IN ('timescaledb', 'postgis', 'pg_prometheus', 'timescale_prometheus_extra', 'promscale', 'vectorscale', 'ai', 'timescaledb_toolkit', 'timescale_analytics')
name IN ('timescaledb', 'postgis', 'pg_prometheus', 'timescale_prometheus_extra', 'vectorscale', 'ai', 'timescaledb_toolkit', 'timescale_analytics')
UNION ALL
SELECT
'postgresql.version',
Expand All @@ -33,14 +33,6 @@ WITH versions(name, version) AS (
WHERE
name = 'timescaledb'
UNION ALL
SELECT
'promscale.available_versions',
string_agg(version, ',' ORDER BY version)
FROM
pg_available_extension_versions
WHERE
name = 'promscale'
UNION ALL
SELECT
'vectorscale.available_versions',
string_agg(version, ',' ORDER BY version)
Expand Down

0 comments on commit 7587a4f

Please sign in to comment.