Skip to content

Commit

Permalink
SDK - Fixed the broken kfp.gcp.use_preemptible_nodepool extension (#3091
Browse files Browse the repository at this point in the history
)

It was generating broken Kubernetes structures that made the workflow fail at submission time.

Fixes #2847
  • Loading branch information
Ark-kun authored Feb 15, 2020
1 parent 06c03f9 commit 839198f
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions sdk/python/kfp/gcp.py
Original file line number Diff line number Diff line change
Expand Up @@ -112,9 +112,10 @@ def _set_preemptible(task):
node_affinity = V1NodeAffinity(required_during_scheduling_ignored_during_execution=
V1NodeSelector(node_selector_terms=[node_selector_term]))
else:
node_affinity = V1NodeAffinity(preferred_during_scheduling_ignored_during_execution=
node_affinity = V1NodeAffinity(preferred_during_scheduling_ignored_during_execution=[
V1PreferredSchedulingTerm(preference=node_selector_term,
weight=50))
weight=50)
])
affinity = V1Affinity(node_affinity=node_affinity)
task.add_affinity(affinity=affinity)
return task
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ spec:
- affinity:
nodeAffinity:
preferredDuringSchedulingIgnoredDuringExecution:
preference:
- preference:
matchExpressions:
- key: cloud.google.com/gke-preemptible
operator: In
Expand Down

0 comments on commit 839198f

Please sign in to comment.