Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PostgreSQL 17 support #495

Draft
wants to merge 12 commits into
base: master
Choose a base branch
from
6 changes: 3 additions & 3 deletions .github/workflows/build_branch.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Build branch
on:
push:
branches:
- "*/**"
- "ignore-*/**"
paths-ignore:
- ".github/workflows/publish*.yaml"
- "*.md"
Expand All @@ -13,9 +13,9 @@ concurrency:
cancel-in-progress: true

env:
DOCKER_REPOSITORY: timescale/timescaledb-ha
DOCKER_REPOSITORY: timescaledev/timescaledb-ha
DOCKER_REGISTRY: docker.io
PG_MAJOR: 16
PG_MAJOR: 17
ALL_VERSIONS: "true"
OSS_ONLY: "false"

Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/publish_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ on:
branches:
- master
- main
- brent/pg17
paths-ignore:
- "*.md"

Expand All @@ -18,7 +19,7 @@ concurrency:
cancel-in-progress: true

env:
DOCKER_REPOSITORY: timescale/timescaledb-ha
DOCKER_REPOSITORY: timescaledev/timescaledb-ha
DOCKER_REGISTRY: docker.io

jobs:
Expand All @@ -29,7 +30,7 @@ jobs:
fail-fast: false
matrix:
platform: [ "amd64", "arm64" ]
pg_major: [ "16", "15", "14", "13", "12" ]
pg_major: [ "17", "16", "15", "14", "13", "12" ]
all_versions: [ "false", "true" ]
oss_only: [ "false", "true" ]

Expand Down Expand Up @@ -106,7 +107,7 @@ jobs:
fail-fast: false

matrix:
pg_major: [ "16", "15", "14", "13", "12" ]
pg_major: [ "17", "16", "15", "14", "13", "12" ]
docker_tag_postfix: ["", "-all", "-oss", "-all-oss" ]
include:
- docker_tag_postfix: ""
Expand Down Expand Up @@ -166,7 +167,7 @@ jobs:
strategy:
fail-fast: false
matrix:
pg_major: [ "16", "15", "14", "13", "12" ]
pg_major: [ "17", "16", "15", "14", "13", "12" ]
docker_tag_postfix: ["", "-all", "-oss", "-all-oss" ]

steps:
Expand Down
24 changes: 12 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,8 +32,8 @@ FROM ${DOCKER_FROM} AS builder
# regardless of the major PostgreSQL Version. It also allow us to support (eventually)
# pg_upgrade from one major version to another,
# so we need all the postgres & timescale libraries for all versions
ARG PG_VERSIONS="16 15 14 13"
ARG PG_MAJOR=16
ARG PG_VERSIONS="17 16 15 14 13"
ARG PG_MAJOR=17

ENV DEBIAN_FRONTEND=noninteractive

Expand Down Expand Up @@ -113,22 +113,22 @@ RUN set -eux; \
# forbid creation of a main cluster when package is installed
RUN sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf

# The next 2 instructions (ENV + RUN) are directly copied from https://github.com/rust-lang/docker-rust/blob/dcb74d779e8a74263dc8b91d58d8ce7f3c0c805b/1.70.0/bullseye/Dockerfile
# The next 2 instructions (ENV + RUN) are directly copied from https://github.com/rust-lang/docker-rust/blob/master/stable/bullseye/Dockerfile
ENV RUSTUP_HOME=/usr/local/rustup \
CARGO_HOME=/usr/local/cargo \
PATH=/usr/local/cargo/bin:$PATH \
RUST_VERSION=1.70.0
RUST_VERSION=1.82.0

RUN set -eux; \
dpkgArch="$(dpkg --print-architecture)"; \
case "${dpkgArch##*-}" in \
amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='0b2f6c8f85a3d02fde2efc0ced4657869d73fccfce59defb4e8d29233116e6db' ;; \
armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='f21c44b01678c645d8fbba1e55e4180a01ac5af2d38bcbd14aa665e0d96ed69a' ;; \
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='673e336c81c65e6b16dcdede33f4cc9ed0f08bde1dbe7a935f113605292dc800' ;; \
i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='e7b0f47557c1afcd86939b118cbcf7fb95a5d1d917bdd355157b63ca00fc4333' ;; \
amd64) rustArch='x86_64-unknown-linux-gnu'; rustupSha256='6aeece6993e902708983b209d04c0d1dbb14ebb405ddb87def578d41f920f56d' ;; \
armhf) rustArch='armv7-unknown-linux-gnueabihf'; rustupSha256='3c4114923305f1cd3b96ce3454e9e549ad4aa7c07c03aec73d1a785e98388bed' ;; \
arm64) rustArch='aarch64-unknown-linux-gnu'; rustupSha256='1cffbf51e63e634c746f741de50649bbbcbd9dbe1de363c9ecef64e278dba2b2' ;; \
i386) rustArch='i686-unknown-linux-gnu'; rustupSha256='0a6bed6e9f21192a51f83977716466895706059afb880500ff1d0e751ada5237' ;; \
*) echo >&2 "unsupported architecture: ${dpkgArch}"; exit 1 ;; \
esac; \
url="https://static.rust-lang.org/rustup/archive/1.26.0/${rustArch}/rustup-init"; \
url="https://static.rust-lang.org/rustup/archive/1.27.1/${rustArch}/rustup-init"; \
wget "$url"; \
echo "${rustupSha256} *rustup-init" | sha256sum -c -; \
chmod +x rustup-init; \
Expand All @@ -137,7 +137,7 @@ RUN set -eux; \
chmod -R a+w $RUSTUP_HOME $CARGO_HOME; \
rustup --version; \
cargo --version; \
rustc --version;
rustc --version

