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

Add mlrun/owner label to runs k8s resources #478

Merged
merged 2 commits into from
Oct 15, 2020
Merged
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
6 changes: 5 additions & 1 deletion mlrun/runtimes/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,11 +316,12 @@ def apply_kfp(modify, cop, runtime):


def get_resource_labels(function, run=None, scrape_metrics=False):
run_uid, run_name, run_project = None, None, None
run_uid, run_name, run_project, run_owner = None, None, None, None
if run:
run_uid = run.metadata.uid
run_name = run.metadata.name
run_project = run.metadata.project
run_owner = run.metadata.labels.get("owner")
labels = deepcopy(function.metadata.labels)
labels[mlrun_key + "class"] = function.kind
labels[mlrun_key + "project"] = run_project or function.metadata.project
Expand All @@ -334,6 +335,9 @@ def get_resource_labels(function, run=None, scrape_metrics=False):
if run_name:
labels[mlrun_key + "name"] = run_name

if run_owner:
labels[mlrun_key + "owner"] = run_owner

return labels


Expand Down