News for hackers. Stuff that matters.

Ask HN: Job Scheduling as a service

Is there any product that will allow us to schedule via an api , and then if the time is triggered then it should call the destination via webhook(with payload preferably ) Right now we are using quartz scheduler which has more configuration (Including Mysql Connection ) .

Cons are 1) Does not have an admin UI 2) No reporting or history of jobs

Thanks

( 40 comments | 23 points | on HN )
Re:Ask HN: Job Scheduling as a service by scarface74 on Monday November 20, 2017 @07:33AM (#15739445)
Nomad by Hashicorp. You have to do just a little legwork to get it to call an API - just schedule a job that calls the appropriate curl command. When I'm explaining it to people, I explain it is a "distributed cron". You schedule a job either using the command line or via an API to the Nomad server and then it runs the job on any box that has the Nomad agent running and registered to the server. If you combine Nomad with Consul, configuration is dead simple.

https://www.nomadproject.io

Re:Ask HN: Job Scheduling as a service by bpicolo on Monday November 20, 2017 @10:42AM (#15740662)
Nomad is probably a bit overkill for cron. It's a whole k8s alternative isn't it?
Re:Ask HN: Job Scheduling as a service by scarface74 on Monday November 20, 2017 @10:59AM (#15740820)
It can be. But if you just need a distributed cron, you can just use the raw_exec or exec driver type and run a shell command.
Re:Ask HN: Job Scheduling as a service by stephenr on Monday November 20, 2017 @04:52AM (#15738851)
You want cron, as a service?

Shit on a stick doesn't anyone actually host anything themselves anymore?

Re:Ask HN: Job Scheduling as a service by mani-smhack on Monday November 20, 2017 @06:36AM (#15739217)
I need a scheduler where i can dynamically ( via api ) schedule a job , with the admin UI to manage the jobs .

I Think these are not part of application development and it can be offloaded to hosted services .

Re:Ask HN: Job Scheduling as a service by bpicolo on Monday November 20, 2017 @10:39AM (#15740639)
There are a lot of frameworks for this in various languages, depends on what you're doing - like sidekiq in ruby and hangfire in dotnet

https://github.com/mperham/sidekiq https://www.hangfire.io/

Re:Ask HN: Job Scheduling as a service by caraga on Monday November 20, 2017 @06:38AM (#15739228)
Jenkins has scheduled jobs and an UI. It can also be accessed via API. https://jenkins.io/
Re:Ask HN: Job Scheduling as a service by mani-smhack on Monday November 20, 2017 @06:42AM (#15739240)
This is not with respect to devops or build .

My app has schedule functionality for example a scheduled report , so if it where like a webhook call then i dont want to waste the cpu cycle ,now i am using quartz scheduler in my java app .

Re:Ask HN: Job Scheduling as a service by aprdm on Monday November 20, 2017 @10:46AM (#15740693)
Jenkins isn't just for devops or build.
Re:Ask HN: Job Scheduling as a service by dozzie on Monday November 20, 2017 @06:16AM (#15739163)
We do, but it's not sexy, because it just gets the job done and you can't really brag about not having bugs or troubles.
Re:Ask HN: Job Scheduling as a service by ddorian43 on Monday November 20, 2017 @06:39AM (#15739232)
But cron isn't highly available/distributed with consistent state/scheduling
Re:Ask HN: Job Scheduling as a service by stephenr on Monday November 20, 2017 @06:50AM (#15739271)
Run cron on all your boxes, have them pull a job at a time from the database. Or shit, go full tilt with a clustered Redis job queue.

All of these are better options than "embed the entire job info in a URL and hand it off to a remote scheduling service".

Re:Ask HN: Job Scheduling as a service by scarface74 on Monday November 20, 2017 @07:35AM (#15739451)
Re:Ask HN: Job Scheduling as a service by stephenr on Monday November 20, 2017 @07:52AM (#15739527)
The user doesn't need a queue though. They just need a process to find posts with a publish date of <= now that aren't published and publish them. That's a one line indempotent sql update statement in any decently architected application.
Re:Ask HN: Job Scheduling as a service by scarface74 on Monday November 20, 2017 @08:24AM (#15739688)
This was the other part of the comment I replied to:

Run cron on all your boxes, have them pull a job at a time from the database. Or shit, go full tilt with a clustered Redis job queue.

You're solving for the example but the original poster noted multiple jobs.

Re:Ask HN: Job Scheduling as a service by stevekemp on Monday November 20, 2017 @05:36AM (#15739011)
There are a few online tools, such as:

https://www.easycron.com/

https://www.setcronjob.com/

etc. You might be as well writing your own though, since it shouldn't be a difficult task.

Re:Ask HN: Job Scheduling as a service by scarface74 on Monday November 20, 2017 @07:45AM (#15739499)
I couldn't agree more, I am a Dev lead with a mandate to "outsource everything possible" When it comes to infrastructure type stuff, but even he would look at me crazy for outsourcing job scheduling.
Re:Ask HN: Job Scheduling as a service by egamirorrim on Monday November 20, 2017 @03:42PM (#15743066)
Even if you want clustered level resilience? Loads of places i've worked end up running a scheduler on 'just one server' - that ain't redundant brother!
Re:Ask HN: Job Scheduling as a service by egamirorrim on Monday November 20, 2017 @03:41PM (#15743057)
I'm surprised no one's mentioned Chronos - it takes a butt load of setup because it runs on top of Mesos (which requires Zookeeper) etc - but if you already have these tools in your stack it's a pretty tidy clustered scheduler: https://medium.com/airbnb-engineering/chronos-a-replacement-...

Edit: if you haven't got this stack around though i'd second calls to use a build tool like Jenkins or Rundeck - of course you probably don't want this on the same Jenkins that builds your jobs... so you'd have to set all that up

Re:Ask HN: Job Scheduling as a service by sahilagg06 on Monday November 20, 2017 @01:39PM (#15742051)
Re:Ask HN: Job Scheduling as a service by cdoxsey on Monday November 20, 2017 @06:08AM (#15739133)
Google app engine has a cron service:

https://cloud.google.com/appengine/docs/standard/python/conf...

You'll have to create an app handler for the URL which can then make the outbound http request. It's inexpensive, reliable and has an admin interface and logs.

Re:Ask HN: Job Scheduling as a service by mani-smhack on Monday November 20, 2017 @06:34AM (#15739212)
Yeah this works for cron jobs . Let me explain my requirement , say i have social media platform and users will schedule their post , and i need to schedule it in my scheduler and i have to persist in the databsae too . Because if the server is restarted all my scheduled jobs will be gone ..

So i am looking for a hosted scheduler where i can send a rest API request with a webhook and a small payload . During the execution time the hosted scheduler will call the webhook with the payload , so that i will publish the post .

Pros is that i dont want to worry about the scheduled jobs .Right now i am unable to find a scheduler with the good admin UI ( to pause all the jobs ) to delete the trial users post .

Re:Ask HN: Job Scheduling as a service by stephenr on Monday November 20, 2017 @06:46AM (#15739259)
This sounds like a terrible way to achieve your goal.

Save the future posts to the database with the required publish date/time.

Run cron every $X minutes where $X is the smallest interval you allow (ie if you force publish date to be rounded to 5 minutes, run cron every 5 minutes) and check for "future posts" where the publish date <= now(), and take action.

This is pretty basic stuff and that you want to offload it to a 3rd party by capturing all the details into a request to be made back to your app is a huge red flag IMO.

Re:Ask HN: Job Scheduling as a service by scarface74 on Monday November 20, 2017 @09:09AM (#15739927)
He's posting an example. He mentioned multiple jobs.
Re:Ask HN: Job Scheduling as a service by scarface74 on Monday November 20, 2017 @07:40AM (#15739476)
Because if the server is restarted all my scheduled jobs will be gone ..

I went into more details about Hashicorp's Nomad in another post, but I didn't mention that you can run a cluster of Nomad servers for high availability.

Nomad is open source - I don't have a dog in the fight - I'm just a happy user.

Re:Ask HN: Job Scheduling as a service by BerislavLopac on Monday November 20, 2017 @09:30AM (#15740057)
Apache Airflow? It's not SaaS but is easily self-hosted, and I'm aware of a few initiatives to make it into a service.
Re:Ask HN: Job Scheduling as a service by skibz on Monday November 20, 2017 @05:33AM (#15739001)
Operated by my coworker: https://crontron.com
Re:Ask HN: Job Scheduling as a service by aaronhoffman on Monday November 20, 2017 @09:19AM (#15739994)
Something like Azure Storage Queues and Functions may be what you're looking for

https://aaron-hoffman.blogspot.com/2017/01/replace-azure-sch...

Re:Ask HN: Job Scheduling as a service by macca321 on Monday November 20, 2017 @11:05AM (#15740877)
Re:Ask HN: Job Scheduling as a service by Daviey on Monday November 20, 2017 @07:55AM (#15739544)
I agree that Nomad is a GREAT solution for this... but another thing to look at is Rundeck http://rundeck.org/
Re:Ask HN: Job Scheduling as a service by guilhas on Monday November 20, 2017 @09:58AM (#15740266)
I would use Jenkins, although marketed as CI tool, can do what you asked. And has a lot of customization.

https://jenkins.io/

Re:Ask HN: Job Scheduling as a service by ako on Monday November 20, 2017 @02:52PM (#15742665)
Redwood software RunMyJob: https://www.redwood.com/runmyjobs/
Re:Ask HN: Job Scheduling as a service by mani-smhack on Monday November 20, 2017 @11:48AM (#15741233)
Basically what i am looking is a quartz scheduler alternative with monitoring and admin UI(preferrably hosted)

More like sendgrid.com for scheduling

Re:Ask HN: Job Scheduling as a service by _Marak_ on Monday November 20, 2017 @11:35AM (#15741131)
I think hook.io can do this.

see: http://hook.io/cron

Re:Ask HN: Job Scheduling as a service by z0mbie42 on Monday November 20, 2017 @09:54AM (#15740228)
with a friend we did : https://www.jobscheduler.xyz/ it's an MVP but it works well for our projects (chatbot, emailing service...)
Re:Ask HN: Job Scheduling as a service by assafmo on Monday November 20, 2017 @04:00PM (#15743241)
webhook.io works great for me. they also have a great free plan
Re:Ask HN: Job Scheduling as a service by jnbiche on Monday November 20, 2017 @06:14PM (#15744233)
webhook.io is now defunct. They either shut it already down or will soon shut it down.

I think webtask.io is somewhat similar.

Also, iron.io lets you schedule functions using docker, has full API.

AWS Lambda also lets you schedule Lambda and has full API.

Re:Ask HN: Job Scheduling as a service by assafmo on Monday November 20, 2017 @08:15PM (#15744805)
sorry i meant webtask.io!
Re:Ask HN: Job Scheduling as a service by aprdm on Monday November 20, 2017 @10:45AM (#15740682)
You can use Jenkins.
Re:Ask HN: Job Scheduling as a service by podhy on Monday November 20, 2017 @07:24AM (#15739415)
Rundeck