Compute machine type matching reservations

Signed-off-by: Nicolas De Loof <nicolas.deloof@gmail.com>
This commit is contained in:
Nicolas De Loof 2020-09-23 12:18:42 +02:00
parent f2430afa06
commit d57a39958b
No known key found for this signature in database
GPG Key ID: 9858809D6F8F6E7E
2 changed files with 5 additions and 2 deletions

View File

@ -46,7 +46,10 @@ func (b *ecsAPIService) createCapacityProvider(ctx context.Context, project *typ
return err 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 var securityGroups []string
for _, r := range networks { for _, r := range networks {

View File

@ -108,7 +108,7 @@ func guessMachineType(project *types.Project) (string, error) {
instanceType, err := gpufamily. instanceType, err := gpufamily.
filter(func(m machine) bool { 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 { filter(func(m machine) bool {
return m.cpus >= requirements.cpus return m.cpus >= requirements.cpus