Skip to content

Commit 5a3131f

Browse files
marmijodustymabe
authored andcommitted
kola/azure/options: determine default machine size based on architecture
Now that we can build aarch64 Azure images, drop the default machine size from the Cobra command flags and determine it dynamically based on the architecture, consistent with other cloud platforms.
1 parent 3bbf06d commit 5a3131f

File tree

1 file changed

+12
-1
lines changed

1 file changed

+12
-1
lines changed

mantle/cmd/kola/options.go

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ func init() {
9999
sv(&kola.AzureOptions.Sku, "azure-sku", "alpha", "Azure image sku/channel (default \"alpha\"")
100100
sv(&kola.AzureOptions.Version, "azure-version", "", "Azure image version")
101101
sv(&kola.AzureOptions.Location, "azure-location", "westus", "Azure location (default \"westus\"")
102-
sv(&kola.AzureOptions.Size, "azure-size", "Standard_D2s_v3", "Azure machine size (default \"Standard_D2s_v3\")")
102+
sv(&kola.AzureOptions.Size, "azure-size", "", "Azure machine size")
103103
sv(&kola.AzureOptions.AvailabilityZone, "azure-availability-zone", "1", "Azure Availability Zone (default \"1\")")
104104

105105
// do-specific options
@@ -233,6 +233,17 @@ func syncOptionsImpl(useCosa bool) error {
233233
fmt.Printf("Using %s instance type\n", kola.AWSOptions.InstanceType)
234234
}
235235

236+
// Choose an appropriate Azure instance type (size) for the target architecture
237+
if kolaPlatform == "azure" && kola.AzureOptions.Size == "" {
238+
switch kola.Options.CosaBuildArch {
239+
case "x86_64":
240+
kola.AzureOptions.Size = "Standard_D2s_v3"
241+
case "aarch64":
242+
kola.AzureOptions.Size = "Standard_D2ps_v5"
243+
}
244+
fmt.Printf("Using %s size\n", kola.AzureOptions.Size)
245+
}
246+
236247
// Choose an appropriate GCP instance type for the target architecture
237248
if kolaPlatform == "gcp" && kola.GCPOptions.MachineType == "" {
238249
switch kola.Options.CosaBuildArch {

0 commit comments

Comments
 (0)