Skip to main content

Netflix Conductor Python SDK

Project description

Netflix Conductor SDK - Python

The conductor-python repository provides the client SDKs to manage:

  1. Task workers
  2. Tasks & Workflows
  3. Schedules & Secrets
  4. Role Based Access Control (RBAC)

Task Workers

Building the task workers in Python mainly consists of the following steps:

  1. Setup conductor-python package
  2. Create and run task workers

Setup Conductor Python Package​

  • Create a virtual environment to build your package
virtualenv conductor
source conductor/bin/activate
  • Get Conductor Python SDK
python3 -m pip install conductor-python

Server Settings

Everything related to server settings should be done within the Configuration class by setting the required parameter (when initializing an object) like this:

from conductor.client.configuration.configuration import Configuration

configuration = Configuration(
    server_api_url='https://play.orkes.io/api',
    debug=True
)
  • server_api_url : Conductor server address. For example, if you are running locally, it would look like; http://localhost:8000/api.
  • debug: It can take the values true/false. true for verbose logging false to display only the errors

Authentication Settings (Optional)

Configure the authentication settings if your Conductor server requires authentication.

Access Control Setup

See Access Control for more details on role-based access control with Conductor and generating API keys for your environment.

from conductor.client.configuration.configuration import Configuration
from conductor.client.configuration.settings.authentication_settings import AuthenticationSettings

configuration = Configuration(
    authentication_settings=AuthenticationSettings(
        key_id='key',
        key_secret='secret'
    )
)

Metrics Settings (Optional)

Conductor uses Prometheus to collect metrics.

metrics_settings = MetricsSettings(
    directory='/path/to/folder',
    file_name='metrics_file_name.extension',
    update_interval=0.1,
)
  • directory: Directory to store the metrics.
    • Ensure that you have already created this folder, or the program should have permission to create it for you.
  • file_name: File where the metrics are stored.
    • example: metrics.log
  • update_interval: Time interval in seconds to refresh metrics into the file.
    • example: 0.1 means metrics are updated every 0.1s or 100ms.

Create and Run Task Workers

The next step is to create and run task workers.

Tasks & Workflows

Builing tasks and workflows involve usage of Orkes Clients that can be used to do the following:

Create task and workflow definitions

We can use the metadata client to manage task and workflow definitions.

Execute Workflows using Code

You can execute workflows using code.

Task Management

You can manage tasks using code.

Unit Testing Workflows

You can unit test your conductor workflows on a remote server before running them on production..

Error Handling

You can handle errors returned from any of the Orkes Client SDK methods.

Schedules & Secrets

Schedule Management

You can manage schedules using code.

Secret Management

You can manage secrets using code.

Role Based Access Control (RBAC)

Access Control Management

You can manage applications, users, groups and permissions using code.

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

conductor-python-1.0.73.tar.gz (100.2 kB view details)

Uploaded Source

Built Distribution

conductor_python-1.0.73-py3-none-any.whl (192.7 kB view details)

Uploaded Python 3

File details

Details for the file conductor-python-1.0.73.tar.gz.

File metadata

  • Download URL: conductor-python-1.0.73.tar.gz
  • Upload date:
  • Size: 100.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for conductor-python-1.0.73.tar.gz
Algorithm Hash digest
SHA256 9b4e52b86ff751c51badbc0d6be6ec69ae260036b9ca29e505b94160b7f41795
MD5 0c4e13c7d374ebaf26d4d25a96ad2fa3
BLAKE2b-256 5c1d435b20260c589060b46a6c6791b5e136d8ea187f7d10135f6e89d5c11e0c

See more details on using hashes here.

File details

Details for the file conductor_python-1.0.73-py3-none-any.whl.

File metadata

File hashes

Hashes for conductor_python-1.0.73-py3-none-any.whl
Algorithm Hash digest
SHA256 138c18100272d5c1fc78dc703c4809a97891440223258337b3010d14f9819744
MD5 42bdd258daa5206a18c6fdcc95a8926d
BLAKE2b-256 68865ea877c3129b2166163a5302882d4a4097381efa39f71d9926e6d503403f

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page