Giter Site home page Giter Site logo

expediagroup / flyte-ticker Goto Github PK

View Code? Open in Web Editor NEW
1.0 10.0 5.0 19 KB

Pack implementing cron-like scheduling in Flyte flows

License: Apache License 2.0

Makefile 8.06% Go 84.29% Dockerfile 7.66%
chatops ifttt flyte flyte-pack crontab workflows

flyte-ticker's Introduction

flyte-ticker

Build Status Docker Stars Docker Pulls

A simple ticker pack for Flyte. Emits a "Tick" event every minute which can be used in flows for cron like behaviour. The event looks like this:

{
    "time": "2018-02-14T17:14:37.765525Z"
}

That is, the time is in the ISO-8601 format.

Build

Pack requires go version 1.9+ and uses dep to manage dependencies (install dep and run dep ensure before build/test).

  • to build: go build
  • to test: go test
  • docker build docker build -t <name>:<version> .

Or, if you have make installed, you can use that. See the Makefile for available targets.

Configuration

The plugin is configured using environment variables:

ENV VAR Default Description Example
FLYTE_API - The API endpoint to use http://localhost:8080
FLYTE_API_TIMEOUT 10 secs Combined timeout for accessing the API 20
FLYTE_LABELS - Labels to disambiguate this instance env=staging,bar=foo

Example Flow

This flow sends a friendly greeting at 9am every morning!:

{
  "name": "tick_demo",
  "description": "Demo echoing tick events to Slack room",
  "steps": [
    {
      "id": "get_tick",
      "event": {
        "packName": "Ticker",
        "name": "Tick"
      },
      "criteria": "{{ Event.Payload.time | match: 'T09:' }}",
      "context": {
        "Time": "{{ Event.Payload.time }}"
      },
      "command": {
        "packName": "Slack",
        "name": "SendMessage",
        "input": {
          "channelId":"<SLACK CHANNEL ID>",
          "message":"Good morning everyone!"
        }
      }
    }
  ]
}

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.