Domain 3 of 4 · Chapter 3 of 3

Automate orchestration and delivery for ML and AI workloads

Unlock the complete study guide.

Bundled into the existing AWS Certified Machine Learning Engineer - Associate premium course — no separate purchase.

14-day money-back guarantee — no questions asked.

Included in this chapter:

  • The ML release path: two pipelines and a registry
  • The release pipeline: stages and actions
  • Connecting source repositories to the pipeline
  • SageMaker Pipelines: the model-building pipeline
  • Starting retraining: events and schedules
  • Batch transform jobs: how input is distributed
  • Model versions for repeatability and audit
  • Versioning prompts, flows and agents
  • Promoting a fine-tuned model on Provisioned Throughput
  • Automated tests and evaluations as release gates
  • Live validation: shadow tests and production variants
  • Deployment guardrails for SageMaker AI endpoints
  • CodeDeploy: deploying the application around the model
  • Knowledge base refresh cycles

Validating and rolling out a SageMaker AI endpoint change

CriterionShadow testProduction variantsBlue/green: all at onceBlue/green: canaryBlue/green: linearRolling deployment
Who receives candidate responsesNo caller; only production responses are returnedCallers routed to the candidate by its weightAll callers, after one shiftA small canary slice first, then all callersA growing share in equal stepsA growing share, batch by batch
How traffic movesA copy of each request goes to the shadow variantYou set variant weights; TargetVariant overrides them per requestAll traffic in one step, then a baking periodTwo shifts, each followed by a baking periodSeveral equally spaced steps, each bakedBatches of 5 to 50 percent of fleet capacity
Extra capacity during the changeThe shadow variant's instancesEach variant's own instancesA full new fleet while bakingA full new fleet for the whole updateA full new fleet for the whole updateAbout one batch
Automatic rollbackNot applicable: callers never receive shadow responsesManual: change the weights with UpdateEndpointWeightsAndCapacitiesYes, when a CloudWatch alarm tripsYes, when a CloudWatch alarm tripsYes, when a CloudWatch alarm tripsYes, in batches or all traffic at once
Fits whenA model, container or instance change must be tested with no user impactCandidates must be compared side by side on live trafficA simple cutover with a safety window is enoughThe blast radius must stay within a small sliceRisk must be spread across many equal stepsThe model or fleet is large, or accelerated instances are scarce

Decision tree

Callers may receivecandidate responses?Shadow testcopy of live requestsCompare candidates sideby side on live traffic?Production variantsweighted A/B splitSpare capacity fora full second fleet?Rolling deploymentbatches, 5 to 50 percentHow should exposure grow?Blue/green: canarysmall slice, then the restBlue/green: linearequally spaced stepsBlue/green: all at onceone shift, then bakeEvery guardrail mode: automatic rollback needs CloudWatch alarms watched during baking periodsNoYesYesNoNoYesone small slicemany equal stepsone step

Cheat sheet

  • Shadow testing evaluates live requests without returning candidate responses to users
  • Production variant weights control the traffic used for live model comparisons
  • Explicit variant targeting overrides weighted request distribution
  • Blue/green deployment retains the old fleet while the new fleet is validated
  • Canary and linear deployments differ in how they increase traffic exposure
  • Deployment alarms connect validation failures to automatic rollback
  • Rolling deployment updates serving capacity in configurable batches
  • SageMaker AI deployment guardrails apply only to supported endpoint configurations
  • A manual approval action pauses a release until an authorized decision is recorded
  • CodePipeline coordinates release stages while actions perform their own work
  • A CodeBuild buildspec defines both execution commands and build outputs
  • CodeBuild can obtain sensitive values from managed secret stores
  • A repository connection must complete provider authorization before it can trigger releases
  • A full-clone source reference is intended for downstream CodeBuild actions
  • Git source control and S3 object versioning serve different collaboration needs
  • CodeDeploy handles application platforms rather than SageMaker AI endpoint updates
  • A CodeDeploy AppSpec identifies deployment resources and lifecycle validation hooks
  • Unit tests and integration tests catch different defects in an ML release
  • SageMaker AI pipeline steps separate processing, training, and batch inference
  • A condition step turns evaluation results into a pipeline decision
  • EventBridge can start a model-building pipeline when relevant data changes
  • Scheduled retraining uses a separate trigger that must be managed with the pipeline
  • Pipeline step caching reuses successful matching work within a configured window
  • Callback steps wait for external work to report completion
  • Batch transform distributes S3 objects rather than splitting one object across instances
  • Batch input splitting and output assembly preserve file boundaries
  • Model Groups organize related model versions in a production catalog
  • Model approval status can gate an explicitly configured deployment workflow
  • Cross-account model deployment needs access to the Model Group and its underlying artifacts
  • MLflow connects model candidates to the experiments that produced them
  • Managed MLflow separates service-managed metadata from customer S3 artifacts
  • Prompt variables reuse a tested template with different runtime inputs
  • Prompt variants compare alternative messages and inference configurations
  • Published prompt versions preserve tested configurations for deployment
  • Custom prompt datasets make automated model tests specific to the application
  • Judge-model and human evaluations provide different forms of release evidence
  • RAG testing must assess retrieval as well as the generated response
  • AgentCore Evaluations scores instrumented agent behavior rather than only final text
  • MLflow traces connect unexpected AI outputs to the components that produced them
  • Updating an AgentCore Runtime creates a new immutable configuration version
  • Named AgentCore endpoints support controlled promotion independently of the default endpoint
  • Flow aliases let applications change workflow versions without changing the invocation target
  • Provisioned custom-model updates must preserve the supported base-model relationship
  • A successful update request does not mean the new custom model is already serving
  • Knowledge-base source changes require a sync to update the retrieval index
  • Some metadata-only refreshes can reuse existing document embeddings
  • Refresh orchestration must observe ingestion completion and document results
  • Newly ingested vectors may need time to become queryable
  • Bedrock agent aliases select immutable versions for application invocation

