Skip to content

Commit 6617999

Browse files
committed
set up conda and jupyter environment in home dir, not /tmp
1 parent 36a87f9 commit 6617999

2 files changed

Lines changed: 7 additions & 14 deletions

File tree

Cloud_Setup/jupyter_env_setup.sh

Lines changed: 5 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -29,29 +29,22 @@ echo -e "${red_start}Installed wget${nocolor_start}"
2929
sudo dnf install tmux -y
3030
echo -e "${red_start}Installed tmux${nocolor_start}"
3131

32-
# retrieve and install miniforge in /tmp/
33-
# assuming EBS volume is already attached to instance
32+
# retrieve and install miniforge
3433
echo -e "${red_start}Starting Miniforge3 installation${nocolor_start}"
3534
mkdir -p /tmp
3635
wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh" -O /tmp/Miniforge3.sh
37-
bash /tmp/Miniforge3.sh -b -p /tmp/conda
36+
bash /tmp/Miniforge3.sh -b -p ~/conda
3837
rm -f /tmp/Miniforge.sh
39-
source "/tmp/conda/etc/profile.d/conda.sh"
40-
source "/tmp/conda/etc/profile.d/mamba.sh"
38+
source ~/conda/bin/activate
4139

4240
echo -e "${red_start}Completed Miniforge3 installation${nocolor_start}"
4341

4442
# add conda and mamba to path
4543
mamba init
4644

47-
# set paths to environment and package directories
48-
printf '\n# set conda environment and package directories' >> ~/.bashrc
49-
printf '\nexport CONDA_ENVS_PATH=/tmp/conda/envs' >> ~/.bashrc
50-
printf '\nexport CONDA_PKGS_DIRS=/tmp/conda/pkgs' >> ~/.bashrc
51-
source ~/.bashrc
45+
# # set paths to environment and package directories
5246

53-
# create jupyter environment under /tmp/conda/envs/
54-
# (in EBS storage to save space in home directory)
47+
# create jupyter environment
5548
mamba create --name jupyter python=3.11 -y
5649
echo -e "${red_start}Created jupyter environment${nocolor_start}"
5750

Cloud_Setup/jupyter_lab_start.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ red_start='\033[0;31m'
77
blue_start='\033[0;34m'
88
nocolor_start='\033[0m'
99

10-
source /tmp/conda/bin/activate
10+
source ~/conda/bin/activate
1111
conda activate jupyter
1212

1313
# Start configuration for Jupyter lab
@@ -20,7 +20,7 @@ jlab_start="jupyter Space lab Space --no-browser Space --autoreload Space --port
2020
tmux new -d -s jupyterlab
2121

2222
# Execute commands in tmux window using send-keys
23-
tmux send-keys -t jupyterlab source Space /tmp/conda/bin/activate Enter
23+
tmux send-keys -t jupyterlab source Space ~/conda/bin/activate Enter
2424
tmux send-keys -t jupyterlab conda Space activate Space jupyter Enter
2525
tmux send-keys -t jupyterlab ${jlab_start} Enter
2626

0 commit comments

Comments
 (0)