Course menuMLA-C02

Exams / MLA-C02 / Study guide / SageMaker Pipelines and CI/CD

SageMaker Pipelines and CI/CD: MLA-C02 study notes and practice questions

What to know about SageMaker Pipelines and CI/CD for the MLA-C02 exam, from the Deployment and Orchestration of ML and AI Workflows domain (24% of the exam guide), then 2 free questions to test it. Part of the MLA-C02 study guide.

Last verified against current AWS documentation ·How we write our questions

What to know for the exam

MLOps questions ask how to automate retraining and promotion with approvals and no manual steps.

SageMaker Pipelines

A pipeline is a directed graph of steps defined in the Python SDK (or the visual designer):

Step Does
Processing Data prep, feature engineering, evaluation scripts
Training / Tuning Train or tune the model
Condition Branch on a value, such as “AUC at least 0.85”
Model / RegisterModel Create a model or register a version in the Model Registry
Transform Batch transform
Lambda / Callback Call other services or wait for external work
Fail Stop with a clear message
Clarify check / Quality check Bias and data or model quality baselines
@step decorator Turn Python functions into steps
  • Parameters make one pipeline reusable across datasets and environments.
  • Step caching skips steps whose inputs haven’t changed.
  • Every run’s lineage is recorded.

Gate before production

A typical pattern: train → evaluate → condition step → register as PendingManualApproval → a person or rule approves → deployment pipeline deploys the approved version.

Triggers

  • EventBridge starts a pipeline on a schedule or on events, such as new data landing or a CloudWatch alarm from Model Monitor drift.
  • Approval status changes in the Model Registry emit events that can start deployment.

CI/CD

  • SageMaker Projects provide templates that wire source control, CodePipeline, CodeBuild and pipelines.
  • Infrastructure as code with CloudFormation or CDK.
  • Promote across dev, staging and prod accounts.
  • MWAA or Step Functions can orchestrate broader workflows.

Common traps

  • Registering every model and checking metrics later. Gate with a condition step.
  • Cron on an EC2 instance to start retraining. Use EventBridge.
  • Hiding the approval inside training code, with no audit trail.

Try the 2 practice questions

A dental chain retrains its patient no-show model each week. The team wants a SageMaker Pipelines workflow that trains the model, evaluates it on a holdout set, and registers the model only when its AUC is at or above the value the production model achieved.

A model that fails the check must not be registered at all, and a model that passes must be registered as pending manual approval so that a reviewer signs it off before production.

Which pipeline design meets these requirements?

Choose one answer.

  1. A. Train and evaluate the model, use a condition step to compare its AUC with the threshold, and on success register the version as PendingManualApproval.
  2. B. Train, evaluate and register the model in a single script step, and have the script exit with an error code when the AUC is too low.
  3. C. Register every trained model, and add a separate approval step that deletes the models whose AUC is too low after registration.
  4. D. Trigger the pipeline and then have an engineer check the AUC by hand before deciding whether to register the model.
Show the answer and explanation

Answer: A

  • A. Right: Correct. A condition step routes the pipeline run on the evaluation metric, so the model step that registers the version runs only when the check passes. Registering it with PendingManualApproval keeps a reviewer in the loop before production. Learn more: Add a step to a pipeline (opens in a new tab)
  • B. Wrong: A script step that fails stops the pipeline, but the check is hidden inside custom code rather than a pipeline control flow step. The stem asks for a pipeline design that gates registration explicitly.
  • C. Wrong: Registering weak models first puts them in the registry, which the stem forbids. Deleting them afterward is cleanup, not a gate.
  • D. Wrong: A manual check does not automate the gate the team wants, and the stem asks for registration to depend on the metric. The option relies on people to apply the rule.

Explanation

A condition step in SageMaker Pipelines compares the evaluation metric with the threshold, and only a passing run reaches the step that registers the model version as pending manual approval. Registering first, hiding the gate in a script or relying on a manual check does not enforce the rule in the pipeline.

Study

Question 2

Medium · choose 2 ·Link to this question (question 2)

A solar installer retrains its production-output forecasting model every quarter, and it also needs to retrain when production data drifts. Its SageMaker Pipelines workflow already runs training, evaluation and registration, and its existing Model Monitor schedules publish drift metrics to Amazon CloudWatch.

The team wants retraining to start automatically from two sources: a quarterly schedule and detected drift. No one should start the pipeline by hand, and the triggers must stay in managed AWS services.

Which TWO configurations meet these requirements? (Choose two.)

Choose two answers.

  1. A. Create an Amazon EventBridge rule with a quarterly schedule expression that starts the SageMaker AI pipeline as its target.
  2. B. Create a CloudWatch alarm on the drift metric that the monitoring schedule publishes, and an EventBridge rule on the alarm's state change that starts the pipeline.
  3. C. Run a loop on an Amazon EC2 instance that polls the S3 monitoring output every second and starts the pipeline when it finds a new file.
  4. D. Have the inference code start a pipeline execution with every prediction, so that the model is retrained continuously.
  5. E. Require a data scientist to start the pipeline from the Studio console after reviewing each monitoring report.
Show the answer and explanation

Answers: A, B

  • A. Right: Correct. SageMaker Pipelines is a supported EventBridge target, so a scheduled rule can call StartPipelineExecution each quarter with no manual step. The rule needs a role that allows it to start the pipeline. Learn more: Schedule pipeline runs (opens in a new tab)
  • B. Right: Correct. The monitoring jobs emit drift metrics to CloudWatch, an alarm turns a threshold breach into a state change event, and an EventBridge rule on that event starts the pipeline. Retraining follows drift without any polling code. Learn more: Model Monitor CloudWatch metrics (opens in a new tab)
  • C. Wrong: Polling every second on a server adds cost and an operated component the stem does not want. Events from EventBridge are the managed trigger for this.
  • D. Wrong: Starting a pipeline per prediction would retrain far more often than the team needs and would be very costly. The stem asks for scheduled and drift-based triggers.
  • E. Wrong: Manual starts are excluded by the stem, because the team wants retraining to start automatically. A person running the pipeline by hand is also slower and easier to forget than a managed trigger.

Explanation

EventBridge can start a SageMaker AI pipeline on a schedule and in response to events, such as a CloudWatch alarm on the drift metrics the monitoring schedules publish. That covers both triggers without manual steps or polling. Polling loops, per-prediction retraining and manual starts each break a stated requirement.

Study

Want more on SageMaker Pipelines and CI/CD? The 5 full-length practice sets have 9 more SageMaker Pipelines and CI/CD questions, 325 in all, none of them in the free exam. One payment of $14.99, no subscription. See the practice sets

Study SageMaker Pipelines and CI/CD

More Deployment and Orchestration of ML and AI Workflows topics