GithubHelp home page GithubHelp logo

szyn / mog Goto Github PK

View Code? Open in Web Editor NEW
42.0 4.0 1.0 60 KB

mog is the CLI for Digdag (Unofficial) (https://www.digdag.io).

License: Apache License 2.0

Shell 13.69% Go 75.69% Makefile 10.62%
digdag mog cli

mog's Introduction

mog

GitHub release Circle CI Language GoDoc Docker Pulls License

mog - A CLI Tool for Digdag.

Description

mog is a command-line interface tool for the Digdag.
mog output format is JSON, so it can be filtered with a JSON processor such as jq.

What's Digdag?

Digdag is an open source Workload Automation System (https://www.digdag.io)

Installation

You can download the binary from the releases page.

e.g. os: linux, arch: amd64
Download to /usr/local/bin

$ curl -L https://github.com/szyn/mog/releases/download/v0.1.6/mog_linux_amd64.tar.gz | tar zx -C /usr/local/bin

macOS

You can use Homebrew:

$ brew tap szyn/mog
$ brew install mog

Docker

You can also to use docker image:

$ docker run --rm szyn/mog:v0.1.6

go get

...Or you can install via go get:

$ go get -u github.com/szyn/mog

Usage

mog --help show help.

$ mog --help
NAME:
   mog - A CLI Tool for Digdag

USAGE:
   mog [global options] command [command options] [arguments...]

VERSION:
   v0.1.6

COMMANDS:
     status, s  Show a status of the task
     start,     Start a new session attempt of a workflow
     retry, r   Retry a session
     polling, p  Poll to get a status of the task
     help, h    Shows a list of commands or help for one command

GLOBAL OPTIONS:
   --host value, -H value  digdag host or ip addr (default: "localhost")
   --port value, -P value  digdag port number (default: 65432)
   --ssl https             make https request
   --verbose               verbose output
   --help, -h              show help
   --version, -v           print the version

Examples

Check a status of the task

Use mog status

e.g.
#############################################
# host: localhost (default)
# project: sample
# workflow: digdag-sample
# sessionTime: 2017-10-08T15:00:00+00:00 (UTC)
# taskName: +digdag-sample+disp_current_date
#############################################

$ mog -H localhost status -p sample -w digdag-sample --session 2017-10-08T15:00:00+00:00 +digdag-sample+disp_current_date
{
    "id": "41",
    "fullName": "+digdag-sample+disp_current_date",
    "parentId": "39",
    "config": {
        "echo>": "${moment(session_time).utc().format('YYYY-MM-DD HH:mm:ss Z')}"
    },
    "upstreams": [
        "40"
    ],
    "state": "success",
    "exportParams": {},
    "storeParams": {},
    "stateParams": {},
    "updatedAt": "2017-10-09T14:50:26Z",
    "retryAt": null,
    "startedAt": "2017-10-09T14:50:26Z",
    "isGroup": false
}

See also mog status --help

Polling to check success state of the task

Use mog polling status

Start a workflow (experimental)

Use mog start

e.g.
#############################################
# host: localhost (default)
# project: sample
# workflow: digdag-sample
# sessionTime: 2017-10-08T15:00:00+00:00 (UTC)
#############################################

$ mog -H localhost start -p sample -w digdag-sample --session 2017-10-09
{
    "id": "5",
    "index": 1,
    "project": {
        "id": "2",
        "name": "sample"
    },
    "workflow": {
        "name": "digdag-sample",
        "id": "3"
    },
    "sessionId": "3",
    "sessionUuid": "948a9083-095c-4eea-b910-d63763006de7",
    "done": false,
    "success": false,
    "cancelRequested": false,
    "createdAt": "2017-10-09T14:50:03Z",
    "finishedAt": "",
    "workflowId": "3",
    "sessionTime": "2017-10-08T15:00:00+00:00",
    "params": {}
}

See also mog start --help

Retry a workflow (experimental)

Use mog retry

e.g.
#############################################
# host: localhost (default)
# project: sample
# workflow: digdag-sample
# sessionTime: 2017-10-08T15:00:00+00:00 (UTC)
#############################################

$ mog -H localhost retry -p sample -w digdag-sample --session 2017-10-09
{
    "id": "6",
    "index": 2,
    "project": {
        "id": "2",
        "name": "sample"
    },
    "workflow": {
        "name": "digdag-sample",
        "id": "3"
    },
    "sessionId": "3",
    "sessionUuid": "948a9083-095c-4eea-b910-d63763006de7",
    "done": false,
    "success": false,
    "cancelRequested": false,
    "createdAt": "2017-10-09T14:50:26Z",
    "finishedAt": "",
    "workflowId": "3",
    "sessionTime": "2017-10-08T15:00:00+00:00",
    "retryAttemptName": "f01529fd-fc2c-4f77-b6c5-f484321e2001",
    "params": {}
}

See also mog retry --help

Licence

Apache License 2.0

Author

szyn

mog's People

Contributors

blue1st avatar ryysud avatar szyn avatar

Stargazers

 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

Watchers

 avatar  avatar  avatar  avatar

Forkers

blue1st

mog's Issues

Fix to use workflow's time zone

Under existing conditions, mog use machine’s time zone.
But it doesn't work correctly in a case like that get a task status if machine’s time zone and workflow’s time zone are different.

Unnecessary sleep when start polling

Hi szyn-san.
Thank you developed cool tool "mog" .
But i think mog has unnecessary sleep when start polling.
Because "mog polling status" always needs over 60 seconds although target session has finished.

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.