MCPcopy
hub / github.com/shunfei/cronsun

github.com/shunfei/cronsun @v0.3.5 sqlite

repository ↗ · DeepWiki ↗ · release v0.3.5 ↗
564 symbols 1,732 edges 69 files 114 documented · 20%
README

cronsun Build Status

cronsun is a distributed cron-style job system. It's similar with crontab on stand-alone *nix.

简体中文

Purpose

The goal of this project is to make it much easier to manage jobs on lots of machines and provides high availability. cronsun is different from Azkaban, Chronos, Airflow.

Features

  • Easy manage jobs on multiple machines
  • Management panel
  • Mail service
  • Multi-language support
  • Simple authentication and accounts manager(default administrator email and password: admin@admin.com/admin)

Status

cronsun has been tested in production for years on hundreds of servers. Although the current version is not release as an stable version, but we think it is completely available for the production environment. We encourage you to try it, it's easy to use, see how it works for you. We believe you will like this tool.

Architecture

                                                [web]
                                                  |
                                     --------------------------
           (add/del/update/exec jobs)|                        |(query job exec result)
                                   [etcd]                 [mongodb]
                                     |                        ^
                            --------------------              |
                            |        |         |              |
                         [node.1]  [node.2]  [node.n]         |
             (job exec fail)|        |         |              |
          [send mail]<-----------------------------------------(job exec result)

Security

cronsun support security with security.json config. When open=true, job command is only allow local files with special extension on the node.

{
    "open": true,
    "#users": "allowed execution users",
    "users": [
        "www", "db"
    ],
    "#ext": "allowed execution file extensions",
    "ext": [
        ".cron.sh", ".cron.py"
    ]
}

Getting started

Setup / installation

Install from binary latest release

Or build from source, require go >= 1.11+.

NOTE: The branch master is not in stable, using Cronsun for production please checkout corresponding tags.

export GO111MODULE=on
go get -u github.com/shunfei/cronsun
cd $GOPATH/src/github.com/shunfei/cronsun
go mod vendor
sh build.sh

Run

  1. Install MongoDB
  2. Install etcd3
  3. Open and update Etcd(conf/etcd.json) and MongoDB(conf/db.json) configurations
  4. Start cronnode: ./cronnode -conf conf/base.json, start cronweb: ./cronweb -conf conf/base.json
  5. Open http://127.0.0.1:7079 in browser
  6. Login with username admin@admin.com and password admin

Screenshot

Brief:

Exec result:

Job:

Node:

Credits

cron is base on robfig/cron

Extension points exported contracts — how you extend this code

Job (Interface)
Job is an interface for submitted cron jobs. [3 implementers]
node/cron/cron.go
Noticer (Interface)
(no doc) [2 implementers]
noticer.go
SessionManager (Interface)
(no doc) [1 implementers]
web/session/session.go
Logger (Interface)
(no doc)
log/log.go
Schedule (Interface)
The Schedule describes a job's duty cycle. [3 implementers]
node/cron/cron.go
FuncJob (FuncType)
A wrapper that turns a func() into a cron.Job
node/cron/cron.go

Core symbols most depended-on inside this repo

outJSONWithCode
called by 107
web/base.go
Errorf
called by 68
log/log.go
Warnf
called by 42
log/log.go
Errorf
called by 31
log/log.go
all
called by 24
node/cron/parser.go
WithC
called by 22
db/mgo.go
NewAuthHandler
called by 21
web/base.go
Get
called by 21
web/session/session.go

Shape

Function 251
Method 230
Struct 63
TypeAlias 10
Interface 5
Class 4
FuncType 1

Languages

Go95%
TypeScript5%

Modules by API surface

web/static_assets.go60 symbols
job.go44 symbols
node/cron/cron.go30 symbols
node/node.go27 symbols
node/cron/cron_test.go23 symbols
web/job.go21 symbols
web/base.go20 symbols
web/ui/src/libraries/rest-client.js18 symbols
proc.go18 symbols
web/session/session.go17 symbols
node.go16 symbols
client.go16 symbols

Dependencies from manifests, versioned

github.com/beorn7/perksv0.0.0-2018032116474 · 1×
github.com/boltdb/boltv1.3.1 · 1×
github.com/cockroachdb/cmuxv0.0.0-2017011019260 · 1×
github.com/coreos/bboltv1.3.0 · 1×
github.com/coreos/etcdv3.3.9+incompatible · 1×
github.com/coreos/go-semverv0.2.0 · 1×
github.com/coreos/go-systemdv0.0.0-2018082814035 · 1×
github.com/coreos/pkgv0.0.0-2018010823065 · 1×
github.com/davecgh/go-spewv1.1.1 · 1×
github.com/dgrijalva/jwt-gov3.2.0+incompatible · 1×
github.com/fsnotify/fsnotifyv1.4.7 · 1×
github.com/ghodss/yamlv1.0.0 · 1×

Datastores touched

(mongodb)Database · 1 repos

For agents

$ claude mcp add cronsun \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact