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

experimental buildx.yml #312

Open
wants to merge 12 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
154 changes: 154 additions & 0 deletions .github/workflows/buildx.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
name: buildx-experimental

# This workflow is QEMU/BUILDX based!
# - Not for the platform='linux/amd64' see --> `main.yml' !
# - Not for the `*-master``building. Emulation takes a lot of times!
#
# Expecting: upstream "postgres" docker images for OS/ARCH=platforms
# [ check https://hub.docker.com/_/postgres/tags ]
#
# Comments: ( with QEMU 7.0 / 2022-october )
# 'linux/arm64' Postgres JIT is not working; ( SET JIT=OFF under the alpine test ; see alpine template )
# 'linux/ppc64le' Postgres JIT is not working; ( SET JIT=OFF under the alpine test ; see alpine template )
# 'linux/arm/v7' - debian: Unable to locate package postgresql-??-postgis-3;
# 'linux/arm/v6' - debian: Unable to locate package postgresql-??-postgis-3;
# 'linux/s390x' [alpine|debian] failed test.
# 'linux/mips64le' [alpine|debian] failed test.
#

on:
push:
pull_request:
schedule:
- cron: '15 6 * * 1'

defaults:
run:
shell: bash

jobs:

make-docker-images:
strategy:
# allowing fails ..
fail-fast: false
matrix:
# -3.3 debian for linux/arm64
postgres: [11, 12, 13, 14, 15]
postgis: ['3.3']
variant: [default]
platforms: ['linux/arm64']
include:
- postgres: 10
postgis: '3.2'
variant: default
platforms: 'linux/arm64'

# 15-3.3-alpine for every platforms
- postgres: 15
postgis: '3.3'
variant: 'alpine'
platforms: 'linux/arm64'
- postgres: 15
postgis: '3.3'
variant: 'alpine'
platforms: 'linux/arm/v7'
- postgres: 15
postgis: '3.3'
variant: 'alpine'
platforms: 'linux/arm/v6'
- postgres: 15
postgis: '3.3'
variant: 'alpine'
platforms: 'linux/386'
- postgres: 15
postgis: '3.3'
variant: 'alpine'
platforms: 'linux/ppc64le'

# 15-3.3 debian for linux/ppc64le
- postgres: 15
postgis: '3.3'
variant: 'default'
platforms: 'linux/ppc64le'

name: ${{ matrix.platforms }} ${{ matrix.postgres }}-${{ matrix.postgis }} ${{ matrix.variant }}
runs-on: ubuntu-latest

env:
# Alpine image version
ALPINE_VERSION: '3.16'
# Workflow name for internal logic;
# We are NOT the default ('main') workflow!
WORKFLOW: buildx
# Docker image Repo and Image name
REPO_NAME: postgis
IMAGE_NAME: postgis
# Docker image version and variant
VERSION: ${{ matrix.postgres }}-${{ matrix.postgis }}
VARIANT: ${{ matrix.variant }}
# Docker image tag postfix
TAG_POSTFIX: '-experimental'

steps:

- name: Checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: "debug: docker buildx inspect --bootstrap"
run: docker buildx inspect --bootstrap

- name: "debug: docker buildx ls"
run: docker buildx ls

- name: "debug: Inspect the base alpine image postgres:${{ matrix.postgres }}-alpine${{ env.ALPINE_VERSION }} "
if: ${{ env.VARIANT == 'alpine' }}
run: docker pull postgres:${{ matrix.postgres }}-alpine${{ env.ALPINE_VERSION }} && docker inspect postgres:${{ matrix.postgres }}-alpine${{ env.ALPINE_VERSION }}
env:
DOCKER_DEFAULT_PLATFORM: ${{ matrix.platforms }}
PLATFORM: ${{ matrix.platforms }}

- name: "Build/Test: ${{ env.VERSION }} ${{ env.VARIANT }}${{env.TAG_POSTFIX}} ${{ env.DOCKER_DEFAULT_PLATFORM }}"
run: make test
env:
DOCKER_DEFAULT_PLATFORM: ${{ matrix.platforms }}
PLATFORM: ${{ matrix.platforms }}
# Buildx/qemu test need more time
POSTGRES_TEST_TRIES: 42
POSTGRES_TEST_SLEEP: 2

