Code Monkey home page Code Monkey logo

radix-job-scheduler's Introduction

Build status

Radix Job Scheduler

The job scheduler server for application jobs

Usage

Request from application container URLs

  • POST http://<job-name>:8080/api/v1/jobs - start a new job
  • GET http://<job-name>:8080/api/v1/jobs - get a job list
  • GET http://<job-name>:8080/api/v1/jobs/<job-name> - get a job status
  • DELETE http://<job-name>:8080/api/v1/jobs/<job-name> - delete a job
  • POST http://<job-name>:8080/api/v1/jobs/<batch-name>/stop - stop a batch
  • POST http://<job-name>:8080/api/v1/batches - start a new batch
  • GET http://<job-name>:8080/api/v1/batches - get a batch list
  • GET http://<job-name>:8080/api/v1/batches/<batch-name> - get a batch status
  • DELETE http://<job-name>:8080/api/v1/batches/<batch-name> - delete a batch
  • POST http://<job-name>:8080/api/v1/batches/<batch-name>/stop - stop a batch
  • POST http://<job-name>:8080/api/v1/batches/<batch-name>/jobs/<job-name>/stop - stop a batch job

Developing

You need Go installed. Make sure GOPATH and GOROOT are properly set up.

Clone the repo into your GOPATH and run go mod download.

Also needed:

  • go-swagger (on a Mac, you can install it with Homebrew: brew install go-swagger)
  • statik (install with go get github.com/rakyll/statik)

Clone the repo into your GOPATH and run go mod download.

Update version

We follow the semantic version as recommended by go. radix-job-scheduler has three places to set version

  • apiVersionRoute in router/server.go and BasePathin docs/docs.go - API version, used in API's URL

  • Version in docs/docs.go - indicates changes in radix-job-scheduler logic - to see (e.g in swagger), that the version in the environment corresponds with what you wanted

    Run following command to update version in swagger.json

    make swagger
    
  • If generated file swagger.json is changed (methods or structures) - copy it to the public site

Custom configuration

By default Info and Error messages are logged. This can be configured via environment variable LOG_LEVEL (pods need to be restarted after changes)

  • LOG_LEVEL=ERROR - log only Error messages
  • LOG_LEVEL=INFO or not set - log Info and Error messages
  • LOG_LEVEL=WARNING or not set - log Info, Warning and Error messages
  • LOG_LEVEL=DEBUG - log Debug, Warning, Info and Error messages

By default swagger UI is not available. This can be configured via environment variable USE_SWAGGER

  • USE_SWAGGER=true - allows to use swagger UI with URL <api-endpoint>/swaggerui

Generating mocks

We use gomock to generate mocks used in unit test. https://github.com/golang/mock

You need to regenerate mocks if you make changes to any of the interfaces in the code, e.g. the job Handler interface

Run make mock to regenerate mocks

Update version

We follow the semantic version as recommended by go.

  • tag in git repository (in main branch)

    Run following command to set tag (with corresponding version)

    git tag v1.0.0 
    git push origin v1.0.0
    

Contribution

Want to contribute? Read our contributing guidelines

Security

This is how we handle security issues

radix-job-scheduler's People

Contributors

satr avatar nilsgstrabo avatar magnus-longva-bouvet avatar pespiri avatar richard87 avatar emirgens avatar mhorvat-no avatar dependabot[bot] avatar

Stargazers

John Ivar Haugland avatar Mads Schou avatar  avatar

Watchers

James Cloos avatar  avatar

radix-job-scheduler's Issues

Implement cleanup of pods of jobs that are finished

Pre-requisite - Logs for completed jobs

Pods of completed or failed jobs keep log, which is valuable. However when job component is configured to use volumeMount, persistent volume is bound to this pod and it cannot be deleted/released while the pod exist.
Delete pods for completed or failed jobs, older then one day to clean up resources. Logs will be available from Analytics Workspaces

DoD:
Job Pods deleted x hrs after completed/finished, x as settings

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.