Remote computing at the Unity cluster.¶
Use the documentation to supplement this guide
Objectives¶
- Learn basic unix shell navigation and commands.
- Set up computing environment for Python on the Unity cluster.
- Use file transfer to upload/download files from the remote environment, including Python (.py) scripts and image files (.jpeg, .png, .tif).
- Practice basic tasks at the Unix command line.
- Set up the environment for a parallel computing exercise
+We will compute the NDVI Normalized Distributed Vegetation Index using LANDSAT satellite imagery from the bands. Check out the details at the above link.
Step 1: Log in to Unity.¶
Your user account and password was created when you requested an account at unity.uri.edu.
These should be something like:
Name: first last name
Login: firstinitiallastname_uri
Password: whatever_you_specified
To access the HPC, we will use the Unity On Demand service via web browser.
In your browser type in:
$ https://ood.unity.rc.umass.edu/
Choose your institution and follow the steps to log in.
If this connection is successful, then you can proceed to setting up your Python environment in the next step.
NOTE: The Oscar Unity environment uses PyModules to let the user customize their work environment and even install software via conda or pip. Type ]$ module available
to see what's available.
Step 2: Set up the working environment.¶
- [Do this only once] Once you have loaded the Anaconda module, you need to install the Python libraries that we will use. This command creates an Anaconda programming environment called
your_env_here
. You will need to activate this environment every time you log in.$ module load conda/latest $ conda create -n [your_env_here] python=3.9 dask mpi4py scikit-image matlplotlib $ conda activate [your_env_here] # Activate your environment before installing landsatexplore using pip. $ pip install landsatxplore
- [Do this every time you log in] Unity uses modules; modules can be loaded with the load command. You will load them every time you log in.
At the end of the session when you log out, you can enter$ module load conda/latest $ source activate [your_env_here]
source deactivate
to end the Anaconda environment.
RECAP:
The next time you log in, you won't have to carry out the installation steps. you will just execute the following command sequence.
$ module load conda/latest
$ source activate [your_env_here]
Step 3: Follow this Unix tutorial on navigating around the Oscar directories, creating files, etc.¶
Also check out Unix shell commands to better understand how to use the command line tools. https://maker.pro/linux/tutorial/basic-linux-commands-for-beginners. You will likely need to use the Unix commands sudo, cd, rm, mkdir, ssh, sftp, and nano.
Step 4: Transfer your .py files by OODs web-based file manager.¶
- Choose Files-->Home Directory from the top menu in Unity Open On Demand.
If you haven't already, make a directory in your Unity home folder entitled ocg404
. This directory should be inside your /home/your_username
.
You can do this at the Shell:
]$ mkdir ocg404
Or you can create the folder from within the OOD file manager that you opened above with Files-->Home Directory.
Now transfer your files to the ocg404 directory on Unity OOD.
- Upload landsatexplore.py
Step 5: Use a text editor to modify landsatexplore.py and upload via the Unity OOD file manager.¶
- landsat_exploreRI.py uses the landsatxplore API to find and download Landsat images, based on the time and geographic criteria you give it.
- To use the API, you will need to create a USGS EarthExplorer account.
- Fllow the prompts in landsat_exploreRI.py and add the missing code to landsat_exploreRI.py.
- You will download and graph at least one landsat image.
- Note, that because we don't have a graphics connection to Unity, you will need to save the file as a .png or .jpeg for downloading by ftp.
- Run landsat_exploreRI.py on the Unity HPC at the command line using the command below:
]$ python landsat_exploreRI.py
What to turn in (in-class assignment part 2):¶
Download the image you created and submit that as this week's in_class assignment, along with your modified version of landsat_exploreRI.py.