Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to submit aws batch job periodically

We are looking for aws batch job and we want to submit this batch job on a certain predefined interval. For e.g.: we want to auto submit this job every 4 hours.

What could be a preferred way to achieve it.

like image 893
Rahul Garg Avatar asked Nov 16 '17 13:11

Rahul Garg


People also ask

How do I create a batch job in AWS?

On the right side of the screen add a target of batch job, fill in the queue, job name, job definition, etc. We use this for all of our batch jobs, works very well. Indeed you can! Give this doc a read through: aws.amazon.com/premiumsupport/knowledge-center/…

What is AWS Batch in AWS?

AWS Batch is one of the most popular services of AWS that allows you to create and run pipeline jobs periodically or on-demand. With its user-friendly and interactive user interface, AWS Batch enables you to seamlessly build, configure, and launch pipeline jobs.

What happens if you don’t submit a job in AWS Batch?

When you don’t submit any other job, AWS Batch will terminate the instance it created. You now have the basics to kick off a job in AWS Batch. Once you’ve finished this guide, it’s up to you which scripts or code you’ll put in a container. AWS Batch will manage all the infrastructure, scheduling, and retries for you.

How do I create a queue in AWS Batch?

Click the “Create” blue button and wait a bit while the environment is created. Now you need a queue where you’ll send the jobs to get executed. This queue will be attached to a compute environment so the AWS Batch service will create the resources needed based on the load of the queue.


1 Answers

You can use Cloudwatch to schedule Batch jobs. In the Cloudwatch console:

  1. Click on Rules
  2. Click on the blue "Create rule" button
  3. Click the "Schedule" radio button
  4. Change the fixed rate to 4 hours, or you can use a cron expression
  5. On the right side of the screen add a target of batch job, fill in the queue, job name, job definition, etc.

We use this for all of our batch jobs, works very well.

like image 108
doug Avatar answered Oct 17 '22 15:10

doug