Skip to content

Commit 20b00f7

Browse files
authored
Fix for CI docker builds. (#235)
* Don't build plrust support in Docker images pushed in CI. Update PLRUST version. * Add comments to dockerfile * update plrustversion * Start incremental migration tests at 0.3.0 as pg_partman which is only used prior to v0.3.0 introduced a breaking change with no way to pin to earlier version * Add platforms and comments to ci build for PRs * remove verbose name
1 parent ebb45f1 commit 20b00f7

File tree

4 files changed

+19
-11
lines changed

4 files changed

+19
-11
lines changed

.github/workflows/continuous-integration.yml

+5-2
Original file line numberDiff line numberDiff line change
@@ -45,8 +45,9 @@ jobs:
4545
echo "pytag=${{ env.REGISTRY }}/stac-utils/pgstac-pyrust:$ref" >>$GITHUB_OUTPUT;
4646
echo "buildpy=$buildpg" >>$GITHUB_OUTPUT;
4747
48+
# This builds a base postgres image that has everything installed to be able to run pgstac. This image does not have pgstac itself installed.
4849
buildpg:
49-
name: Build and push base postgres
50+
name: Build and push base postgres image
5051
if: ${{ needs.changes.outputs.buildpgdocker == 'true' }}
5152
runs-on: ubuntu-latest
5253
needs: [changes]
@@ -62,8 +63,9 @@ jobs:
6263
- name: Build and Push Base Postgres
6364
uses: docker/build-push-action@v4
6465
with:
66+
platforms: linux/amd64,linux/arm64
6567
context: .
66-
target: pgstacbase-plrust
68+
target: pgstacbase
6769
file: docker/pgstac/Dockerfile
6870
tags: ${{ needs.changes.outputs.pgdocker }}
6971
push: true
@@ -87,6 +89,7 @@ jobs:
8789
- name: Build and Push Base pyrust
8890
uses: docker/build-push-action@v4
8991
with:
92+
platforms: linux/amd64,linux/arm64
9093
context: .
9194
target: pyrustbase
9295
file: docker/pypgstac/Dockerfile

.github/workflows/release.yml

+6-5
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ jobs:
2121
repo_token: "${{ secrets.GITHUB_TOKEN }}"
2222
prerelease: false
2323

24-
24+
# This builds a base postgres image that has everything installed to be able to run pgstac.
2525
buildpg:
26-
name: Build and push base postgres
26+
name: Build and push base postgres image
2727
runs-on: ubuntu-latest
2828
steps:
2929
- uses: actions/checkout@v3
@@ -46,16 +46,17 @@ jobs:
4646
with:
4747
platforms: linux/amd64,linux/arm64
4848
context: .
49-
target: pgstacbase-plrust
49+
target: pgstacbase
5050
file: docker/pgstac/Dockerfile
5151
tags: ${{ steps.meta.outputs.tags }}
5252
labels: ${{ steps.meta.outputs.labels }}
5353
push: true
5454
cache-from: type=gha
5555
cache-to: type=gha, mode=max
5656

57+
# This builds a postgres image that already has pgstac installed to the tagged version
5758
buildpgstac:
58-
name: Build and push base postgres
59+
name: Build and push base postgres with pgstac installed
5960
runs-on: ubuntu-latest
6061
steps:
6162
- uses: actions/checkout@v3
@@ -78,7 +79,7 @@ jobs:
7879
with:
7980
platforms: linux/amd64,linux/arm64
8081
context: .
81-
target: pgstac-plrust
82+
target: pgstac
8283
file: docker/pgstac/Dockerfile
8384
tags: ${{ steps.meta.outputs.tags }}
8485
labels: ${{ steps.meta.outputs.labels }}

docker/pgstac/Dockerfile

+6-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
ARG PG_MAJOR=15
22
ARG POSTGIS_MAJOR=3
33

4+
# Base postgres image that pgstac can be installed onto
45
FROM postgres:${PG_MAJOR}-bullseye as pgstacbase
56
ARG POSTGIS_MAJOR
67
RUN \
@@ -17,9 +18,10 @@ RUN \
1718
&& rm -rf /var/lib/apt/lists/*
1819
COPY docker/pgstac/dbinit/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh
1920

21+
# Base postgres image with plrust installed that can be used for future development using plrust
2022
FROM pgstacbase as pgstacbase-plrust
21-
ENV PLRUSTVERSION=1.2.3
22-
ENV RUSTVERSION=1.70.0
23+
ENV PLRUSTVERSION=1.2.7
24+
ENV RUSTVERSION=1.72.0
2325
ENV PLRUSTDOWNLOADURL=https://github.com/tcdi/plrust/releases/download/
2426
ENV PLRUSTFILE=plrust-trusted-${PLRUSTVERSION}_${RUSTVERSION}-debian-pg${PG_MAJOR}-amd64.deb
2527
ENV PLRUSTURL=${PLRUSTDOWNLOADURL}v${PLRUSTVERSION}/${PLRUSTFILE}
@@ -60,11 +62,13 @@ COPY docker/pgstac/dbinit/pgstac-rust.sh 991_plrust.sh
6062
USER root
6163
RUN apt-get install -y /${PLRUSTFILE}
6264

65+
# The pgstacbase image with latest version of pgstac installed
6366
FROM pgstacbase as pgstac
6467
WORKDIR /docker-entrypoint-initdb.d
6568
COPY docker/pgstac/dbinit/pgstac.sh 990_pgstac.sh
6669
COPY src/pgstac/pgstac.sql 999_pgstac.sql
6770

71+
# The pgstacbase-plrust image with the latest version of pgstac installed
6872
FROM pgstacbase-plrust as pgstac-plrust
6973
WORKDIR /docker-entrypoint-initdb.d
7074
COPY docker/pgstac/dbinit/pgstac.sh 990_pgstac.sh

docker/pypgstac/bin/test

+2-2
Original file line numberDiff line numberDiff line change
@@ -151,14 +151,14 @@ ALTER DATABASE pgstac_test_migration SET search_path to pgstac, public;
151151
ALTER DATABASE pgstac_test_migration SET client_min_messages to $CLIENTMESSAGES;
152152
EOSQL
153153
export PGDATABASE=pgstac_test_migration
154-
echo "Migrating from version 0.1.9"
154+
echo "Migrating from version 0.3.0"
155155
cd $SRCDIR/pypgstac
156156
python -m venv venv
157157
source venv/bin/activate
158158
pip install --cache /tmp/.pipcache --upgrade pip
159159
pip install --cache /tmp/.pipcache -e .[dev,test,psycopg]
160160

161-
pypgstac migrate --toversion 0.1.9
161+
pypgstac migrate --toversion 0.3.0
162162
pypgstac --version
163163

164164
pypgstac migrate

0 commit comments

Comments
 (0)