Skip to content

Commit

Permalink
Merge pull request #10181 from camptocamp/new-qgis
Browse files Browse the repository at this point in the history
Updates for QGIS
  • Loading branch information
sbrunner authored Nov 18, 2022
2 parents acf0694 + 54b8449 commit aabe2b0
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 22 deletions.
9 changes: 3 additions & 6 deletions .github/workflows/main.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ jobs:
- run: make build-config

# Build and lint QGIS images
- run: QGIS_VERSION=3.22 make build-qgisserver
- run: QGIS_VERSION=3.22 make prospector-qgisserver
- run: QGIS_VERSION=3.28 make build-qgisserver
- run: QGIS_VERSION=3.28 make prospector-qgisserver

# Tests
- run: make preparetest
Expand Down Expand Up @@ -102,10 +102,7 @@ jobs:
- run: c2cciutils-docker-logs
# Similar to: make tests-qgisserver
- run: >
docker-compose exec -T qgisserver-tests coverage run
--source=/var/www/plugins/geomapfish_qgisserver
--module pytest --verbose --color=yes --junitxml=/tmp/qgis.xml
/src/tests/functional
docker-compose exec -T qgisserver-tests pytest --verbose --color=yes /src/tests/functional
- run: c2cciutils-docker-logs
- name: Extract tests artifacts
run: |
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/qgis.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,8 @@ jobs:
matrix:
version:
# Last LTR
- '3.22'
- '3.28'
- latest
- master

env:
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ LABEL maintainer Camptocamp "[email protected]"
# Print commands and their arguments as they are executed.
SHELL ["/bin/bash", "-o", "pipefail", "-cux"]

# Fix for newer version of setuptools
# Workaround for newer version of setuptools
ENV SETUPTOOLS_USE_DISTUTILS=stdlib

RUN --mount=type=cache,target=/var/lib/apt/lists \
Expand Down
8 changes: 8 additions & 0 deletions ci/config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,14 @@ publish:
group: qgis-3.22
tags:
- gmf{version}-qgis3.22
- name: camptocamp/geomapfish-qgisserver
group: qgis-3.28
tags:
- gmf{version}-qgis3.28
- name: camptocamp/geomapfish-qgisserver
group: qgis-latest
tags:
- gmf{version}-qgislatest
- name: camptocamp/geomapfish-qgisserver
group: qgis-master
tags:
Expand Down
4 changes: 2 additions & 2 deletions ci/create-new-project
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ docker tag camptocamp/geomapfish:${TAG} camptocamp/geomapfish
docker tag camptocamp/geomapfish-tools:${TAG} camptocamp/geomapfish-tools:$(scripts/get-version --full)
docker tag camptocamp/geomapfish-config:${TAG} camptocamp/geomapfish-config:$(scripts/get-version --full)

DOCKER_BUILDKIT=1 docker build --target=runner --build-arg=VERSION=3.22 \
--tag=camptocamp/geomapfish-qgisserver:gmf${TAG}-qgis3.22 \
DOCKER_BUILDKIT=1 docker build --target=runner --build-arg=VERSION=3.28 \
--tag=camptocamp/geomapfish-qgisserver:gmf${TAG}-qgis3.28 \
docker/qgisserver

WORKSPACE=$1
Expand Down
2 changes: 1 addition & 1 deletion doc/integrator/backend_qgis.rst
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ With that you will not have URL encoding issues.
Landing page
============

`The QGIS documentation <https://docs.qgis.org/3.22/en/docs/server_manual/services.html#qgis-server-catalog>`_.
`The QGIS documentation <https://docs.qgis.org/3.28/en/docs/server_manual/services.html#qgis-server-catalog>`_.

To have the landing page you should:

Expand Down
11 changes: 9 additions & 2 deletions docker/qgisserver/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@ ARG VERSION
FROM camptocamp/qgis-server:${VERSION} AS base-all
LABEL maintainer Camptocamp "[email protected]"

# Fail on error on pipe, see: https://github.com/hadolint/hadolint/wiki/DL4006.
# Treat unset variables as an error when substituting.
# Print commands and their arguments as they are executed.
SHELL ["/bin/bash", "-o", "pipefail", "-cux"]

# Used to convert the locked packages by poetry to pip requirements format
# We don't directly use `poetry install` because it force to use a virtual environment.
FROM base-all as poetry
Expand All @@ -26,9 +31,11 @@ RUN --mount=type=cache,target=/var/lib/apt/lists \
--mount=type=bind,from=poetry,source=/tmp,target=/poetry \
apt-get update \
&& apt-get upgrade --assume-yes \
&& apt-get install --assume-yes --no-install-recommends libpython3-dev libpq-dev gcc \
&& apt-get install --assume-yes --no-install-recommends cython3 python3-dev libpq-dev gcc \
&& ln -s /usr/bin/cython3 /usr/bin/cython \
&& PIP_NO_BINARY=shapely pip install --disable-pip-version-check --no-deps --requirement=/poetry/requirements.txt \
&& apt-get remove --assume-yes libpython3-dev libpq-dev gcc
&& rm /usr/bin/cython \
&& apt-get remove --assume-yes cython3 python3-dev libpq-dev gcc

#############################################################################################################

Expand Down
2 changes: 1 addition & 1 deletion docker/qgisserver/acceptance-tests/acceptance-tests
Original file line number Diff line number Diff line change
Expand Up @@ -53,5 +53,5 @@ response = requests.get(
},
)

assert response.ok, response.status_code
assert response.ok, f"{response.status_code}\n{response.text}"
assert response.headers["Content-Type"] == "image/png", response.headers["Content-Type"]
4 changes: 2 additions & 2 deletions docker/qgisserver/geomapfish_qgisserver/accesscontrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ def authorizedLayerAttributes( # noqa: ignore=N802
return []
return self.get_ogcserver_accesscontrol().authorizedLayerAttributes(layer, attributes)
except Exception:
LOG.error("Unhandle error", exc_info=True)
LOG.error("Unhandled error", exc_info=True)
raise

def allowToEdit(self, layer: QgsVectorLayer, feature: QgsFeature) -> bool: # noqa: ignore=N802
Expand All @@ -309,7 +309,7 @@ def cacheKey(self) -> str: # noqa: ignore=N802
return str(random.randrange(1000000)) # nosec
return self.get_ogcserver_accesscontrol().cacheKey()
except Exception:
LOG.error("Unhandle error", exc_info=True)
LOG.error("Unhandled error", exc_info=True)
raise


Expand Down
8 changes: 4 additions & 4 deletions docker/qgisserver/poetry.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docker/qgisserver/pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ description = 'Not used'
authors = []

[tool.poetry.dependencies]
python = ">=3.8,<3.11"
python = ">=3.10,<3.11"
c2cwsgiutils = { extras = ["broadcast"], version = "5.1.5" }
papyrus = "2.4" # commons
transaction = "3.0.1" # commons
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ TILECLOUDCHAIN_INTERNAL_PORT=8080
MAPSERVER_URL=http://mapserver:8080/
TINYOWS_URL=http://tinyows:8080/
QGISSERVER_URL=http://qgisserver:8080/mapserv_proxy
QGIS_VERSION=3.22
QGIS_VERSION=3.28
POSTGRES_TAG=13-postgis-3

DEVSERVER_HOST=webpack_dev_server:8080
Expand Down

0 comments on commit aabe2b0

Please sign in to comment.