Skip to content

asbjornenge/chronos-api

Repository files navigation

Chronos API

A flexible task runner designed for docker based cloud environments.

In Chronos you can add tasks to run at specific times defined in cron syntax. Each task can have multiple steps. Steps are executed in order and stdout and stderr are stored for each execution.

Chronos is split into two components; an app and an api (this repo).

You need to run both to have an operational application. For instruction on how to run the APP, check out the app repo ☝️

Install

Chronos uses postgres as it's database to store tasks, steps and execs.

Create a database, user and load schema:

create database chronos;
create user chronos with encrypted password 'chronos';
grant all privileges on database chronos to chronos;
psql -U chronos -h postgres -d chronos < schema/schema.sql

Run

Start the api

docker run -p 3001:3001 -e DB_HOST=postgres -it asbjornenge/chronos-api:latest 

Supported environment variables:

env             default                 wat
--
DB_HOST         localhost               postgres hostname / ip
DB_PORT         5432                    postgres port
DB_USER         chronos                 postgres username
DB_PASS         chronos                 postgres password
DB_NAME         chronos                 postgres database
FILES_PATH      /files                  path to store uploaded files
FRONT_URL       http://localhost:3000   URL for the frontend app, to configure CORS
AUTH0_BASEURL   http://localhost:3001   BaseURL for auth0 auth
AUTH0_SECRET    null                    Secret for auth0 auth
AUTH0_CLIENTID  null                    Clientid for auth0 auth
AUTH0_ISSUERURL null                    IssuerURL for auth0 auth

Run the app

Refer to the app repo for instruction on running the app and start using Chronos 🎉

NB! The app exects the api service to be availble on the /api path.

Metrics

Chronos API also exports prometheus metrics for it's backups (success/failure) on the /metrics path.

curl localhost:3001/metrics

enjoy.

About

A flexible task runner designed for docker based cloud environments

Resources

Stars

Watchers

Forks

Packages

No packages published