Orchestra SDK for updating self-hosted Tasks.
Project description
Orchestra Python SDK
This is a lightweight SDK that allows Orchestra to interact with self-hosted applications (Tasks).
The basic premise is for your self-hosted Task to send back status updates and logs to Orchestra. This is done via HTTP requests. The Task is started by Orchestra.
Guide
Firstly, install the package:
pip install orchestra-sdk
The package requires the following environment variable to be set manually:
ORCHESTRA_API_KEY
: The API key to connect to Orchestra. This can be found in your settings page.
Orchestra will automatically set the following environment variables when the Task is triggered:
ORCHESTRA_WEBHOOK_URL
: The URL to send status updates toORCHESTRA_TASK_RUN_ID
: The UUID of the Task being executedORCHESTRA_PIPELINE_RUN_ID
: The UUID of the Pipeline Run that the Task is part of
To use the package in your code:
from orchestra_sdk.decorators import orchestra_run
@orchestra_run()
def my_function(arg1, arg2=1):
print("Running complex process")
Summary
- The decorator will firstly read and validate the environment variables
- It will send a
RUNNING
status update to Orchestra - Your function will then run
- If an exception is raised, the decorator will send a
FAILED
status update to Orchestra - If the function finishes without an error being raised, regardless of the return value, the decorator will send a
SUCCEEDED
status update to Orchestra
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
orchestra_sdk-0.0.12.tar.gz
(7.9 kB
view hashes)
Built Distribution
Close
Hashes for orchestra_sdk-0.0.12-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6e125276147bb4ea8d66d6184ae127a5b4c7a8280e97a2f616d09ce5c3af6f43 |
|
MD5 | c79f49bd9eeead34b05c56c422ed7175 |
|
BLAKE2b-256 | 31df064fee26549bec7f2a2b5017f9d54e83133e1700ccf79c73ab2cb8409538 |