- name: "debug: docker images"
run: docker images

- name: "debug: docker inspect ${{ env.REPO_NAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}${{ env.TAG_POSTFIX }}"
if: ${{ env.VARIANT == 'default' }}
run: docker inspect ${{ env.REPO_NAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}${{ env.TAG_POSTFIX }}

- name: "debug: docker inspect ${{ env.REPO_NAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}-${{ env.VARIANT }}${{ env.TAG_POSTFIX }}"
if: ${{ env.VARIANT == 'alpine' }}
run: docker inspect ${{ env.REPO_NAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}-${{ env.VARIANT }}${{ env.TAG_POSTFIX }}

- name: Login to dockerhub
uses: docker/login-action@v1
if: ${{ (github.ref == 'refs/heads/master') && (github.event_name != 'pull_request') }}
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}

- name: Push docker image to dockerhub - ${{ matrix.platforms }}
if: ${{ (github.ref == 'refs/heads/master') && (github.event_name != 'pull_request') }}
env:
# platform is important!
DOCKER_DEFAULT_PLATFORM: ${{ matrix.platforms }}
PLATFORM: ${{ matrix.platforms }}
#
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_PASSWORD: ${{ secrets.DOCKERHUB_PASSWORD }}
DOCKERHUB_ACCESS_TOKEN: ${{ secrets.DOCKERHUB_ACCESS_TOKEN }}
run: make push
31 changes: 29 additions & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
name: Docker PostGIS CI

# for building linux/amd64 ( x86-64 ) images !

on:
push:
pull_request:
Expand Down Expand Up @@ -37,16 +39,41 @@ jobs:
runs-on: ubuntu-20.04
continue-on-error: ${{ matrix.postgis == 'master' }}
env:
# Alpine image version
ALPINE_VERSION: '3.16'
# Workflow name for internal logic
WORKFLOW: main
# Docker image Repo and Image name
REPO_NAME: postgis
IMAGE_NAME: postgis
# Docker image version and variant
VERSION: ${{ matrix.postgres }}-${{ matrix.postgis }}
VARIANT: ${{ matrix.variant }}
# Docker image tag postfix! in this case, no postfix!
TAG_POSTFIX: ''

steps:
- name: Checkout source
uses: actions/checkout@v2
uses: actions/checkout@v3

- name: "debug: Inspect the base alpine image postgres:${{ matrix.postgres }}-alpine${{ env.ALPINE_VERSION }} "
if: ${{ env.VARIANT == 'alpine' }}
run: docker pull postgres:${{ matrix.postgres }}-alpine${{ env.ALPINE_VERSION }} && docker inspect postgres:${{ matrix.postgres }}-alpine${{ env.ALPINE_VERSION }}

- name: Build docker image for ${{ env.VERSION }} ${{ env.VARIANT }}
- name: Build docker image for ${{ env.VERSION }} ${{ env.VARIANT }}${{ env.TAG_POSTFIX }}
run: make test

- name: "debug: docker images"
run: docker images

- name: "debug: docker inspect ${{ env.REPO_NAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}${{ env.TAG_POSTFIX }}"
if: ${{ env.VARIANT == 'default' }}
run: docker inspect ${{ env.REPO_NAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}${{ env.TAG_POSTFIX }}

- name: "debug: docker inspect ${{ env.REPO_NAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}-${{ env.VARIANT }}${{ env.TAG_POSTFIX }}"
if: ${{ env.VARIANT == 'alpine' }}
run: docker inspect ${{ env.REPO_NAME }}/${{ env.IMAGE_NAME }}:${{ env.VERSION }}-${{ env.VARIANT }}${{ env.TAG_POSTFIX }}

- name: Login to dockerhub
uses: docker/login-action@v1
if: ${{ (github.ref == 'refs/heads/master') && (github.event_name != 'pull_request') }}
Expand Down
3 changes: 3 additions & 0 deletions 10-3.2/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ ENV POSTGIS_MAJOR 3
ENV POSTGIS_VERSION 3.2.3+dfsg-1.pgdg110+1

RUN apt-get update \
# buildx debug info
&& uname -a && uname -m && lscpu \
\
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
&& apt-get install -y --no-install-recommends \
# ca-certificates: for accessing remote raster files;
Expand Down
23 changes: 22 additions & 1 deletion 10-3.2/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,32 @@ RUN set -eux \
&& make -j$(nproc) \
&& make install \
\
# buildx platform check for debug.
&& uname -a && uname -m && cat /proc/cpuinfo \
\
# regress check
&& mkdir /tempdb \
&& chown -R postgres:postgres /tempdb \
&& su postgres -c 'pg_ctl -D /tempdb init' \
&& su postgres -c 'pg_ctl -D /tempdb start' \
\
# QEMU7.0/BUILDX - JIT workaround
&& if [[ "$(uname -m)" == "aarch64" && "10" != "10" ]] || \
[[ "$(uname -m)" == "ppc64le" && "10" != "10" ]]; then \
set -eux \
# for the buildx/qemu workflow
# with (aarch64 ppc64le) and PG>10 .. we are testing with JIT=OFF to avoid QEMU7.0/BUILDX error
&& echo "WARNING: JIT=OFF testing (aarch64 ppc64le)!" \
&& echo "## WARNING: tested with JIT=OFF (aarch64 ppc64le)!" >> /_pgis_full_version.txt \
&& su postgres -c 'pg_ctl -o "--jit=off" -D /tempdb start' \
&& su postgres -c 'psql -c "SHOW JIT;"' \
; \
else \
set -eux \
# default test .. no problem expected.
&& su postgres -c 'pg_ctl -D /tempdb start' \
; \
fi \
\
&& cd regress \
&& make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \
#&& make -j$(nproc) check RUNTESTFLAGS=--dumprestore PGUSER=postgres \
Expand Down
3 changes: 3 additions & 0 deletions 11-3.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ ENV POSTGIS_MAJOR 3
ENV POSTGIS_VERSION 3.3.1+dfsg-2.pgdg110+1

RUN apt-get update \
# buildx debug info
&& uname -a && uname -m && lscpu \
\
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
&& apt-get install -y --no-install-recommends \
# ca-certificates: for accessing remote raster files;
Expand Down
23 changes: 22 additions & 1 deletion 11-3.3/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,32 @@ RUN set -eux \
&& make -j$(nproc) \
&& make install \
\
# buildx platform check for debug.
&& uname -a && uname -m && cat /proc/cpuinfo \
\
# regress check
&& mkdir /tempdb \
&& chown -R postgres:postgres /tempdb \
&& su postgres -c 'pg_ctl -D /tempdb init' \
&& su postgres -c 'pg_ctl -D /tempdb start' \
\
# QEMU7.0/BUILDX - JIT workaround
&& if [[ "$(uname -m)" == "aarch64" && "11" != "10" ]] || \
[[ "$(uname -m)" == "ppc64le" && "11" != "10" ]]; then \
set -eux \
# for the buildx/qemu workflow
# with (aarch64 ppc64le) and PG>10 .. we are testing with JIT=OFF to avoid QEMU7.0/BUILDX error
&& echo "WARNING: JIT=OFF testing (aarch64 ppc64le)!" \
&& echo "## WARNING: tested with JIT=OFF (aarch64 ppc64le)!" >> /_pgis_full_version.txt \
&& su postgres -c 'pg_ctl -o "--jit=off" -D /tempdb start' \
&& su postgres -c 'psql -c "SHOW JIT;"' \
; \
else \
set -eux \
# default test .. no problem expected.
&& su postgres -c 'pg_ctl -D /tempdb start' \
; \
fi \
\
&& cd regress \
&& make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \
#&& make -j$(nproc) check RUNTESTFLAGS=--dumprestore PGUSER=postgres \
Expand Down
3 changes: 3 additions & 0 deletions 12-3.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ ENV POSTGIS_MAJOR 3
ENV POSTGIS_VERSION 3.3.1+dfsg-2.pgdg110+1

RUN apt-get update \
# buildx debug info
&& uname -a && uname -m && lscpu \
\
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
&& apt-get install -y --no-install-recommends \
# ca-certificates: for accessing remote raster files;
Expand Down
23 changes: 22 additions & 1 deletion 12-3.3/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,32 @@ RUN set -eux \
&& make -j$(nproc) \
&& make install \
\
# buildx platform check for debug.
&& uname -a && uname -m && cat /proc/cpuinfo \
\
# regress check
&& mkdir /tempdb \
&& chown -R postgres:postgres /tempdb \
&& su postgres -c 'pg_ctl -D /tempdb init' \
&& su postgres -c 'pg_ctl -D /tempdb start' \
\
# QEMU7.0/BUILDX - JIT workaround
&& if [[ "$(uname -m)" == "aarch64" && "12" != "10" ]] || \
[[ "$(uname -m)" == "ppc64le" && "12" != "10" ]]; then \
set -eux \
# for the buildx/qemu workflow
# with (aarch64 ppc64le) and PG>10 .. we are testing with JIT=OFF to avoid QEMU7.0/BUILDX error
&& echo "WARNING: JIT=OFF testing (aarch64 ppc64le)!" \
&& echo "## WARNING: tested with JIT=OFF (aarch64 ppc64le)!" >> /_pgis_full_version.txt \
&& su postgres -c 'pg_ctl -o "--jit=off" -D /tempdb start' \
&& su postgres -c 'psql -c "SHOW JIT;"' \
; \
else \
set -eux \
# default test .. no problem expected.
&& su postgres -c 'pg_ctl -D /tempdb start' \
; \
fi \
\
&& cd regress \
&& make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \
#&& make -j$(nproc) check RUNTESTFLAGS=--dumprestore PGUSER=postgres \
Expand Down
3 changes: 3 additions & 0 deletions 13-3.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ ENV POSTGIS_MAJOR 3
ENV POSTGIS_VERSION 3.3.1+dfsg-2.pgdg110+1

RUN apt-get update \
# buildx debug info
&& uname -a && uname -m && lscpu \
\
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
&& apt-get install -y --no-install-recommends \
# ca-certificates: for accessing remote raster files;
Expand Down
23 changes: 22 additions & 1 deletion 13-3.3/alpine/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,32 @@ RUN set -eux \
&& make -j$(nproc) \
&& make install \
\
# buildx platform check for debug.
&& uname -a && uname -m && cat /proc/cpuinfo \
\
# regress check
&& mkdir /tempdb \
&& chown -R postgres:postgres /tempdb \
&& su postgres -c 'pg_ctl -D /tempdb init' \
&& su postgres -c 'pg_ctl -D /tempdb start' \
\
# QEMU7.0/BUILDX - JIT workaround
&& if [[ "$(uname -m)" == "aarch64" && "13" != "10" ]] || \
[[ "$(uname -m)" == "ppc64le" && "13" != "10" ]]; then \
set -eux \
# for the buildx/qemu workflow
# with (aarch64 ppc64le) and PG>10 .. we are testing with JIT=OFF to avoid QEMU7.0/BUILDX error
&& echo "WARNING: JIT=OFF testing (aarch64 ppc64le)!" \
&& echo "## WARNING: tested with JIT=OFF (aarch64 ppc64le)!" >> /_pgis_full_version.txt \
&& su postgres -c 'pg_ctl -o "--jit=off" -D /tempdb start' \
&& su postgres -c 'psql -c "SHOW JIT;"' \
; \
else \
set -eux \
# default test .. no problem expected.
&& su postgres -c 'pg_ctl -D /tempdb start' \
; \
fi \
\
&& cd regress \
&& make -j$(nproc) check RUNTESTFLAGS=--extension PGUSER=postgres \
#&& make -j$(nproc) check RUNTESTFLAGS=--dumprestore PGUSER=postgres \
Expand Down
3 changes: 3 additions & 0 deletions 14-3.3/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ ENV POSTGIS_MAJOR 3
ENV POSTGIS_VERSION 3.3.1+dfsg-2.pgdg110+1

RUN apt-get update \
# buildx debug info
&& uname -a && uname -m && lscpu \
\
&& apt-cache showpkg postgresql-$PG_MAJOR-postgis-$POSTGIS_MAJOR \
&& apt-get install -y --no-install-recommends \
# ca-certificates: for accessing remote raster files;
Expand Down
Loading