Convert Figma logo to code with AI

shunfei logocronsun

A Distributed, Fault-Tolerant Cron-Style Job System.

2,921
457
2,921
87

Top Related Projects

5,634

Quick and Easy server testing/validation

4,330

Dkron - Distributed, fault tolerant job scheduling system https://dkron.io

2,140

Modern Job Scheduler

4,390

Fault tolerant job scheduler for Mesos which handles dependencies and ISO8601 based schedules

13,246

Highly available Prometheus setup with long term storage capabilities. A CNCF Incubating project.

13,186

a cron library for go

Quick Overview

Cronsun is a distributed cron-style job system for managing and scheduling tasks across multiple nodes. It provides a web-based interface for job management, real-time monitoring, and logging, making it easier to handle complex scheduling requirements in distributed environments.

Pros

  • Distributed architecture for improved scalability and fault tolerance
  • Web-based interface for easy job management and monitoring
  • Supports multiple node groups for better organization and resource allocation
  • Provides real-time logs and execution status for each job

Cons

  • Requires etcd as a dependency for distributed coordination
  • Limited documentation, especially for advanced features
  • May have a steeper learning curve compared to traditional cron systems
  • Lacks built-in support for some advanced scheduling patterns

Getting Started

  1. Install and configure etcd on your system.

  2. Download and install Cronsun:

go get -u github.com/shunfei/cronsun
cd $GOPATH/src/github.com/shunfei/cronsun
go build -o cronsun
  1. Configure Cronsun by editing the conf/files/base.json file:
{
  "Web": {
    "BindAddr": ":7079"
  },
  "Etcd": {
    "Endpoints": ["http://127.0.0.1:2379"]
  }
}
  1. Start the Cronsun node:
./cronsun node -c conf/files/base.json
  1. Access the web interface at http://localhost:7079 to begin managing jobs.

Competitor Comparisons

5,634

Quick and Easy server testing/validation

Pros of goss

  • Lightweight and fast system testing tool
  • Easy to use YAML-based test definitions
  • Supports multiple output formats (JSON, TAP, JUnit, etc.)

Cons of goss

  • Limited to system and service testing, not a full job scheduler
  • Less extensive web UI compared to cronsun
  • Primarily focused on validation rather than job execution

Code comparison

goss (YAML test definition):

file:
  /etc/passwd:
    exists: true
    mode: "0644"
    owner: root
    group: root
    filetype: file
    contains: []

cronsun (Job configuration):

{
  "name": "test job",
  "command": "echo hello",
  "rules": [{
    "rule": "* * * * *"
  }]
}

Summary

goss is a lightweight system testing tool that excels in validating system state and service health. It uses simple YAML definitions for tests and supports various output formats. However, it lacks job scheduling capabilities and a comprehensive web UI.

cronsun, on the other hand, is a distributed cron-like job scheduler with a more extensive web interface and job management features. It focuses on job execution and scheduling rather than system validation.

The choice between these tools depends on the specific use case: goss for system testing and validation, cronsun for distributed job scheduling and execution.

4,330

Dkron - Distributed, fault tolerant job scheduling system https://dkron.io

Pros of dkron

  • More active development with frequent updates and releases
  • Better documentation and user guides
  • Supports multiple storage backends (etcd, Redis, Consul)

Cons of dkron

  • Less flexible job scheduling options compared to cronsun
  • Steeper learning curve for complex setups
  • Limited built-in notification options

Code Comparison

dkron configuration example:

{
  "name": "dkron-node1",
  "backend": "etcd",
  "backend_machine": ["127.0.0.1:2379"],
  "http_addr": ":8080"
}

cronsun configuration example:

{
  "web": {
    "BindAddr": ":7079"
  },
  "etcd": {
    "Endpoints": ["http://127.0.0.1:2379"]
  }
}

Both projects use similar configuration structures, but dkron offers more options for backend storage. cronsun focuses primarily on etcd for distributed coordination.

dkron provides a more polished user interface and API, making it easier to manage and monitor jobs. However, cronsun offers more granular control over job scheduling and execution.

While dkron has a larger community and more frequent updates, cronsun may be a better choice for users who require fine-grained control over job scheduling in a distributed environment.

2,140

Modern Job Scheduler

Pros of Kala

  • Written in Go, offering better performance and easier deployment compared to Cronsun's Node.js implementation
  • Supports job chaining and dependencies, allowing for more complex workflow orchestration
  • Provides a REST API for easier integration with other systems and services

