mirror of https://github.com/docker/compose.git
Compute machine type matching reservations
Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
parent
f2430afa06
commit
d57a39958b
|
@ -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 {
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue