Experience how Moto mocks AWS SageMaker machine learning workflows for comprehensive testing
Real AWS ML Pipeline
1
Your ML Code
Python + boto3
2
AWS Cloud
Lambda + SageMaker + S3
3
ML Model
Ready for predictions
Real AWS
$15.40
Cost
~Hours
Time
💰 Real billing
⏳ Actual training time
🔧 Full infrastructure
Moto Mock
$0.00
Cost
~2s
Time
✅ Free testing
⚡ Instant results
🛡️ Safe development
How it works:
Your code calls AWS services to train ML models. Real mode uses actual AWS infrastructure with real costs. Moto mode intercepts these calls and simulates everything locally for free testing.
Python ML Pipeline Test
def test_ml_pipeline():
sagemaker = boto3.client('sagemaker')
lambda_client = boto3.client('lambda')
s3_client = boto3.client('s3')
# Upload training data to S3
s3_client.upload_file('data.csv', 'ml-bucket', 'data/')
# Trigger ML pipeline via Lambda
lambda_client.invoke(FunctionName='ml-pipeline')
# Create SageMaker training job
sagemaker.create_training_job(...)
# Deploy model endpoint
sagemaker.create_endpoint(...)
# Uses real ML infrastructure 💰
Moto SageMaker Benefits
Zero ML infrastructure costs
Instant training job "completion"
Test complex ML pipelines safely
No GPU/compute instance charges
Validate ML workflow logic quickly
Test error scenarios without risk
Works offline for development
Real SageMaker Challenges
Expensive ML instances ($0.065-$3.06/hour)
Hours/days for training completion
Complex IAM roles and permissions
Storage costs for large datasets
Risk of runaway training costs
Network dependency for all operations
Difficult to test failure scenarios
Perfect for Testing
Pipeline Validation
Test ML workflow orchestration without spinning up expensive resources
Integration Tests
Verify SageMaker + Lambda + S3 integrations work correctly
Error Handling
Test how your code handles training failures and resource limits