npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

ckron

v1.3.1

Published

A cron-like job scheduler for docker

Downloads

23

Readme

ckron

A cron-style job scheduler for docker

NPM Version Test Docker Image Size

ckron is a versatile and straightforward tool to schedule operations on containerized applications.

ckron is heavily inspired by ofelia but attempts to improve on it by allowing multiple tasks per job. Using tasks, you can compose complex workflows with a few off-the-shelf images and follow Docker's motto of one process per container.

Install

If you have Node installed:

$ npm i -g ckron

If you only have Docker installed:

$ docker pull nicomt/ckron

Usage

If you installed it in Node:

$ ckron daemon --config /path/to/config.yml

If you installed it in Docker:

$ docker run --rm -it \
      -v $PWD/config.yml:/etc/ckron/config.yml \
      -v /var/run/docker.sock:/var/run/docker.sock \
      nicomt/ckron daemon

NOTE: For production is recommended to use docker with a restart policy or create a service in something like systemd, upstart or forever. A service will ensure the daemon is restarted in case of an unexpected failure

Configuration

The configuration consists of a YAML file, which is meant to have familiar docker compose like syntax. The main sections of the config file are the following:

Tasks

Single operations that can be carried out by a job. Tasks currently supported are:

  • run: Runs a command inside of a new container, using a specific image.
  • exec: Runs a new command in a running container
  • signal: Send a signal to the main process inside the container. Similar to docker kill --signal

See tasks reference for more documentation

Jobs

Jobs are sets of tasks scheduled with a cron-like syntax. See jobs reference for more documentation

Notifiers

Notification channels for failed jobs. See notifiers reference for more documentation

YAML Full Example

Run with $ ckron daemon --config /path/to/config.yml

tasks:
  test-01:
    type: run
    command: printenv
    environment:
      HELLO: World
    image: ubuntu:latest
jobs:
  job-01:
    schedule: "*/30 * * * * *"
    on_error: ["email-dev"]
    run_on_init: true
    tasks:
      - test-01
notifiers:
  email-dev:
    type: email
    smtp_host: smtp.server.com
    smtp_port: 25
    smtp_auth:
      user: XXXXXXX
      pass: XXXXXXX
    to: [email protected]
    from: '"Ckron Scheduler" <[email protected]>'