Cons of Kala

  • Less active development and community support compared to Cronsun
  • Fewer built-in monitoring and alerting features
  • Limited documentation and examples for advanced use cases

Code Comparison

Kala job definition:

{
  "name": "test_job",
  "command": "echo 'Hello World'",
  "schedule": "0 30 * * * *"
}

Cronsun job definition:

{
  "name": "test_job",
  "cmd": "echo 'Hello World'",
  "rules": [{
    "rule": "0 30 * * * *"
  }]
}

Both projects use similar JSON structures for job definitions, with minor differences in field names and organization. Kala's approach is slightly more concise, while Cronsun offers more flexibility in defining multiple scheduling rules for a single job.

4,390

Fault tolerant job scheduler for Mesos which handles dependencies and ISO8601 based schedules

Pros of Chronos

  • Integrated with Apache Mesos for distributed resource management
  • Supports complex job dependencies and workflows
  • Offers a RESTful API for job management and scheduling

Cons of Chronos

  • Steeper learning curve due to Mesos integration
  • Less active development and community support
  • More complex setup and configuration process

Code Comparison

Chronos (Java):

@Path("/scheduler/job")
@Produces(MediaType.APPLICATION_JSON)
public class JobResource {
    @POST
    public Response createJob(SingularityRequest request) {
        // Job creation logic
    }
}

Cronsun (Go):

func (j *Job) Run() bool {
    if !j.Running {
        j.Running = true
        defer func() { j.Running = false }()
        j.runJob()
        return true
    }
    return false
}

Key Differences

  • Chronos is built for Mesos environments, while Cronsun is a standalone distributed job system
  • Cronsun offers a simpler setup and management process
  • Chronos provides more advanced job dependency features
  • Cronsun has a more active development community and recent updates
  • Chronos uses Java, while Cronsun is written in Go

Use Cases

  • Choose Chronos for complex, large-scale distributed environments using Mesos
  • Opt for Cronsun for simpler distributed job scheduling needs with easier setup and management
13,246

Highly available Prometheus setup with long term storage capabilities. A CNCF Incubating project.

Pros of Thanos

  • Highly scalable and designed for large-scale Prometheus deployments
  • Provides long-term storage and global query view across multiple Prometheus instances
  • Offers advanced features like downsampling and compaction for efficient data management

Cons of Thanos

  • More complex setup and configuration compared to Cronsun
  • Requires additional infrastructure and resources to run effectively
  • May be overkill for smaller-scale monitoring needs

Code Comparison

Thanos (Go):

func (s *GRPCServer) Info(ctx context.Context, _ *storepb.InfoRequest) (*storepb.InfoResponse, error) {
    res := &storepb.InfoResponse{
        MinTime: s.minTime,
        MaxTime: s.maxTime,
        Labels:  s.labels,
    }
    return res, nil
}

Cronsun (Go):

func (j *Job) Run() bool {
    if !j.Valid {
        return false
    }
    j.running = true
    defer func() {
        j.running = false
    }()
    // ... (implementation details)
}

While both projects are written in Go, Thanos focuses on distributed systems and Prometheus integration, whereas Cronsun is primarily a distributed cron job system. Thanos's code snippet demonstrates its integration with Prometheus data structures, while Cronsun's code shows its job execution logic.

13,186

a cron library for go

Pros of cron

  • Lightweight and simple to use, with a focus on in-process scheduling
  • Well-established and widely adopted in the Go community
  • Supports standard cron syntax for easy schedule definition

Cons of cron

  • Lacks distributed execution capabilities
  • No built-in web interface for job management and monitoring
  • Limited features for complex scheduling scenarios and fault tolerance

Code Comparison

cronsun:

j := &cronsun.Job{
    Name:     "example job",
    Command:  "echo hello",
    Rules:    []string{"* * * * *"},
    Timeout:  60,
    Retry:    3,
}

cron:

c := cron.New()
c.AddFunc("* * * * *", func() {
    fmt.Println("hello")
})
c.Start()

cronsun is designed for distributed cron job management with features like a web UI, node management, and job distribution across multiple machines. It's suitable for large-scale, distributed environments.

cron is a simpler library focused on in-process cron job scheduling. It's ideal for applications that need to run scheduled tasks within a single process or service.

Choose cronsun for distributed, scalable cron job management with advanced features. Opt for cron if you need a lightweight, easy-to-use scheduler for single-process applications.

Convert Figma logo designs to code with AI

Visual Copilot

Introducing Visual Copilot: A new AI model to turn Figma designs to high quality code using your components.

Try Visual Copilot

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