Skip to content
Snippets Groups Projects
Commit c9f787f2 authored by Lars Bilke's avatar Lars Bilke
Browse files

[web] Added docs on using a custom Python environment for container.

parent 20876f67
No related branches found
No related tags found
No related merge requests found
...@@ -75,6 +75,27 @@ Singularity ogs-6.2.2-serial.sif:...> ls /scif/apps/ogs/bin ...@@ -75,6 +75,27 @@ Singularity ogs-6.2.2-serial.sif:...> ls /scif/apps/ogs/bin
Singularity ogs-6.2.2-serial.sif:...> exit Singularity ogs-6.2.2-serial.sif:...> exit
``` ```
### Custom Python environment for the container
For certain benchmarks or tutorials you may need additional Python packages. You can create a Python [virtual environment](https://virtualenv.pypa.io/en/latest/) inside the container (stored on your host) and install packages via `pip` (inside the container):
```bash
mkdir my-working-directory && cd my-working-directory
singularity shell my-container.sif
# Now in the container
virtualenv .venv
source .venv/bin/activate
pip install numpy # or whatever you need
# run ogs
exit
# Now outside the container
# The virtualenv-directory .venv still persists
# If you want to run something in the container with exec, source the venv before:
singularity exec --app ogs my-container.sif bash -c 'source .venv/bin/activate && ogs ...'
```
### Run the DataExplorer inside a Container ### Run the DataExplorer inside a Container
* Get a Singularity container with the DataExplorer (has `-gui` in its name) * Get a Singularity container with the DataExplorer (has `-gui` in its name)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment