From 56643f4d057d216dff46b4c9cd4ac17d8504dfa0 Mon Sep 17 00:00:00 2001 From: Tenz Date: Sun, 6 Aug 2023 05:02:07 +0200 Subject: [PATCH] Feature/extension h3 (#428) * Adding h3 library installs to enable h3, h3_postgis extensions * enable h3 extensions by default if env var POSTGRES_MULTIPLE_EXTENSIONS is not set * Fix build since we migrated to new base image * do not activate h3 by default for backward compatibility * upgrade workflows to use bookworm * fix pip install --------- Co-authored-by: Martino Co-authored-by: mazano --- .github/workflows/build-latest.yaml | 6 +++--- .github/workflows/deploy-image.yaml | 4 ++-- Dockerfile | 19 ++++++++++++------- 3 files changed, 17 insertions(+), 12 deletions(-) diff --git a/.github/workflows/build-latest.yaml b/.github/workflows/build-latest.yaml index 20ac2d70..8d15d069 100644 --- a/.github/workflows/build-latest.yaml +++ b/.github/workflows/build-latest.yaml @@ -9,7 +9,7 @@ on: # imageVersion: # description: Base distro image version/release # required: true -# default: bullseye +# default: bookworm # imageVariant: # description: Base image variant # required: true @@ -41,7 +41,7 @@ jobs: - init_scripts include: - distro: debian - imageVersion: bullseye + imageVersion: bookworm imageVariant: slim steps: - uses: actions/checkout@v3 @@ -96,7 +96,7 @@ jobs: - 3 include: - distro: debian - imageVersion: bullseye + imageVersion: bookworm imageVariant: slim steps: - uses: actions/checkout@v3 diff --git a/.github/workflows/deploy-image.yaml b/.github/workflows/deploy-image.yaml index c0684269..f7849f01 100644 --- a/.github/workflows/deploy-image.yaml +++ b/.github/workflows/deploy-image.yaml @@ -9,7 +9,7 @@ on: # imageVersion: # description: Base distro image version/release # required: true -# default: bullseye +# default: bookworm # imageVariant: # description: Base image variant # required: true @@ -36,7 +36,7 @@ jobs: - 3 include: - distro: debian - imageVersion: bullseye + imageVersion: bookworm imageVariant: slim steps: - uses: actions/checkout@v3 diff --git a/Dockerfile b/Dockerfile index f8de26bc..9fbcb186 100644 --- a/Dockerfile +++ b/Dockerfile @@ -23,13 +23,13 @@ RUN set -eux \ && apt-get update \ && apt-get -y --no-install-recommends install \ locales gnupg2 wget ca-certificates rpl pwgen software-properties-common iputils-ping \ - apt-transport-https curl gettext \ - && dpkg-divert --local --rename --add /sbin/initctl - -RUN apt-get -y update; apt-get -y install build-essential autoconf libxml2-dev zlib1g-dev netcat-openbsd gdal-bin \ + apt-transport-https curl gettext pgxnclient cmake && \ + apt-get -y install build-essential autoconf libxml2-dev zlib1g-dev netcat-openbsd gdal-bin \ figlet toilet gosu; \ # verify that the binary works - gosu nobody true + gosu nobody true && \ + dpkg-divert --local --rename --add /sbin/initctl + # Generating locales takes a long time. Utilize caching by runnig it by itself # early in the build process. @@ -56,6 +56,8 @@ RUN if [ -z "${GENERATE_ALL_LOCALE}" ] || [ $GENERATE_ALL_LOCALE -eq 0 ]; \ && /usr/sbin/locale-gen RUN update-locale ${LANG} + + # Cleanup resources RUN apt-get -y --purge autoremove \ && apt-get clean \ @@ -105,7 +107,8 @@ RUN set -eux \ postgresql-${POSTGRES_MAJOR_VERSION}-postgis-${POSTGIS_MAJOR_VERSION}-scripts \ postgresql-plpython3-${POSTGRES_MAJOR_VERSION} postgresql-${POSTGRES_MAJOR_VERSION}-pgrouting \ postgresql-server-dev-${POSTGRES_MAJOR_VERSION} postgresql-${POSTGRES_MAJOR_VERSION}-cron \ - postgresql-${POSTGRES_MAJOR_VERSION}-mysql-fdw + postgresql-${POSTGRES_MAJOR_VERSION}-mysql-fdw && \ + pgxn install h3 # TODO a case insensitive match would be more robust RUN if [ "${BUILD_TIMESCALE}" = "true" ]; then \ @@ -128,6 +131,8 @@ cd pointcloud-master && \ ./autogen.sh && ./configure && make -j 4 && make install && \ cd .. && rm -Rf pointcloud-master + + # Cleanup resources RUN apt-get -y --purge autoremove \ && apt-get clean \ @@ -166,4 +171,4 @@ RUN set -eux \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -RUN pip3 install -r /lib/utils/requirements.txt +RUN pip3 install -r /lib/utils/requirements.txt --break-system-packages