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

[WB-10593] Launch kubernetes support taints and tolerations #4086

Merged
merged 2 commits into from Aug 11, 2022
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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 2 additions & 0 deletions tests/unit_tests_old/tests_launch/test_launch_kubernetes.py
Expand Up @@ -245,6 +245,7 @@ def test_launch_kube(
"preemption_policy": "Never",
"node_name": "test-node-name",
"node_selectors": {"test-selector": "test-value"},
"tolerations": [{"key": "test-key", "value": "test-value"}],
},
},
}
Expand All @@ -269,6 +270,7 @@ def test_launch_kube(
assert job.spec.template.spec.restart_policy == args["restart_policy"]
assert job.spec.template.spec.preemption_policy == args["preemption_policy"]
assert job.spec.template.spec.node_name == args["node_name"]
assert job.spec.template.spec.tolerations == args["tolerations"]
assert (
job.spec.template.spec.node_selector["test-selector"]
== args["node_selectors"]["test-selector"]
Expand Down
2 changes: 2 additions & 0 deletions wandb/sdk/launch/runner/kubernetes.py
Expand Up @@ -167,6 +167,8 @@ def populate_pod_spec(
pod_spec["nodeName"] = resource_args.get("node_name")
if resource_args.get("node_selectors"):
pod_spec["nodeSelectors"] = resource_args.get("node_selectors")
if resource_args.get("tolerations"):
pod_spec["tolerations"] = resource_args.get("tolerations")

def populate_container_resources(
self, containers: List[Dict[str, Any]], resource_args: Dict[str, Any]
Expand Down