AWS AI Practitioner — Day 10: CI & Deployment Pipelines
Learn: integrate a quick health check into CI, and plan a deploy/rollback strategy.
Hands-on: create a CI job that runs a smoke request and fails on non-200 responses.
Practice question:
Q1: What is a common CI check for model endpoints?
A) Run full training job in CI B) Execute a smoke request to the endpoint and validate response schema C) Delete the endpoint after every commit D) Disable tests to speed up CI
Answer: B — smoke tests validate the endpoint quickly and fail fast.
Daily Practice Questions (new)
Q1: What CLI is commonly used to run smoke tests in CI pipelines?
A) curl or a small script invoked by CI B) aws iam create-user C) docker build only D) terraform plan
Answer: A — curl or lightweight scripts are common for smoke tests.
Q2: What is a practical rollback strategy?
A) Revert to previous infra via IaC or switch traffic away B) Delete all resources C) Wait an hour and hope D) Change DNS only
Answer: A — IaC reapply or traffic switch are reliable rollback methods.
Q3: How do you run CI smoke tests only for pull requests?
A) Configure pipeline triggers for PR events B) Always run tests on master only C) Disable CI for PRs D) Run only on weekends
Answer: A — configure CI triggers to run on PR events.
Q4: Why avoid running full training jobs in CI?
A) Long runtimes and cost B) Training is always free C) CI provides GPUs by default D) To speed up PR reviews
Answer: A — training in CI is costly and slow.
Q5: What is blue/green deployment?
A) Deploy new version alongside old and switch traffic when ready B) Deploy only to blue servers C) Delete old version immediately D) Use only batch jobs
Answer: A — blue/green keeps both versions to enable safe switches.
Q6: How to validate rollback capability?
A) Ensure previous version can be redeployed quickly and smoke-tested B) Ignore previous versions C) Delete backups D) Disable monitoring
Answer: A — test redeploy and smoke tests for rollback readiness.
Q7: Which tools are common for Infrastructure-as-Code?
A) Terraform or CloudFormation B) Excel spreadsheets C) Notepad only D) Route 53
Answer: A — Terraform and CloudFormation declare infra reproducibly.
Q8: How should CI secrets be stored?
A) Encrypted CI secrets store or AWS Secrets Manager B) In plaintext in repo C) In S3 public buckets D) In comments
Answer: A — use encrypted secret stores to protect credentials.
Q9: What quick check should CI perform after deployment?
A) Endpoint health and basic response schema B) Delete logs C) Increase instance size D) Change DNS TTL
Answer: A — basic health checks confirm the deployment succeeded.
Q10: How to notify teams on CI failures?
A) Configure CI to send alerts to chat or email B) Keep failures silent C) Post on social media D) Disable alerts
Answer: A — CI notifications help teams act on failures quickly.
Review Questions (previous lessons)
Q1: What is a smoke test in deployment pipelines?
A) A quick verification that core functionality works B) A full regression suite C) Performance benchmarking only D) Billing audit
Answer: A — smoke tests confirm basic functionality after deploy.
Q2: Why avoid running full training jobs in CI?
A) Long runtimes and high costs B) They are always free C) CI provides GPUs by default D) Training is instantaneous
Answer: A — training in CI is expensive and slow.
Q3: What improves reproducibility in deployments?
A) Infrastructure-as-Code and versioned artifacts B) Manual scripts only C) Random environment variables D) No tracking
Answer: A — IaC and versioned artifacts enable reproducible deploys.
Q4: How to validate an endpoint in CI?
A) Invoke it with a sample input and assert expected output/schema B) Skip tests C) Delete the endpoint D) Update DNS
Answer: A — CI should include a smoke test call to the endpoint.
Q5: What is the purpose of a canary deployment?
A) Gradual rollout to reduce risk and validate changes B) Immediate full rollout C) Always rollback automatically D) Increase costs intentionally
Answer: A — canaries limit exposure while validating behavior.
Q6: Why must CI secrets be stored securely?
A) To prevent credential leakage and unauthorized access B) To make them public C) To store in repo files D) To send via email
Answer: A — secure secret storage protects credentials.
Q7: What can trigger an automated rollback?
A) Health check failure or monitoring alert B) Manual admin vacation C) DNS change only D) Random timer
Answer: A — alerts or failed health checks can trigger rollback.
Q8: How to keep CI costs reasonable?
A) Run minimal effective checks and avoid heavy training jobs in CI B) Run all tests everywhere always C) Use largest instances always D) Never run tests
Answer: A — balance checks for safety and cost.
Q9: What is a minimal deploy pipeline step sequence?
A) Build, test, deploy, smoke test B) Deploy only C) Test only D) Document only
Answer: A — this sequence ensures code builds and functions post-deploy.
Q10: Where should deployment steps be documented?
A) README or pipeline config B) In random chat messages C) Only in password-protected files D) Not documented
Answer: A — documentation in README or pipeline config is best practice.