Skip to content

Commit

Permalink
Merge branch 'dev' into standalone-ors
Browse files Browse the repository at this point in the history
  • Loading branch information
Raruto committed Jan 21, 2025
2 parents 0666214 + a7b2a34 commit 1917262
Show file tree
Hide file tree
Showing 219 changed files with 35,412 additions and 28,885 deletions.
44 changes: 22 additions & 22 deletions .github/workflows/test_runner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,91 +22,91 @@ jobs:
id: extract_branch

- name: Starting Docker compose
run: docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml up -d
run: docker compose -f docker-compose.${{ matrix.qgis_version }}.yml up -d

- name: Copying code into the container
run: |
docker cp ./ "$(docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml ps -q g3w-suite)":/code
docker cp ./ "$(docker compose -f docker-compose.${{ matrix.qgis_version }}.yml ps -q g3w-suite)":/code
- name: Installing Python requirements
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r requirements_docker.txt && pip3 install -r requirements_huey.txt"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r requirements_docker.txt --break-system-packages && pip3 install -r requirements_huey.txt --break-system-packages"
- name: Installing Caching Python requirements
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/caching/requirements.txt"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/caching/requirements.txt --break-system-packages"
- name: Installing Filemanager Python requirements
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/filemanager/requirements.txt"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/filemanager/requirements.txt --break-system-packages"
- name: Installing Qplotly Python requirements
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/qplotly/requirements.txt"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/qplotly/requirements.txt --break-system-packages"
- name: Installing Openrouteservice Python requirements
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/openrouteservice/requirements.txt && pip3 install -r g3w-admin/openrouteservice/requirements_testing.txt"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/ && pip3 install -r g3w-admin/openrouteservice/requirements.txt --break-system-packages && pip3 install -r g3w-admin/openrouteservice/requirements_testing.txt --break-system-packages"
- name: Building g3w-suite
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "/code/ci_scripts/build_suite.sh"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "/code/ci_scripts/build_suite.sh"
- name: Setting up g3w-suite
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "/code/ci_scripts/setup_suite.sh"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "/code/ci_scripts/setup_suite.sh"
- name: Starting Django
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py runserver 0.0.0.0:8000" &
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py runserver 0.0.0.0:8000" &
- name: Waiting for Django
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "wait-for-it -h localhost -p 8000 -t 240"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "wait-for-it -h localhost -p 8000 -t 240"
- name: Running g3w-admin core tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test core"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test core"
- name: Running g3w-admin qdjango tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test qdjango"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test qdjango"
- name: Running g3w-admin usersmanage tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test usersmanage"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test usersmanage"
- name: Running g3w-admin client tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test client"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test client"
- name: Running g3w-admin editing tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test editing.tests"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test editing.tests"
- name: Running g3w-admin caching tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test caching"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test caching"
- name: Running g3w-admin filemanager tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test filemanager"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test filemanager"
- name: Running g3w-admin qplotly tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test qplotly"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test qplotly"
- name: Running g3w-admin openrouteservice tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test openrouteservice"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test openrouteservice"
- name: Running g3w-admin qtimeseries tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test qtimeseries"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test qtimeseries"
- name: Running g3w-admin about tests
run: |
docker-compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test about"
docker compose -f docker-compose.${{ matrix.qgis_version }}.yml exec -T g3w-suite sh -c "cd /code/g3w-admin && python3 manage.py test about"
- name: Setup tmate session
if: ${{ failure() }}
Expand Down
40 changes: 22 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

# G3W-ADMIN

Admin server for G3W-SUITE written in Python, based on **Django** LTS (v3.2) and **QGIS Server** LTR (v3.28)
Admin server for G3W-SUITE written in Python, based on **Django** LTS (v3.2) and **QGIS Server** LTR (v3.34)

