Skip to content

Commit 5f1b95b

Browse files
authored
Merge pull request #82 from andrewdelman/cloud_compatibility
Cloud compatibility
2 parents 05df61a + 7031ede commit 5f1b95b

9 files changed

Lines changed: 3278 additions & 684 deletions

Cloud_Setup/install_conda_mamba.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ fi
2525
echo -e "${red_start}Starting Miniforge3 installation${nocolor_start}"
2626

2727
# download Miniforge
28-
if [ -f ~/Miniforge3.sh ]; then
28+
if [ ! -f ~/Miniforge3.sh ]; then
2929
wget "https://github.com/conda-forge/miniforge/releases/latest/download/Miniforge3-Linux-x86_64.sh" -O ~/Miniforge3.sh
3030
else
3131
echo "Miniforge already downloaded!"
@@ -34,16 +34,23 @@ fi
3434
# install Miniforge
3535
# default directory is ~/miniforge3
3636

37+
if [ -d ~/miniforge3 ]; then
38+
echo "~/miniforge3 directory already exists"
39+
echo "deleting and re-installing Miniforge"
40+
rm -r ~/miniforge3
41+
fi
3742
sh ~/Miniforge3.sh -b
3843

3944
# add conda and mamba to .bashrc or equivalent
4045
~/miniforge3/bin/conda init
4146
~/miniforge3/bin/mamba init
47+
source ~/.bashrc
4248

4349
echo -e "${red_start}Completed Miniforge3 installation${nocolor_start}"
44-
echo -e "${red_start}Restart your shell${nocolor_start}"
50+
# echo -e "${red_start}Restart your shell${nocolor_start}"
4551

46-
mamba update -n base -c conda-forge conda
52+
mamba update -n base -c conda-forge conda -y
4753

4854
# this one is a bit of a mystery, but required
4955
echo "export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:~/miniforge3/lib" >> ~/.bashrc
56+
source ~/.bashrc

Cloud_Setup/install_packages.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ red_start='\033[0;31m'
2121
blue_start='\033[0;34m'
2222
nocolor_start='\033[0m'
2323

24-
# # set paths to environment and package directories
24+
mamba init
2525

2626
# create jupyter environment
2727
mamba create --name jupyter python=3.11 -y

Cloud_Setup/install_packages_bigmem.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,9 @@ red_start='\033[0;31m'
1414
blue_start='\033[0;34m'
1515
nocolor_start='\033[0m'
1616

17-
# # set paths to environment and package directories
17+
18+
conda init
19+
1820
# create conda environment called 'jupyter'
1921
env_name='jupyter'
2022

@@ -47,7 +49,6 @@ mamba install -n ${env_name} xarray[complete] jupyterlab dask_labextension s3fs
4749
mamba install -n ${env_name} pyresample -y
4850

4951
# install remaining packages using pip
50-
# (mamba installs tend to get killed on t2.micro)
5152
pip install ecco_v4_py --no-cache-dir
5253

5354
echo -e "${red_start}Completed Python package installations${nocolor_start}"

Cloud_Setup/jupyter_lab_start.sh

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

10-
source ~/conda/bin/activate
10+
11+
conda init
12+
source ~/miniforge3/bin/activate
1113
conda activate jupyter
1214

13-
echo "Staring Jupyter lab session!"
15+
echo "Starting Jupyter lab session!"
1416
echo ""
1517

1618
read -p 'Which port do you want to use [default 9889]: ' user_port
@@ -24,7 +26,7 @@ echo "Enter password to access Jupyter lab from browser,"
2426
echo "or leave blank to not require a password."
2527

2628
PW="$(python3 -c 'from jupyter_server.auth import passwd; import getpass; print(passwd(getpass.getpass(), algorithm="sha256"))')"
27-
jlab_start="jupyter Space lab Space --no-browser Space --autoreload Space --port=\"${user_port}\" Space --ip='127.0.0.1' Space --NotebookApp.token='' Space --NotebookApp.password=\"$PW\" Space --notebook-dir=\"~/ECCO-v4-Python-Tutorial\""
29+
jlab_start="jupyter Space lab Space --no-browser Space --autoreload Space --port=\"${user_port}\" Space --ip='127.0.0.1' Space --IdentityProvider.token='' Space --PasswordIdentityProvider.hashed_password=\"$PW\" Space --notebook-dir=\"~/ECCO-v4-Python-Tutorial\""
2830

2931
# Start new tmux session
3032
tmux new -d -s jupyterlab

Tutorials_as_Jupyter_Notebooks/ECCO_v4_Heat_budget_closure.ipynb

Lines changed: 787 additions & 669 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)