Author: Alexander Michels
This notebook walks through running the CyberGIS-Compute model composed of the three examples in this guide.
from IPython.display import Image
import os
The GeoJSONs in the data/
folder is already uploaded as part of the Github repo, so let's get some new data to plot. The commands below make a new_data
folder and download a dataset of the Stephen's Kangaroo Rat Range.
!mkdir new_data/
!wget -O new_data/kangarro_rat_range.geojson https://data-cdfw.opendata.arcgis.com/datasets/2331a5a9cf4547faa8b86d73b1af38a0_0.geojson?outSR=%7B%22latestWkid%22%3A3857%2C%22wkid%22%3A102100%7D
Now, we want to connect to our CyberGIS-Compute server with the commands below. Normally we would use "cgjobsup.cigi.illinois.edu", but since this is a toy model, we put it on our test deployment:
from cybergis_compute_client import CyberGISCompute
cybergis = CyberGISCompute(url="cgjobsup-test.cigi.illinois.edu", isJupyter=True, protocol="HTTPS", port=443, suffix="v2")
Once you pull up the UI by running the cell below, follow these steps:
The UI will switch to the "Your Job Status" tab which gives you updates about your job. Wait for it to finish.
cybergis.show_ui()
With the job complete, go to the "Download Job Results" tab and click the "Download" button to download the full result folder. The download can take a minute or more (depending on the amount of data) and when it is complete, you should see:
✅ download success!
please check your data at your root folder under "globus_download_xxxxxxxxxxx"
That globus_download_xxxxxxxxxxx
folder will be in your root directory in the file browser (~/work
in the terminal) and we can access it with the variable cybergis.recentDownloadPath
. Let's inspect the outputs:
!ls {cybergis.recentDownloadPath}
The logs for our job are in the result folder under the folder slurm_log
. Let's see the contents:
!ls {cybergis.recentDownloadPath}/slurm_log/
!cat {cybergis.recentDownloadPath}/slurm_log/job.stderr
!cat {cybergis.recentDownloadPath}/slurm_log/job.stdout
Now, let's load a map:
Image(filename=os.path.join(cybergis.recentDownloadPath, "0.jpg"))