From 72c966783fa250419665fa1c83f688ca7daa0862 Mon Sep 17 00:00:00 2001 From: Daniel Barnes Date: Mon, 14 Nov 2022 08:51:50 -0800 Subject: [PATCH] help type parity --- iterative/aws/provider.go | 24 +++++++++++++----------- iterative/azure/provider.go | 27 +++++++++++++++------------ iterative/gcp/provider.go | 18 ++++++++++++++++++ 3 files changed, 46 insertions(+), 23 deletions(-) diff --git a/iterative/aws/provider.go b/iterative/aws/provider.go index 1b3abf3f..6368f81e 100644 --- a/iterative/aws/provider.go +++ b/iterative/aws/provider.go @@ -486,17 +486,19 @@ func GetAvailabilityZone(region string) string { } func getInstanceType(instanceType string, instanceGPU string) string { - instanceTypes := make(map[string]string) - instanceTypes["m"] = "m5.2xlarge" - instanceTypes["l"] = "m5.8xlarge" - instanceTypes["xl"] = "m5.16xlarge" - instanceTypes["m+k80"] = "p2.xlarge" - instanceTypes["l+k80"] = "p2.8xlarge" - instanceTypes["xl+k80"] = "p2.16xlarge" - instanceTypes["m+v100"] = "p3.xlarge" - instanceTypes["l+v100"] = "p3.8xlarge" - instanceTypes["xl+v100"] = "p3.16xlarge" - + instanceTypes := map[string]string{ + "s": "t2.micro", + "m": "m5.2xlarge", + "l": "m5.8xlarge", + "xl": "m5.16xlarge", + "m+t4": "g4dn.xlarge", + "m+k80": "p2.xlarge", + "l+k80": "p2.8xlarge", + "xl+k80": "p2.16xlarge", + "m+v100": "p3.xlarge", + "l+v100": "p3.8xlarge", + "xl+v100": "p3.16xlarge", + } if val, ok := instanceTypes[instanceType+"+"+instanceGPU]; ok { return val } else if val, ok := instanceTypes[instanceType]; ok && instanceGPU == "" { diff --git a/iterative/azure/provider.go b/iterative/azure/provider.go index 8659c3e5..23423200 100644 --- a/iterative/azure/provider.go +++ b/iterative/azure/provider.go @@ -206,7 +206,7 @@ func ResourceMachineCreate(ctx context.Context, d *schema.ResourceData, m interf vmClient, _ := getVMClient(subscriptionID) vmSettings := compute.VirtualMachine{ - Tags: metadata, + Tags: metadata, Location: to.StringPtr(region), VirtualMachineProperties: &compute.VirtualMachineProperties{ HardwareProfile: &compute.HardwareProfile{ @@ -256,7 +256,7 @@ func ResourceMachineCreate(ctx context.Context, d *schema.ResourceData, m interf }, }, } - + if userAssignedIdentities != nil { vmSettings.Identity = &compute.VirtualMachineIdentity{ UserAssignedIdentities: userAssignedIdentities, @@ -414,16 +414,19 @@ func GetRegion(region string) string { } func getInstanceType(instanceType string, instanceGPU string) string { - instanceTypes := make(map[string]string) - instanceTypes["m"] = "Standard_F8s_v2" - instanceTypes["l"] = "Standard_F32s_v2" - instanceTypes["xl"] = "Standard_F64s_v2" - instanceTypes["m+k80"] = "Standard_NC6" - instanceTypes["l+k80"] = "Standard_NC12" - instanceTypes["xl+k80"] = "Standard_NC24" - instanceTypes["m+v100"] = "Standard_NC6s_v3" - instanceTypes["l+v100"] = "Standard_NC12s_v3" - instanceTypes["xl+v100"] = "Standard_NC24s_v3" + instanceTypes := map[string]string{ + "s": "Standard_B1s", + "m": "Standard_F8s_v2", + "l": "Standard_F32s_v2", + "xl": "Standard_F64s_v2", + "m+t4": "Standard_NC4as_T4_v3", + "m+k80": "Standard_NC6", + "l+k80": "Standard_NC12", + "xl+k80": "Standard_NC24", + "m+v100": "Standard_NC6s_v3", + "l+v100": "Standard_NC12s_v3", + "xl+v100": "Standard_NC24s_v3", + } if val, ok := instanceTypes[instanceType+"+"+instanceGPU]; ok { return val diff --git a/iterative/gcp/provider.go b/iterative/gcp/provider.go index ae44b51f..4ea59a62 100644 --- a/iterative/gcp/provider.go +++ b/iterative/gcp/provider.go @@ -439,6 +439,15 @@ func getRegion(region string) string { func getInstanceType(instanceType string, instanceGPU string) (map[string]map[string]string, error) { instanceTypes := make(map[string]map[string]map[string]string) + instanceTypes["s"] = map[string]map[string]string{ + "accelerator": { + "count": "0", + "type": "", + }, + "machine": { + "type": "g1-small", + }, + } instanceTypes["m"] = map[string]map[string]string{ "accelerator": { "count": "0", @@ -466,6 +475,15 @@ func getInstanceType(instanceType string, instanceGPU string) (map[string]map[st "type": "n2-custom-64-262144", }, } + instanceTypes["m+t4"] = map[string]map[string]string{ + "accelerator": { + "count": "1", + "type": "nvidia-tesla-t4", + }, + "machine": { + "type": "n1-standard-4", + }, + } instanceTypes["m+k80"] = map[string]map[string]string{ "accelerator": { "count": "1",