diff --git a/ecs/ec2.go b/ecs/ec2.go index f6c3cc76e..c7d8d6819 100644 --- a/ecs/ec2.go +++ b/ecs/ec2.go @@ -46,7 +46,10 @@ func (b *ecsAPIService) createCapacityProvider(ctx context.Context, project *typ return err } - machineType := "g4dn.xlarge" // FIXME https://github.com/docker/compose-cli/pull/628 + machineType, err := guessMachineType(project) + if err != nil { + return err + } var securityGroups []string for _, r := range networks { diff --git a/ecs/gpu.go b/ecs/gpu.go index a05e0f219..e38667634 100644 --- a/ecs/gpu.go +++ b/ecs/gpu.go @@ -108,7 +108,7 @@ func guessMachineType(project *types.Project) (string, error) { instanceType, err := gpufamily. filter(func(m machine) bool { - return m.memory >= requirements.memory + return m.memory > requirements.memory // actual memory available for ECS tasks < total machine memory }). filter(func(m machine) bool { return m.cpus >= requirements.cpus