Skip to content
Snippets Groups Projects

Resolve "Update documentation on virtual env. for Alpha"

Merged Elias Werner requested to merge 533-update-documentation-on-virtual-env-for-alpha into preview
All threads resolved!
1 file
+ 3
6
Compare changes
  • Side-by-side
  • Inline
@@ -128,11 +128,19 @@ marie@login.alpha$ module spider <module_name>
additional Python packages and create an isolated runtime environment. We recommend using
`virtualenv` for this purpose.
??? example "Example: Creating virtual environment and installing `torchvision` package"
!!! hint
We recommend to use [workspaces](../data_lifecycle/workspaces.md) for your virtual environments.
??? example "Example: Creating a virtual environment and installing `torchvision` package"
```console
marie@login.alpha$ srun --nodes=1 --cpus-per-task=1 --gres=gpu:1 --time=01:00:00 --pty bash -l
marie@alpha$ mkdir python-environments # please use workspaces
marie@alpha$ ws_allocate -n python_virtual_environment -d 1
Info: creating workspace.
/beegfs/ws/1/marie-python_virtual_environment
remaining extensions : 2
remaining time in days: 1
marie@alpha$ module load release/23.04 GCCcore/11.3.0 GCC/11.3.0 OpenMPI/4.1.4 Python/3.10.4
Module GCC/11.3.0, OpenMPI/4.1.4, Python/3.10.4 and 21 dependencies loaded.
marie@alpha$ module load PyTorch/1.12.1-CUDA-11.7.0
@@ -141,30 +149,30 @@ additional Python packages and create an isolated runtime environment. We recomm
/software/rome/r23.04/Python/3.10.4-GCCcore-11.3.0/bin/python
marie@alpha$ pip list
[...]
marie@alpha$ virtualenv --system-site-packages python-environments/my-torch-env
marie@alpha$ virtualenv --system-site-packages /beegfs/ws/1/marie-python_virtual_environment/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)
creator CPython3Posix(dest=/beegfs/.global1/ws/marie-python_virtual_environment/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
marie@alpha$ source /beegfs/ws/1/marie-python_virtual_environment/my-torch-env/bin/activate
(my-torch-env) marie@alpha$ pip install torchvision==0.13.1
[...]
Installing collected packages: torchvision
Successfully installed torchvision-0.10.0
Successfully installed torchvision-0.13.1
[...]
(my-torch-env) marie@alpha$ python -c "import torchvision; print(torchvision.__version__)"
0.10.0+cu102
0.13.1+cu102
(my-torch-env) marie@alpha$ deactivate
```
### JupyterHub
[JupyterHub](../access/jupyterhub.md) can be used to run Jupyter notebooks on Alpha Centauri
sub-cluster. As a starting configuration, a "GPU (NVIDIA Ampere A100)" preset can be used
in the advanced form. In order to use latest software, it is recommended to choose
`fosscuda-2020b` as a standard environment. Already installed modules from `modenv/hiera`
can be preloaded in "Preload modules (modules load):" field.
cluster. You can either use the
[standard profiles for Alpha](../access/jupyterhub.md#standard-profiles) or use the advanced form
and define the resources for your JupyterHub job. The "Alpha GPU (NVIDIA Ampere A100)" preset
is a good starting configuration.
### Containers
Loading