tree: 0ab24cb294bf988e51412a21f6c65d62eb1f739f [path history] [tgz]
  1. airavata/
  2. airavata_auth/
  3. airavata_experiments/
  4. airavata_jupyter_magic/
  5. airavata_sdk/
  6. docs/
  7. .gitignore
  8. __init__.py
  9. LICENSE
  10. Makefile
  11. mkdocs.yml
  12. pyproject.toml
  13. README.md
airavata-python-sdk/README.md

Apache Airavata Python SDK

The Apache Airavata Python SDK for third party clients to integrate with Airavata middleware

Folder Structure

  • airavata Includes thrift stubs generated by a thrift compiler. Mainly contains data model and functions. You may need to import data model packages to integrate with clients.
  • airavata_sdk
    • clients Includes integration clients, which you want to import and integrate with your code to access airavata middleware.
    • samples Includes set of sample implementation of integration clients to demonastrate the integration with airavata middleware
    • transport Includes connection handling classes and connection pool implementations
  • airavata_experiments Python APIs to run experiments from anywhere. Handles uploading data, running experiments, tracking progress, and fetching data from past runs.
  • airavata_jupyter_magic Jupyter Plugin providing magic annotations (%) to shift notebook runtimes between resources (local/remote).

Connection Model

All Thrift services (Airavata, RegistryService, CredentialStore, SharingRegistry, UserProfile, TenantProfile, IamAdminServices, GroupManager, Orchestrator) are served on a single port (default 8930) using TMultiplexedProcessor. The SDK uses TMultiplexedProtocol to route each client call to the correct service by name. No separate per-service port configuration is needed.

The default server settings are in airavata_sdk/__init__.py (Settings class) and can be overridden with environment variables (e.g., API_SERVER_HOSTNAME, API_SERVER_PORT).

Before Integration

  • Create a virtual environment
    python3 -m venv venv
    
  • Activate the virtual environment
    source venv/bin/activate
    
  • Install dependencies
    pip install -e .
    
  • Configure server connection via environment variables or the Settings class defaults:
    • API_SERVER_HOSTNAME (default: api.gateway.cybershuttle.org)
    • API_SERVER_PORT (default: 8930)
    • AUTH_SERVER_URL, AUTH_REALM, AUTH_CLIENT_ID for Keycloak authentication

Generating Distribution Archives (Optional)

You can generate a *.tar.gz distribution and install to any external project.

  • Make sure you have the latest versions of build and setuptools installed
    python3 -m pip install --upgrade build setuptools
    
  • Now run this command from the same directory where pyproject.toml is located
    python3 -m build .
    
  • This command should output a lot of text and once completed should generate two files in the dist directory
    dist/
        airavata_python_sdk-2.0.0-py2.py3-none-any.whl
        airavata-python-sdk-2.0.0.tar.gz
    

Now, you should be able to install those packages into your project.