falco2202 / provision-detect-model

Set up infrastructure ECS cluster for AI Model

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ECS Infrastructure for Pose Detection - Infrastructure as Code

Infrastructure

image

  • Note: To reduce complexity and cost, I ran the container in the public subnet. (It is still best practice to keep container in the private subnet).

Folder structure

.
├── detect-model
|   ├── app
|   |      ├── __init__.py
|   |      ├── app.py
|   |      └── yolov8n-pose.py             # Model pose detect image
|   ├── Dockerfile
|   └── requirements.txt          
├── environment
|       ├── development                    # Infrastructure Dev environment
|       |      ├── main.tf
|       |      ├── variables.tf
|       |      ├── terraform.tfvars
|       |      └── ...
|       ├── production                     # Infrastructure Production environment     
|       |      ├── main.tf
|       |      ├── variables.tf
|       |      ├── terraform.tfvars
|       |      └── ...             
├── module
|   ├── acm
|   |    ├── main.tf
|   |    ├── variables.tf
|   |    └── outputs.tf
|   ├── alb
|   ├── ecr
|   ├── ecs
|   ├── networking
|   └── route53                 
├── .gitignore                   
├── LICENSE.md
└── README.md

Usage repository

  1. Clone repository
git clone https://github.com/falco2202/provision-detect-model.git
  1. To add your AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY to Github secret, as well as your preferred REGION in Github variables.
  2. Run job in GitHub action

Load test

  • Note: Application is tested for performance with ECS Fargate(task: 1 vCPU, 2GB Memory) and autoscaling (min: 2, max: 5)

image

-> The server died with the 15 users and 13 requests/second

About

Set up infrastructure ECS cluster for AI Model

License:MIT License


Languages

Language:HCL 91.1%Language:Python 5.8%Language:Dockerfile 3.1%