Code Monkey home page Code Monkey logo

azkaban-cli's Introduction

Azkaban CLI

Build Status Code style: black

CLI for Azkaban 3 API access and flow upload.

Install

Use virtualenv or conda env

### Building virtualenv
virtualenv azkaban_cli

### Activating virtualenv
source azkaban_cli/bin/activate

### Installing Azkaban CLI
pip install azkaban_cli

Usage

Activate your virtualenv and call azkaban

$ azkaban --help
Usage: azkaban [OPTIONS] COMMAND1 [ARGS]... [COMMAND2 [ARGS]...]...

Options:
  --version  Show the version and exit.
  --help     Show this message and exit.

Commands:
  add_permission                      Add a group with permission in a project
  change_permission                   Change a group permission in a project
  create                              Create a new project
  delete                              Delete a project
  execute                             Execute a flow from a project
  cancel                              Cancel a flow execution
  fetch_running_executions_of_a_flow  Fetch the running executions of a flow
  fetch_flow_execution                Fetch a flow execution
  fetch_flow_execution_updates        Fetch flow execution updates
  fetch_execution_of_a_flow           Fetch all execution of a given flow
  fetch_jobs_from_flow                Fetch jobs of a flow
  fetch_execution_job_log             Fetches the correponding job logs
  fetch_projects                      Fetch all project from a user
  fetch_sla                           Fetch the SLA from a schedule
  login                               Login to an Azkaban server
  logout                              Logout from Azkaban session
  remove_permission                   Remove group permission from a project
  schedule                            Schedule a flow from a project with specified cron...
  unschedule                          Unschedule a flow from a project
  upload                              Generates a zip of path passed as argument and...

Environment setting

User session files are saved by default in the directory "$HOME/.azkaban_cli" directory. This directory can be changed setting the environment variable AZKABAN_CLI_PATH .

Examples

Making login (this login cache information and don't need to do again)

azkaban login --host https://azkaban.your_company.com

Contribute

For development and contributing, please follow Contributing Guide and ALWAYS respect the Code of Conduct

azkaban-cli's People

Contributors

aguimaraesduarte avatar arnour avatar destag avatar dmvieira avatar endersonmenezes avatar gmvargass avatar hermancaldara avatar icarodgl avatar izontm avatar jcsekar avatar jessescn avatar leonardofurtado avatar marcelofa avatar perkles avatar pniedzwiedzinski avatar rafaveira3 avatar regismachado avatar renanoliveira avatar rrrahal avatar sumit-badsara avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

azkaban-cli's Issues

Fix function docstrings in azkaban.py

File azkaban.py is well documented with docstrings. However, some of the information in there is wrong with regards to the returns. Some are missing, some are incorrect... This issue is related to fixing all the docstrings so that they correspond to the expected outcome of each function call.

Copyright holder and license

Hi,
Could you please add LICENSE file and put the copyright holder and license inside each file?

This way there is no chance of someone stumbling across a piece of code without being exposed to the license.

Thanks!

Request : Add project to Hacktoberfest 2020

I would like to inform you that currently this project is not participating in the hacktoberfest 2020 for not having the hacktoberfest topic added. contributors who send PR's for this project will receive the symbol below on their PR's:
Sem título

To participate, just add the topic hacktoberfest to the repo, and hacktoberfest-accepted for accepted PR's.

Thanks in advance, happy coding ♥

Add execution options to schedule and execute commands

Azkaban schedule command let you pass some execution options. One of them (concurrent_option) is already supported.

@login_required
def __schedule(ctx, project, flow, cron, concurrent_option):
    azkaban = ctx.obj[u'azkaban']

    try:
        azkaban.schedule(project, flow, cron, concurrentOption=concurrent_option)
    except ScheduleError as e:
        logging.error(str(e))

But others (like failureAction) is not supported yet.

All execution options allowed can be found here: https://azkaban.readthedocs.io/en/latest/ajaxApi.html#execute-a-flow

Module 'click' has no attribute 'INTEGER'

I was trying to run the project and the following error occurred:

Traceback (most recent call last):
  File "/Workspace/vrs/my_azkaban/bin/azkaban", line 6, in <module>
    from azkaban_cli.azkaban_cli import cli
  File "/Workspace/vrs/my_azkaban/lib/python3.5/site-packages/azkaban_cli/azkaban_cli.py", line 618, in <module>
    @click.argument(u'start', type=click.INTEGER, default=0, show_default=True)
AttributeError: module 'click' has no attribute 'INTEGER'

Looking further I realize that the error was caused by #54

@click.argument(u'start', type=click.INTEGER, default=0, show_default=True)
@click.argument(u'length', type=click.INTEGER, default=3, show_default=True)

INTEGER isn't a valid click parameter type, click.INT should be used instead. Also show_default belongs to click.Option and should not be called in click.Argument

Unnecessary syntax highlighting in Readme.md [Usage Section]

Readme.md [Usage section] :
There is no syntax highlight required, only irrelevant keywords are getting highlighted, which can be confusing at time.

For example these keywords :

logout jobs in

whereas they are equally important as other words.
So, removing shell commands highlighting from a specific section might be useful.

Add pre-commit to azkaban-cli

Overview of the issue

Add pre-commit to the project, with black and flake8 set up.

Motivation for or Use Case

I believe that standardizing the project code style is a good practice, so we can use black and flake8, a useful tool for this purpose is pre-commit. I would like to configure this tool in the project as part of my contributions to hacktober fest.

Improve versioning process

Today, versioning is done manually by changing the __version__.py file and then running the make release command.

Versioning should be a part of the release process.

Not friendly to multiple environments

azkaban_cli keeps track of your last login, and only requires the password if your session has expired.

But whenever you need to send a command to another environment, you need to perform a new login, where is asked for host, user and password

It would be interesting if azkaban_cli could keep track of multiple environments and if there was an easy selection between them

Complement to CONTRIBUTING.md required

The CONTRIBUTING.md divide the installation process into two steps:

1 - pip install -e .
2 - make test

It could misslead contributors. The comand pip install -e . install the dependences described in requirements.txt and under the setup.py install_requires atribute:

  • requests
  • click
  • beautifulsoup4

Ain't nothing wrong until here. But when you move to the next step (make test) the test suit doesn't run properly. The majority of the tests rely on the responses module but this module would not be installed by running pip install -e .

The responses dependency is under setup.py > tests_require but pip install -e . won't reach that line. To properly run the make test I need to pip install -r requirements-dev.txt.

Should this be described at CONTRIBUTING.md or there's some other way to install everything at once.

Provide unschedule flow command

With azkaban cli we can schedule flows but we can't unchedule.

It would be practical a command just like schedule, using project name and flow name as parameters.

Example:

azkaban schedule {project} {flow} {cron}

azkaban unschedule {project} {flow}

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.