Code Monkey home page Code Monkey logo

azkaban-job-generator-plugin's Introduction

Azkaban Job Generation Plugin

azkaban-job-generation-plugin generates Azkaban flows in zip format by taking flows in xml file. It also validates DAG of the flow during build.

Available from the Central Repository

Features

  • Representing flows and property files in simple xml format

  • During build it will validate every graph of the flow with following algorithms

    => Cycle detection (throws Exception if cycle is detected)

    => Graph connectivity (throws Exception if jobs of the flow are not connected)

  • Generates zip of job files and property files in output directory with following structure.

    => A separate folder will be created for each flow.

    => flow specific property files are kept in their respective folder

    => global or shared property files are kept in root folder

Types of jobs supported

Command Job

  • By default it will be a command job and only following parameters can be set
      command
      arguments
      working.dir
      retries
      retry.backoff
      failure.emails
      success.emails
      notify.emails
      dependency

  • If any extra properties to be added in job you can mention in flow specific property file.

Custom Job

  • Add following property to the job node if job is custom
<customJob>true</customJob>
  • All properties mentioned in the CustomJob(except customJob property) node will be written to job file in key value pairs.

Flow of the code

Cat

How to use.

  1. Create xml file with flows and their jobs,property files as shown in below sample file
<flows>

    <propertyFiles>
        <file>shared.properties</file>
    </propertyFiles>

    <flow name="flow1">
       
        <propertyFiles>
            <file>flow1.properties</file>
        </propertyFiles>

        <job name="job1">
            <command>.....</command>
            <arguments>....</arguments>
        </job>
        
        <job name="job2">
            <command>....</command>
            <arguments>.....</arguments>
            <dependency>job1</dependency>
        </job>
        
        <job name="job3">
            <command>....</command>
            <arguments>.....</arguments>
            <dependency>job2</dependency>
        </job>
    
    </flow>
    
    <flow>
    .....
    .....
    .....
    </flow>

</flows>
  1. Global property files are mentioned in the parent node and flow specific property files are present in flow node.

  2. Add following plugin repository and plugin to project pom.xml.

 <pluginRepositories>
        <pluginRepository>
            <id>oss-sonatype</id>
            <name>oss-sonatype</name>
            <url>https://oss.sonatype.org/content/repositories/releases/</url>
            <snapshots>
                <enabled>true</enabled>
            </snapshots>
        </pluginRepository>
 </pluginRepositories>
       
       
            <plugin>
                <groupId>io.github.mvamsichaitanya</groupId>
                <artifactId>azkaban-job-generation</artifactId>
                <version>${latest_version_in_release}</version>
                <inherited>false</inherited>
                <configuration>
                    <resourcesPath>${project.basedir}/src/main/resources/</resourcesPath>
                    <jobsFile>flows.xml</jobsFile>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>job_generation</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
  1. Parameters of plugin and their description

    parameter => description

    jobsFile => Name of xml file where flows are mentioned in above specified format

    flowsPath => Path where jobsFile is present

    propertiesPath => Path where propertyFiles are present

    outputDirectory => Output directory where zip file to be generated

    zipFile => Name of the zip file

  2. Parameters of plugin and default values

    parameter => default_value

    flowsPath => ${project.basedir}/src/main/resources/

    propertiesPath => ${project.basedir}/src/main/resources/

    jobsFile => flows.xml

    outputDirectory => ${project.build.directory}

    zipFile => azkaban

  3. After successful build of project and azkaban.zip and unzip of azkaban.zip will be created in output directory.

  4. Structure of zip file will be as following:-

    => A separate folder will be created for each flow.

    => flow specific property files are kept in their respective folder

    => global or shared property files are kept in root folder

  5. azkaban.zip contains job files generated from flows.xml and properties file present in resourcesPath

LICENSE

MIT

azkaban-job-generator-plugin's People

Contributors

mvamsichaitanya avatar

Stargazers

 avatar  avatar  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.