Skip to content

Commit d0d1308

Browse files
authored
Clean up conda environments (#375)
1 parent dec4386 commit d0d1308

File tree

10 files changed

+4981
-4072
lines changed

10 files changed

+4981
-4072
lines changed

dashboard.Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,9 @@ WORKDIR /app/dashboard
88
ENV PIP_ROOT_USER_ACTION=ignore
99

1010
# Install any needed packages specified in the environment file
11-
COPY dashboard/gui-lock.yml /app/dashboard/gui-lock.yml
11+
COPY dashboard/environment-lock.yml /app/dashboard/environment-lock.yml
1212
RUN conda install -c conda-forge conda-lock \
13-
&& conda-lock install --name gui gui-lock.yml \
13+
&& conda-lock install --name synapse-gui environment-lock.yml \
1414
&& conda clean --all -y
1515

1616
# Configure an exectuable entrypoint script

dashboard/README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Here are a few how-to guides on how to develop and use the dashboard.
2020

2121
3. Create the lock file starting from the existing minimal environment file:
2222
```console
23-
conda-lock --file gui-base.yml --lockfile gui-lock.yml
23+
conda-lock --file environment.yml --lockfile environment-lock.yml
2424
```
2525

2626
### How to set up the conda environment
@@ -35,16 +35,16 @@ Here are a few how-to guides on how to develop and use the dashboard.
3535
conda install -c conda-forge conda-lock
3636
```
3737

38-
3. Create the `gui` conda environment from the lock file:
38+
3. Create the `synapse-gui` conda environment from the lock file:
3939
```console
40-
conda-lock install --name gui gui-lock.yml
40+
conda-lock install --name synapse-gui environment-lock.yml
4141
```
4242

4343
### How to run the GUI
4444

45-
1. Activate the `gui` conda environment:
45+
1. Activate the `synapse-gui` conda environment:
4646
```console
47-
conda activate gui
47+
conda activate synapse-gui
4848
```
4949

5050
2. Set the database settings (read only):
@@ -81,16 +81,16 @@ Here are a few how-to guides on how to develop and use the dashboard.
8181

8282
2. Build the Docker image based on `Dockerfile`:
8383
```console
84-
docker build --platform linux/amd64 -t gui -f dashboard.Dockerfile .
84+
docker build --platform linux/amd64 -t synapse-gui -f dashboard.Dockerfile .
8585
```
8686

8787
3. Run the Docker container from the `dashboard/` folder:
8888
```console
89-
docker run --network=host -v /etc/localtime:/etc/localtime -v $PWD/ml:/app/ml -e SF_DB_HOST='127.0.0.1' -e SF_DB_READONLY_PASSWORD='your_password_here' gui
89+
docker run --network=host -v /etc/localtime:/etc/localtime -v $PWD/ml:/app/ml -e SF_DB_HOST='127.0.0.1' -e SF_DB_READONLY_PASSWORD='your_password_here' synapse-gui
9090
```
9191
For debugging, you can also enter the container without starting the app:
9292
```console
93-
docker run --network=host -v /etc/localtime:/etc/localtime -v $PWD/ml:/app/ml -e SF_DB_HOST='127.0.0.1' -e SF_DB_READONLY_PASSWORD='your_password_here' -it gui bash
93+
docker run --network=host -v /etc/localtime:/etc/localtime -v $PWD/ml:/app/ml -e SF_DB_HOST='127.0.0.1' -e SF_DB_READONLY_PASSWORD='your_password_here' -it synapse-gui bash
9494
```
9595
Note that `-v /etc/localtime:/etc/localtime` is necessary to synchronize the time zone in the container with the host machine.
9696

@@ -101,9 +101,9 @@ Here are a few how-to guides on how to develop and use the dashboard.
101101
# Password: your NERSC password without 2FA
102102
```
103103
```console
104-
docker tag gui:latest registry.nersc.gov/m558/superfacility/gui:latest
105-
docker tag gui:latest registry.nersc.gov/m558/superfacility/gui:$(date "+%y.%m")
106-
docker push -a registry.nersc.gov/m558/superfacility/gui
104+
docker tag synapse-gui:latest registry.nersc.gov/m558/superfacility/synapse-gui:latest
105+
docker tag synapse-gui:latest registry.nersc.gov/m558/superfacility/synapse-gui:$(date "+%y.%m")
106+
docker push -a registry.nersc.gov/m558/superfacility/synapse-gui
107107
```
108108
This has been also automated through the Python script [publish_container.py](https://github.com/BLAST-AI-ML/synapse/blob/main/publish_container.py), which can be executed via
109109
```console

dashboard/entrypoint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
# Activate the conda environment
44
source /opt/conda/etc/profile.d/conda.sh
5-
conda activate gui
5+
conda activate synapse-gui
66

77
# Execute the provided command
88
exec "$@"

0 commit comments

Comments
 (0)