Building an end-to-end ML Pipeline on AWS Sagemaker.
Install uv before running.
-
If you are using AWS SSO, you can activate your profile by running the following command:
# AWS_PROFILE=sandbox aws configure sso --profile sandbox # OR aws sso login --profile sandbox
-
Setup Infra
# Bootstrap the CDK environment ./run cdk-bootstrap # Deploy the CDK stack # This will create the S3 bucket and SageMaker domain ./run cdk-deploy
-
Create a
.envfile based on theenv.examplefile and fill in the required values. -
Clean Up
# Destroy infra ./run cdk-destroy # Clean up local files ./run clean
-
Run the Pipeline:
# to run the pipeline with SageMaker ./run pipeline # to run the pipeline locally ./run pipeline --local
-
Test the endpoint:
AWS_PROFILE=sandbox uv run scripts/test_endpoint.py
Single penguin data: { "island": "Torgersen", "culmen_length_mm": 39.1, "culmen_depth_mm": 18.7, "flipper_length_mm": 181, "body_mass_g": 3750 } Response status: 200 Result: { 'prediction': 'Adelie', 'confidence': 0.5893437266349792, 'probabilities': { 'Adelie': 0.5893437266349792, 'Chinstrap': 0.16670739650726318, 'Gentoo': 0.2439488023519516 } }
If you find any problems with the code or have any ideas on improving it, please open an issue and share your recommendations.

