CyberGIS-Compute is a scalable middleware framework for enabling high-performance and data-intensive geospatial research and education on CyberGISX. This API can be used to send supported jobs to various supported HPC & computing resources.
Requirements
JUPYTERHUB_API_TOKEN
: user access token, comes with JupyterHub/Lab.JUPYTER_INSTANCE_URL
: server urlFrom Pip:
pip install cybergis-compute-client
From Github:
git clone https://github.com/cybergis/cybergis-compute-python-sdk.git
cd cybergis-compute-python-sdk
python3 setup.py install
In this example, you will be using the SDK's Pilot UI to run the hello world GitHub project on the Keeling Computing Cluster.
from cybergis_compute_client import CyberGISCompute
cybergis = CyberGISCompute(url="xxx") # replace xxx with CyberGIS-Compute server url cybergis.show_ui() # run Pilot UI
2. Select `hello world` from **š¦ Job Template**
3. Select `keeling_community` from **š„ Computing Resource**
4. Configure the following, or leave it as default
- Slurm Computing Configurations
- Input Parameters
- Receive Email
5. Select a file to upload under **Upload Data**
6. Click Submit
> ā If you wonder where the customized configuration options comes from, they are defined in the `manifest.json` file of each project. Please refer to https://github.com/cybergis/cybergis-compute-hello-world/blob/main/manifest.json
***
## SDK Usage
```python
cybergis = CyberGISCompute(url="xxx")
# CyberGISCompute.list_job -> return a list of jobs that you submitted
cybergis.list_job()
cybergis.get_job_by_id(id)
2. Query CyberGIS-Compute server support information
```python
# CyberGISCompute.list_hpc -> prints a list of hpc resources that the server supports
cybergis.list_hpc()
# CyberGISCompute.list_git -> prints a list of Git projects that the server supports
cybergis.list_git()
# Renders a IPython Widget UI in Jupyter (async)
# CyberGISCompute.create_job_by_ui -> return None
cybergis.show_ui()
cybergis.get_latest_created_job()
4. Submit job using programming style (in progress)
```python
# the Job object is an interface for a job
# CyberGISCompute.create_job -> return Job object & print the job's information
job = cybergis.create_job(hpc="some HPC")
# Job.submit -> print the job's information
job.submit()