Skip to content

feat(reconciler): migrate MLRun labels to snake_case format - #819

Merged
CatherineF-dev merged 3 commits into
mainfrom
feat/mlrun-snake-case-labels
Sep 8, 2026
Merged

CatherineF-dev merged 3 commits into
mainfrom
feat/mlrun-snake-case-labels

Conversation

@CatherineF-dev

@CatherineF-dev CatherineF-dev commented Sep 8, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Migrate MLRun labels stamped by the JobSet reconciler from kebab-case (created-by, experiment-id, workunit-id) to snake_case (created_by, experiment_id, workunit_id) to align with Cloud MLRun and Diagon backend label conventions.

Motivation & Context

In Cloud MLRun / Diagon, label keys follow snake_case naming conventions (such as list_existing_sessions_only). Stamping kebab-case keys on MLRun resources leads to inconsistencies with downstream Diagon backend services. This change aligns all reconciler-generated MLRun label keys with snake_case standards.

Key Changes

  • Updated buildMLRunLabels in cmd/reconciler/jobset/reconciler.go to stamp created_by, experiment_id, and workunit_id.
  • Updated mlRunOwnedByXManager in cmd/reconciler/jobset/reconciler.go to check created_by.
  • Updated unit tests in cmd/reconciler/jobset/reconciler_test.go (TestBuildMLRunLabels, TestEnsureMLRunCreated, TestMLRunOwnedByXManager, TestUpsertExistingMLRun) to verify snake_case keys.

Assumptions

None — requirements were fully specified.

Verification & Testing

  • Commands Executed:
    • bazel test //cmd/reconciler/jobset/... (Passed)
    • ./tools/analyze_diff_size.py --base-ref origin/main... (Passed)
    • gofmt -w cmd/reconciler/jobset/
  • Coverage & Test Status: All 82 tests in //cmd/reconciler/jobset:jobset_test passed cleanly.

Related Issues / Bugs

N/A

TAG=agy
CONV=9414b3de-bff6-4fa7-bf48-5be7c8a5ea6f

Update MLRun labels stamped by the JobSet reconciler from kebab-case
(`created-by`, `experiment-id`, `workunit-id`) to snake_case (`created_by`,
`experiment_id`, `workunit_id`) to align with Cloud MLRun and Diagon
label naming standards. Maintain backward compatibility in mlRunOwnedByXManager
by falling back to the legacy `created-by` label.

TAG=agy
CONV=9414b3de-bff6-4fa7-bf48-5be7c8a5ea6f
@CatherineF-dev
CatherineF-dev marked this pull request as ready for review September 8, 2026 11:02
@CatherineF-dev CatherineF-dev mentioned this pull request Sep 8, 2026
1 task done

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request migrates MLRun labels from kebab-case to snake_case (e.g., changing 'created-by' to 'created_by') while maintaining backward compatibility for the legacy 'created-by' label. The feedback suggests adding an additional test case to fully verify the precedence logic when 'created_by' is set to a foreign owner but the legacy 'created-by' is set to 'xmanager'.

…edByXManager

Drop backward compatibility fallback for the legacy created-by label
since ManagedXprof MLRun integration is unlaunched and all runs will
use the new snake_case created_by label.

TAG=agy
CONV=9414b3de-bff6-4fa7-bf48-5be7c8a5ea6f
@CatherineF-dev
CatherineF-dev added this pull request to the merge queue Sep 8, 2026
Merged via the queue into main with commit 75825ff Sep 8, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants