blacklabelops-legacy / jobber-cron Goto Github PK
View Code? Open in Web Editor NEWDocker Container Cron Alternative With Jobber.
Home Page: https://hub.docker.com/r/blacklabelops/jobber/
License: MIT License
Docker Container Cron Alternative With Jobber.
Home Page: https://hub.docker.com/r/blacklabelops/jobber/
License: MIT License
Since tini is included in docker @blacklabelops
NOTE: If you are using Docker 1.13 or greater, Tini is included in Docker itself.
This includes all versions of Docker CE. To enable Tini, just pass the --init flag to docker run.
I have a question, if I execute a task every 1 second, but sometimes the task sometimes takes 5 seconds.. what happens? Can we have an option to either Serialize -or- Parallel?
Hi I'm trying to execute php
in another container. Which route would you recommend:-
docker
into jobber-cron, and volume map the .sock then run docker exec..Many thanks
Would you consider releasing an updated version with a later version of the Docker client?
We want to use docker system prune
in our jobs but it is only available in API 1.25+
Docker-Compose uses some environment variable container:affinity
. This hinders the execution of scripts cause the pre-script exporting all env variables cannot run with one of these.
I am managing my jobber container with Rancher. Rancher has the ability to do a healthcheck on containers and then respawn them if the the container is unreachable. However, it does this by checking either TCP Connection or HTTP Response. Jobber has neither of those. Is there a way to modify jobber so that it will respond to either of these health checks?
Rancher uses these health checks to determine what to do with the container in case the underlying host dies. Without it, Rancher will not move the container to a health host.
Any help would be appreciated.
Can't tell if I'm just being stupid but whenever I try to run this container (e.g. Using README demo command):
docker run -d --name jobber -e "JOB_NAME1=TestEcho" -e "JOB_COMMAND1=echo hello world" blacklabelops/jobber
Docker logs just yields:
/opt/jobber/docker-entrypoint.sh: line 55: jobberd: command not found
I've tried overriding the entrypoint to take a look inside the container with it running and can't find jobber anywhere...
Trying to use Jobber:aws. I get this error:
5/9/2016 7:20:12 PM/opt/cloud/environment-amazonws.sh: /usr/bin/aws: /usr/bin/python: bad interpreter: No such file or directory
Then the container restarts.
I can't seem to find any documentation regarding how I can see my job's output. All I see is exit status
. Any advice would be appreciated.
I am using Jobber-cron to backup files from my /efs/data folder into S3. It was working, but when I checked my bucket today I saw that new files are not getting copied. Apparently it stopped working about a week ago. If I execute a shell into the container and try to run the command, it says: "aws: command not found"
Here is my docker compose file.
JobberAWSBackup:
environment:
AWS_ACCESS_KEY_ID: ***************
AWS_SECRET_ACCESS_KEY: ***********************
JOB_COMMAND1: aws s3 sync /data s3://bucketname-efs-backup/data --region us-west-2 --delete
JOB_NAME1: CopyEFSDatatoS3
JOB_ON_ERROR1: Backoff
JOB_TIME1: 1 1
image: blacklabelops/jobber
volumes:
- /efs/data:/data:ro
Here is the docker logs:
10/14/2016 2:21:42 PM---
10/14/2016 2:21:42 PM- name: CopyEFSDatatoS3
10/14/2016 2:21:42 PM cmd: aws s3 sync /data s3://bucketname-efs-backup/data --region us-west-2 --delete
10/14/2016 2:21:42 PM time: '1 1'
10/14/2016 2:21:42 PM onError: Backoff
10/14/2016 2:21:42 PM notifyOnError: false
10/14/2016 2:21:42 PM notifyOnFailure: false
10/14/2016 2:21:42 PM
10/14/2016 2:21:42 PMLaunching.
10/14/2016 2:21:42 PMUsing legacy jobber file format.
10/14/2016 2:21:42 PMGot jobs section
10/14/2016 2:21:42 PMLoaded 1 new jobs for root.
10/14/2016 2:21:42 PMLoaded 0 new jobs for bin.
10/14/2016 2:21:42 PMLoaded 0 new jobs for daemon.
10/14/2016 2:21:42 PMLoaded 0 new jobs for adm.
10/14/2016 2:21:42 PMLoaded 0 new jobs for lp.
10/14/2016 2:21:42 PMLoaded 0 new jobs for sync.
10/14/2016 2:21:42 PMLoaded 0 new jobs for shutdown.
10/14/2016 2:21:42 PMLoaded 0 new jobs for halt.
10/14/2016 2:21:42 PMLoaded 0 new jobs for mail.
10/14/2016 2:21:42 PMLoaded 0 new jobs for news.
10/14/2016 2:21:42 PMLoaded 0 new jobs for uucp.
10/14/2016 2:21:42 PMLoaded 0 new jobs for operator.
10/14/2016 2:21:42 PMLoaded 0 new jobs for man.
10/14/2016 2:21:42 PMLoaded 0 new jobs for postmaster.
10/14/2016 2:21:42 PMLoaded 0 new jobs for cron.
10/14/2016 2:21:42 PMLoaded 0 new jobs for ftp.
10/14/2016 2:21:42 PMFailed to load jobs for open /dev/null/.jobber: not a directory: sshd
10/14/2016 2:21:42 PMLoaded 0 new jobs for at.
10/14/2016 2:21:42 PMLoaded 0 new jobs for squid.
10/14/2016 2:21:42 PMLoaded 0 new jobs for xfs.
10/14/2016 2:21:42 PMLoaded 0 new jobs for games.
10/14/2016 2:21:42 PMLoaded 0 new jobs for postgres.
10/14/2016 2:21:42 PMLoaded 0 new jobs for nut.
10/14/2016 2:21:42 PMLoaded 0 new jobs for cyrus.
10/14/2016 2:21:42 PMLoaded 0 new jobs for vpopmail.
10/14/2016 2:21:42 PMLoaded 0 new jobs for ntp.
10/14/2016 2:21:42 PMLoaded 0 new jobs for smmsp.
10/14/2016 2:21:42 PMFailed to load jobs for open /dev/null/.jobber: not a directory: guest
10/14/2016 2:21:42 PMLoaded 0 new jobs for nobody.
10/14/2016 2:21:42 PMtotalJobs: -1; len(m.jobs): 1
10/14/2016 2:21:42 PMLoaded 0 new jobs for jobber_client.
10/14/2016 2:21:42 PMNew context: 0.0
10/14/2016 2:21:42 PMMain thread context: 0.0
10/14/2016 2:21:42 PMNew context: 0.0.0
Get the below output when trying to build, I'll submit a pr.
package github.com/dshearer/jobber: no Go files in /tmp/jobber/lib/src/github.com/dshearer/jobber make: Entering directory '/tmp/jobber/lib/src/github.com/dshearer/jobber' MAKE GOYACC /bin/sh: rsync: not found make: *** [mk/buildtools.mk:11: /tmp/jobber/lib/src/github.com/dshearer/jobber/buildtools/gen/bin/goyacc] Error 127 make: Leaving directory '/tmp/jobber/lib/src/github.com/dshearer/jobber'
Hi I plan on having many instances of jobber-cron running, all with the same timing config. This leads to an issue for my hourly cron where multiple containers will all work at the same millisecond. I would like to specify something like this for the interval:
? * * * * *
where the ?
means "Select a random value within the range (0-59 in this case), and stick with it!" so for example on init it would choose 35 let's say.. so every ::35 it will now execute.
For midnight cron, I would want it random between midnight and 1am I think.. so something like ? ? 0
could work so for example it might execute every 00:32:11am
Hi, it would be useful to setup notifyProgram
via ENV variables
using the default sendmail
is particularly useless with docker
Can I use all the cron shortcuts, like @hourly? If not, how would I write the Job_Time parameter if I want something to run hourly?
Not sure how things are set up, but I'm assuming that #10 should've triggered a build + push of jobber:cloud
as well, however, looking at https://hub.docker.com/r/blacklabelops/jobber/tags/ it seems like that specific tag hasn't been updated recently.
Waiting for this ticket to be solved before I can continue:
dshearer/jobber#17
Hello - cool image! I tried it out and ran into this issue, which prevented my task from running:
Running job "Spider" for user "root"...
Job "Spider" failed.
New status: Good.
Stdout:
Stderr:
-sh: export: line 3: DCNEW_SCRAPYD_1_ENV_affinity:container: bad variable name
Looking at the file /etc/profile.d/jobber.sh in the container shows this variable:
export DCNEW_SCRAPYD_1_ENV_affinity:container='=8fe6d49e6ce66e5373326afb2f0d473e6fe44fe7bfff5a7e6829157882d5830a'
It looks like the colon in the variable name is not allowed. You'd think that sh export
would take care of that, but apparently not. It looks like your image pipelines environment variables into the job that is run, but is hitting an error with this variable name. That environment variable is added by docker-compose, I think.
My solution was to modify the image to install perl, and modify the code in docker-entrypoint.sh to the following:
function pipeEnvironmentVariables() {
local environmentfile="/etc/profile.d/jobber.sh"
cat > ${environmentfile} <<_EOF_
#!/bin/sh
_EOF_
sh -c export | perl -ne 's/(?<=export )(.+)(?=\='\'')/$new = $1; $new =~ s\/[^[:alnum:]]\/_\/g; $new/eg; print;' >> ${environmentfile}
}
Hope that helps. I'm not a regex master, so there is probably a better solution than substitution regex nested inside of another substitution regex. I wanted to do it with sed but couldn't figure out a solution that would only replace instances in the variable name (not the variable value) and also replace multiple instances (in case variable name has multiple non-alphanumeric characters). It's also not a perfect solution because scripts might be expecting those environment var names (with colons or whatever) and folks would get confused that they are being renamed. But don't immediately see a way around it.
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.