AWS - ECS
Run Lumeo Gateways in AWS Elastic Container Service
Overview
Lumeo Gateways can be deployed in AWS Elastic Container Service using a EC2 Capacity provider.
Note: Fargate is not currently supported since it does not allow GPU-based tasks.
Within an ECS cluster, new Lumeo Gateways are created when spawning new Tasks or increasing the tasks within a Service definition. These Gateways will appear in the Lumeo console and are usable to deploy analytics.
Scaling down the number of Tasks will have those Gateways go offline in the Lumeo console.
ECS Configuration
Create ECS Cluster
Highlights:
- Use a Amazon EC2 instances as the Infrastructure for your cluster, and create an EC2 Auto Scaling Group as a Capacity Provider for the ECS cluster
- Setup the EC2 Auto Scaling Group to use
g4
instances, ex:g4dn.xlarge
,g4dn.2xlarge
, etc. Ensure you have requested enough quota for these instances in your AWS account. This guide assumes we are usingg4dn.xlarge
instances. - Setup the instances to use atleast 100GB for the Root EBS volume size to accommodate Lumeo container images.
Create ECS Task Definition
Using JSON
This is the easiest way to create a task definition.
In the task definition JSON template is provided below, replace the following fields:
containerDefinitions.environment
values for LUMEO_APP_ID and LUMEO_API_KEYexecutionRoleArn
replace with the one found in "Create new task definition from JSON"memory
replace with the actual amount of memory available on your instance.
{
"family": "lumeo-gateway",
"containerDefinitions": [
{
"name": "lumeo-gateway",
"image": "docker.io/lumeo/gateway-nvidia-dgpu:latest",
"cpu": 0,
"portMappings": [
{
"name": "lumeo-gateway-554-tcp",
"containerPort": 554,
"hostPort": 554,
"protocol": "tcp"
},
{
"containerPort": 554,
"hostPort": 554,
"protocol": "udp"
}
],
"essential": true,
"environment": [
{
"name": "CONTAINER_MODEL",
"value": "AWS ECS"
},
{
"name": "LUMEO_APP_ID",
"value": "<replace with your workspace id>"
},
{
"name": "LUMEO_API_KEY",
"value": "<replace with your API Key>"
}
],
"mountPoints": [
{
"sourceVolume": "lumeo-gateway-storage",
"containerPath": "/var/lib/lumeo",
"readOnly": false
}
],
"volumesFrom": [],
"startTimeout": 120,
"logConfiguration": {
"logDriver": "awslogs",
"options": {
"awslogs-create-group": "true",
"awslogs-group": "/ecs/lumeo-gateway",
"awslogs-region": "us-east-1",
"awslogs-stream-prefix": "ecs"
},
"secretOptions": []
},
"resourceRequirements": [
{
"value": "1",
"type": "GPU"
}
]
}
],
"executionRoleArn": "<replace with your execution role arn>",
"networkMode": "bridge",
"volumes": [
{
"name": "lumeo-gateway-storage",
"dockerVolumeConfiguration": {
"scope": "task",
"driver": "local"
}
}
],
"requiresCompatibilities": [
"EC2"
],
"memory": "15360",
"runtimePlatform": {
"cpuArchitecture": "X86_64",
"operatingSystemFamily": "LINUX"
}
}
Using GUI
As an alternative to using JSON to create the task definition, you can create one using the GUI following the steps below.
Create ECS Service
After configuring the service, hit create, and wait for the Lumeo Gateways to show up in your Lumeo console. You can increase the number of gateways by increasing the number of tasks.
However, when you decrease the number of gateways by reducing the tasks, those gateways will go offline in the Lumeo Console, and the deployments will not automatically migrate.
Updated 12 months ago