Skip to content

Commit ae7b717

Browse files
authored
Merge pull request #100 from andrewdelman/cloud_compatibility
Some fixes and edits to AWS cloud environment setup
2 parents 25892df + 35077e8 commit ae7b717

File tree

5 files changed

+18
-14
lines changed

5 files changed

+18
-14
lines changed

Cloud_Setup/JPL_setup_instructions.md

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,26 +37,24 @@ JPL does not enable `ssh` access to AWS instances by default, instead preferring
3737
- *Initial set up and download GitHub repository*: Copy the following commands and paste in your SSM window (using shift-insert or right-click then **Paste**):
3838

3939
```
40-
$ cd ~ && sudo dnf update -y && sudo dnf install git -y
41-
$ sudo su jpluser
42-
$ cd ~/
43-
$ mkdir git_repos
44-
$ cd git_repos
45-
$ git clone https://github.com/ECCO-GROUP/ECCO-v4-Python-Tutorial.git
40+
cd ~ && sudo dnf update -y && sudo dnf install git -y
41+
sudo su jpluser
42+
cd ~/
43+
git clone https://github.com/ECCO-GROUP/ECCO-v4-Python-Tutorial.git
4644
```
4745

4846
- *Enable ssh access*: There is a script in the GitHub repository to enable ssh access `sshd_enable.sh`. You want to run it as the *root* user, otherwise you will not have the necessary permissions. Again, copy and paste the following in your SSM window:
4947

5048
```
51-
$ sudo ~/git_repos/ECCO-v4-Python-Tutorial/Cloud_Setup/sshd_enable.sh
49+
sudo ~/ECCO-v4-Python-Tutorial/Cloud_Setup/sshd_enable.sh
5250
```
5351

54-
The script will ask if you want to move the git repo and change its ownership. Answer **Y** and enter **jpluser** for user name.
52+
The script will ask if you want to generate new SSH keys, answer **Y**. Then it will ask if you want to move the git repo and change its ownership. Answer **Y** and enter **jpluser** for user name.
5553

5654
Once the script is completed, you should be able to ssh into your new instance. You can **Terminate** the SSM window. Then from your machine's terminal window, connect to the instance's *private* IPv4 address (given on the AWS instance summary page) with user name **jpluser**. For example, if the key file is `~/.ssh/aws_ec2_jupyter.pem` and the private IPv4 address is 100.104.70.37, then:
5755

5856
```
59-
$ ssh -i "~/.ssh/aws_ec2_jupyter.pem" [email protected] -L 9889:localhost:9889
57+
ssh -i "~/.ssh/aws_ec2_jupyter.pem" [email protected] -L 9889:localhost:9889
6058
```
6159

6260
The `-L` option indicates a tunnel from the local machine's port 9889 to the instance's port 9889; this will be used later to open Jupyterlab through your local machine's web browser.
@@ -80,7 +78,7 @@ Now you need to install software (conda/miniconda/miniforge) to run Python, and
8078
To run `jupyter_env_setup.sh`, copy, paste, and execute the following two commands on the instance:
8179

8280
```
83-
$ sudo chmod 755 ~/git_repos/ECCO-v4-Python-Tutorial/Cloud_Setup/jupyter_env_setup.sh && ~/git_repos/ECCO-v4-Python-Tutorial/Cloud_Setup/jupyter_env_setup.sh
81+
sudo chmod 755 ~/ECCO-v4-Python-Tutorial/Cloud_Setup/jupyter_env_setup.sh && ~/ECCO-v4-Python-Tutorial/Cloud_Setup/jupyter_env_setup.sh
8482
```
8583

8684
The script takes several minutes to run, but it should set up our environment with the packages we need. Now you can return to Step 4 of the [AWS Cloud: getting started](https://ecco-v4-python-tutorial.readthedocs.io/AWS_Cloud_getting_started.html) tutorial.

Cloud_Setup/install_packages.sh

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ red_start='\033[0;31m'
2121
blue_start='\033[0;34m'
2222
nocolor_start='\033[0m'
2323

24+
25+
source ~/.bashrc
2426
mamba init
2527

2628
# create jupyter environment

Cloud_Setup/install_packages_bigmem.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ blue_start='\033[0;34m'
1515
nocolor_start='\033[0m'
1616

1717

18+
source ~/.bashrc
1819
conda init
1920

2021
# create conda environment called 'jupyter'

Cloud_Setup/jupyter_env_setup.sh

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
11
#!/bin/bash
22

3+
# get path of directory where script is located
4+
script_dir=$(dirname "$0")
5+
36
# install wget and tmux
4-
sh ./install_wget_tmux.sh
7+
sh ${script_dir}/install_wget_tmux.sh
58

69
# download and install miniforge/conda/mamba
7-
sh ./install_conda_mamba.sh
10+
sh ${script_dir}/install_conda_mamba.sh
811

912
# download and install a bunch of packages
1013
# including ecco_v4_py and jupyterlab
11-
sh ./install_packages_bigmem.sh
14+
sh ${script_dir}/install_packages_bigmem.sh

Intro_to_PO_Tutorials/Steric_height.ipynb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,7 @@
213213
"source": [
214214
"### Sea surface height file\n",
215215
"\n",
216-
"To look at the impact of steric height variations, we will also be looking at the actual sea surface height field from ECCOv4. To compare steric height with sea surface height, we of course need to download and retrieve sea surface height output. You can do this by importing the **ecco_download** module and calling the function *ecco_podaac_download* (see the Geostrophic Balance tutorial for an example). Consulting the [variable list](https://raw.githubusercontent.com/ECCO-GROUP/ECCO-v4-Python-Tutorial/master/varlist/v4r4_nctiles_monthly_varlist.txt) for monthly mean output, we find that the datasets containing sea surface height have ShortName ```ECCO_L4_SSH_LLC0090GRID_MONTHLY_V4R4```. To start, download the granule of that dataset corresponding to January 2000 (2000-01). Once you have this file downloaded, view its structure using the code below."
216+
"To look at the impact of steric height variations, we will also be looking at the actual sea surface height field from ECCOv4. Consulting the [variable list](https://raw.githubusercontent.com/ECCO-GROUP/ECCO-v4-Python-Tutorial/master/varlist/v4r4_nctiles_monthly_varlist.txt) for monthly mean output, we find that the datasets containing sea surface height have ShortName ```ECCO_L4_SSH_LLC0090GRID_MONTHLY_V4R4```. To start, we access the granule of that dataset corresponding to January 2000 (2000-01)."
217217
]
218218
},
219219
{

0 commit comments

Comments
 (0)