Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

special temporary code to be generalized #753

Merged
merged 2 commits into from
Jan 9, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 9 additions & 6 deletions src/ClusterManager/dist_pod_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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())
Expand All @@ -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"
Expand Down
15 changes: 9 additions & 6 deletions src/ClusterManager/pod_template.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -112,10 +116,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"
Expand Down