2222from kubernetes .client import ApiClient
2323from kubernetes .client .rest import ApiException
2424
25- from ..core .blueprint .blueprint_generator import (
26- get_subnetworks_for_a3mega ,
27- get_subnetworks_for_a3ultra ,
28- get_subnetworks_for_a4 ,
29- )
30- from ..core .capacity import (
31- H100_DEVICE_TYPE ,
32- H100_MEGA_DEVICE_TYPE ,
33- H200_DEVICE_TYPE ,
34- )
35- from ..core .storage import GCS_FUSE_ANNOTATIONS , PARALLELSTORE_ANNOTATIONS
36- from ..core .workload_decorators import (
37- rdma_decorator ,
38- tcpx_decorator ,
39- tcpxo_decorator ,
40- )
4125from ..utils import templates
4226from ..utils .console import xpk_exit , xpk_print
27+ from .capacity import H100_DEVICE_TYPE , H100_MEGA_DEVICE_TYPE , H200_DEVICE_TYPE
4328from .cluster import DEFAULT_NAMESPACE , XPK_SA , setup_k8s_env
4429from .commands import (
4530 run_command_for_value ,
5439 KJOB_SHELL_WORKING_DIRECTORY ,
5540 XpkConfig ,
5641)
42+ from .network import get_cluster_subnetworks
5743from .resources import (
5844 AcceleratorType ,
5945 SystemCharacteristics ,
6046 get_cluster_system_characteristics ,
6147)
6248from .storage import (
49+ GCS_FUSE_ANNOTATIONS ,
50+ PARALLELSTORE_ANNOTATIONS ,
6351 get_auto_mount_gcsfuse_storages ,
6452 get_auto_mount_parallelstore_storages ,
6553 get_auto_mount_storages ,
6654)
55+ from .workload_decorators import (
56+ rdma_decorator ,
57+ tcpx_decorator ,
58+ tcpxo_decorator ,
59+ )
6760from .workload_decorators .tcpxo_decorator import get_tcpxo_deamon_entry
6861
6962KJOB_API_GROUP_NAME = "kjobctl.x-k8s.io"
@@ -176,8 +169,8 @@ class PodTemplateDefaults(Enum):
176169default_interface_annotation = "networking.gke.io/default-interface=eth0"
177170
178171
179- def get_a4_pod_template_annotations () -> tuple [str , str ]:
180- sub_networks = get_subnetworks_for_a4 ( )
172+ def get_a4_pod_template_annotations (args ) -> tuple [str , str ]:
173+ sub_networks = get_cluster_subnetworks ( args )
181174 interfaces_key , interfaces_value = rdma_decorator .get_interfaces_entry (
182175 sub_networks
183176 )
@@ -189,7 +182,7 @@ def get_a4_pod_template_annotations() -> tuple[str, str]:
189182
190183
191184def get_a3ultra_pod_template_annotations (args : Namespace ) -> tuple [str , str ]:
192- sub_networks = get_subnetworks_for_a3ultra (args . cluster )
185+ sub_networks = get_cluster_subnetworks (args )
193186 interfaces_key , interfaces_value = rdma_decorator .get_interfaces_entry (
194187 sub_networks
195188 )
@@ -204,7 +197,7 @@ def get_a3mega_pod_template_annotations(
204197 args : Namespace ,
205198) -> tuple [str , str , str ]:
206199 """Adds or updates annotations in the Pod template."""
207- sub_networks = get_subnetworks_for_a3mega (args . cluster )
200+ sub_networks = get_cluster_subnetworks (args )
208201 tcpxo_deamon_key , tcpxo_deamon_paths = get_tcpxo_deamon_entry ()
209202 interfaces_key , interfaces_value = tcpxo_decorator .get_interfaces_entry (
210203 sub_networks
0 commit comments