Skip to content

Commit 3ff15ce

Browse files
committed
merge vpc modules and update vpc name scheme
1 parent d53608a commit 3ff15ce

File tree

4 files changed

+378
-413
lines changed

4 files changed

+378
-413
lines changed

setup.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[metadata]
22
name = ibm-ray-config
3-
version = 1.0.0b14
3+
version = 1.0.0b15
44
author = Omer J Cohen
55
author_email = [email protected]
66
description = Interactive tool generating ray configuration for IBM platforms

src/ibm_ray_config/modules/config_builder.py

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
import threading
88
import time
99
import sys
10-
from ibm_ray_config.modules.utils import CACHE, find_default, get_option_from_list
10+
from ibm_ray_config.modules.utils import CACHE, find_default, get_option_from_list, get_region_by_endpoint
1111

1212
logger = logging.getLogger(__name__)
1313

@@ -62,6 +62,17 @@ def init_clients(self, iam_api_key, iam_endpoint=None):
6262
self.resource_controller_service = ResourceControllerV2(authenticator=authenticator)
6363

6464

65+
def get_region(self):
66+
"""returns the region based on
67+
either the endpoint the vpc client was initialized with,
68+
or the parent class region value. """
69+
region = None
70+
try:
71+
region = get_region_by_endpoint(self.ibm_vpc_client.service_url)
72+
except Exception:
73+
region = ConfigBuilder.region
74+
return region
75+
6576
"""Interacts with user to get all required parameters"""
6677

6778
def run(self, config) -> Dict[str, Any]:

0 commit comments

Comments
 (0)