Skip to content

Commit 722798c

Browse files
committed
WIP Conda environments in dandi-hub usage docs
1 parent b5d57d7 commit 722798c

File tree

1 file changed

+111
-0
lines changed

1 file changed

+111
-0
lines changed

docs/user-guide-using/dandi-hub.md

Lines changed: 111 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,117 @@ We request that users of this server be considerate of their usage of the DANDI
1919
Training large deep neural networks is not appropriate.
2020
A "Base (MATLAB)" server is also available, which provides a MATLAB cloud installation but you would be required to provide your own license.
2121

22+
## Using conda environments
23+
24+
DANDI Hub provides two ways to work with Python environments: shared environments managed through conda-store, and individual environments you create with conda in your home directory.
25+
26+
**Shared environments** are managed through conda-store and are available to all DANDI Hub users.
27+
These environments contain commonly used packages for neurophysiology analysis and are maintained by administrators.
28+
Use shared environments when:
29+
- You need standard analysis tools and packages
30+
- You want to collaborate with other users using the same environment
31+
- You prefer not to manage package dependencies yourself
32+
33+
**Individual environments** are created and managed using standard conda commands in your user home directory (`/home/username`).
34+
These are private to your account and **should be used instead of conda-store for personal environments**.
35+
Create individual environments when:
36+
- You need specific package versions not available in shared environments
37+
- You're experimenting with new packages or configurations
38+
- You need a customized environment for your specific analysis workflow
39+
40+
**Important:** Do not use conda-store for creating individual environments.
41+
Conda-store is a deployment service for shared environments only.
42+
Use regular conda commands for personal environments in your home directory.
43+
44+
### Shared Environments list:
45+
46+
#### nebari-git:
47+
48+
all dandi users have access
49+
50+
| env name | description |
51+
|----------|-------------|
52+
| allensdk | |
53+
| dandi | |
54+
| dashboard | |
55+
| dask | |
56+
| linc | |
57+
| mlai | |
58+
| openscope | |
59+
60+
61+
### Using shared environments
62+
63+
#### Activating in the terminal
64+
65+
To see available shared environments:
66+
```bash
67+
conda env list
68+
```
69+
70+
To activate a shared environment:
71+
```bash
72+
conda activate environment-name
73+
```
74+
75+
For example, to activate the dandi environment:
76+
```bash
77+
conda activate dandi
78+
```
79+
80+
#### Activating in your Jupyter notebook
81+
82+
**At startup:** When launching JupyterLab, you can select a shared environment from the kernel dropdown in the launcher.
83+
84+
**In an existing notebook:**
85+
1. In the top right of a notebook, click the current environment which will open a "Start a new kernel for "mynotebook.ipynb"
86+
2. Select the desired shared environment from the list
87+
3. The notebook will switch to use packages from that environment
88+
89+
### Creating individual environments
90+
91+
Individual environments should be stored in your home directory using the `--prefix` flag:
92+
93+
```bash
94+
conda create --prefix /home/username/.conda/envs/my-env-name python=3.9
95+
```
96+
97+
To activate your individual environment:
98+
```bash
99+
conda activate /home/username/.conda/envs/my-env-name
100+
```
101+
102+
To install packages in your individual environment:
103+
```bash
104+
conda activate /home/username/.conda/envs/my-env-name
105+
conda install package-name
106+
# or
107+
pip install package-name
108+
```
109+
110+
**Note:** Replace `username` with your actual username, or use `$HOME` instead of `/home/username`.
111+
112+
## (Admin) Managing Shared Conda Environments
113+
114+
TODO if you feel that a shared environment will be helpful please
115+
file an issue to have one created.
116+
117+
Shared conda environments are maintained by administrators
118+
119+
### How to create simple environments
120+
121+
TODO conda-store GUI upload conda-spec.yml
122+
TODO conda-store GUI select requirements
123+
124+
### Using conda-lock
125+
126+
TODO spin up a jupyterlab instance, and from your server run conda-lock against your conda-spec.yml
127+
then upload the conda lock to the conda-store GUI
128+
129+
### Modifying and deleting shared envs
130+
131+
TODO
132+
22133
## Custom server image
23134

24135
If you need additional software installed in the image, you can add a server image that will be made available for all users in the `Server Options` menu. Add a server image by following the instructions below and submitting a pull request to the [dandi-hub repository](https://github.com/dandi/dandi-hub). Once the pull request is merged, the DANDI team will redeploy JupyterHub and the image will be available.

0 commit comments

Comments
 (0)