How aws-samples/mlops-sagemaker-github-actions works
This repository is an AWS SageMaker/GitHub Actions MLOps example. Its central workflow builds and evaluates an Abalone model, registers it, then prepares staging and production deployments, with production gated by approval. The seedcode pipeline CLI dynamically loads a pipeline module; deployment configuration selects an approved package, and stack deployment applies stage parameters. The root Lambda triggers a GitHub deployment workflow using a token from Secrets Manager. The pipeline definition and GitHub workflow internals were not sampled, so documented capability links use the README and implementation detail is limited to shown code.
Main entry points: build_deployment_configs.py Stage config builder · pipeline.py Abalone pipeline · deploy_stack.py Stack deployer · workflows GitHub Actions workflows
Components 22
Model pipeline
- Run pipeline CLI
seedcode/pipelines/run_pipeline.py - Pipeline utilities
seedcode/pipelines/_utils.py - Abalone pipeline
seedcode/pipelines/abalone/pipeline.py - Prepare data
seedcode/pipelines/abalone/preprocess.py - Train model
seedcode/pipelines/abalone/pipeline.py - Evaluate model
seedcode/pipelines/abalone/evaluate.py - Model Registry
- Definition CLI
seedcode/pipelines/get_pipeline_definition.py
Deployment
- Stage config builder
seedcode/build_deployment_configs.py - Stage configurations
seedcode/staging-config.json - Production configuration
seedcode/prod-config.json - Stack deployer
seedcode/deploy_stack.py - Endpoint stack template
seedcode/endpoint-config-template.yml - SageMaker project template
project/template.yml
GitHub automation
- Workflow trigger Lambda
lambda_functions/lambda_github_workflow_trigger/lambda_function.py - GitHub Actions workflows
seedcode/.github/workflows
Other components
- Project operator
- GitHub
- AWS Secrets Manager
- Amazon SageMaker
- AWS CloudFormation
- Production reviewer
Connections 23
- Project operator → Run pipeline CLI: runs
README.md - Run pipeline CLI → Pipeline utilities: loads driver
seedcode/pipelines/run_pipeline.py - Definition CLI → Pipeline utilities: loads driver
seedcode/pipelines/get_pipeline_definition.py - Pipeline utilities → Abalone pipeline: imports module
seedcode/pipelines/_utils.py - Run pipeline CLI → Amazon SageMaker: upserts and starts
seedcode/pipelines/run_pipeline.py - Abalone pipeline → Prepare data: runs preparation
README.md - Abalone pipeline → Train model: trains model
README.md - Abalone pipeline → Evaluate model: evaluates model
README.md - Abalone pipeline → Model Registry: registers model
README.md - Stage config builder → Model Registry: selects approved model
seedcode/build_deployment_configs.py - Stage config builder → Stage configurations: reads staging settings
seedcode/build_deployment_configs.py - Stage config builder → Production configuration: reads production settings
seedcode/build_deployment_configs.py - Stage config builder → Amazon SageMaker: queries project and package
seedcode/build_deployment_configs.py - Stage config builder → Stack deployer: provides stage parameters
README.md - Stack deployer → Endpoint stack template: loads template
seedcode/deploy_stack.py - Stack deployer → AWS CloudFormation: creates or updates
seedcode/deploy_stack.py - SageMaker project template → Workflow trigger Lambda: provisions trigger
README.md - SageMaker project template → GitHub Actions workflows: configures integration
README.md - Production reviewer → GitHub Actions workflows: approves production
README.md - GitHub Actions workflows → Stage config builder: prepares deployment
README.md - GitHub Actions workflows → Stack deployer: deploys stages
README.md - Workflow trigger Lambda → AWS Secrets Manager: reads token
lambda_functions/lambda_github_workflow_trigger/lambda_function.py - Workflow trigger Lambda → GitHub: dispatches workflow
lambda_functions/lambda_github_workflow_trigger/lambda_function.py