Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions .github/workflows/ami-build-ubuntu-18.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ jobs:
- uses: docker/setup-buildx-action@v2
with:
endpoint: builders
driver-opts: image=moby/buildkit:v0.11.6
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated buildkit just in case it'd help us avoid connection reset errors; default was running under v0.10.0

buildkitd-flags: --debug
- uses: docker/build-push-action@v3
with:
push: false
Expand All @@ -56,7 +58,7 @@ jobs:
tags: supabase/postgres:extensions
platforms: linux/${{ matrix.arch }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max,ignore-error=true
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also no point crashing the entire workflow if the build cache push fails


- name: Extract built packages
run: |
Expand All @@ -80,11 +82,12 @@ jobs:
ubuntu_release_no=${{ matrix.ubuntu_version }}
postgresql_major=${{ steps.version.outputs.postgresql_major }}
postgresql_release=${{ steps.version.outputs.postgresql_release }}
CPPFLAGS=-mcpu=${{ matrix.mcpu }}
CPPFLAGS=
DEB_BUILD_PROFILES=pkg.postgresql.nozstd
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Building Postgres from source requires libzstd 1.4.0+, whereas Ubuntu 18 only has versions up to 1.3.3 available.
Sadness all around, although it doesn't affect us since these binaries are only used to upgrade from PG13/14 (which didn't have zstd compression support)

