Skip to content

Commit

Permalink
feat: added support for specifying the volume size (BlockDeviceVolume…
Browse files Browse the repository at this point in the history
…GB) and timeout (TimeoutHours) in the ECS config.yml file to support larger video/model processing
  • Loading branch information
danellecline committed Feb 29, 2024
1 parent 94b5531 commit be93068
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 4 deletions.
2 changes: 2 additions & 0 deletions deepsea_ai/cdk/app/config1280.yml
Expand Up @@ -3,5 +3,7 @@ StackName: Megadetector
TaskDefinition: strongsort-yolov5
ContainerImage: 548531997526.dkr.ecr.us-west-2.amazonaws.com/mbari/strongsort-yolov5:1.10.0
FleetSize: 1
BlockDeviceVolumeGB: 55
TimeoutHours: 2
model_location: s3://deepsea-ai-548531997526-models/Megadetector.pt
track_config: s3://deepsea-ai-548531997526-track-conf/strong_sort_benthic.yaml
2 changes: 2 additions & 0 deletions deepsea_ai/cdk/app/config640.yml
Expand Up @@ -3,5 +3,7 @@ StackName: yv5
TaskDefinition: strongsort-yolov5
ContainerImage: 548531997526.dkr.ecr.us-west-2.amazonaws.com/mbari/strongsort-yolov5:1.10.0
FleetSize: 1
BlockDeviceVolumeGB: 10
TimeoutHours: 2
model_location: s3://deepsea-ai-548531997526-models/yolov5x_mbay_benthic_model.tar.gz
track_config: s3://deepsea-ai-548531997526-track-conf/strong_sort_benthic.yaml
2 changes: 2 additions & 0 deletions deepsea_ai/cdk/app/lib/config.ts
@@ -1,6 +1,8 @@
export interface TaskConfig {
FleetSize: number;
StackName: string;
TimeoutHours: number;
BlockDeviceVolumeGB: number;
ContainerImage: string;
TaskDefinition: string;
track_config: string;
Expand Down
8 changes: 4 additions & 4 deletions deepsea_ai/cdk/app/lib/ecs_task_autoscaling.ts
Expand Up @@ -31,7 +31,7 @@ export class AutoScalingTaskStack extends cdk.Stack {
minCapacity: 0,
maxCapacity: config.FleetSize,
cooldown: cdk.Duration.minutes(15),
blockDevices: [{ deviceName: '/dev/sdh', volume: autoscaling.BlockDeviceVolume.ebs(10)}],
blockDevices: [{ deviceName: '/dev/sdh', volume: autoscaling.BlockDeviceVolume.ebs(config.BlockDeviceVolumeGB)}],
vpc
})

Expand All @@ -49,11 +49,11 @@ export class AutoScalingTaskStack extends cdk.Stack {
const maxReceiveCount = 600

// Set the video processing visibility timeout to the maximum time that it takes to process a video once the message is dequeued
const videoTimeout = cdk.Duration.hours(2)
const videoTimeout = cdk.Duration.hours(config.TimeoutHours)

// Set the track processing visibility timeeout to the maximum time that it takes to ingest the track once the message is dequeued
// Set the track processing visibility timeout to the maximum time that it takes to ingest the track once the message is dequeued
// or the maximum time that it takes to monitor the status of the job
const trackTimeout = cdk.Duration.hours(2)
const trackTimeout = cdk.Duration.hours(config.TimeoutHours)

const deadLetterQueue = new sqs.Queue(this, 'dead', {
retentionPeriod: cdk.Duration.days(10),
Expand Down

0 comments on commit be93068

Please sign in to comment.