![Admin GUI](https://user-images.githubusercontent.com/9614886/189155796-6feff629-b500-4e38-b7c2-d98b53ae7564.png)

Expand All @@ -13,21 +13,25 @@ Admin server for G3W-SUITE written in Python, based on **Django** LTS (v3.2) and

Software releases follow theese main branches as described in the compatibility table:

| Branch | Python | Django | QGIS | [client] | First release | Status |
|------------|----------------|----------------|---------------|--------------|---------------|----------------|
| [dev] | 3.10 | 3.2 | 3.28 | dev | Unreleased | ⚠️️ Unstable |
| [v.3.7.x] | 3.10 | 3.2 | 3.28 | 3.9.0 | Dec 2023 | 🪲️ Bug fixing |
| [v.3.6.x] | 3.10 | 3.2 | 3.28 | 3.8.15 | May 2023 | 🪲️ Bug fixing |
| [v.3.5.x] | 3.10 | 2.2 | 3.22 | 3.7 | Nov 2022 | 🚨 End of Life |
| [v.3.4.x] | 3.8 | 2.2 | 3.22 | 3.4 | Mar 2022 | 🚨 End of Life |
| [v.3.3.x] | 3.6 | 2.2 | 3.16 | 3.3 | Sep 2021 | 🚨 End of Life |
| [v.3.2.x] | 3.6 | 2.2 | 3.16 | 3.2 | Apr 2021 | 🚨 End of Life |
| [v.3.1.x] | 3.6 | 2.2 | 3.10 | 3.1 | Nov 2020 | 🚨 End of Life |
| [v.3.0.x] | 3.6 | 2.2 | 3.10 | 3.0 | Nov 2020 | 🚨 End of Life |
| [dj22-py3] | 3.6 | 2.2 | [🔗] | | | 🚨 End of Life |
| [py2] | 2.7 | 1.11 | [🔗] | | | 🚨 End of Life |
| Branch | Python | Django | QGIS | [client] | First release | Status |
|------------|--------|----------------|---------------|--------------|---------------|----------------|
| [dev] | 3.12 | 4.2 | 3.34 | dev | Unreleased | ⚠️️ Unstable |
| [v.3.9.x] | 3.12 | 4.2 | 3.34 | 3.11.0 | Jan 2025 | New release |
| [v.3.8.x] | 3.10 | 3.2 | 3.34 | 3.10.3 | Sep 2024 | 🪲️ Bug fixing |
| [v.3.7.x] | 3.10 | 3.2 | 3.34 | 3.9.6 | Dec 2023 | 🪲️ Bug fixing |
| [v.3.6.x] | 3.10 | 3.2 | 3.28 | 3.8.15 | May 2023 | 🚨 End of Life |
| [v.3.5.x] | 3.10 | 2.2 | 3.22 | 3.7 | Nov 2022 | 🚨 End of Life |
| [v.3.4.x] | 3.8 | 2.2 | 3.22 | 3.4 | Mar 2022 | 🚨 End of Life |
| [v.3.3.x] | 3.6 | 2.2 | 3.16 | 3.3 | Sep 2021 | 🚨 End of Life |
| [v.3.2.x] | 3.6 | 2.2 | 3.16 | 3.2 | Apr 2021 | 🚨 End of Life |
| [v.3.1.x] | 3.6 | 2.2 | 3.10 | 3.1 | Nov 2020 | 🚨 End of Life |
| [v.3.0.x] | 3.6 | 2.2 | 3.10 | 3.0 | Nov 2020 | 🚨 End of Life |
| [dj22-py3] | 3.6 | 2.2 | [🔗] | | | 🚨 End of Life |
| [py2] | 2.7 | 1.11 | [🔗] | | | 🚨 End of Life |


[dev]: https://github.com/g3w-suite/g3w-admin/tree/dev
[v.3.8.x]: https://github.com/g3w-suite/g3w-admin/tree/v.3.8.x
[v.3.7.x]: https://github.com/g3w-suite/g3w-admin/tree/v.3.7.x
[v.3.6.x]: https://github.com/g3w-suite/g3w-admin/tree/v.3.6.x
[v.3.5.x]: https://github.com/g3w-suite/g3w-admin/tree/v.3.5.x
Expand Down Expand Up @@ -170,12 +174,12 @@ Any additional package must be placed into the [`/g3w-admin/g3w-admin`](./g3w-ad

## Testing

Automated tests are performed on both latest QGIS release and current QGIS LTR (v3.28) for any push event involving the [`dev`](https://github.com/g3w-suite/g3w-admin/tree/dev) branch.
Automated tests are performed on both latest QGIS release and current QGIS LTR (v3.34) for any push event involving the [`dev`](https://github.com/g3w-suite/g3w-admin/tree/dev) branch.

The Dockerfile and docker-compose.yml files used to perform these tests are:

- [Dockerfile.deps](ci_scripts/Dockerfile.deps) + [docker-compose.yml](docker-compose.yml) → latest QGIS release
- [Dockerfile.ltr.deps](ci_scripts/Dockerfile.ltr.deps) + [docker-compose.ltr.yml](docker-compose.ltr.yml) → current QGIS LTR (v3.28)
- [Dockerfile.ltr.deps](ci_scripts/Dockerfile.ltr.deps) + [docker-compose.ltr.yml](docker-compose.ltr.yml) → current QGIS LTR (v3.34)

Execution log: [github.com/g3w-suite/g3w-admin/actions](https://github.com/g3w-suite/g3w-admin/actions)

Expand Down Expand Up @@ -219,8 +223,8 @@ Depending on the component you want to translate you can start by consulting one
---

**Compatibile with:**
[![Django version](https://img.shields.io/badge/Django-2.2-1EB300.svg?style=flat)](https://www.djangoproject.com/download/)
[![QGIS version](https://img.shields.io/badge/QGIS%20LTR-3.28-1EB300.svg?style=flat)](https://www.qgis.org/en/site/forusers/download.html)
[![Django version](https://img.shields.io/badge/Django-3.2-1EB300.svg?style=flat)](https://www.djangoproject.com/download/)
[![QGIS version](https://img.shields.io/badge/QGIS%20LTR-3.34-1EB300.svg?style=flat)](https://www.qgis.org/en/site/forusers/download.html)

---

Expand Down
21 changes: 10 additions & 11 deletions ci_scripts/Dockerfile.deps
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
FROM ubuntu:jammy
LABEL maintainer="Gis3w" Description="This image is used to prepare build requirements for g3w-suite CI testing" Vendor="Gis3w" Version="1.3"
FROM ubuntu:noble
LABEL maintainer="Gis3w" Description="This image is used to prepare build requirements for g3w-suite CI testing" Vendor="Gis3w"

ENV DEBIAN_FRONTEND=noninteractive
RUN chown root:root /tmp && chmod ugo+rwXt /tmp
RUN apt-get update && apt install -y \
git \
libxml2-dev \
libxslt-dev \
postgresql-server-dev-all \
libgdal-dev \
python3-dev \
libgdal30 \
libgdal34t64 \
python3-gdal \
python3-pip \
curl \
wait-for-it \
wget \
vim \
wait-for-it \
gdal-bin \
libsqlite3-mod-spatialite \
dirmngr \
xvfb
xvfb \
postgresql-client

# PyQGIS latest version
RUN wget -qO - https://qgis.org/downloads/qgis-2022.gpg.key | \
gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/qgis-archive.gpg --import && \
chmod a+r /etc/apt/trusted.gpg.d/qgis-archive.gpg && \
echo "deb [arch=amd64] https://qgis.org/ubuntu jammy main" >> /etc/apt/sources.list && \
apt update && apt install -y python3-qgis qgis-server
RUN curl -sS https://download.qgis.org/downloads/qgis-archive-keyring.gpg > /etc/apt/keyrings/qgis-archive-keyring.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/qgis-archive-keyring.gpg] https://qgis.org/ubuntu noble main" | \
tee /etc/apt/sources.list.d/qgis.list && \
apt-get update && apt-get install -y python3-qgis qgis-server

# Yarn

Expand Down
23 changes: 11 additions & 12 deletions ci_scripts/Dockerfile.ltr.deps
Original file line number Diff line number Diff line change
@@ -1,33 +1,32 @@
FROM ubuntu:jammy
LABEL maintainer="Gis3w" Description="This image is used to prepare build requirements for g3w-suite CI testing" Vendor="Gis3w" Version="1.3"
FROM ubuntu:noble
LABEL maintainer="Gis3w" Description="This image is used to prepare build requirements for g3w-suite CI testing" Vendor="Gis3w"

ENV DEBIAN_FRONTEND=noninteractive
RUN chown root:root /tmp && chmod ugo+rwXt /tmp
RUN apt-get update && apt install -y \
git \
libxml2-dev \
libxslt-dev \
postgresql-server-dev-all \
libgdal-dev \
python3-dev \
libgdal30 \
libgdal34t64 \
python3-gdal \
python3-pip \
curl \
wait-for-it \
wget \
vim \
wait-for-it \
gdal-bin \
libsqlite3-mod-spatialite \
dirmngr \
xvfb
xvfb \
postgresql-client

# PyQGIS 3.28
RUN wget -qO - https://qgis.org/downloads/qgis-2022.gpg.key | \
gpg --no-default-keyring --keyring gnupg-ring:/etc/apt/trusted.gpg.d/qgis-archive.gpg --import && \
chmod a+r /etc/apt/trusted.gpg.d/qgis-archive.gpg && \
echo "deb [arch=amd64] https://qgis.org/ubuntu-ltr jammy main" >> /etc/apt/sources.list && \
apt update && apt install -y python3-qgis qgis-server
# PyQGIS
RUN curl -sS https://download.qgis.org/downloads/qgis-archive-keyring.gpg > /etc/apt/keyrings/qgis-archive-keyring.gpg && \
echo "deb [signed-by=/etc/apt/keyrings/qgis-archive-keyring.gpg] https://qgis.org/ubuntu-ltr noble main" | \
tee /etc/apt/sources.list.d/qgis.list && \
apt-get update && apt-get install -y python3-qgis qgis-server

# Yarn
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - && \
Expand Down
16 changes: 11 additions & 5 deletions ci_scripts/setup_suite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,11 @@ if [ ! -e ${SETUP_DONE_FILE} ]; then
ls ${PROJECTS_DIR} || mkdir ${PROJECTS_DIR}
ls ${DATASOURCE_PATH} || mkdir ${DATASOURCE_PATH}

wait-for-it -h ${G3WSUITE_POSTGRES_HOST:-postgis} -p ${G3WSUITE_POSTGRES_PORT:-5432} -t 60

until pg_isready -h ${G3WSUITE_POSTGRES_HOST:-postgis} -p ${G3WSUITE_POSTGRES_PORT:-5432}; do
echo "wait 30s until is ready"
sleep 30;
done

pushd .
cd ${DJANGO_DIRECTORY}/core/static
rm -rf bower_components
Expand All @@ -68,9 +71,9 @@ if [ ! -e ${SETUP_DONE_FILE} ]; then
done
# sync menu tree items
python3 manage.py sitetree_resync_apps
python3 manage.py createsuperuser --noinput --username admin --email [email protected] || true
python3 manage.py createsuperuser --noinput --username ${G3WSUITE_ADMIN_USERNAME:-admin} --email [email protected] || true
# Set fake password for all users
python3 manage.py set_passwords --password admin
python3 manage.py set_passwords --password ${G3WSUITE_ADMIN_PASSWORD:-admin}

# For django-file-form: create <media_directory>/temp_uploads if not exists
ls ${MEDIA_ROOT}/temp_uploads || mkdir ${MEDIA_ROOT}/temp_uploads
Expand All @@ -81,7 +84,10 @@ if [ ! -e ${SETUP_DONE_FILE} ]; then
else
echo "Setup was already done, skipping ..."
# Wait for postgis
wait-for-it -h ${G3WSUITE_POSTGRES_HOST:-postgis} -p ${G3WSUITE_POSTGRES_PORT:-5432} -t 60
until pg_isready -h ${G3WSUITE_POSTGRES_HOST:-postgis} -p ${G3WSUITE_POSTGRES_PORT:-5432}; do
echo "wait 30s until is ready"
sleep 30;
done

# Restore on restart ln -s for bower_component
cd ${DJANGO_DIRECTORY}/core/static
Expand Down
9 changes: 5 additions & 4 deletions docker-compose.latest.yml
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
# Use QGIS latest release

version: "3"
services:
postgis:
image: g3wsuite/postgis:11.0-2.5
image: kartoza/postgis:16-3.4
ports:
- "55432:5432"
environment:
POSTGRES_USER: docker
POSTGRES_PASS: docker
POSTGRES_DBNAME: g3w-suite
POSTGRES_DBNAME: g3w_suite
ALLOW_IP_RANGE: 0.0.0.0/0
RUN_AS_ROOT: true
FORCE_SSL: False
volumes:
- shared-volume:/shared-volume

Expand Down
10 changes: 6 additions & 4 deletions docker-compose.ltr.yml
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
version: '3'
services:
postgis:
image: g3wsuite/postgis:11.0-2.5
image: kartoza/postgis:16-3.4
ports:
- "55432:5432"
- "55432:5432"
environment:
POSTGRES_USER: docker
POSTGRES_PASS: docker
POSTGRES_DBNAME: g3w-suite
POSTGRES_DBNAME: g3w_suite
ALLOW_IP_RANGE: 0.0.0.0/0
RUN_AS_ROOT: true
FORCE_SSL: False
volumes:
- shared-volume:/shared-volume

Expand Down
6 changes: 6 additions & 0 deletions g3w-admin/OWS/urls.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,4 +31,10 @@
name='ows'
),

re_path(
r'^ows/(?P<group_slug>[-_\w\d]+)/(?P<project_type>[-_\w\d]+)/(?P<project_id>[-_\w\d]+)/wfs3&?',
OWSView.as_view(),
name='ows-wfs3'
),

]
Loading

0 comments on commit 1917262

Please sign in to comment.