Code Monkey home page Code Monkey logo

rancher-cron's People

Contributors

jmloeffler avatar mschroeder223 avatar smazurov 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  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  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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rancher-cron's Issues

Queries all services not just it's own stack

We deployed the same stack several times rancher-cron in each of them.

The problem now is that rancher-cron uses getServices() so it seems to register cron entries multiple times (over all stacks, not just for it's own).

Schouldn't it just care about it's own stack?

Support Self-Signed SSL

If you use self-signed SSL to use rancher throught SSL, you get certification authority error when rancher-cron try to reach metadata.
It should add ca.crt from /var/lib/rancher/etc/ssl/ca.crt same used by rancher agent itself.

Also include schedules for "Standalone Containers"

Great project!
For one of our services, I added a container manually with the appropriate schedule config label, but was surprised to see it did not get picked up.
I'm assuming this is because rancher-cron queries for services and containers in those services, causing the Standalone Containers to not get listed, but I haven't dug in too much so I may be mistaken...

Scratch image

Is it possible to use scratch instead of alpine? Should shrink the image a bit

Write stdout logs when starting service

Currently there are logs for adding/removing containers to cron. Would be useful to see whenever a container is started (based on its own cron times) in the logs too.

Disable cron for "Stopped" services

While debugging (or calming backend services) I sometimes need to temporarily disable a cron-ed service.

I tried setting the service to "Stopped" but rancher-cron runs the service anyway. My current workaround is to "upgrade" services and change the rancher-cron label to something like 'off....' to preserve the crontab entry format but disable.

It would be ideal if rancher-cron could poll the api and not start cron services if they are "Stopped"

Getting a error about container is in running state

I've started crontab service and my container which should be executed every 10 minutes,
It appeared as "Started-once", but then changed a state to just "Active". Since that I'm getting a error in the crontab service:


11/10/2016 1:28:30 PMtime="2016-11-10T10:28:30Z" level=error msg="Could not find any containers with label com.socialengine.rancher-cron.schedule"
11/10/2016 1:29:00 PMtime="2016-11-10T10:29:00Z" level=info msg="adding container to cron" containerName="old_cron-update-api-rates_1" containerUUID=9b7a4b72-eec1-4126-8d42-77d505e168d3 schedule="@every 1m"
11/10/2016 1:30:02 PMtime="2016-11-10T10:30:02Z" level=error msg="Failed to start container: container is not stopped. Currently in [starting] state" containerId=1i2963 containerUuid=9b7a4b72-eec1-4126-8d42-77d505e168d3
11/10/2016 1:31:01 PMtime="2016-11-10T10:31:01Z" level=error msg="Failed to start container: container is not stopped. Currently in [running] state" containerId=1i2963 containerUuid=9b7a4b72-eec1-4126-8d42-77d505e168d3

How does rancher-cron handle services with scale > 1?

I have several cron type jobs that run using rancher-cron. I recently updated the jobs to allow parallelization since single run times were creeping up. After I bumped up the scale (to 4) it seems rancher cron only starts one instance each interval. I see the following in the README:

"You should not have Auto Restart turned on and have scale of 1 for services you wish to run as a cron container."

Is there any reason that scale must be set to 1? Is there any easy way to start such as task with scale > 1?

A naive implementation that starts all containers for the service would suffice. Though if there is concern with backward-compatibility (though not certain if this would be an issue since the docs explicitly stated to use scale = 1 before now) a label like "com.socialengine.rancher-cron.atscale":"true" would also handle the use case.

com.socialengine.rancher-cron.schedule @after Service1

I don't know if it's possible, but I really need this option.

More specific I just want to run one container after another one has finished.

P.S. It should be a bit hard cuz: Note: The interval does not take the job runtime into account.

Predefined schedules issue

I'll try to use predefined expression like:
com.socialengine.rancher-cron.schedule: '@monthly'
But get error:
04.08.2016 20:04:002016/08/04 17:04:00 Unrecognized descriptor: @monthly
What am I doing wrong?

Updating schedule on a container does not change it in the service

Description

When you change schedule on your cron container, instead of assigning it for the first time, it gets picked up, but because uuid does not change (i thought it would!), it does not update the schedule at which it runs in the cron service.

Steps to reproduce

  1. Assuming cron is running (in debug mode) and has registered a scheduled container
  2. Go to service with scheduled container and change the schedule to be more or less frequent
  3. See that new schedule is displayed, but not reflected in the schedule that actually runs

What should happen

Cron service should pick up new schedule, check to see if its the same as old, if not, mark the current cron job as "stale" and add a new one for new schedule

Workaround

Restart cron service.

Have option for RESTARTING a service instead of Starting it (if running)

I would like this, as it would solve many use cases. In my case, I want to restart a Nginx container that uses let's encrypt updated SSL files. For my use case, I can't use the rancher load balancer to do SSL termination. So restarting the container every day at say midnight would be good enough as certs are updated before they expire, and the restart would cause the certs to be reloaded.

Container is in running state

I have added a cron-job every 20m for a specific container, with the settings to start ones.

I have the following error:

Failed to start container: container is not stopped. Currently in [running] state..

I have checked the container and it is not running, any hints?

Metadata access

Hello,
For another project , I am trying to access metadata of all containers to check if a label is present, could you point me to which part of the code I should look ?
Regards,

configurable timezone

This is more of a feature request rather than issue.
Could you please consider expose a env variable or label so that the timezone can be passed in?
Thanks,

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.