scheduler

command module
v0.0.0-...-1427ac7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 30, 2020 License: MIT Imports: 8 Imported by: 0

README

SCHEDULER

This is a distributed scheduler based on RabbitMQ that allows you to execute tasks on specific time.

Supported task types

  • Remote http (POST/GET with specified body)
  • Local cmd
  • Dummy (for testing or just for notification callback)

Prerequisites

Please note limitations of MQ delayed messages that are applied same for this project, eg. task can be scheduled up to ~47days from its publication date

Installation

docker-compose up -d --build --remove-orphans

By default, service will be available on port 8245 via grpc, monitoring via grafana on port 3000. Raw prometheus metrics exposed on 0.0.0.0:8457/metrics. Both Grafana and Prometheus included for demonstration purposes.

If you want to run it locally after cloning repository create config.yaml from config.example.yaml in project root directory and run go run main.go

Generated API and *.proto files are available here

Project includes client package for external integrations

You can install example application by running

GO111MODULE=on go get github.com/DoomSentinel/scheduler/cmd/scheduler-example

Usage
  scheduler-example --host=0.0.0.0 --port=8245  

Configuration

Configuration passed by environment variables, defaults defined in config.example.yaml in project root

Variable Default Description
API_GRPC_PORT 8245 Listen for for GRPC API
AMQP_HOST 127.0.0.01 RabbitMQ broker host
AMQP_PORT 5672 RabbitMQ broker port
AMQP_USER guest RabbitMQ auth user
AMQP_PASSWORD guest RabbitMQ auth password
MONITORING_PORT 8457 Port of http service where Prometheus metrics are exposed
DEBUG_DEBUG false Enables debug mode

Project maturity

Currently, not battle tested - therefore not ready for production usage. Needs more vespene gas tests.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis
Package client is a generated GoMock package.
Package client is a generated GoMock package.
cmd
monitoring_mocks
Package monitoring_mocks is a generated GoMock package.
Package monitoring_mocks is a generated GoMock package.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
grpc/v1/schedulerService/mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