Skip to content
Snippets Groups Projects
Commit 537c0810 authored by Jan Frenzel's avatar Jan Frenzel
Browse files

Merge branch 'merge-preview-in-main' into 'main'

Automated merge from preview to main

See merge request !563
parents 3dc0d5df 7cded3c5
No related branches found
No related tags found
2 merge requests!603Issue285,!563Automated merge from preview to main
......@@ -16,29 +16,27 @@ Due to the structuring there are different ways to access [HPC resources](https:
## Workflow
``` mermaid
graph LR
A(NHR Type) --> |National| B(Login);
A --> |Saxony| B;
A --> |TU Dresden| B;
B --> |ZIH Login| H(Jards Frontend);
B --> |E-Mail Callback| H;
J --> |show| J;
J--> |copy| J;
H --> |create| J(Application);
J --> |edit| J;
J --> | submit | L(Finalized Application);
click A href "http://localhost:8000/application/project_request_form_jards/#application-type" _self;
click E href "http://localhost:8000/application/project_request_form_jards/#nhr" _self;
click F href "http://localhost:8000/application/project_request_form_jards/#saxony" _self;
click G href "http://localhost:8000/application/project_request_form_jards/#tu-dresden" _self;
click B href "http://localhost:8000/application/project_request_form_jards/#login" _self;
click C href "http://localhost:8000/application/project_request_form_jards/#with-tu-dresden-idm-account" _self;
click D href "http://localhost:8000/application/project_request_form_jards/#with-tu-dresden-idm-account" _self;
```
{: align="center"}
``` mermaid
graph LR
A(NHR Type) --> |National| B(Login);
A --> |Saxony| B;
A --> |TU Dresden| B;
B --> |ZIH Login| H(Jards Frontend);
B --> |E-Mail Callback| H;
J --> |show| J;
J--> |copy| J;
H --> |create| J(Application);
J --> |edit| J;
J --> | submit | L(Finalized Application);
click A href "http://localhost:8000/application/project_request_form_jards/#application-type" _self;
click E href "http://localhost:8000/application/project_request_form_jards/#nhr" _self;
click F href "http://localhost:8000/application/project_request_form_jards/#saxony" _self;
click G href "http://localhost:8000/application/project_request_form_jards/#tu-dresden" _self;
click B href "http://localhost:8000/application/project_request_form_jards/#login" _self;
click C href "http://localhost:8000/application/project_request_form_jards/#with-tu-dresden-idm-account" _self;
click D href "http://localhost:8000/application/project_request_form_jards/#with-tu-dresden-idm-account" _self;
```
=== "NHR Type"
......
......@@ -66,6 +66,37 @@ the environment as follows:
(env) marie@compute$ deactivate #Leave the virtual environment
```
??? example
This is an example on partition Alpha. The example creates a conda virtual environment, and
installs the package `torchvision` with conda.
```console
marie@login$ srun --partition=alpha-interactive --nodes=1 --gres=gpu:1 --time=01:00:00 --pty bash
marie@alpha$ ws_allocate -F scratch my_python_virtualenv 100 # use a workspace for the environment
marie@alpha$ cd /scratch/ws/1/marie-my_python_virtualenv
marie@alpha$ module load modenv/hiera GCC/10.2.0 CUDA/11.1.1 OpenMPI/4.0.5 PyTorch/1.9.0
Module GCC/10.2.0, CUDA/11.1.1, OpenMPI/4.0.5, PyTorch/1.9.0 and 54 dependencies loaded.
marie@alpha$ which python
/sw/installed/Python/3.8.6-GCCcore-10.2.0/bin/python
marie@alpha$ pip list
[...]
marie@alpha$ virtualenv --system-site-packages my-torch-env
created virtual environment CPython3.8.6.final.0-64 in 42960ms
creator CPython3Posix(dest=[...]/my-torch-env, clear=False, global=True)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=~/.local/share/virtualenv)
added seed packages: pip==21.1.3, setuptools==57.2.0, wheel==0.36.2
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
marie@alpha$ source my-torch-env/bin/activate
(my-torch-env) marie@alpha$ pip install torchvision==0.10.0
[...]
Installing collected packages: torchvision==0.10.0
Successfully installed torchvision-0.10.0
[...]
(my-torch-env) marie@alpha$ python -c "import torchvision; print(torchvision.__version__)"
0.10.0+cu102
(my-torch-env) marie@alpha$ deactivate
```
### Persistence of Python Virtual Environment
To persist a virtualenv, you can store the names and versions of installed
......@@ -134,34 +165,41 @@ can deactivate the conda environment as follows:
(conda-env) marie@compute$ conda deactivate #Leave the virtual environment
```
!!! warning
When installing conda packages via `conda install`, ensure to have enough main memory requested
in your job allocation.
!!! hint
We do not recommend to use conda environments together with EasyBuild modules due to
dependency conflicts. Nevertheless, if you need EasyBuild modules, consider installing conda
packages via `conda install --no-deps [...]` to prevent conda from installing dependencies.
??? example
This is an example on partition Alpha. The example creates a virtual environment, and installs
the package `torchvision` with pip.
This is an example on partition Alpha. The example creates a conda virtual environment, and
installs the package `torchvision` with conda.
```console
marie@login$ srun --partition=alpha-interactive --nodes=1 --gres=gpu:1 --time=01:00:00 --pty bash
marie@alpha$ mkdir python-environments # please use workspaces
marie@alpha$ module load modenv/hiera GCC/10.2.0 CUDA/11.1.1 OpenMPI/4.0.5 PyTorch
Module GCC/10.2.0, CUDA/11.1.1, OpenMPI/4.0.5, PyTorch/1.9.0 and 54 dependencies loaded.
marie@alpha$ which python
/sw/installed/Python/3.8.6-GCCcore-10.2.0/bin/python
marie@alpha$ pip list
marie@alpha$ ws_allocate -F scratch my_conda_virtualenv 100 # use a workspace for the environment
marie@alpha$ cd /scratch/ws/1/marie-my_conda_virtualenv
marie@alpha$ module load Anaconda3
Module Anaconda3/2021.11 loaded.
marie@alpha$ conda create --prefix my-torch-env python=3.8
Collecting package metadata (current_repodata.json): done
Solving environment: done
[...]
marie@alpha$ virtualenv --system-site-packages python-environments/my-torch-env
created virtual environment CPython3.8.6.final.0-64 in 42960ms
creator CPython3Posix(dest=~/python-environments/my-torch-env, clear=False, global=True)
seeder FromAppData(download=False, pip=bundle, setuptools=bundle, wheel=bundle, via=copy, app_data_dir=~/.local/share/virtualenv)
added seed packages: pip==21.1.3, setuptools==57.2.0, wheel==0.36.2
activators BashActivator,CShellActivator,FishActivator,PowerShellActivator,PythonActivator,XonshActivator
marie@alpha$ source python-environments/my-torch-env/bin/activate
(my-torch-env) marie@alpha$ pip install torchvision
Proceed ([y]/n)? y
[...]
Installing collected packages: torchvision
Successfully installed torchvision-0.10.0
marie@alpha$ conda activate my-torch-env
(my-torch-env) marie@alpha$ conda install -c pytorch torchvision
Collecting package metadata (current_repodata.json): done
[...]
Preparing transaction: done
Verifying transaction: done
(my-torch-env) marie@alpha$ which python # ensure to use the correct Python
(my-torch-env) marie@alpha$ python -c "import torchvision; print(torchvision.__version__)"
0.10.0+cu102
(my-torch-env) marie@alpha$ deactivate
0.12.0
(my-torch-env) marie@alpha$ conda deactivate
```
### Persistence of Conda Virtual Environment
......
......@@ -36,6 +36,8 @@
/* interaction color */
--tud-red-90: rgb(221, 29, 29);
--fg-color--light: rgba(0, 0, 0, 0.6);
--icon-external-link: url('data:image/svg+xml, <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"> <g style="stroke:rgb(35,82,124);stroke-width:1"> <line x1="5" y1="5" x2="5" y2="14" /> <line x1="14" y1="9" x2="14" y2="14" /> <line x1="5" y1="14" x2="14" y2="14" /> <line x1="5" y1="5" x2="9" y2="5" /> <line x1="10" y1="2" x2="17" y2="2" /> <line x1="17" y1="2" x2="17" y2="9" /> <line x1="10" y1="9" x2="17" y2="2" style="stroke-width:1.5" /> </g> </svg>');
}
.md-typeset h1,
......@@ -192,7 +194,26 @@ p {
margin: 0.2em;
}
/* main */
/* style external links as found on https://stackoverflow.com/questions/5379752/css-style-external-links */
.md-content a[href]:where([href*="\."]):not(:where(
/* exclude hash only links */
[href^="#"],
/* exclude relative but not double slash only links */
[href^="/"]:not([href^="//"]),
/* exclude page itself */
[href*="//doc.zih.tu-dresden.de"],
/* exclude relative links beginning with ../ */
[href^="\.\./"],
[href^="misc/"],
/* exclude buttons */
.md-content__button,
/* exclude icons */
.md-icon
)):after {
content: '';
background: no-repeat var(--icon-external-link);
padding-right: 1em;
}
/* footer */
.md-footer * {
justify-content: flex-start;
......
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