GithubHelp home page GithubHelp logo

alexandermichels / cybergis-compute-python-sdk Goto Github PK

View Code? Open in Web Editor NEW

This project forked from cybergis/cybergis-compute-python-sdk

0.0 0.0 0.0 9.51 MB

License: Apache License 2.0

Python 47.02% Jupyter Notebook 52.98%

cybergis-compute-python-sdk's Introduction

CyberGIS-Compute Python SDK

GitHub Docs PyPi Status

Docs Deployed PythonCodeQuality PythonCodeTest

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.


Installation

Requirements

  • Python3 + pip3
  • Jupyter server (Hub/Lab) with fixed domain
  • System environment variables:
    • JUPYTERHUB_API_TOKEN: user access token, comes with JupyterHub/Lab.
    • JUPYTER_INSTANCE_URL: server url

From 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

Hello World Example

In this example, you will be using the SDK's Pilot UI to run the hello world GitHub project on the Keeling Computing Cluster.

  1. Run the Pilot UI
from cybergis_compute_client import CyberGISCompute

cybergis = CyberGISCompute(url="xxx") # replace xxx with CyberGIS-Compute server url
cybergis.show_ui() # run Pilot UI
  1. Select hello world from ๐Ÿ“ฆ Job Template
  2. Select keeling_community from ๐Ÿ–ฅ Computing Resource
  3. Configure the following, or leave it as default
    • Slurm Computing Configurations
    • Input Parameters
    • Receive Email
  4. Select a file to upload under Upload Data
  5. 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

cybergis = CyberGISCompute(url="xxx")
  1. Query and resume jobs that you own.
# CyberGISCompute.list_job -> return a list of jobs that you submitted
cybergis.list_job()

# CyberGISCompute.get_job_by_id -> return a Job object referred by that id
cybergis.get_job_by_id(id)
  1. Query CyberGIS-Compute server support information
# 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()
  1. Use Pilot UI
# Renders a IPython Widget UI in Jupyter (async)
# CyberGISCompute.create_job_by_ui -> return None
cybergis.show_ui()

# Get the job submitted by the UI (after you press the submit button)
# CyberGISCompute.get_latest_created_job -> return Job object
cybergis.get_latest_created_job()
  1. Submit job using programming style (in progress)
# 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()

Related Documentation and Projects

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.