neckhair / crontainer Goto Github PK
View Code? Open in Web Editor NEWCrontainer is intended to be a replacement for cron to be used in a Docker image.
License: MIT License
Crontainer is intended to be a replacement for cron to be used in a Docker image.
License: MIT License
The user should be able to call the program like this:
gcron --comand="echo hello world" --pattern="* */5 * * * *"
This should run the command every 5 minutes.
The config file should be read (by using viper) and stored in an internal structure.
Draft of a config file:
logfile: /dev/stdout
command: echo "Hello World"
pattern: '* * * * * *'
GCron is currently made to run shell commands like the original cron does. But this often requires a Docker image to have more dependencies installed. For example when you want to fetch a URL on a regular basis (Drupal Cronjobs for example) you'll need to have curl
installed in the container.
The idea of this feature is to have a built in task which can call URLs.
Example config:
tasks:
- type: GetUrl
schedule: @every 10m
get_url:
url: http://mydrupalsite.com/cron/_abcd
method: GET
This feature builds the foundation for more such tasks.
I really do not have any explanation but crontainer does not work on any alpine linux container on docker for mac:
tobias:~ tpetry$ docker run -v ~/Downloads/crontainer.yaml:/etc/crontainer.yml neckhair/crontainer:0.3.3
standard_init_linux.go:190: exec user process caused "no such file or directory"
tobias:~ tpetry$ docker run -it --entrypoint sh neckhair/crontainer:0.3.3
/ # /usr/local/bin/crontainer
sh: /usr/local/bin/crontainer: not found
But it does work on ubuntu containers:
tobias:~ tpetry$ docker run -it ubuntu
root@39a4ba05919a:/# apt-get update && apt-get install wget
[skipped output]
root@39a4ba05919a:/# wget https://github.com/neckhair/crontainer/releases/download/0.3.3/crontainer_0.3.3_linux_amd64.tar.gz
[skipped output]
root@39a4ba05919a:/# tar xzfv crontainer_0.3.3_linux_amd64.tar.gz
LICENSE
README.md
crontainer
root@39a4ba05919a:/# ./crontainer
2018/09/12 08:13:02 ---> Begin scheduling <---
currently the image does not build correctly when trying to build without goreleaser, as it looks for a crontainer binary at the root as the dockerfile, which cannot exist due to the source code dir being also called crontainer. Could the compiled file be placed in a subdir instead and then added to the dockerfile to stop the conflict?
The log is currently a bit hard to overview. Logs are prefixed with their task name. But when more then one task is running it's a bit difficult the see logs which belong together.
Each task should get a random color and whenever the task logs something, its name should be written in that color.
the two commands to run the container give me the following error
standard_init_linux.go:185: exec user process caused "exec format error"
I tried with those commands:
docker run -v $(pwd)/crontainer.yml:/etc/crontainer.yml neckhair/crontainer:0.2.0
docker run neckhair/crontainer:0.2.0 --command="echo 'Hello World'" --schedule="*/5 * * * * *"
Is it just me, or is it a general error?
Commands which were read from the config file should be run using their pattern.
Currently the output of a command is not fully returned to crontainer.
Currently only one command and its pattern can be defined in the config. This should be changed so that an array of commands with their patterns can by defined.
Run the Go test in a CI environment like Travis or similar.
The logs are a bit randomly formatted. It could be improved by using a logging library like https://github.com/sirupsen/logrus.
Create a reference implementation of a Docker image.
It should be possible to pass one command and its pattern via environment variables.
The image should be runnable with a non-privileged user (on Openshift).
Maybe try something like https://bintray.com as package repository.
The user should be able to define some after-run commands. The first feature should be to just run a CLI command after a job has failed or was successful (or both). With this we are able to curl
a Slack webhook for example.
In the future some common hooks can be built into the application: E-Mail, Slack, Common Webhook, CLI commands, etc.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.