I'm currently in the process of migrating a Django website from my own hosted server running Ubuntu to AWS Elastic Beanstalk.
I've found the process somewhat straight-forward so far - until trying to set up a few scheduled jobs for my app. From what I can gather, I want to run a cron job on a worker tier environment using a cron.yaml
file. I've read through the docs:
http://docs.aws.amazon.com/elasticbeanstalk/latest/dg/using-features-managing-env-tiers.html#worker-periodictasks
And read the blog post: https://medium.com/@joelennon/running-cron-jobs-on-amazon-web-services-aws-elastic-beanstalk-a41d91d1c571#.mx7dq9ufo
And various StackOverflow posts, but I feel like I'm still missing some fundamental concepts about what actually makes up my worker tier environment. On my own server I could simply set up a cron job to fit this need - so this concept is rather new to me. I also have a few Django apps running on Heroku that use web and worker dynos, async processing, Redis and Celery and scheduled jobs, but I can't work out how to translate this into the Elastic Beanstalk world.
Basically, the concepts I want to understand are:
I essentially want to schedule some Django management commands. I've exposed methods as POST endpoints as well but can't figure out how to get the worker environment to talk to / execute jobs on the web app.
Excuse my naivety, I would really appreciate any sort of advice and direction on how this concept all comes together.
So I ended up talking to a friend who's more familiar with the AWS services. He explained the concepts, and I got the scheduled jobs running by setting up the worker environment as follows:
cron.yaml
file direct toEt voila, the scheduled jobs executed on schedule and make the database changes as required.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With