Skip to content

Commit

Permalink
rename name_space to namespace for k8s plugin (#750)
Browse files Browse the repository at this point in the history
  • Loading branch information
oavdeev authored Oct 12, 2021
1 parent 8ab1336 commit fb73234
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 6 deletions.
8 changes: 4 additions & 4 deletions metaflow/plugins/aws/eks/kubernetes_cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,9 @@ def kubernetes():
)
@click.option(
# Note that ideally we would have liked to use `namespace` rather than
# `name-space` but unfortunately, `namespace` is already reserved for
# `k8s-namespace` but unfortunately, `namespace` is already reserved for
# Metaflow namespaces.
"--name-space",
"--k8s-namespace",
default=None,
help="Namespace for Kubernetes job on Amazon EKS.",
)
Expand Down Expand Up @@ -109,7 +109,7 @@ def step(
service_account=None,
secrets=None,
node_selector=None,
name_space=None,
k8s_namespace=None,
cpu=None,
gpu=None,
disk=None,
Expand Down Expand Up @@ -210,7 +210,7 @@ def _sync_metadata():
service_account=service_account,
secrets=secrets,
node_selector=node_selector,
namespace=name_space,
namespace=k8s_namespace,
cpu=cpu,
gpu=gpu,
disk=disk,
Expand Down
11 changes: 9 additions & 2 deletions metaflow/plugins/aws/eks/kubernetes_decorator.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def my_step(self):
"node_selector": None, # e.g., kubernetes.io/os=linux
"gpu": "0",
# "shared_memory": None,
"name_space": None,
"namespace": None,
}
package_url = None
package_sha = None
Expand Down Expand Up @@ -180,7 +180,14 @@ def runtime_step_cli(
cli_args.commands = ["kubernetes", "step"]
cli_args.command_args.append(self.package_sha)
cli_args.command_args.append(self.package_url)
cli_args.command_options.update(self.attributes)

# --namespace is used to specify Metaflow namespace (different
# concept from k8s namespace).
for k,v in self.attributes.items():
if k == 'namespace':
cli_args.command_options['k8s_namespace'] = v
else:
cli_args.command_options['namespace'] = v
cli_args.command_options["run-time-limit"] = self.run_time_limit
cli_args.entrypoint[0] = sys.executable

Expand Down

0 comments on commit fb73234

Please sign in to comment.