Git Product home page Git Product logo

conductor-python's Introduction

Netflix Conductor SDK - Python

The conductor-python repository provides the client SDKs to build task workers in Python.

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

  1. Setup conductor-python package
  2. Create and run task workers
  3. Create workflows using code

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.

Create Workflows using Code

Finally, you can create workflows using code.

conductor-python's People

Contributors

amjith avatar c4lm avatar coderabhigupta avatar dengguojie avatar dougsillars avatar gardusig avatar hebrd avatar jchacking avatar marcocrasso avatar phmurias-invitae avatar rizafarheen avatar tullytim avatar v1r3n avatar

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.