Skip to content

Commit d555017

Browse files
authored
Use all Lambda regions by default (#2478)
1 parent ca0319a commit d555017

3 files changed

Lines changed: 3 additions & 26 deletions

File tree

src/dstack/_internal/core/backends/aws/configurator.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434

3535
logger = get_logger(__name__)
3636

37+
# where dstack OS images are published
3738
REGIONS = [
3839
("US East, N. Virginia", "us-east-1"),
3940
("US East, Ohio", "us-east-2"),

src/dstack/_internal/core/backends/lambdalabs/compute.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def get_offers(
3939
) -> List[InstanceOfferWithAvailability]:
4040
offers = get_catalog_offers(
4141
backend=BackendType.LAMBDA,
42-
locations=self.config.regions,
42+
locations=self.config.regions or None,
4343
requirements=requirements,
4444
)
4545
offers_with_availability = self._get_offers_with_availability(offers)
@@ -90,7 +90,7 @@ def update_provisioning_data(
9090
if instance_info is not None and instance_info["status"] != "booting":
9191
provisioning_data.hostname = instance_info["ip"]
9292
commands = get_shim_commands(authorized_keys=[project_ssh_public_key])
93-
# shim is asssumed to be run under root
93+
# shim is assumed to be run under root
9494
launch_command = "sudo sh -c '" + "&& ".join(commands) + "'"
9595
thread = Thread(
9696
target=_start_runner,
@@ -119,8 +119,6 @@ def _get_offers_with_availability(
119119
}
120120
availability_offers = []
121121
for offer in offers:
122-
if offer.region not in self.config.regions:
123-
continue
124122
availability = InstanceAvailability.NOT_AVAILABLE
125123
if offer.region in instance_availability.get(offer.instance.name, []):
126124
availability = InstanceAvailability.AVAILABLE

src/dstack/_internal/core/backends/lambdalabs/configurator.py

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -19,26 +19,6 @@
1919
BackendType,
2020
)
2121

22-
REGIONS = [
23-
"us-south-1",
24-
"us-south-2",
25-
"us-south-3",
26-
"us-west-2",
27-
"us-west-1",
28-
"us-midwest-1",
29-
"us-west-3",
30-
"us-east-1",
31-
"us-east-2",
32-
"us-east-3",
33-
"europe-central-1",
34-
"asia-south-1",
35-
"me-west-1",
36-
"asia-northeast-1",
37-
"asia-northeast-2",
38-
]
39-
40-
DEFAULT_REGION = "us-east-1"
41-
4222

4323
class LambdaConfigurator(Configurator):
4424
TYPE = BackendType.LAMBDA
@@ -50,8 +30,6 @@ def validate_config(self, config: LambdaBackendConfigWithCreds, default_creds_en
5030
def create_backend(
5131
self, project_name: str, config: LambdaBackendConfigWithCreds
5232
) -> BackendRecord:
53-
if config.regions is None:
54-
config.regions = REGIONS
5533
return BackendRecord(
5634
config=LambdaStoredConfig(
5735
**LambdaBackendConfig.__response__.parse_obj(config).dict()

0 commit comments

Comments
 (0)