# Setup locales, and make sure we have a en_US.UTF-8 locale available
RUN set -eux; \
Expand Down Expand Up @@ -225,8 +225,8 @@ ARG PGVECTO_RS
RUN set -ex; \
if [ -n "${PGVECTO_RS}" ]; then \
for pg in ${PG_VERSIONS}; do \
# Vecto.rs only support PostgreSQL 14 and upwards
if [ $pg -gt 13 ]; then \
# Vecto.rs only support PostgreSQL 14..16
if [ $pg -gt 13 -a $pg -lt 17 ]; then \
curl --silent \
--location \
--output /tmp/vectors.deb \
Expand Down
16 changes: 9 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ SHELL = bash

all: help

PG_MAJOR?=16
PG_MAJOR?=17
# All PG_VERSIONS binaries/libraries will be included in the Dockerfile
# specifying multiple versions will allow things like pg_upgrade etc to work.
PG_VERSIONS?=
Expand All @@ -14,10 +14,10 @@ PG_VERSIONS?=
PGAI_VERSION?=extension-0.4.0
PGVECTORSCALE_VERSIONS?=all
POSTGIS_VERSIONS?=3
PG_AUTH_MON?=v2.0
PG_STAT_MONITOR?=2.0.3
PG_LOGERRORS?=18d9795
PGVECTO_RS?=0.2.0
PG_AUTH_MON?=v3.0
PG_STAT_MONITOR?=2.1.0
PG_LOGERRORS?=v2.1.3
PGVECTO_RS?=0.3.0
TIMESCALEDB_VERSIONS?=all
PROMSCALE_VERSIONS?=all
TOOLKIT_VERSIONS?=all
Expand All @@ -42,7 +42,9 @@ endif

ifeq ($(ALL_VERSIONS),true)
DOCKER_TAG_POSTFIX := $(strip $(DOCKER_TAG_POSTFIX))-all
ifeq ($(PG_MAJOR),16)
ifeq ($(PG_MAJOR),17)
PG_VERSIONS := 17 16 15 14 13 12
else ifeq ($(PG_MAJOR),16)
PG_VERSIONS := 16 15 14 13 12
else ifeq ($(PG_MAJOR),15)
PG_VERSIONS := 15 14 13 12
Expand Down Expand Up @@ -180,7 +182,7 @@ fast: ALL_VERSIONS=false
fast: PG_AUTH_MON=
fast: PG_LOGERRORS=
fast: PGAI_VERSION=
fast: PG_VERSIONS=16
fast: PG_VERSIONS=17
fast: POSTGIS_VERSIONS=
fast: TOOLKIT_VERSIONS=
fast: PROMSCALE_VERSIONS=
Expand Down
4 changes: 2 additions & 2 deletions build_scripts/shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -168,15 +168,15 @@ require_cargo_pgrx_version() {
available_pg_versions() {
# this allows running out-of-container with dry-run to test script logic
if [[ "$DRYRUN" = true && ! -d /usr/lib/postgresql ]]; then
echo 12 13 14 15 16
echo 12 13 14 15 16 17
else
(cd /usr/lib/postgresql && ls)
fi
}

cargo_pgrx_cmd() {
local pgrx_version="$1"
if [[ "$pgrx_version" =~ ^0\.[0-7]\.* ]]; then echo "pgx"; else echo "pgrx"; fi
if [[ "$pgrx_version" =~ ^0\.[0-7]\. ]]; then echo "pgx"; else echo "pgrx"; fi
}

cargo_pgrx_init() {
Expand Down
5 changes: 5 additions & 0 deletions build_scripts/shared_install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@ install_timescaledb() {
continue
fi

if [ "$version" = main -a "$pg" -lt 14 ]; then
log "$pkg-$version: unsupported for < pg14"
continue
fi

log "building $pkg-$version for pg$pg"

[[ "$DRYRUN" = true ]] && continue
Expand Down
9 changes: 6 additions & 3 deletions build_scripts/versions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,13 +120,13 @@ timescaledb:
pg-max: 16
2.17.0:
pg-min: 14
pg-max: 16
pg-max: 17
2.17.1:
pg-min: 14
pg-max: 16
pg-max: 17
2.17.2:
pg-min: 14
pg-max: 16
pg-max: 17

promscale:
0.5.0:
Expand Down Expand Up @@ -203,6 +203,9 @@ toolkit:
1.18.0:
cargo-pgrx: 0.10.2
pg-max: 16
1.19.0:
cargo-pgrx: 0.12.8
pg-max: 17

pgvectorscale:
0.2.0:
Expand Down
3 changes: 2 additions & 1 deletion cicd/shared.sh
Original file line number Diff line number Diff line change
Expand Up @@ -269,7 +269,8 @@ check_others() {
fi

record_ext_version pgvecto.rs "$pg" ""
if [[ -n "$PGVECTO_RS" && "$pg" -gt 13 ]]; then
# TODO: pgvecto.rs hasn't released a pg17 compatible version yet, check https://github.com/tensorchord/pgvecto.rs/releases
if [[ -n "$PGVECTO_RS" && "$pg" -gt 13 && "$pg" -lt 17 ]]; then
if [ -s "$lib/vectors.so" ]; then
record_ext_version pgvecto.rs "$pg" "$PGVECTO_RS"
else
Expand Down
Loading