Skip to content

Commit

Permalink
Ensure PostgreSQL 16 is tested
Browse files Browse the repository at this point in the history
To achieve this, we have had to change quite a few things:

Explicitly list our Docker Image builds

The logic in the json was pretty complex, by using more yamls, and lists
we hope to achieve a workflow that is easier to inspect, reason with and
adapt.

We also need to reintroduce the difference between $PG_VERSIONS and
$TSDB_PG_VERSIONS, as PostgreSQL 16 support is not yet available for
TimescaleDB.
  • Loading branch information
feikesteenbergen committed Oct 13, 2023
1 parent 4f28156 commit 7028fbe
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 44 deletions.
76 changes: 40 additions & 36 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,43 +39,47 @@ jobs:
fail-fast: false
max-parallel: 12
matrix:
pgversion: [12, 13, 14, 15]
container: "${{ \
( \
inputs.all-platforms || \
( \
github.event_name == 'schedule' && \
github.event.schedule == '0 6 * * 1-4' \
) \
) && \
fromJSON('[ \
{ \"os\": \"debian\", \"version\": \"10\", \"image\": \"debian-10-amd64\" }, \
{ \"os\": \"debian\", \"version\": \"11\", \"image\": \"debian-11-amd64\" }, \
{ \"os\": \"rockylinux\", \"version\": \"8\", \"image\": \"rockylinux-8-x86_64\" }, \
{ \"os\": \"rockylinux\", \"version\": \"9\", \"image\": \"rockylinux-9-x86_64\" }, \
{ \"os\": \"centos\", \"version\": \"7\", \"image\": \"centos-7-x86_64\" }, \
{ \"os\": \"ubuntu\", \"version\": \"20.04\", \"image\": \"ubuntu-20.04-amd64\" }, \
{ \"os\": \"ubuntu\", \"version\": \"22.04\", \"image\": \"ubuntu-22.04-amd64\" } \
]') \
|| fromJSON('[ \
{ \"os\": \"debian\", \"version\": \"11\", \"image\": \"debian-11-amd64\" }, \
{ \"os\": \"rockylinux\", \"version\": \"9\", \"image\": \"rockylinux-9-x86_64\" }, \
{ \"os\": \"centos\", \"version\": \"7\", \"image\": \"centos-7-x86_64\" } \
]') \
}}"
# Building TSDB in CI is only supported on Debian/Ubuntu
exclude: "${{ \
( \
(github.event_name == 'schedule' && github.event.schedule == '0 8 * * 1-4') \
|| inputs.tsdb-commit != '' \
) && \
fromJSON('[ \
{\"container\": {\"os\": \"centos\"}}, \
{\"container\": {\"os\": \"rockylinux\"}} \
]') || \
fromJSON('[]') \
}}"
pgversion: [12, 13, 14, 15, 16]
container:
- os: rockylinux
version: "9"
image: rockylinux-9-x86_64
# Building TSDB in CI is only supported on Debian/Ubuntu
skip: ${{ inputs.tsdb-commit != '' }}
schedule: ${{ !(github.event_name == 'schedule' && github.event.schedule == '0 8 * * 1-4') }}
- os: centos
version: "7"
image: centos-7-x86_64
# Building TSDB in CI is only supported on Debian/Ubuntu
skip: ${{ inputs.tsdb-commit != '' }}
schedule: ${{ !(github.event_name == 'schedule' && github.event.schedule == '0 8 * * 1-4') }}
- os: debian
version: "11"
image: debian-11-amd64
schedule: true
- os: debian
version: "10"
image: debian-10-amd64
schedule: ${{ inputs.all-platforms || ( github.event_name == 'schedule' && github.event.schedule == '0 6 * * 1-4' ) }}
- os: ubuntu
version: "20.04"
image: ubuntu-20.04-amd64
schedule: ${{ inputs.all-platforms || ( github.event_name == 'schedule' && github.event.schedule == '0 6 * * 1-4' ) }}
- os: ubuntu
version: "22.04"
image: ubuntu-22.04-amd64
schedule: ${{ inputs.all-platforms || ( github.event_name == 'schedule' && github.event.schedule == '0 6 * * 1-4' ) }}

exclude:
- container:
skip: true
- container:
schedule: false
# CentOS 7 does not have PostgreSQL 16 packages
- container:
os: centos
version: "7"
pgversion: 16
env:
# TODO Why? Cargo default is to pass `-C incremental` to rustc; why don't we want that?
# https://doc.rust-lang.org/rustc/codegen-options/index.html#incremental
Expand Down
16 changes: 11 additions & 5 deletions docker/ci/setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -133,10 +133,13 @@ EOF
for pg in $PG_VERSIONS; do
yum -q -y install \
postgresql$pg-devel \
postgresql$pg-server \
timescaledb-2-postgresql-$pg
postgresql$pg-server
# We install as user postgres, so that needs write access to these.
chown $BUILDER_USERNAME $PG_BASE$pg/lib $PG_BASE$pg/share/extension
done;

for pg in $TSDB_PG_VERSIONS; do
yum -q -y install timescaledb-2-postgresql-$pg
done

gem install fpm -v $FPM_VERSION -N
Expand Down Expand Up @@ -198,12 +201,15 @@ EOF
apt-get -qq install \
postgresql-$pg \
postgresql-server-dev-$pg
# timescaledb packages Recommend toolkit, which we don't want here.
apt-get -qq install --no-install-recommends timescaledb-2-postgresql-$pg
# We install as user postgres, so that needs write access to these.
chown $BUILDER_USERNAME $PG_BASE$pg/lib /usr/share/postgresql/$pg/extension
done

for pg in $TSDB_PG_VERSIONS; do
# timescaledb packages Recommend toolkit, which we don't want here.
apt-get -qq install --no-install-recommends timescaledb-2-postgresql-$pg
done

# Ubuntu is the only system we want an image for that sticks an extra
# copy of the default PATH into PAM's /etc/environment and we su or sudo
# to $BUILDER_USERNAME thereby picking up that PATH and clobbering the
Expand Down Expand Up @@ -244,7 +250,7 @@ for pg in $PG_VERSIONS; do
done
cargo pgrx init $init_flags
## Initialize pgrx-managed databases so we can add the timescaledb load.
for pg in $PG_VERSIONS; do
for pg in $TSDB_PG_VERSIONS; do
echo "shared_preload_libraries = 'timescaledb'" >> ~/.pgrx/data-$pg/postgresql.conf
done

Expand Down
6 changes: 3 additions & 3 deletions tools/dependencies.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@
# All our automation scripts read this, so at least we're not duplicating this
# information across all those.

PG_VERSIONS='12 13 14 15'
# TODO: remove this once TimescaleDB supports PostgreSQL 15: issue #648
TSDB_PG_VERSIONS='12 13 14'
PG_VERSIONS='12 13 14 15 16'
# TODO: extend this with 16 this once TimescaleDB supports PostgreSQL 16: issue #5752
TSDB_PG_VERSIONS='12 13 14 15'

CARGO_EDIT=0.11.2

Expand Down

0 comments on commit 7028fbe

Please sign in to comment.