Skip to content

Commit

Permalink
chore: pg 15.6 -> 15.8
Browse files Browse the repository at this point in the history
Signed-off-by: vados <[email protected]>
  • Loading branch information
t3hmrman committed Sep 29, 2024
1 parent 3610ce5 commit 6f7b5a4
Show file tree
Hide file tree
Showing 4 changed files with 104 additions and 4 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/container.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
runner: ubuntu-22.04
container:
arch: amd64
pg_version: 15.6
os_version: alpine3.18
pg_version: 15.8
os_version: alpine3.20.3
- triple: x86_64-unknown-linux-musl
gh:
runner: ubuntu-22.04
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- pgrx:
pg-version: pg15
pg:
version: 15.6
version: 15.8
- pgrx:
pg-version: pg16
pg:
Expand All @@ -55,7 +55,7 @@ jobs:
- pgrx:
pg-version: pg15
pg:
version: 15.6
version: 15.8
- pgrx:
pg-version: pg16
pg:
Expand Down
55 changes: 55 additions & 0 deletions infra/docker/base-pkg-alpine3.20.3-amd64.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
FROM alpine:3.20.3@sha256:beefdbd8a1da6d2915566fde36db9db0b524eb737fc57cd1367effd16dc0d06d AS builder

# Allow for overriding rust toolcahin version
ARG RUST_TOOLCHAIN_VERSION=1.81
ENV RUST_TOOLCHAIN_VERSION=$RUST_TOOLCHAIN_VERSION

# Allow for overriding of PGRX PG version that is used
ARG PGRX_PG_VERSION=pg16
ENV PGRX_PG_VERSION=$PGRX_PG_VERSION

# Allow overriding features so that this file can be used to build
# different crate features. By default since this is a 16.2 base package
# we expect to build with crate feature 'pg16'
ARG CARGO_FEATURES=pg16
ENV CARGO_FEATURES=$CARGO_FEATURES

# Install OS deps
RUN apk add --no-cache \
alpine-sdk \
bash \
bison \
clang \
clang-dev \
clang-libs \
coreutils \
flex \
icu-dev \
linux-headers \
musl-dev \
openssl-dev \
perl \
readline \
readline-dev \
rustup \
zlib-dev

# Install Rust & related deps
RUN rustup-init -y --profile minimal --default-toolchain $RUST_TOOLCHAIN_VERSION
ENV PATH="/root/.cargo/bin:${PATH}"
RUN cargo install just cargo-get

# Install pgrx
# (disabling the static C runtime is required since pgrx requires dynamic linking w/ libssl and libcrypto)
RUN RUSTFLAGS="-Ctarget-feature=-crt-static" cargo install --locked [email protected]

# Copy in pg_idkit code
WORKDIR /pg_idkit
COPY . .

# Initialize pgrx
ENV PGRX_IGNORE_RUST_VERSIONS=y
RUN just pgrx-init

# Build the package
RUN RUSTFLAGS="-Ctarget-feature=-crt-static" just build package
45 changes: 45 additions & 0 deletions infra/docker/pg_idkit-pg15.8-alpine3.20.3-amd64.Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
#
# NOTE: you must have the base packaging layer built for this image to work
# you can build this from scratch with `just build-base-pkg-image`
#
# `cargo pgrx init` is run in the base-pkg, so it contains the versions of pg that will be used.
#
FROM ghcr.io/vadosware/pg_idkit/base-pkg:0.1.x-alpine3.20.3-amd64 AS builder

ARG USER
ENV USER=$USER

ARG PGRX_PG_VERSION=pg15
ENV PGRX_PG_VERSION=$PGRX_PG_VERSION

ARG PKG_PG_VERSION=15.8
ENV PKG_PG_VERSION=$PKG_PG_VERSION

ENV PKG_TARBALL_SUFFIX="-musl"

# Re-run the build with the latest code
WORKDIR /pg_idkit
COPY . .
RUN RUSTFLAGS="-Ctarget-feature=-crt-static" just build package

FROM postgres:15.8-alpine3.20@sha256:620dc79c45816cff4f38f0b49c71f15a3bc6bab9439ba1eea3a76d23ebcf1e4d

# NOTE: PGRX_PG_VERSION is defined via base-pkg:pg15.8-alpine3.20.3-amd64
ARG PGRX_PG_VERSION=pg15
ARG PGIDKIT_VERSION
ARG PGIDKIT_REVISION

# Install packaged pg_idkit for system postgres
COPY --from=builder /pg_idkit/pg_idkit-*-musl.tar.gz /tmp
RUN tar -C /usr/local --strip-components=1 -xvf /tmp/pg_idkit-*-musl.tar.gz

LABEL org.opencontainers.image.authors="Victor Adossi <[email protected]>"
LABEL org.opencontainers.image.description="A distribution of the base postgres image, with pg_idkit pre-installed."
LABEL org.opencontainers.image.documentation="https://github.com/VADOSWARE/pg_idkit#readme"
LABEL org.opencontainers.image.licenses="Apache-2.0"
LABEL org.opencontainers.image.revision=$PGIDKIT_REVISION
LABEL org.opencontainers.image.source="https://github.com/VADOSWARE/pg_idkit"
LABEL org.opencontainers.image.title="Postgres + pg_idkit"
LABEL org.opencontainers.image.url="https://github.com/VADOSWARE/pg_idkit"
LABEL org.opencontainers.image.vendor="VADOSWARE"
LABEL org.opencontainers.image.version=v${PGIDKIT_VERSION}

0 comments on commit 6f7b5a4

Please sign in to comment.