Code Monkey home page Code Monkey logo

job-runner's Introduction

The Concept

Stitch together a Docker job scheduler, distributed locking, task runner

CircleCI Docker Registryย 

This repo outputs reaps and alerts on finished kubernetes jobs.

Project: [https://github.com/sstarcher/job-runner] (https://github.com/sstarcher/job-runner)

Docker image: [https://registry.hub.docker.com/u/sstarcher/job-runner/] (https://registry.hub.docker.com/u/sstarcher/job-runner/)

  • Job Scheduler: Cron
  • Distributed Locking: Consul
  • Task Runners: Kubernetes

Run Methods

  • Cron
    • If ran with no command argument it will start in cron mode and run on the cron schedule.
  • Single Job
    • If a job name is specified it will run the job and print out the pod name
    • Lockers are disabled in this mode

Deployment Methods

apiVersion: v1
kind: Deployment
metadata:
  name: job-runner
spec:
  replicas: 1
  template:
    metadata:
      labels:
        name: job-runner
    spec:
      containers:
      - name: job-runner
        image: sstarcher/job-runner:latest

Runner Kubernetes

  • Set KUBERNETES_MASTER to your Kubernetes cluster url example http://127.0.0.1:8080

Lockers

  • Consul
    • CONSUL_HOST to an address without your cluster - default localhost
    • CONSUL_PORT to the port your cluster is listening on - default 8500

Configuration

  • Lockers are disabled by default
  • Example job formats are in the example-jobs folder
  • Job names must be unique
  • example-jobs
  • This project utilizes docker ONBUILD so any yaml files added under a jobs directory will be added and processed
  1. Create a Dockerfile
FROM sstarcher/job-runner:latest
  1. Create a folder called jobs
  2. Create a job
Example:
  image: debian:jessie #This value is overriding what is set in the DEFAULTS.yaml
  Jobs:
    - Test:
        time: '* * * * *'
        command: echo $job
  1. docker build --pull -t jobs .
  2. docker run jobs

job-runner's People

Contributors

sstarcher avatar trinitronx avatar jmccarty3 avatar

Watchers

James Cloos avatar Eli Heady 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.