Skip to content

Commit

Permalink
added new zone, new regions and sorted the vms
Browse files Browse the repository at this point in the history
  • Loading branch information
racinmat committed Aug 18, 2023
1 parent 4e3121e commit 419e754
Showing 1 changed file with 56 additions and 46 deletions.
102 changes: 56 additions & 46 deletions src/wanna/core/utils/gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,27 +64,28 @@ def get_available_compute_machine_types(project_id: str, zone: str) -> List[str]
machine_types = [mtype.name for mtype in response.items]
else:
machine_types = [
"c2-standard-30",
"c2-standard-4",
"c2-standard-60",
"c2-standard-8",
"e2-highcpu-16",
"c2-standard-16",
"c2-standard-30",
"c2-standard-60",
"e2-highcpu-2",
"e2-highcpu-32",
"e2-highcpu-4",
"e2-highcpu-8",
"e2-highmem-16",
"e2-highcpu-16",
"e2-highcpu-32",
"e2-highmem-2",
"e2-highmem-4",
"e2-highmem-8",
"e2-highmem-16",
"e2-medium",
"e2-micro",
"e2-small",
"e2-standard-16",
"e2-standard-2",
"e2-standard-32",
"e2-standard-4",
"e2-standard-8",
"e2-standard-16",
"e2-standard-32",
"f1-micro",
"g1-small",
"m1-megamem-96",
Expand All @@ -94,100 +95,105 @@ def get_available_compute_machine_types(project_id: str, zone: str) -> List[str]
"m2-megamem-416",
"m2-ultramem-208",
"m2-ultramem-416",
"n1-highcpu-16",
"n1-highcpu-2",
"n1-highcpu-32",
"n1-highcpu-4",
"n1-highcpu-64",
"n1-highcpu-8",
"n1-highcpu-16",
"n1-highcpu-32",
"n1-highcpu-64",
"n1-highcpu-96",
"n1-highmem-16",
"n1-highmem-2",
"n1-highmem-32",
"n1-highmem-4",
"n1-highmem-64",
"n1-highmem-8",
"n1-highmem-32",
"n1-highmem-64",
"n1-highmem-96",
"n1-megamem-96",
"n1-standard-1",
"n1-standard-16",
"n1-standard-2",
"n1-standard-32",
"n1-standard-4",
"n1-standard-64",
"n1-standard-8",
"n1-standard-16",
"n1-standard-32",
"n1-standard-64",
"n1-standard-96",
"n1-ultramem-160",
"n1-ultramem-40",
"n1-ultramem-80",
"n2-highcpu-16",
"n1-ultramem-160",
"n2-highcpu-2",
"n2-highcpu-32",
"n2-highcpu-4",
"n2-highcpu-8",
"n2-highcpu-16",
"n2-highcpu-32",
"n2-highcpu-48",
"n2-highcpu-64",
"n2-highcpu-8",
"n2-highcpu-80",
"n2-highcpu-96",
"n2-highmem-128",
"n2-highmem-16",
"n2-highmem-2",
"n2-highmem-32",
"n2-highmem-4",
"n2-highmem-8",
"n2-highmem-16",
"n2-highmem-32",
"n2-highmem-48",
"n2-highmem-64",
"n2-highmem-8",
"n2-highmem-80",
"n2-highmem-96",
"n2-standard-128",
"n2-standard-16",
"n2-highmem-128",
"n2-standard-2",
"n2-standard-32",
"n2-standard-4",
"n2-standard-8",
"n2-standard-16",
"n2-standard-32",
"n2-standard-48",
"n2-standard-64",
"n2-standard-8",
"n2-standard-80",
"n2-standard-96",
"n2-standard-128",
"n2d-highcpu-128",
"n2d-highcpu-16",
"n2d-highcpu-2",
"n2d-highcpu-224",
"n2d-highcpu-32",
"n2d-highcpu-4",
"n2d-highcpu-8",
"n2d-highcpu-16",
"n2d-highcpu-32",
"n2d-highcpu-48",
"n2d-highcpu-64",
"n2d-highcpu-8",
"n2d-highcpu-80",
"n2d-highcpu-96",
"n2d-highmem-16",
"n2d-highcpu-224",
"n2d-highmem-2",
"n2d-highmem-32",
"n2d-highmem-4",
"n2d-highmem-8",
"n2d-highmem-16",
"n2d-highmem-32",
"n2d-highmem-48",
"n2d-highmem-64",
"n2d-highmem-8",
"n2d-highmem-80",
"n2d-highmem-96",
"n2d-standard-128",
"n2d-standard-16",
"n2d-standard-2",
"n2d-standard-224",
"n2d-standard-32",
"n2d-standard-4",
"n2d-standard-8",
"n2d-standard-16",
"n2d-standard-32",
"n2d-standard-48",
"n2d-standard-64",
"n2d-standard-8",
"n2d-standard-80",
"n2d-standard-96",
"n2d-standard-128",
"n2d-standard-224",
"t2d-standard-1",
"t2d-standard-16",
"t2d-standard-2",
"t2d-standard-32",
"t2d-standard-4",
"t2d-standard-8",
"t2d-standard-16",
"t2d-standard-32",
"t2d-standard-48",
"t2d-standard-60",
"t2d-standard-8",
"a2-highgpu-1g",
"a2-highgpu-2g",
"a2-highgpu-4g",
"a2-highgpu-8g",
"a2-megagpu-16g",
]

return machine_types
Expand All @@ -208,17 +214,21 @@ def get_available_zones(project_id: str) -> List[str]:
return [zone.name for zone in response.items]
else:
return [
"us-east1-b",
"us-east1-c",
"us-east1-d",
"us-west1-a",
"us-west1-b",
"us-west1-c",
"us-west1-a",
"europe-west1-b",
"europe-west1-d",
"europe-west1-c",
"europe-west3-c",
"europe-west1-d",
"europe-west3-a",
"europe-west3-b",
"europe-west3-c",
"europe-west4-a",
"europe-west4-b",
"europe-west4-c",
]


Expand All @@ -235,7 +245,7 @@ def get_available_regions(project_id: str) -> List[str]:
response = RegionsClient(credentials=get_credentials()).list(project=project_id)
return [region.name for region in response.items]
else:
return ["europe-west1", "europe-west3", "us-east1", "us-west1"]
return ["europe-west1", "europe-west3", "europe-west4", "us-east1", "us-west1"]


def get_region_from_zone(zone: str) -> str:
Expand Down

0 comments on commit 419e754

Please sign in to comment.