-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Cloud Jobs Guidance #153
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
I agree a guide would be handy. We've been leaning towards telling developers to build node scripts for this and trigger them with a cron scheduler... but yeah, an example would be great. |
My Cloud code (main.js) contains a Job function: This caused failure of deployment of my app on Heroku. So I had to remove the Job from the main.js so that deployment was successful. |
Going to close this for lack of activity. Guidance for cloud jobs will likely vary based on the deployment platform of choice (i.e. the Scheduler addon for heroku, or some cron script for a VPS). |
Hi, I'm setting up a tutorial on Kue + Heroku. In order to finish it, I need help on this issue #1078. Thanks and I hope you'll like it ^^! |
I use the following for simple jobs:
Where |
Does anyone know if there are any news on any tutorials for this. I keep hitting rode blocks trying to set this up. |
I have to kick this as well, I have seen some info on jobs but no wiki or docs on the best way or best practices for this.. |
Parse.Cloud.Job is exposed. Every job will be exposed through: Job status is recorded in the _JobStatus whenever the jobs starts, ends, error etc... as the old jobs would do. Jobs are not scheduled, you should handle scheduling calling the job HTTP endpoint yourself (with the masterKey). You should be able to run the jobs from the parse-dashboard to test your endpoints and see the status of your jobs. |
@flovilmart thanks for your reply, is their some sort of priority we can define for jobs and whats the expected time out that a job might see. I can early have another server do the scheduling via cron and using CURL to run the job. How would be pull _JobStatus back to see the progress, completion etc? |
There is no priority as there is no schedule, the Job is just the same thing a a cloud function, the only difference is that it's status can be updated for success, error and messages. You can read the job status in the dashboard or make a query on it "_JobStatus". |
So how should we do this if we want the job(s) to be scheduled? (Open to anyone's answer) I am using google app engine, and I understand there is some sort of scheduler but it is not cron-based. Would that work? |
You can use app engine |
I should of asked, but do jobs time out after x minutes? |
This was pretty difficult for me to figure out so I am just going to post a full url example here in hopes it saves someone else time. Basically I used Postman to Post to a url like |
@gateway they don't |
FYI, I've successfully used a web cron service as an external scheduler so that I didn't have to maintain an additional bit of infrastructure. P.S. - I have no affiliation w/ this service. It's just the one I happened to use and it worked for me. |
@flovilmart - for AWS worker tier, cron.yaml is to be formatted as: version: 1
Where would I include the parse app id and masterkey? Would it look like below? url: "/backup" Any guidance would be greatly appreciated! |
On Google cloud, I'm using something similar with app engine CRON. I have deployed a very simple JavaScript web app that listen on /job/:jobName and forwards the HTTP call to parse server. This way, I use app engine cron for scheduling as I can't pass the headers either. You should probably look for something similar on AWS. |
@flovilmart - just checking, when you are forwarding the HTTP call to parse server, are you passing along the app_id/master_key values in headers by using something like headers option for require('request')? If so, how secure is it to send the request with keys in the headers? I would assume I wouldn't hardcode the key values in the headers options but use env var, but since the values are being sent in the post request I was wondering if it is recommended to protect the values, i.e. encryption, etc. |
I make HTTPS requests from the 'worker' so yes I pass my masterKey in the header. |
@devKC AWS worker tier? huh? you got a link to what you are talking about? What I've been doing for scheduled jobs is to set an event in AWS Cloud Watch which invokes a lambda that then sends the request. Its problematic in a few ways: 1. its way too complicated, every time i have to touch it, i need to re-wrap my head around it. 2. it doesn't guarantee that the event will only fire once, so I have to code around that, so if there is some AWS worker tier thing...I need to read up on it.... |
If anyone is using Parse Server and Heroku, I just used Heroku Scheduler to schedule jobs. It bypasses the need to create a Cloud Job. It's very quick and easy. Here's a tutorial. |
We implemented a job runner, https://github.com/ampme/Parse-server-job-runner , it just needs to run periodically and will work with the jobSchedule objects (re-introduced in 2.5.0 and next dashboard release) |
@flovilmart How will it be possible to use it with Cron ? |
You should ask on the parse-server-job-runner repository |
🎉 This change has been released in version 5.0.0-alpha.2 |
🎉 This change has been released in version 5.0.0-beta.1 |
🎉 This change has been released in version 4.10.5 |
The label |
🎉 This change has been released in version 5.0.0 |
Hello, from what I understand, cloud jobs are not working in parse-server. It states the following in the migration docs:
I am wondering if a tutorial could be made showing how to modify already-made cloud jobs to run using kue. Either that or it would be really nice if somebody could implement this functionality.
The text was updated successfully, but these errors were encountered: