This project provides a two-step process to analyze and visualize AWS Batch workloads. It includes:
- Analytics Stack: Captures job metrics and insights from AWS Batch and stores them in DynamoDB.
- Spot Viewer Stack (Optional): Visualizes On-Demand vs. Spot cost insights for AWS Batch jobs, helping optimize workloads.
- Monitor AWS Batch jobs and collect insights such as instance IDs, retries, interruptions, and runtime into DynamoDB.
- EventBridge Rule: Triggers a Lambda function for Batch job state changes.
- Lambda Function: Processes job data from AWS Batch and ECS, then stores it in DynamoDB.
UniquePrefix: A unique prefix for resource naming (e.g.,project-nameor a random string).BatchComputeEnvironmentName: Name of the AWS Batch Compute Environment to monitor.
DynamoDBTableName: Name of the DynamoDB table storing job metrics.LambdaFunctionName: Name of the Lambda function processing job state changes.
- Provides visual insights into AWS Batch workloads, comparing On-Demand and Spot costs with MemVerge enhancements.
- Deploys an EC2 instance hosting a Flask-based web application.
- Two visualization options:
- On-Demand Metrics:
/on-demand.html - Spot Metrics with MemVerge Enhancements:
/spot.html
- On-Demand Metrics:
- Cost analysis for AWS Batch jobs:
- On-Demand vs. Spot.
- Savings potential with MemVerge.
UniquePrefix: The same prefix used in Stack 1 for consistent integration.VpcId: VPC ID for the EC2 instance.SubnetId: Subnet ID for the EC2 instance.KeyName: Key Pair for SSH access.
SpotViewerEC2InstanceId: ID of the EC2 instance hosting the Spot Viewer.PublicIP: Public IP of the EC2 instance for accessing the web interface.
-
Deploy Stack 1:
- Use AWS CloudFormation to deploy the Analytics stack.
- Provide the required parameters:
UniquePrefixandBatchComputeEnvironmentName.
-
Deploy Stack 2 (Optional):
- Use AWS CloudFormation to deploy the Spot Viewer stack.
- Provide the required parameters:
UniquePrefix,VpcId,SubnetId, andKeyName.
-
Access Spot Viewer:
- Get the Public IP from the stack outputs or EC2 dashboard.
- Open the following URLs in a browser:
- On-Demand Metrics:
http://<ip_address>:5005/on-demand.html - Spot Metrics:
http://<ip_address>:5005/spot.html
- On-Demand Metrics:
-
Source Code:
- API-level details:
doc/ - Lambda and HTML code:
resources/
- API-level details:
-
Note: Make sure to use the same
UniquePrefixacross both stacks to ensure proper integration.
This project is licensed under the Apache License 2.0 - see the LICENSE file for details