Skip to content

aws-samples/sample-capacity-finder-for-ec2-capacity-block-and-sagemaker-training-plan

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 

AWS EC2 Capacity Blocks and SageMaker Training Plans Finder

🔎 A Streamlit app for exploring available AWS EC2 Capacity Blocks and SageMaker Training Plans across regions and instance types.

App Screenshot

License: MIT Streamlit Python

Very Quick Start

This is a single-file Streamlit app. Download app.py and run:

   streamlit run app.py

Make sure you have:

  • Python Dependencies (listed in requirements.txt): streamlit, boto3, pandas
  • AWS IAM permissions: ec2:DescribeCapacityBlockOfferings, sagemaker:SearchTrainingPlanOfferings

Quick Start

  1. Clone the repository

    git clone <Repo URL>
    cd <Repo folder>
  2. Install dependencies

    pip install -r requirements.txt
  3. Configure AWS credentials

    The app requires the following AWS IAM permissions:

    • ec2:DescribeCapacityBlockOfferings
    • sagemaker:SearchTrainingPlanOfferings
    aws configure
    
    # or set environment variables
    export AWS_ACCESS_KEY_ID=your_key
    export AWS_SECRET_ACCESS_KEY=your_secret
  4. Run the application

    streamlit run app.py

Additional

  • (Optional) Create and activate a virtual environment:
python -m venv venv
source venv/bin/activate
  • Example of a minimal IAM policy:
{
  "Version": "2012-10-17",
  "Statement": [
    {
      "Effect": "Allow",
      "Action": [
        "ec2:DescribeCapacityBlockOfferings",
        "sagemaker:SearchTrainingPlanOfferings"
      ],
      "Resource": "*"
    }
  ]
}

License

This project is licensed under the MIT License.

About

A Streamlit app for exploring available AWS EC2 Capacity Blocks and SageMaker Training Plans across regions and instance types.

Topics

Resources

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages