-
Notifications
You must be signed in to change notification settings - Fork 0
Add container for running qgis #3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| FROM docker.io/qgis/qgis:latest | ||
|
|
||
| ENV DEBIAN_FRONTEND=noninteractive | ||
|
|
||
| RUN apt-get update && \ | ||
| apt-get install -y \ | ||
| git \ | ||
| g++-12 \ | ||
| libboost-all-dev \ | ||
| libeigen3-dev \ | ||
| libtiff-dev \ | ||
| make \ | ||
| --no-install-recommends | ||
|
|
||
| WORKDIR /root | ||
|
|
||
| ENV DISPLAY=:0 | ||
|
|
||
| RUN chmod +x build.sh && ./build.sh | ||
|
|
||
| CMD ["/bin/bash", "-c", "source /root/venv/bin/activate && qgis"] | ||
| # CMD ["tail", "-f", "/dev/null"] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,71 @@ | ||
| # QGIS container with Fire2A plugins | ||
| The container runs the latest version of QGIS with all of our tools without having to manually build and configure the | ||
| application on your system. The container is compatible with both Podman and Docker. We recommend using Podman, but the | ||
| instructions found here are easily translated into Docker. | ||
| ### Everything that is not saved to the container directory `/mnt` will be lost once the container stops running. | ||
| ## TL;DR | ||
|
|
||
| ```bash | ||
| sudo apt install podman git | ||
| mkdir qgis-vol | ||
| cd qgis-vol | ||
| git clone git@github.com:fire2a/qgis-pan-europeo.git | ||
| git clone git@github.com:fire2a/fire2a-lib.git | ||
| git clone https://github.com/fire2a/fire-analytics-qgis-processing-toolbox-plugin.git toolbox | ||
| git clone https://github.com/fire2a/C2F-W.git | ||
| # build the container | ||
| podman build -t qgis-fire2a --volume $(pwd)/qgis-vol:/mnt -f Containerfile . | ||
| # run the container | ||
| podman run -it --env DISPLAY=$DISPLAY --volume /tmp/.X11-unix:/tmp/.X11-unix --volume qgis-vol:/mnt --device /dev/dri --name fire2a qgis-fire2a | ||
| # be sure to save your qgis project in the mnt directory so you can access it later, otherwise it will be lost forever | ||
| ``` | ||
|
|
||
| ## Prerequisites | ||
|
|
||
| ```bash | ||
| sudo apt install podman git | ||
| ``` | ||
|
|
||
| Ensure you have Podman installed on your system. You can find installation instructions in the [official Podman documentation](https://podman.io/docs/installation). | ||
| You must also have Git installed. | ||
|
|
||
| ## Clone the repositories | ||
|
|
||
| Clone our tools into a dedicated directory. | ||
| ```bash | ||
| mkdir qgis-vol | ||
| cd qgis-vol | ||
| git clone git@github.com:fire2a/qgis-pan-europeo.git | ||
| git clone git@github.com:fire2a/fire2a-lib.git | ||
| git clone https://github.com/fire2a/fire-analytics-qgis-processing-toolbox-plugin.git toolbox | ||
| git clone https://github.com/fire2a/C2F-W.git | ||
| ``` | ||
|
|
||
| ## Build the image | ||
|
|
||
| To build the container image using Podman, navigate to the directory where the container file is stored | ||
| and run the following command: | ||
|
|
||
| ```bash | ||
| podman build -t qgis-fire2a --volume Path/to/qgis-vol:/mnt -f Containerfile . | ||
| ``` | ||
|
|
||
| This will build the container using a volume mount, sharing all that is in your local directory `qgis-vol` to the | ||
| directory `/mnt` in the container. | ||
|
|
||
| ## Run the container | ||
|
|
||
| Once the image is built, you can run QGIS using Podman: | ||
|
|
||
| ```bash | ||
| podman run -it --env DISPLAY=$DISPLAY --volume /tmp/.X11-unix:/tmp/.X11-unix --volume ~/Path/to/qgis-vol:/mnt --device /dev/dri --name fire2a qgis-fire2a | ||
| ``` | ||
| You can use the QGIS application as you would normally. Everything you save onto the container directory `mnt` will | ||
| be saved to your local directory `qgis-vol`. **If you do not save your project to this directory, it will be lost when | ||
| you close the application or the container**. | ||
|
|
||
| To access the container's terminal while you're running QGIS, open another local terminal and run | ||
| ```bash | ||
| podman exec -it qgis-fire2a bash | ||
| ``` | ||
| ### Remember that everything that is not saved to the container directory `/mnt` will be lost once the container stops running. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| #!/bin/env bash | ||
|
|
||
| cd C2F-W/Cell2Fire | ||
| make clean | ||
| make | ||
| cd ../.. | ||
|
|
||
| python3 -m venv venv --system-site-packages | ||
| . venv/bin/activate | ||
| cd fire2a-lib | ||
| pip install -r requirements.build.txt | ||
| pip install -r requirements.code.txt | ||
| pip install -r requirements.txt | ||
| pip install --editable . | ||
| cd .. | ||
|
|
||
| plugins_dir=~/.local/share/QGIS/QGIS3/profiles/default/python/plugins/ | ||
| mkdir -p $plugins_dir | ||
| ln -sf "$(pwd)/toolbox/fireanalyticstoolbox" "$plugins_dir/fireanalyticstoolbox" | ||
| ln -sf "$(pwd)/C2F-W" "$(pwd)/toolbox/fireanalyticstoolbox/simulator/C2F" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.