Skip to content

Commit b245b20

Browse files
committed
fix node-selector init in compute_pool case, and fix typo in compute pool node-selector. add ability to skip passing some attributes to step CLI
1 parent 7b64927 commit b245b20

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

metaflow/plugins/kubernetes/kubernetes_decorator.py

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -158,10 +158,12 @@ def __init__(self, attributes=None, statically_defined=False):
158158
self.attributes["node_selector"].split(",")
159159
)
160160
if self.attributes["compute_pool"]:
161+
if self.attributes["node_selector"] is None:
162+
self.attributes["node_selector"] = {}
161163
self.attributes["node_selector"].update(
162-
{"outerbounds.co/compute_pool": self.attributes["compute_pool"]}
164+
{"outerbounds.co/compute-pool": self.attributes["compute_pool"]}
163165
)
164-
del self.attributes["compute_pool"]
166+
# del self.attributes["compute_pool"]
165167

166168
if self.attributes["tolerations"]:
167169
try:
@@ -379,9 +381,13 @@ def runtime_step_cli(
379381
cli_args.command_args.append(self.package_sha)
380382
cli_args.command_args.append(self.package_url)
381383

384+
# skip certain keys as CLI arguments
385+
_skip_keys = ["compute_pool"]
382386
# --namespace is used to specify Metaflow namespace (a different
383387
# concept from k8s namespace).
384388
for k, v in self.attributes.items():
389+
if k in _skip_keys:
390+
continue
385391
if k == "namespace":
386392
cli_args.command_options["k8s_namespace"] = v
387393
elif k in {"node_selector"} and v:

0 commit comments

Comments
 (0)