Skip to content

Commit

Permalink
update sddi-base to ckan 2.10.1
Browse files Browse the repository at this point in the history
  • Loading branch information
Martin Bayr committed Nov 30, 2023
1 parent 0034b05 commit abb752b
Show file tree
Hide file tree
Showing 2 changed files with 123 additions and 24 deletions.
81 changes: 81 additions & 0 deletions .github/workflows/edge-sddi-base.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
name: Build/push edge image

on:
push:
branches: [sddi-urban]
paths:
- sddi-base/**

env:
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}

jobs:
build-and-push-images:
runs-on: ubuntu-latest
strategy:
matrix:
context: ['sddi-base']
fail-fast: true
max-parallel: 1
permissions:
contents: read
packages: write

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Log in to the Github Container Registry
uses: docker/login-action@v2
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract metadata (tags, labels) for docker image
id: meta
uses: docker/metadata-action@v4
with:
images: |
${{ env.REGISTRY }}/it-at-m/ckan-${{ matrix.context }}
tags: |
type=edge,branch=sddi-urban
labels: |
maintainer=it@m, Landeshauptstadt Muenchen (LHM)
org.opencontainers.image.vendor=it@m, Landeshauptstadt Muenchen (LHM)
org.opencontainers.image.title=ckan-sddi-docker
- name: Build and publish ${{ env.REGISTRY }}/it-at-m/ckan-${{ matrix.context }}
uses: docker/build-push-action@v4
with:
context: ${{ matrix.context }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build-args: |
BASEIMAGE_VERSION=edge
- name: Extract metadata (tags, labels) for debug docker image
id: meta-debug
uses: docker/metadata-action@v4
with:
images: |
${{ env.REGISTRY }}/it-at-m/ckan-${{ matrix.context }}
tags: |
type=edge,branch=sddi-urban,suffix=-debug
labels: |
maintainer=it@m, Landeshauptstadt Muenchen (LHM)
org.opencontainers.image.vendor=it@m, Landeshauptstadt Muenchen (LHM)
org.opencontainers.image.title=ckan-sddi-docker
- name: Build and publish ${{ env.REGISTRY }}/it-at-m/ckan-${{ matrix.context }}
uses: docker/build-push-action@v4
with:
context: ${{ matrix.context }}
file: ${{ matrix.context }}/Dockerfile.debug
push: true
tags: ${{ steps.meta-debug.outputs.tags }}
labels: ${{ steps.meta-debug.outputs.labels }}
build-args: |
BASEIMAGE_VERSION=edge
66 changes: 42 additions & 24 deletions sddi-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
###############################################################################
# Build stage
###############################################################################
ARG CKAN_VERSION_BUILD_STAGE=2.9.9-dev
ARG CKAN_VERSION_BUILD_SPATIAL=2.9.9-focal
ARG CKAN_VERSION_RUNTIME_STAGE=2.9.9-focal
ARG CKAN_VERSION_BUILD_STAGE=2.10.1-dev
ARG CKAN_VERSION_BUILD_SPATIAL=2.10.1-dev
ARG CKAN_VERSION_RUNTIME_STAGE=2.10.1

FROM ckan/ckan-base:${CKAN_VERSION_BUILD_STAGE} as extbuild

Expand Down Expand Up @@ -101,38 +101,48 @@ RUN set -ex && \
git+${CKANEXT_PASSWORD_POLICY_GITHUB_URL}.git@${CKANEXT_PASSWORD_POLICY_VERSION}#egg=ckanext-password-policy

# ckanext-spatial #############################################################
FROM ghcr.io/keitaroinc/ckan:${CKAN_VERSION_BUILD_SPATIAL} as extbuild-spatial
FROM ckan/ckan-base:${CKAN_VERSION_BUILD_SPATIAL} as extbuild-spatial

ARG CKANEXT_SPATIAL_VERSION="c2118b9"
ARG CKANEXT_SPATIAL_VERSION="master"
ENV CKANEXT_SPATIAL_VERSION=${CKANEXT_SPATIAL_VERSION}

USER root

# Install any system packages necessary to build extensions
# Install any system packages necessary to build extensions
RUN set -ex && \
apt-get update && \
apt-get install -y --no-install-recommends \
python3-dev python3-pip libxml2-dev libxslt1-dev libgeos-c1v5 python-is-python3 && \
mkdir -p /wheels && \
pip install -U pip
apk update && \
apk add --no-cache \
geos \
geos-dev \
proj-util \
proj-dev \
libxml2 \
libxslt \
gcc \
libxml2-dev \
libxslt-dev

RUN set -ex && \
pip install -r https://raw.githubusercontent.com/MarijaKnezevic/ckanext-spatial/${CKANEXT_SPATIAL_VERSION}/requirements.txt && \
mkdir -p /wheels && \
pip install --upgrade pip && \
pip install -r https://raw.githubusercontent.com/ckan/ckanext-spatial/${CKANEXT_SPATIAL_VERSION}/requirements.txt && \
curl -o /wheels/ckanext-spatial.txt \
https://raw.githubusercontent.com/MarijaKnezevic/ckanext-spatial/${CKANEXT_SPATIAL_VERSION}/requirements.txt && \
pip install -r https://raw.githubusercontent.com/MarijaKnezevic/ckanext-spatial/${CKANEXT_SPATIAL_VERSION}/requirements-postgis.txt && \
curl -o /wheels/ckanext-spatial-postgis.txt \
https://raw.githubusercontent.com/MarijaKnezevic/ckanext-spatial/${CKANEXT_SPATIAL_VERSION}/requirements-postgis.txt && \
ls -lah /wheels
https://raw.githubusercontent.com/ckan/ckanext-spatial/${CKANEXT_SPATIAL_VERSION}/requirements.txt

# pip install -r https://raw.githubusercontent.com/ckan/ckanext-spatial/${CKANEXT_SPATIAL_VERSION}/requirements-postgis.txt && \
# curl -o /wheels/ckanext-spatial-postgis.txt \
# https://raw.githubusercontent.com/ckan/ckanext-spatial/${CKANEXT_SPATIAL_VERSION}/requirements-postgis.txt && \
# ls -lah /wheels

RUN set -ex && \
pip wheel --wheel-dir=/wheels \
git+https://github.com/MarijaKnezevic/ckanext-spatial.git@${CKANEXT_SPATIAL_VERSION}#egg=ckanext-spatial
git+https://github.com/ckan/ckanext-spatial.git@${CKANEXT_SPATIAL_VERSION}#egg=ckanext-spatial

###############################################################################
# Runtime stage
###############################################################################
FROM ghcr.io/keitaroinc/ckan:${CKAN_VERSION_RUNTIME_STAGE} as runtime
FROM ckan/ckan-base:${CKAN_VERSION_RUNTIME_STAGE} as runtime

ENV CKAN__PLUGINS "image_view text_view recline_view webpage_view datastore datapusher \
hierarchy_display hierarchy_form display_group relation \
Expand All @@ -149,11 +159,17 @@ USER root

# Install any system packages necessary to build extensions
RUN set -ex && \
apt-get update && \
apt-get install -y --no-install-recommends \
libxml2-dev libxslt1-dev libgeos-c1v5 && \
pip install --no-cache-dir -U pip && \
rm -rf /var/lib/apt/lists/*
apk update && \
apk add --no-cache \
geos \
geos-dev \
proj-util \
proj-dev \
libxml2 \
libxslt \
gcc \
libxml2-dev \
libxslt-dev

# Copy python wheels from build stage
COPY --from=extbuild /wheels ${APP_DIR}/ext_wheels
Expand All @@ -177,7 +193,7 @@ RUN set -ex && \
# ckanext-spatial #############################################################
RUN set -ex && \
pip install -r ${APP_DIR}/ext_wheels/ckanext-spatial.txt && \
pip install -r ${APP_DIR}/ext_wheels/ckanext-spatial-postgis.txt && \
#pip install -r ${APP_DIR}/ext_wheels/ckanext-spatial-postgis.txt && \
pip install --no-index --find-links=${APP_DIR}/ext_wheels ckanext-spatial

# ckanext-scheming ############################################################
Expand Down Expand Up @@ -206,6 +222,8 @@ COPY --chown=ckan:ckan initScripts/ ${APP_DIR}/docker-afterinit.d
COPY --chown=ckan:ckan who.ini ${APP_DIR}/who.ini

RUN set -ex && \
pip install -U pip && \
pip install --upgrade Jinja2 && \
ckan config-tool "${CKAN_INI}" "ckan.plugins = ${CKAN__PLUGINS}" && \
ckan config-tool "${CKAN_INI}" "ckan.spatial.srid = 4326" && \
ckan config-tool "${CKAN_INI}" "ckanext.spatial.search_backend = solr-bbox" && \
Expand Down

0 comments on commit abb752b

Please sign in to comment.