socialengine / rancher-cron Goto Github PK
View Code? Open in Web Editor NEWA service that can start containers on a defined schedule.
License: MIT License
A service that can start containers on a defined schedule.
License: MIT License
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?
any chance to remove containers instead of stopping them? ( data reset )
Wikipedia addresses cron syntax as having 5 columns, but the examples in this case have 6 columns. Can you elaborate on what these columns are?
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.
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...
Is it possible to use scratch instead of alpine? Should shrink the image a bit
hi, could you do an "official" docker release with the #16 patch?
thx
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.
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"
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
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.
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.
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?
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.
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
Restart cron service.
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.
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?
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,
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,
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.