tags: supabase/postgres:deb-u18
platforms: linux/${{ matrix.arch }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max,ignore-error=true
- name: Extract Postgres deb
run: |
mkdir -p /tmp/build ansible/files/postgres
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/ami-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
- uses: docker/setup-buildx-action@v2
with:
endpoint: builders
driver-opts: image=moby/buildkit:v0.11.6
buildkitd-flags: --debug
- uses: docker/build-push-action@v3
with:
push: false
Expand All @@ -48,7 +50,7 @@ jobs:
tags: supabase/postgres:extensions
platforms: linux/${{ matrix.arch }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max,ignore-error=true
- name: Extract built packages
run: |
mkdir -p /tmp/extensions ansible/files/extensions
Expand All @@ -75,7 +77,7 @@ jobs:
tags: supabase/postgres:deb
platforms: linux/${{ matrix.arch }}
cache-from: type=gha
cache-to: type=gha,mode=max
cache-to: type=gha,mode=max,ignore-error=true
- name: Extract Postgres deb
run: |
mkdir -p /tmp/build ansible/files/postgres
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/dockerhub-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,11 @@ on:
push:
branches:
- develop
- pcnc/fix-pljava
paths:
- ".github/workflows/dockerhub-release.yml"
- "common.vars*"
workflow_dispatch:

jobs:
settings:
Expand Down
21 changes: 6 additions & 15 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ ARG plpgsql_check_release=2.2.5
ARG pg_safeupdate_release=1.4
ARG timescaledb_release=2.9.1
ARG wal2json_release=2_5
ARG pljava_release=1.6.4
ARG pljava_release=1_6_5
ARG plv8_release=3.1.5
ARG pg_plan_filter_release=5081a7b5cb890876e67d8e7486b6a64c38c9a492
ARG pg_net_release=0.7.1
Expand Down Expand Up @@ -403,11 +403,10 @@ RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --pkgver
####################
FROM builder as pljava-source
# Download and extract
# TODO: revert to using main repo after PG15 support is merged: https://github.com/tada/pljava/pull/413
ARG pljava_release=master
ARG pljava_release_checksum=sha256:e99b1c52f7b57f64c8986fe6ea4a6cc09d78e779c1643db060d0ac66c93be8b6
ARG pljava_release=1_6_5
ARG pljava_release_checksum=sha256:e1492b237eac8aaed6792feb26b8fa06b9c6ec3bd0a61ecd7a90e175dd1f1c5a
ADD --checksum=${pljava_release_checksum} \
"https://github.com/supabase/pljava/archive/refs/heads/${pljava_release}.tar.gz" \
"https://github.com/tada/pljava/archive/refs/tags/V${pljava_release}.tar.gz" \
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reverting to original repo since PG15 support was merged in the meantime

/tmp/pljava.tar.gz
RUN tar -xvf /tmp/pljava.tar.gz -C /tmp && \
rm -rf /tmp/pljava.tar.gz
Expand All @@ -422,15 +421,7 @@ RUN apt-get update && apt-get install -y --no-install-recommends \
WORKDIR /tmp/pljava-${pljava_release}
RUN mvn -T 1C clean install -Dmaven.test.skip -DskipTests -Dmaven.javadoc.skip=true
# Create debian package
RUN cp pljava-packaging/target/pljava-pg${postgresql_major}.jar /tmp/

FROM base as pljava
# Download pre-built packages
RUN apt-get update && apt-get install -y --no-install-recommends --download-only \
default-jdk-headless \
postgresql-${postgresql_major}-pljava \
&& rm -rf /var/lib/apt/lists/*
RUN mv /var/cache/apt/archives/*.deb /tmp/
RUN checkinstall -D --install=no --fstrans=no --backup=no --pakdir=/tmp --pkgname=pljava --pkgversion="\${pljava_release//_/.}" --requires=default-jdk-headless --exclude /proc/ --nodoc java -jar pljava-packaging/target/pljava-pg${postgresql_major}.jar

####################
# 13-plv8.yml
Expand Down Expand Up @@ -832,7 +823,7 @@ COPY --from=plpgsql_check-source /tmp/*.deb /tmp/
COPY --from=pg-safeupdate-source /tmp/*.deb /tmp/
COPY --from=timescaledb-source /tmp/*.deb /tmp/
COPY --from=wal2json-source /tmp/*.deb /tmp/
# COPY --from=pljava /tmp/*.deb /tmp/
COPY --from=pljava-source /tmp/*.deb /tmp/
COPY --from=plv8 /tmp/*.deb /tmp/
COPY --from=pg_plan_filter-source /tmp/*.deb /tmp/
COPY --from=pg_net-source /tmp/*.deb /tmp/
Expand Down
30 changes: 11 additions & 19 deletions ansible/tasks/postgres-extensions/12-pljava.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,27 +9,19 @@
update_cache: yes
install_recommends: no

#TODO: revert to using main repo after PG15 support is merged: https://github.com/tada/pljava/pull/413
# - name: pljava - download latest release
# get_url:
# url: https://github.com/tada/pljava/archive/V{{ pljava_release }}.tar.gz
# dest: /tmp/pljava-{{ pljava_release }}.tar.gz
# checksum: "{{ pljava_release_checksum }}"
# timeout: 60

# - name: pljava - unpack archive
# unarchive:
# remote_src: yes
# src: /tmp/pljava-{{ pljava_release }}.tar.gz
# dest: /tmp
# become: yes

- name: pljava - download latest release
get_url:
url: https://github.com/tada/pljava/archive/refs/tags/V{{ pljava_release }}.tar.gz
dest: /tmp/pljava-{{ pljava_release }}.tar.gz
checksum: "{{ pljava_release_checksum }}"
timeout: 60

- name: pljava - unpack archive
unarchive:
remote_src: yes
src: /tmp/pljava-{{ pljava_release }}.tar.gz
dest: /tmp
become: yes
git:
repo: https://github.com/supabase/pljava.git
dest: /tmp/pljava-{{ pljava_release }}
version: "{{ pljava_release }}"

- name: pljava - build
become: yes
Expand Down
7 changes: 7 additions & 0 deletions ansible/tasks/setup-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,13 @@
state: present
line: auto_explain.log_min_duration = 10s

- name: pljava - set pljava.libjvm_location
become: yes
lineinfile:
path: /etc/postgresql/postgresql.conf
state: present
line: pljava.libjvm_location = '/usr/lib/jvm/java-11-openjdk-{{ platform }}/lib/server/libjvm.so'

# supautils
- name: supautils - add supautils to session_preload_libraries
become: yes
Expand Down
7 changes: 7 additions & 0 deletions ansible/tasks/setup-postgres.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,13 @@
apt:
name: postgresql-{{ postgresql_major }}={{ postgresql_release }}-1.pgdg20.04+1
install_recommends: no
when: ansible_distribution_version != "18.04"

- name: Postgres - install server - Ubuntu 18.04
apt:
name: postgresql-{{ postgresql_major }}={{ postgresql_release }}-1.pgdg18.04+1
install_recommends: no
when: ansible_distribution_version == "18.04"

- name: Postgres - remove PPA
apt_repository:
Expand Down
4 changes: 2 additions & 2 deletions ansible/vars.yml
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,8 @@ wal2json_release_checksum: sha256:b516653575541cf221b99cf3f8be9b6821f6dbcfc12567
supautils_release: "1.7.2"
supautils_release_checksum: sha256:527e645112e1348ea4b6be6740037b444797fbbc5d3ed98103ca582419e06084

pljava_release: master
pljava_release_checksum: sha256:e99b1c52f7b57f64c8986fe6ea4a6cc09d78e779c1643db060d0ac66c93be8b6
pljava_release: "1_6_5"
pljava_release_checksum: sha256:e1492b237eac8aaed6792feb26b8fa06b9c6ec3bd0a61ecd7a90e175dd1f1c5a

plv8_release: "3.1.5"
plv8_release_checksum: sha256:1e108d5df639e4c189e1c5bdfa2432a521c126ca89e7e5a969d46899ca7bf106
Expand Down
2 changes: 1 addition & 1 deletion common.vars.pkr.hcl
Original file line number Diff line number Diff line change
@@ -1 +1 @@
postgres-version = "15.1.0.100"
postgres-version = "15.1.0.101"
2 changes: 2 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ ENV DEB_BUILD_OPTIONS="nocheck parallel=$(nproc)"
# Configure processor optimised build
ARG CPPFLAGS="-mcpu=neoverse-n1"
ENV DEB_CPPFLAGS_APPEND="${CPPFLAGS} -fsigned-char"
ARG DEB_BUILD_PROFILES=""
ENV DEB_BUILD_PROFILES="${DEB_BUILD_PROFILES}"

RUN apt-get build-dep -y postgresql-common pgdg-keyring && \
apt-get source --compile postgresql-common pgdg-keyring && \
Expand Down
2 changes: 1 addition & 1 deletion migrations/tests/extensions/12-pljava.sql
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
BEGIN;
create extension if not exists pljava with schema "sqlj";
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pljava creates the sqlj schema automatically

create extension if not exists pljava;
ROLLBACK;
2 changes: 1 addition & 1 deletion migrations/tests/extensions/test.sql
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
\ir 09-pg-safeupdate.sql
\ir 10-timescaledb.sql
\ir 11-wal2json.sql
-- \ir 12-pljava.sql
\ir 12-pljava.sql
\ir 13-plv8.sql
\ir 14-pg_plan_filter.sql
\ir 15-pg_net.sql
Expand Down