UMEP-dev / UMEP

Urban Multi-scale Environmental Predictor
https://umep-docs.readthedocs.io/
62 stars 15 forks source link

If anyone else is trying to use this headless, this docker file patches `qgis_process` so that it loads all plugins, and installs umep processing. #226

Closed sunt05 closed 3 years ago

sunt05 commented 3 years ago

If anyone else is trying to use this headless, this docker file patches qgis_process so that it loads all plugins, and installs umep processing.

FROM qgis/qgis:release-3_16

# build patched qgis_process that loads all plugins
RUN sed -i 's/plugin == QLatin1String( "processing" ) || ( mPythonUtils->isPluginEnabled( plugin ) && mPythonUtils->pluginHasProcessingProvider( plugin ) )/mPythonUtils->pluginHasProcessingProvider( plugin )/' /QGIS/src/process/qgsprocess.cpp
RUN cd /QGIS/build && ninja qgis_process && cp output/bin/qgis_process /usr/bin

# install umep plugin
RUN mkdir -p ~/.local/share/QGIS/QGIS3/profiles/default/QGIS && \
  echo "[PythonPlugins]\nprocessing=true\nprocessing_umap=true" > ~/.local/share/QGIS/QGIS3/profiles/default/QGIS/QGIS3.ini && \
  curl https://plugins.qgis.org/plugins/processing_umep/version/0.5/download/ --output umep-processing.zip && \
  mkdir -p ~/.local/share/QGIS/QGIS3/profiles/default/python/plugins && \
  unzip umep-processing.zip -d ~/.local/share/QGIS/QGIS3/profiles/default/python/plugins && \
  rm umep-processing.zip

# install umep dependencies
RUN apt install -y python3-scipy && pip3 install supy

ENV QT_QPA_PLATFORM offscreen
RUN mkdir /tmp/runtime-root
ENV XDG_RUNTIME_DIR /tmp/runtime-root

Originally posted by @elliots in https://github.com/UMEP-dev/UMEP-processing/issues/1#issuecomment-769568642