Unlock with Premium — includes all practice exams and the complete study guide.

Also tested in

References

  1. https://docs.aws.amazon.com/aws-certification/latest/machine-learning-engineer-associate-02/machine-learning-engineer-associate-02-domain3.html
  2. https://docs.aws.amazon.com/codepipeline/latest/userguide/concepts.html
  3. https://docs.aws.amazon.com/sagemaker/latest/dg/build-and-manage-steps.html
  4. https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry.html
  5. https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-approve.html
  6. https://docs.aws.amazon.com/codepipeline/latest/userguide/approvals.html
  7. https://docs.aws.amazon.com/sagemaker/latest/dg/model-train-storage.html
  8. https://docs.aws.amazon.com/codebuild/latest/userguide/concepts.html
  9. https://docs.aws.amazon.com/codebuild/latest/userguide/build-spec-ref.html
  10. https://docs.aws.amazon.com/dtconsole/latest/userguide/welcome-connections.html
  11. https://docs.aws.amazon.com/codepipeline/latest/userguide/action-reference-CodestarConnectionSource.html
  12. https://docs.aws.amazon.com/dtconsole/latest/userguide/connections-update.html
  13. https://docs.aws.amazon.com/codecommit/latest/userguide/welcome.html
  14. https://docs.aws.amazon.com/sagemaker/latest/dg/processing-job.html
  15. https://docs.aws.amazon.com/sagemaker/latest/dg/build-and-manage-steps-types.html
  16. https://docs.aws.amazon.com/sagemaker/latest/dg/pipelines-caching.html
  17. https://docs.aws.amazon.com/sagemaker/latest/dg/pipeline-eventbridge.html
  18. https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-create-rule-schedule.html
  19. https://docs.aws.amazon.com/sagemaker/latest/dg/batch-transform.html
  20. https://docs.aws.amazon.com/sagemaker/latest/dg/sagemaker-projects-templates-sm.html
  21. https://docs.aws.amazon.com/sagemaker/latest/dg/automating-sagemaker-with-eventbridge.html
  22. https://docs.aws.amazon.com/sagemaker/latest/dg/model-registry-deploy.html
  23. https://docs.aws.amazon.com/aws-certification/latest/machine-learning-engineer-associate-02/machine-learning-engineer-associate-02-domain4.html
  24. https://docs.aws.amazon.com/sagemaker/latest/dg/mlflow.html
  25. https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management.html
  26. https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-deploy.html
  27. https://docs.aws.amazon.com/bedrock/latest/APIReference/API_runtime_Converse.html
  28. https://docs.aws.amazon.com/bedrock/latest/userguide/prompt-management-test.html
  29. https://docs.aws.amazon.com/bedrock/latest/userguide/flows-deploy.html
  30. https://docs.aws.amazon.com/bedrock/latest/userguide/agents-classic-maintenance-mode.html
  31. https://docs.aws.amazon.com/bedrock/latest/userguide/deploy-agent.html
  32. https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/agent-runtime-versioning.html
  33. https://docs.aws.amazon.com/bedrock/latest/userguide/deploy-custom-model-on-demand.html
  34. https://docs.aws.amazon.com/bedrock/latest/userguide/prov-thru-edit.html
  35. https://docs.aws.amazon.com/aws-certification/latest/machine-learning-engineer-associate-02/machine-learning-engineer-associate-02-domain2.html
  36. https://docs.aws.amazon.com/prescriptive-guidance/latest/gen-ai-lifecycle-operational-excellence/preprod-hardening.html
  37. https://docs.aws.amazon.com/bedrock/latest/userguide/evaluation.html
  38. https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/evaluations.html
  39. https://docs.aws.amazon.com/bedrock-agentcore/latest/devguide/how-it-works-evaluations.html
  40. https://docs.aws.amazon.com/sagemaker/latest/dg/shadow-tests.html
  41. https://docs.aws.amazon.com/sagemaker/latest/dg/model-ab-testing.html
  42. https://docs.aws.amazon.com/sagemaker/latest/dg/deployment-guardrails-blue-green.html
  43. https://docs.aws.amazon.com/sagemaker/latest/dg/deployment-guardrails.html
  44. https://docs.aws.amazon.com/sagemaker/latest/dg/deployment-guardrails-configuration.html
  45. https://docs.aws.amazon.com/sagemaker/latest/dg/deployment-guardrails-blue-green-canary.html
  46. https://docs.aws.amazon.com/sagemaker/latest/dg/deployment-guardrails-rolling.html
  47. https://docs.aws.amazon.com/sagemaker/latest/dg/deployment-guardrails-exclusions.html
  48. https://docs.aws.amazon.com/codedeploy/latest/userguide/welcome.html
  49. https://docs.aws.amazon.com/codedeploy/latest/userguide/deployment-steps-ecs.html
  50. https://docs.aws.amazon.com/codedeploy/latest/userguide/reference-appspec-file-structure-hooks.html
  51. https://docs.aws.amazon.com/bedrock/latest/userguide/kb-data-source-sync-ingest.html