Skip to content

Commit 159ed9a

Browse files
committed
chore: ubuntu 18 postgres .deb install compat
1 parent ec228b7 commit 159ed9a

File tree

7 files changed

+31
-21
lines changed

7 files changed

+31
-21
lines changed

.github/workflows/ami-build-ubuntu-18.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,8 @@ jobs:
2424
include:
2525
- runner: arm-runner
2626
arch: arm64
27-
ubuntu: focal
27+
ubuntu_release: bionic
28+
ubuntu_version: 18.04
2829
mcpu: neoverse-n1
2930
runs-on: ${{ matrix.runner }}
3031
timeout-minutes: 150
@@ -74,18 +75,19 @@ jobs:
7475
file: docker/Dockerfile
7576
target: pg-deb
7677
build-args: |
77-
ubuntu_release=${{ matrix.ubuntu }}
78+
ubuntu_release=${{ matrix.ubuntu_release }}
79+
ubuntu_version=${{ matrix.ubuntu_version }}
7880
postgresql_major=${{ steps.version.outputs.postgresql_major }}
7981
postgresql_release=${{ steps.version.outputs.postgresql_release }}
8082
CPPFLAGS=-mcpu=${{ matrix.mcpu }}
81-
tags: supabase/postgres:deb
83+
tags: supabase/postgres:deb-u18
8284
platforms: linux/${{ matrix.arch }}
8385
cache-from: type=gha
8486
cache-to: type=gha,mode=max
8587
- name: Extract Postgres deb
8688
run: |
8789
mkdir -p /tmp/build ansible/files/postgres
88-
docker save supabase/postgres:deb | tar xv -C /tmp/build
90+
docker save supabase/postgres:deb-u18 | tar xv -C /tmp/build
8991
for layer in /tmp/build/*/layer.tar; do
9092
tar xvf "$layer" -C ansible/files/postgres --strip-components 1
9193
done

.github/workflows/ami-release.yml

+13-11
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,8 @@ jobs:
1616
include:
1717
- runner: arm-runner
1818
arch: arm64
19-
ubuntu: focal
19+
ubuntu_release: focal
20+
ubuntu_version: 20.04
2021
mcpu: neoverse-n1
2122
runs-on: ${{ matrix.runner }}
2223
timeout-minutes: 150
@@ -66,7 +67,8 @@ jobs:
6667
file: docker/Dockerfile
6768
target: pg-deb
6869
build-args: |
69-
ubuntu_release=${{ matrix.ubuntu }}
70+
ubuntu_release=${{ matrix.ubuntu_release }}
71+
ubuntu_release_no=${{ matrix.ubuntu_version }}
7072
postgresql_major=${{ steps.version.outputs.postgresql_major }}
7173
postgresql_release=${{ steps.version.outputs.postgresql_release }}
7274
CPPFLAGS=-mcpu=${{ matrix.mcpu }}
@@ -136,15 +138,15 @@ jobs:
136138
tag_name: ${{ steps.process_release_version.outputs.version }}
137139
target_commitish: ${{github.sha}}
138140

139-
- name: Slack Notification on Failure
140-
if: ${{ failure() }}
141-
uses: rtCamp/action-slack-notify@v2
142-
env:
143-
SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }}
144-
SLACK_USERNAME: 'gha-failures-notifier'
145-
SLACK_COLOR: 'danger'
146-
SLACK_MESSAGE: 'Building Postgres AMI failed'
147-
SLACK_FOOTER: ''
141+
# - name: Slack Notification on Failure
142+
# if: ${{ failure() }}
143+
# uses: rtCamp/action-slack-notify@v2
144+
# env:
145+
# SLACK_WEBHOOK: ${{ secrets.SLACK_NOTIFICATIONS_WEBHOOK }}
146+
# SLACK_USERNAME: 'gha-failures-notifier'
147+
# SLACK_COLOR: 'danger'
148+
# SLACK_MESSAGE: 'Building Postgres AMI failed'
149+
# SLACK_FOOTER: ''
148150

149151
- name: Cleanup resources on build cancellation
150152
if: ${{ cancelled() }}

ansible/tasks/internal/collect-pg-binaries.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
- name: Collect Postgres binaries - collect binaries and libraries
77
copy:
88
remote_src: yes
9-
src: /usr/lib/postgresql/{{ item }}/
9+
src: /usr/lib/postgresql/{{ postgresql_major }}/{{ item }}/
1010
dest: /tmp/pg_binaries/{{ postgresql_major }}/{{ item }}/
1111
with_items:
1212
- bin

ansible/tasks/internal/supautils.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
- clang-12
1616
update_cache: yes
1717
cache_valid_time: 3600
18-
when: ansible_distribution_version != "18.04"
18+
when: ansible_distribution_version == "18.04"
1919

2020
- name: supautils - download latest release
2121
get_url:

ansible/tasks/setup-postgres.yml

+5
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@
88
repo: "deb [ trusted=yes ] file:///tmp/build ./"
99
state: present
1010

11+
- name: Postgres install deps - Ubuntu 18.04 compat
12+
ansible.builtin.apt:
13+
deb: "http://ftp.debian.org/debian/pool/main/i/init-system-helpers/init-system-helpers_1.60_all.deb"
14+
when: ansible_distribution_version == "18.04"
15+
1116
- name: Postgres - install commons
1217
apt:
1318
name: postgresql-common

common.vars.pkr.hcl

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
postgres-version = "15.1.0.98-rc0"
1+
postgres-version = "15.1.0.98-rc1"

docker/Dockerfile

+4-3
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ ARG ubuntu_release=focal
22
FROM ubuntu:${ubuntu_release} as base
33

44
ARG ubuntu_release
5+
ARG ubuntu_release_no
56
ARG postgresql_major=15
67
ARG postgresql_release=${postgresql_major}.1
78

@@ -39,8 +40,8 @@ RUN apt-get build-dep -y postgresql-common pgdg-keyring && \
3940
dpkg-scanpackages . > Packages && \
4041
apt-get -o Acquire::GzipIndexes=false update
4142

42-
RUN apt-get build-dep -y "postgresql-${postgresql_major}=${postgresql_release}-1.pgdg20.04+1" && \
43-
apt-get source --compile "postgresql-${postgresql_major}=${postgresql_release}-1.pgdg20.04+1" && \
43+
RUN apt-get build-dep -y "postgresql-${postgresql_major}=${postgresql_release}-1.pgdg${ubuntu_release_no}+1" && \
44+
apt-get source --compile "postgresql-${postgresql_major}=${postgresql_release}-1.pgdg${ubuntu_release_no}+1" && \
4445
dpkg-scanpackages . > Packages && \
4546
apt-get -o Acquire::GzipIndexes=false update
4647

@@ -60,7 +61,7 @@ RUN echo "deb [ trusted=yes ] file:///tmp/build ./" > /etc/apt/sources.list.d/te
6061
apt-get -o Acquire::GzipIndexes=false update && \
6162
apt-get install -y --no-install-recommends postgresql-common && \
6263
sed -ri 's/#(create_main_cluster) .*$/\1 = false/' /etc/postgresql-common/createcluster.conf && \
63-
apt-get install -y --no-install-recommends "postgresql-${postgresql_major}=${postgresql_release}-1.pgdg20.04+1" && \
64+
apt-get install -y --no-install-recommends "postgresql-${postgresql_major}=${postgresql_release}-1.pgdg${ubuntu_release_no}+1" && \
6465
rm -rf /var/lib/apt/lists/* && \
6566
rm -rf /tmp/build /etc/apt/sources.list.d/temp.list
6667

0 commit comments

Comments
 (0)