From cc8080faad19ae2904ce00c48c58fda864c4be4f Mon Sep 17 00:00:00 2001 From: David Bitner Date: Wed, 24 Jan 2024 10:38:03 -0600 Subject: [PATCH 1/6] Don't build plrust support in Docker images pushed in CI. Update PLRUST version. --- .github/workflows/release.yml | 11 ++++++----- docker/pgstac/Dockerfile | 2 +- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index cfcd0b3c..748954cc 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,9 +21,9 @@ jobs: repo_token: "${{ secrets.GITHUB_TOKEN }}" prerelease: false - + # This builds a base postgres image that has everything installed to be able to run pgstac. buildpg: - name: Build and push base postgres + name: Build and push base postgres image (you will need to run pypgstac migrate to install pgstac) runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -46,7 +46,7 @@ jobs: with: platforms: linux/amd64,linux/arm64 context: . - target: pgstacbase-plrust + target: pgstacbase file: docker/pgstac/Dockerfile tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} @@ -54,8 +54,9 @@ jobs: cache-from: type=gha cache-to: type=gha, mode=max + # This builds a postgres image that already has pgstac installed to the tagged version buildpgstac: - name: Build and push base postgres + name: Build and push base postgres with pgstac installed runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 @@ -78,7 +79,7 @@ jobs: with: platforms: linux/amd64,linux/arm64 context: . - target: pgstac-plrust + target: pgstac file: docker/pgstac/Dockerfile tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} diff --git a/docker/pgstac/Dockerfile b/docker/pgstac/Dockerfile index 6199563a..f6a5818d 100644 --- a/docker/pgstac/Dockerfile +++ b/docker/pgstac/Dockerfile @@ -19,7 +19,7 @@ COPY docker/pgstac/dbinit/docker-entrypoint.sh /usr/local/bin/docker-entrypoint. FROM pgstacbase as pgstacbase-plrust ENV PLRUSTVERSION=1.2.3 -ENV RUSTVERSION=1.70.0 +ENV RUSTVERSION=1.72.0 ENV PLRUSTDOWNLOADURL=https://github.com/tcdi/plrust/releases/download/ ENV PLRUSTFILE=plrust-trusted-${PLRUSTVERSION}_${RUSTVERSION}-debian-pg${PG_MAJOR}-amd64.deb ENV PLRUSTURL=${PLRUSTDOWNLOADURL}v${PLRUSTVERSION}/${PLRUSTFILE} From 02199218770349ffb081ccbe823a9c9828b03156 Mon Sep 17 00:00:00 2001 From: David Bitner Date: Wed, 24 Jan 2024 10:54:33 -0600 Subject: [PATCH 2/6] Add comments to dockerfile --- docker/pgstac/Dockerfile | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/docker/pgstac/Dockerfile b/docker/pgstac/Dockerfile index f6a5818d..0f0108be 100644 --- a/docker/pgstac/Dockerfile +++ b/docker/pgstac/Dockerfile @@ -1,6 +1,7 @@ ARG PG_MAJOR=15 ARG POSTGIS_MAJOR=3 +# Base postgres image that pgstac can be installed onto FROM postgres:${PG_MAJOR}-bullseye as pgstacbase ARG POSTGIS_MAJOR RUN \ @@ -17,6 +18,7 @@ RUN \ && rm -rf /var/lib/apt/lists/* COPY docker/pgstac/dbinit/docker-entrypoint.sh /usr/local/bin/docker-entrypoint.sh +# Base postgres image with plrust installed that can be used for future development using plrust FROM pgstacbase as pgstacbase-plrust ENV PLRUSTVERSION=1.2.3 ENV RUSTVERSION=1.72.0 @@ -60,11 +62,13 @@ COPY docker/pgstac/dbinit/pgstac-rust.sh 991_plrust.sh USER root RUN apt-get install -y /${PLRUSTFILE} +# The pgstacbase image with latest version of pgstac installed FROM pgstacbase as pgstac WORKDIR /docker-entrypoint-initdb.d COPY docker/pgstac/dbinit/pgstac.sh 990_pgstac.sh COPY src/pgstac/pgstac.sql 999_pgstac.sql +# The pgstacbase-plrust image with the latest version of pgstac installed FROM pgstacbase-plrust as pgstac-plrust WORKDIR /docker-entrypoint-initdb.d COPY docker/pgstac/dbinit/pgstac.sh 990_pgstac.sh From a582d4b911b8e2674ff86dbc3a7da98ac784a2ea Mon Sep 17 00:00:00 2001 From: David Bitner Date: Wed, 24 Jan 2024 10:55:33 -0600 Subject: [PATCH 3/6] update plrustversion --- docker/pgstac/Dockerfile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docker/pgstac/Dockerfile b/docker/pgstac/Dockerfile index 0f0108be..ce032b84 100644 --- a/docker/pgstac/Dockerfile +++ b/docker/pgstac/Dockerfile @@ -20,7 +20,7 @@ COPY docker/pgstac/dbinit/docker-entrypoint.sh /usr/local/bin/docker-entrypoint. # Base postgres image with plrust installed that can be used for future development using plrust FROM pgstacbase as pgstacbase-plrust -ENV PLRUSTVERSION=1.2.3 +ENV PLRUSTVERSION=1.2.7 ENV RUSTVERSION=1.72.0 ENV PLRUSTDOWNLOADURL=https://github.com/tcdi/plrust/releases/download/ ENV PLRUSTFILE=plrust-trusted-${PLRUSTVERSION}_${RUSTVERSION}-debian-pg${PG_MAJOR}-amd64.deb From ca082e4c22ba6fdcc2d2a4c46afd394a62d164da Mon Sep 17 00:00:00 2001 From: David Bitner Date: Wed, 24 Jan 2024 11:49:08 -0600 Subject: [PATCH 4/6] 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 --- docker/pypgstac/bin/test | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docker/pypgstac/bin/test b/docker/pypgstac/bin/test index 8b1c8628..4655510a 100755 --- a/docker/pypgstac/bin/test +++ b/docker/pypgstac/bin/test @@ -151,14 +151,14 @@ ALTER DATABASE pgstac_test_migration SET search_path to pgstac, public; ALTER DATABASE pgstac_test_migration SET client_min_messages to $CLIENTMESSAGES; EOSQL export PGDATABASE=pgstac_test_migration - echo "Migrating from version 0.1.9" + echo "Migrating from version 0.3.0" cd $SRCDIR/pypgstac python -m venv venv source venv/bin/activate pip install --cache /tmp/.pipcache --upgrade pip pip install --cache /tmp/.pipcache -e .[dev,test,psycopg] - pypgstac migrate --toversion 0.1.9 + pypgstac migrate --toversion 0.3.0 pypgstac --version pypgstac migrate From 0fa5a6e9d02843fb3f1fd085fec21494276af49c Mon Sep 17 00:00:00 2001 From: David Bitner Date: Wed, 24 Jan 2024 11:57:40 -0600 Subject: [PATCH 5/6] Add platforms and comments to ci build for PRs --- .github/workflows/continuous-integration.yml | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index feee63fd..bd8b9309 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -45,8 +45,9 @@ jobs: echo "pytag=${{ env.REGISTRY }}/stac-utils/pgstac-pyrust:$ref" >>$GITHUB_OUTPUT; echo "buildpy=$buildpg" >>$GITHUB_OUTPUT; + # This builds a base postgres image that has everything installed to be able to run pgstac. This image does not have pgstac itself installed. buildpg: - name: Build and push base postgres + name: Build and push base postgres image (you will need to run pypgstac migrate to install pgstac) if: ${{ needs.changes.outputs.buildpgdocker == 'true' }} runs-on: ubuntu-latest needs: [changes] @@ -62,8 +63,9 @@ jobs: - name: Build and Push Base Postgres uses: docker/build-push-action@v4 with: + platforms: linux/amd64,linux/arm64 context: . - target: pgstacbase-plrust + target: pgstacbase file: docker/pgstac/Dockerfile tags: ${{ needs.changes.outputs.pgdocker }} push: true @@ -87,6 +89,7 @@ jobs: - name: Build and Push Base pyrust uses: docker/build-push-action@v4 with: + platforms: linux/amd64,linux/arm64 context: . target: pyrustbase file: docker/pypgstac/Dockerfile From 77acd4101b017bc66fd225ddde31f93dada3c74c Mon Sep 17 00:00:00 2001 From: David Bitner Date: Wed, 24 Jan 2024 12:20:44 -0600 Subject: [PATCH 6/6] remove verbose name --- .github/workflows/continuous-integration.yml | 2 +- .github/workflows/release.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/continuous-integration.yml b/.github/workflows/continuous-integration.yml index bd8b9309..ddb9e284 100644 --- a/.github/workflows/continuous-integration.yml +++ b/.github/workflows/continuous-integration.yml @@ -47,7 +47,7 @@ jobs: # This builds a base postgres image that has everything installed to be able to run pgstac. This image does not have pgstac itself installed. buildpg: - name: Build and push base postgres image (you will need to run pypgstac migrate to install pgstac) + name: Build and push base postgres image if: ${{ needs.changes.outputs.buildpgdocker == 'true' }} runs-on: ubuntu-latest needs: [changes] diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 748954cc..535dcc3e 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -23,7 +23,7 @@ jobs: # This builds a base postgres image that has everything installed to be able to run pgstac. buildpg: - name: Build and push base postgres image (you will need to run pypgstac migrate to install pgstac) + name: Build and push base postgres image runs-on: ubuntu-latest steps: - uses: actions/checkout@v3