Open adrianriobo opened 1 month ago
This is partially fixed with https://github.com/redhat-developer/mapt/pull/314/commits/77281e5c39060077c64f53ca8bf3914bccf09c6b but still there are inconsistencies for all the types of machines and regions (i.e. windows on aws does not using it at all).
There is an option for using metadata (specs for machines instead of actual types) for spot price searches and for autoscaling groups. We may need consider if we can make us of them maybe on one side or even on both.
Running some pipelines tryting to provision Fedora with arm64 on Azure I got a similar issue:
[37mDEBU[0m Best spot price option found: &{standard_d16ps_v5 westus 0.095433}
[36mINFO[0m @ updating....
[36mINFO[0m + azure-native:resources:ResourceGroup fedora-als-rg creating (0s)
[36mINFO[0m + tls:index:PrivateKey fedora-als-privatekey-user creating (0s)
[36mINFO[0m @ updating.....
[36mINFO[0m + azure-native:resources:ResourceGroup fedora-als-rg created (1s)
[36mINFO[0m + azure-native:network:PublicIPAddress fedora-als-pip creating (0s)
[36mINFO[0m + azure-native:network:VirtualNetwork fedora-als-vn creating (0s)
[36mINFO[0m @ updating....
[36mINFO[0m + tls:index:PrivateKey fedora-als-privatekey-user created (2s)
[36mINFO[0m @ updating.....
[36mINFO[0m + azure-native:network:PublicIPAddress fedora-als-pip created (3s)
[36mINFO[0m @ updating......
[36mINFO[0m + azure-native:network:VirtualNetwork fedora-als-vn created (5s)
[36mINFO[0m + azure-native:network:Subnet fedora-als-sn creating (0s)
[36mINFO[0m @ updating.......
[36mINFO[0m + azure-native:network:Subnet fedora-als-sn created (4s)
[36mINFO[0m + azure-native:network:NetworkInterface fedora-als-ni creating (0s)
[36mINFO[0m @ updating.....
[36mINFO[0m + azure-native:network:NetworkInterface fedora-als-ni created (2s)
[36mINFO[0m + azure-native:compute:VirtualMachine fedora-als-vm creating (0s)
[36mINFO[0m @ updating....................................
[36mINFO[0m + azure-native:compute:VirtualMachine fedora-als-vm creating (32s) error: Code="GalleryImageNotFound" Message="\"The gallery image /CommunityGalleries/Fedora-5e266ba4-2250-406d-adad-5d73860d958f/Images/Fedora-Cloud-40-Arm64/Versions/latest is not available in westus region. Please contact image owner to replicate to this region, or change your requested region.\"" Target="imageReference"
[36mINFO[0m + azure-native:compute:VirtualMachine fedora-als-vm **creating failed** error: Code="GalleryImageNotFound" Message="\"The gallery image /CommunityGalleries/Fedora-5e266ba4-2250-406d-adad-5d73860d958f/Images/Fedora-Cloud-40-Arm64/Versions/latest is not available in westus region. Please contact image owner to replicate to this region, or change your requested region.\"" Target="imageReference"
[36mINFO[0m + pulumi:pulumi:Stack fedora-stackAzureLinux-fedora creating (48s) error: update failed
[36mINFO[0m + pulumi:pulumi:Stack fedora-stackAzureLinux-fedora **creating failed (48s)** 1 error
[36mINFO[0m Diagnostics:
[36mINFO[0m azure-native:compute:VirtualMachine (fedora-als-vm):
[36mINFO[0m error: Code="GalleryImageNotFound" Message="\"The gallery image /CommunityGalleries/Fedora-5e266ba4-2250-406d-adad-5d73860d958f/Images/Fedora-Cloud-40-Arm64/Versions/latest is not available in westus region. Please contact image owner to replicate to this region, or change your requested region.\"" Target="imageReference"
[36mINFO[0m
[36mINFO[0m pulumi:pulumi:Stack (fedora-stackAzureLinux-fedora):
So for aws we need to check the spot prices based on the VM specs instead of directly using EC2 specific vm type names, for Azure i think we'll have to have a another filter, first we find out the VM candidates then filter it again based on the requested OS if that image is available in the selected location and finally return the result
for azure i also noticed that some regions don't have support for Resource Groups, which is a hard requirement for mapt
as of now, so we can limit the spot search by default to the regions that does support Resource Groups
Diagnostics:
azure-native:resources:ResourceGroup (az-ghrunner-awd-rg):
error: autorest/azure: Service returned an error. Status=400 Code="LocationNotAvailableForResourceGroup" Message="The provided location 'southafricawest' is not available for resource group. List of available regions is 'eastasia,southeastasia,australiaeast,australiasoutheast,brazilsouth,canadacentral,canadaeast,switzerlandnorth,germanywestcentral,eastus2,eastus,centralus,northcentralus,francecentral,uksouth,ukwest,centralindia,southindia,jioindiawest,italynorth,japaneast,japanwest,koreacentral,koreasouth,mexicocentral,northeurope,norwayeast,polandcentral,qatarcentral,spaincentral,swedencentral,uaenorth,westcentralus,westeurope,westus2,westus,southcentralus,westus3,southafricanorth,australiacentral,australiacentral2,israelcentral,westindia,newzealandnorth'."
Yeah seems reasonable. On my partial fix I applied the suggested fix you said for azure on AWS, so if we want to change everything there (meaning instead of check spot by type machine use directly the specs) we can have it a separate issue (enhancement).
On the azure side definitely apply the second filter and remove regions not supporting Resource Groups.
Just as a side note on this last thing, do not want to complicate things but if I am not wrong nothing is preventing to have the resource group on a different region than the actual resources it groups.
There is some checks missing when looking for best spot price / type machine:
We can see:
But when we try to use the recommended machine type we got: