MLS-C01 Question 52
Single answerYou are a Machine Learning Engineer responsible for running a nightly batch inference job in AWS to generate predictions for a large dataset. The job must execute daily at midnight and automatically handle job retries in case of failure. Which service or approach should you use to efficiently schedule and manage the job?
- A
Use Amazon EventBridge to create a rule that triggers an AWS Lambda function to run the inference job.
- B
Use Amazon SageMaker Processing Jobs with a cron expression to schedule the job.
- C
Use AWS Step Functions with an Amazon S3 trigger to start the job when the input data is ready.
- D
Use AWS Batch with a scheduled job definition configured with a cron expression.
Show answer and explanation
Correct answer: A
Explanation
Amazon EventBridge is the most efficient solution for scheduling jobs that need to run at specific times, such as a nightly batch inference job. It allows you to define cron expressions for precise scheduling and can trigger AWS Lambda functions or other services to execute the job. Other options like SageMaker Processing or AWS Batch are not ideal for this use case due to their lack of native scheduling capabilities or higher complexity.
- A. Correct.
Correct. Amazon EventBridge (formerly CloudWatch Events) allows you to create scheduled rules with cron expressions. You can use it to trigger AWS Lambda functions or other AWS services at specific times, such as midnight, making it suitable for running the nightly batch inference job.
- B. Incorrect.
Incorrect. While SageMaker Processing Jobs are useful for running processing tasks, they do not natively support scheduling. You would need to use a scheduling service like EventBridge to trigger SageMaker Processing Jobs.
- C. Incorrect.
Incorrect. AWS Step Functions can orchestrate workflows, but they are not designed for direct time-based scheduling. Additionally, an S3 trigger is event-driven and would not guarantee the job runs at midnight daily.
- D. Incorrect.
Incorrect. While AWS Batch supports scheduling with job queues, it is primarily suited for high-performance computing or large-scale batch workloads rather than simple nightly inference jobs. EventBridge is a simpler and more cost-effective solution in this scenario.