From 08f2f2fc35601d746cadc054e676887b40def2a8 Mon Sep 17 00:00:00 2001 From: "REDMOND\\anbhu" Date: Thu, 9 Jan 2020 13:36:30 -0800 Subject: [PATCH 1/2] Special temporary code --- src/ClusterManager/dist_pod_template.py | 15 +++++++++------ src/ClusterManager/pod_template.py | 13 ++++++++----- 2 files changed, 17 insertions(+), 11 deletions(-) diff --git a/src/ClusterManager/dist_pod_template.py b/src/ClusterManager/dist_pod_template.py index 44cabebae..b6b5b7fd3 100644 --- a/src/ClusterManager/dist_pod_template.py +++ b/src/ClusterManager/dist_pod_template.py @@ -76,11 +76,15 @@ def generate_pods(self, job): job.data_path = params["dataPath"] # TODO user's mountpoints first, but should after 'job_path' job.add_mountpoints(job.job_path_mountpoint()) - job.add_mountpoints({"name": "home", "containerPath": "/home/{}".format(job.get_alias()), "hostPath": job.get_homefolder_hostpath(), "enabled": True}) + # TODO: Remove VC name dependency + if params["vcName"] != "MMBellevue": + job.add_mountpoints({"name": "home", "containerPath": "/home/{}".format(job.get_alias()), "hostPath": job.get_homefolder_hostpath(), "enabled": True}) if "mountpoints" in params: job.add_mountpoints(params["mountpoints"]) - job.add_mountpoints(job.work_path_mountpoint()) - job.add_mountpoints(job.data_path_mountpoint()) + # TODO: Remove VC name dependency + if params["vcName"] != "MMBellevue": + job.add_mountpoints(job.work_path_mountpoint()) + job.add_mountpoints(job.data_path_mountpoint()) job.add_mountpoints(job.vc_custom_storage_mountpoints()) job.add_mountpoints(job.vc_storage_mountpoints()) job.add_mountpoints(job.infiniband_mountpoints()) @@ -103,10 +107,9 @@ def generate_pods(self, job): vc_node_hard_assignment = job.get_vc_node_hard_assignment() if isinstance(vc_node_hard_assignment, dict): vc = params["vcName"] - # Only consider GPU jobs + # TODO: Fix the case where CPU worker exists in a GPU pool if vc in vc_node_hard_assignment and \ - vc_node_hard_assignment[vc] is True and \ - params["resourcegpu"] > 0: + vc_node_hard_assignment[vc] is True: params["nodeSelector"]["vc"] = vc else: params["nodeSelector"]["vc"] = "default" diff --git a/src/ClusterManager/pod_template.py b/src/ClusterManager/pod_template.py index ed06b787e..7f1fa1bb7 100755 --- a/src/ClusterManager/pod_template.py +++ b/src/ClusterManager/pod_template.py @@ -87,11 +87,15 @@ def generate_pods(self, job): job.data_path = params["dataPath"] # TODO user's mountpoints first, but should after 'job_path' job.add_mountpoints(job.job_path_mountpoint()) - job.add_mountpoints({"name": "home", "containerPath": "/home/{}".format(job.get_alias()), "hostPath": job.get_homefolder_hostpath(), "enabled": True}) + # TODO: Remove VC name dependency + if params["vcName"] != "MMBellevue": + job.add_mountpoints({"name": "home", "containerPath": "/home/{}".format(job.get_alias()), "hostPath": job.get_homefolder_hostpath(), "enabled": True}) if "mountpoints" in params: job.add_mountpoints(params["mountpoints"]) - job.add_mountpoints(job.work_path_mountpoint()) - job.add_mountpoints(job.data_path_mountpoint()) + # TODO: Remove VC name dependency + if params["vcName"] != "MMBellevue": + job.add_mountpoints(job.work_path_mountpoint()) + job.add_mountpoints(job.data_path_mountpoint()) job.add_mountpoints(job.vc_custom_storage_mountpoints()) job.add_mountpoints(job.vc_storage_mountpoints()) params["mountpoints"] = job.mountpoints @@ -114,8 +118,7 @@ def generate_pods(self, job): vc = params["vcName"] # Only consider GPU jobs if vc in vc_node_hard_assignment and \ - vc_node_hard_assignment[vc] is True and \ - params["resourcegpu"] > 0: + vc_node_hard_assignment[vc] is True: params["nodeSelector"]["vc"] = vc else: params["nodeSelector"]["vc"] = "default" From baae38371d9ef079d380f85c977ca77bac4eef59 Mon Sep 17 00:00:00 2001 From: "REDMOND\\anbhu" Date: Thu, 9 Jan 2020 13:37:19 -0800 Subject: [PATCH 2/2] Add TODO comment --- src/ClusterManager/pod_template.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ClusterManager/pod_template.py b/src/ClusterManager/pod_template.py index 7f1fa1bb7..6357ae19a 100755 --- a/src/ClusterManager/pod_template.py +++ b/src/ClusterManager/pod_template.py @@ -116,7 +116,7 @@ def generate_pods(self, job): vc_node_hard_assignment = job.get_vc_node_hard_assignment() if isinstance(vc_node_hard_assignment, dict): vc = params["vcName"] - # Only consider GPU jobs + # TODO: Fix the case where CPU worker exists in a GPU pool if vc in vc_node_hard_assignment and \ vc_node_hard_assignment[vc] is True: params["nodeSelector"]["vc"] = vc