Giter Club home page Giter Club logo

jobber-cron's People

Contributors

andskli avatar blacklabelops-legacy avatar dshearer avatar jukie avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

jobber-cron's Issues

So we still need to include tini?

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.

Clarification on "clobbering"

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?

Best way to add an apt-get dependency?

Hi I'm trying to execute php in another container. Which route would you recommend:-

  1. Install docker into jobber-cron, and volume map the .sock then run docker exec..
  2. Map jobber-cron to /usr/bin then run /host/usr/bin/docker ..?
  3. Fork your repo and build my own image
  4. Ask you to allow a new env var to specify needed apt-get packages eg APTGET=docker
  5. Or any other way?

Many thanks

Docker Version

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+

Problem Env Variable Containing ":"

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.

Health Checks

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.

jobberd: command not found

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...

Error and then container restarts

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.

Jobber cron stopped working

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

Base jobber image doesn't build without adding rsync

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'

Time Interval Randomized Seed

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

support notifyProgram

Hi, it would be useful to setup notifyProgram via ENV variables

using the default sendmail is particularly useless with docker

Time Question

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?

Environment variable name with non-alphanumeric character causes shell error

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.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.