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

K8S: use namespace not name_space #750

Merged
merged 1 commit into from
Oct 12, 2021
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
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