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

Support Pg 14 & 16 in images #56

Merged
merged 14 commits into from
Feb 6, 2024
Merged
43 changes: 42 additions & 1 deletion .github/workflows/build_images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -177,4 +177,45 @@ jobs:
--build-arg PG_VERSION=${{ matrix.pg_version }} \
--platform linux/amd64 \
--tag quay.io/tembo/tembo-pg-cnpg:pg${{ matrix.pg_version }}-${{ steps.sha.outputs.sha }} \
--pull ${PUSH_FLAG} ./tembo-pg-cnpg
--pull ${PUSH_FLAG} ./tembo-pg-cnpg

build_and_push_standard_cnpg:
name: Build and push standard-cnpg
runs-on:
- self-hosted
- dind
- large-8x8
strategy:
fail-fast: false
matrix:
include:
- pg_version: "14"
- pg_version: "15"
- pg_version: "16"
steps:
- name: Check out the repo
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to Quay.io
uses: docker/login-action@v2
with:
registry: quay.io
username: ${{ secrets.QUAY_USER_TEMBO }}
password: ${{ secrets.QUAY_PASSWORD_TEMBO }}
- name: Get short SHA
id: sha
run: echo "::set-output name=sha::$(git rev-parse --short HEAD)"
- name: Build and push
run: |
set -xe
BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)
PUSH_FLAG=""
if [ "${BRANCH_NAME}" == "main" ]; then
PUSH_FLAG="--push"
fi
docker buildx build \
--build-arg PG_VERSION=${{ matrix.pg_version }} \
--platform linux/amd64 \
--tag quay.io/tembo/standard-cnpg:pg${{ matrix.pg_version }}-${{ steps.sha.outputs.sha }} \
--pull ${PUSH_FLAG} ./standard-cnpg
9 changes: 7 additions & 2 deletions standard-cnpg/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,14 @@
ARG PG_VERSION=15

FROM rust:1.70-bookworm as builder

ARG TRUNK_VER=0.10.5
ARG TRUNK_VER=0.12.19

ENV CARGO_REGISTRIES_CRATES_IO_PROTOCOL sparse
RUN cargo install --version $TRUNK_VER pg-trunk

FROM quay.io/tembo/tembo-pg-slim:15.3.0-tembo-pg-slim.1-cd62faf
FROM quay.io/tembo/tembo-pg-slim:pg${PG_VERSION}

USER root

# Install trunk
Expand Down Expand Up @@ -83,6 +86,8 @@ RUN trunk install auto_explain

# cache pg_stat_statements and auto_explain and pg_stat_kcache to temp directory
RUN set -eux; \
mkdir /tmp/pg_pkglibdir; \
mkdir /tmp/pg_sharedir; \
cp -r $(pg_config --pkglibdir)/* /tmp/pg_pkglibdir; \
cp -r $(pg_config --sharedir)/* /tmp/pg_sharedir

Expand Down
2 changes: 1 addition & 1 deletion standard-cnpg/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Postgres Docker Image for Tembo's Standard Stack

Contains a Dockerfile with Postgres 15.3, with trunk, barman-cloud and all extension dependencies installed.
Contains a Dockerfile with trunk, barman-cloud, Postgres 14, 15 or 16 and all extension dependencies installed.

## Versioning

Expand Down
Loading