Execute custom simulations via a headless QGIS in a docker container and PaperScope scenes as input data.
The following simulation algorithms are currently implemented:
To set up the development environment, the preferred method is to use a development container. Alternatively, you can use a virtual environment.
For development, use a development container. Simply open this folder via VS-Code DevContainer and start the program from inside the container. The first parameter is a simulation id from the PaperScope WebInterface
python3 -m paperscope_simulation 39313074-e06d-45a6-9fac-2bb41a32feb3If you have a local PaperScope WebInterface on your machine you can overwrite the default url with your local docker host url:
python3 -m paperscope_simulation 39313074-e06d-45a6-9fac-2bb41a32feb3 http://host.docker.internal/hcu/paperscope-website/public/-
Create a Virtual Environment:
python -m venv venv source venv/bin/activate # On Windows, use `venv\Scripts\activate`
When using a virtual environment, ensure that:
- QGIS and the plugins
umepandumep-processingare installed. - The virtual environment uses the Python binary provided by QGIS.
- QGIS and the plugins
-
Install Dependencies: Use the
pip install -e .[dev]command to install the project in editable mode along with development dependencies:pip install -e .[dev]
First build a Docker image from the project that can be used to run the simulation runner in a containerized environment.
- Navigate to the root directory of the project where the Dockerfile is located.
- Build the Docker image using the following command:
docker build --no-cache -t paperscope-simulation:latest .
Execute the following command to run a simulation. You need to bind your local storage with the image storage. The first parameter is a simulation id from the PaperScope WebInterface
docker run -v /my-local-storage/simulations:/app/storage paperscope-simulation:latest python3 -m paperscope_simulation 39313074-e06d-45a6-9fac-2bb41a32feb3All simulations are managed by the PaperScope WebInterface, which implements an OGC API endpoint to interact with simulations (processes) and jobs. Because simulations are long-running tasks, it is important to have a queue with a high timeout (minimum 1 hour). Ensure that the queue in the WebInterface is started as follows:
php artisan queue:listen --timeout=10800