Skip to content

Commit

Permalink
Allow custom machine+gpu*count on runner cloud=gcp (#380)
Browse files Browse the repository at this point in the history
  • Loading branch information
0x2b3bfa0 authored Feb 2, 2022
1 parent 952f1a9 commit 610c449
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion iterative/gcp/provider.go
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,18 @@ func getInstanceType(instanceType string, instanceGPU string) (map[string]map[st
},
}

if val, ok := instanceTypes[instanceType+"+"+instanceGPU]; ok {
match := regexp.MustCompile(`^([^+]+)\+([^*]+)\*([1-9]\d*)?$`).FindStringSubmatch(instanceType)
if match != nil {
return map[string]map[string]string{
"accelerator": {
"count": match[3],
"type": match[2],
},
"machine": {
"type": match[1],
},
}, nil
} else if val, ok := instanceTypes[instanceType+"+"+instanceGPU]; ok {
return val, nil
} else if val, ok := instanceTypes[instanceType]; ok && instanceGPU == "" {
return val, nil
Expand Down

0 comments on commit 610c449

Please sign in to comment.