Code Monkey home page Code Monkey logo

azkaban-orchestrator's Introduction

Azkaban Orchestrator

An Orchestrator for Azkaban pipelines

Quick Start

pip install azkaban-orchestrator

Define Orchestration logic

Create a file and define the dependencies between pipelines using the following notation.

  • Pipeline name is a project name in Azkaban. Project and flow name of a pipeline should be the same.
  • use '->' for hard dependency between two pipelines. A -> B means B runs if A runs successfully.
  • use '.>' for soft dependency between two pipelines. A .> B means B runs after A despite A runs successfully or not.
  • if pipeline has some parameters put them in parentheses by the pipeline name like A(status=1|date). use vertical bar '|' to separate the parameters.
  • to define clusters use colon ':' e.g. S: A,B,C means cluster S includes pipelines A,B and C. to move from one cluster all the pipelines within the cluster should run successfully.

Sample 1

----------
|  a  b  | s1
----------
    |
    v
----------
|  c  d  | s2
----------
    |
    v
    e

Sample1 diagram file

s1 : a, b
s2 : c, d
s1 -> s2
s2 -> e

Sample 2

a -> b -> d(date)
|     ___/|
|    |    |
v    v    v
c -> e <- f(status=1)
|
v
f(status=2)

Sample2 diagram file

a -> b
b -> d(date)
d(date) -> f(status=1)
d(date) -> e
f(status=1) -> e
a -> c
c -> e
c -> f(status=2)

Usage

To run the orchestrator

import logging
from azkaban_orchestrator import orchestrator

client = orchestrator.Client(
    diagram_file_name='/path/to/diargam_file',
    host='azkaban_host',
    username='azkaban_username',
    password='azkaban_passwpord',
    logger=logging.getLogger(__name__)
)

# define the parameters need to pass to the orchestrator
params = {'date':'20171202'}

# define the initial pipeline
# if you need to start orchestration from a specific pipeline
initial = None

client.run(initial, params)

To draw the diagram

from azkaban_orchestrator import diagram

d = diagram.Diagram('test diagram', 'path/to/diagram_file')
d.show()

azkaban-orchestrator's People

Contributors

amirrezaz avatar dependabot[bot] avatar

Watchers

 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.