As you may have noticed in the last module, occasionally, your batch job might fail. In this module, we take advantage of the Automated job retry feature of AWS Batch to make our batch job more resilient
-
Create a new job by clicking on Submit job in the AWS Batch console under the Jobs tab
-
For Job run-time:
- Job name: use
job-with-retry
- Job definition: pick the definition you created in last module (e.g. "-monte-carlo-job")
- Job queue: the job queue you created in last module (e.g. "-queue")
- Job name: use
-
For environment
- Pick
Array
job type again - For Array size, use
4
this time to add more load
- Pick
-
To use automated retries, all you need to do is specify number of retres in the Job attempts field.
- Use
3
for Job attempts - To change things up a bit, use a different stock ticker, e.g.
AAPL
for this simulation run - Up the number of iterations per run to
4000
- Use
-
Click Submit job
-
Watch the jobs transition between job states
-
Look at the job details, you may notice your jobs get multiple retries if it encountered the download failure!
You have successfully built an batch job in a Docker container that can elastically scale to your needs and automatically retries upon failures!
There are a lot more things you can do, and head to the extra credit section for some ideas!
Or if you are done, go to clean up section to clean up the environment.