Closed fala1991 closed 7 months ago
Thanks for the report @fala1991 I have just last week deployed to EC2, I will dig into why this didn't work.
I noticed
x-cluster:
Properties:
CapacityProviders:
- subzero-inference
- FRGATE
ClusterName: subzero-demo
Noticing the typo, on for FARGATE
, did the cluster get created properly?
edit1: what's the value of parameter EcsLaunchType
on your stack?
Okay, behaviour reproduced with
services:
test:
image: nginx
deploy:
labels:
ecs.compute.platform: EC2
resources:
reservations:
cpus: '0.1'
memory: 64MB
limits:
cpus: '0.25'
memory: 128MB
x-cluster:
Properties:
CapacityProviders:
- subzero-inference
- FRGATE
ClusterName: subzero-demo
I updated the typo with
services:
sift:
networks:
- private
image: 789798371969.dkr.ecr.us-west-2.amazonaws.com/stg-ins-sift:d048178-dirty
ports:
- 8080:8080
labels:
container_name: sift
x-network:
x-cloudmap: subzero
Ingress:
ExtSources:
- IPv4: 10.238.216.0/22
Name: all
x-iam:
Policies:
- PolicyName: TraefikRecommended
PolicyDocument: {
"Version": "2012-10-17",
"Statement": [
{
"Sid": "TraefikECSReadAccess",
"Effect": "Allow",
"Action": [
"ecs:ListClusters",
"ecs:DescribeClusters",
"ecs:ListTasks",
"ecs:DescribeTasks",
],
"Resource": "*"
}
]
}
deploy:
labels:
ecs.compute.platform: EC2
resources:
reservations:
cpus: '0.1'
memory: 64MB
limits:
cpus: '0.25'
memory: 128MB
x-cluster:
Properties:
CapacityProviders:
- subzero-inference
- FARGATE
ClusterName: subzero-demo
Still have same issue. the value of EcsLaunchType
is still Fargate
Yeah, I didn't expect that to fix it, I just wanted to point it out. I am curious to have the details of the ECS cluster though purely out of interest. Don't have to share if you prefer not to of course
I am pinpointing where the change happens EDIT: Found where it changes
is there anyway to force launch type to EC2 except ecs.compute.platform: EC2
?
is there anyway to force launch type to EC2 except
ecs.compute.platform: EC2
?
So Compose-x tries to be smart, and correct the launch type if the cluster didn't support it. Might be trying to be too smart. It will do that based on the settings/providers it finds in the cluster. But you are creating the cluster. Technically a cluster doesn't need to say it uses EC2 as the capacity provider, it would do that if there are ECS instances and you didn't request to use Fargate instead for example.
I found where in the code it does the change, now to find the why.
I presume that the provider subzero-inference
is your configured ASG?
Okay, found where it changes but shouldn't.
yes subzero-inference
is my ASG group and I have made a call to create that as capacity provider via
aws ecs create-capacity-provider --name subzero-inference --auto-scaling-group-provider "autoScalingGroupArn=arn:aws:autoscaling:us-west-2:789798371969:autoScalingGroup:8490889d-2a99-44af-9352-60010bed5357:autoScalingGroupName/subzero-inference"
Should I just use existing cluster? will that solve my issue?
Should I just use existing cluster? will that solve my issue?
Most likely yes, or setting x-ecs.CapacityProviders and point to your should do the trick. But I want to fix this anyways. Sorry I had to disappear to go make a fool of myself: https://www.youtube.com/watch?v=1glvMLqX8bg :D
Okay, tested with
services:
test:
image: nginx
deploy:
labels:
ecs.compute.platform: FARGATE
resources:
reservations:
cpus: '0.1'
memory: 64MB
limits:
cpus: '0.25'
memory: 128MB
test-sidecar:
image: nginx
deploy:
labels:
ecs.compute.platform: EC2
ecs.task.family: test
resources:
reservations:
cpus: '0.1'
memory: 64MB
limits:
cpus: '0.25'
memory: 128MB
x-cluster:
Properties:
CapacityProviders:
- subzero-inference
- FRGATE
ClusterName: subzero-demo
and other variances (EXTERNAL for example) and the highest priority wins. Priority goes EXTERNAL> EC2 > FARGATE => Fargate is default, so using EXTERNAL or EC2 is a user choice. EXTERNAL takes priority over EC2
@fala1991 sorry forgot to tag you on my earlier message to notify you. Let me know how this goes?
Describe the bug I have set
deploy.labels with ecs.compute.platform: EC2
and got log- At least one service defined for EC2. Overriding for all
however, the task definition still set LaunchType to FARGATETo Reproduce Steps to reproduce the behavior:
version: "3.8"
x-vpc: Lookup: VpcId: Tags:
networks: public: x-vpc: PublicSubnets private: x-vpc: AppSubnets
x-cloudmap: subzero: Name: subzero.private Lookup: NamespaceId: ns-dcac5ueihkz5gh5c
services: sift: networks:
x-cluster: Properties: CapacityProviders: