-
Notifications
You must be signed in to change notification settings - Fork 455
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
feature: Adding trial name as env for metrics collectors #2165
feature: Adding trial name as env for metrics collectors #2165
Conversation
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: axel7083 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@axel7083 Thank you for the contribution! I left a few comments.
@kubeflow/wg-automl-leads Could you approve CI?
Co-authored-by: Yuki Iwai <[email protected]>
…' into feature/trial-name-to-containers
Thank you for this contribution @axel7083! Also, I don't understand why we need to add Trial name to the metrics collector container ? |
Hummm, I did not know that, I tried to made a custom collectors myself. Base on what I saw in the code katib/pkg/webhook/v1beta1/pod/inject_webhook.go Lines 301 to 303 in ede6e74
I thought it was not possible to get the trial name without doing some weird parsing of the hostname. Like I saw in #2118. Then I do not really understand the following example inside
TrialNamePrefix will be equal to the trial name ? Why the word Other question then, can we use ${trialParameters.trialName} in custom metrics collector ? |
I think, that is required to get Trial name inside Metrics Collector container since it is not part of Trial Spec.
No, that is not possible today. I think, we have a few options:
What do you think @tenzen-y @johnugeorge @axel7083 ? |
@andreyvelich Thanks for the summary. @axel7083 You can refer to the following how to get trialName from labels: katib/manifests/v1beta1/components/controller/controller.yaml Lines 54 to 58 in ede6e74
|
Alright the following solution as @andreyvelich suggested is very suitable for the requirements I had in mind. ...
- name: KATIB_TRIAL_NAME
valueFrom:
fieldRef:
fieldPath: metadata.labels['katib.kubeflow.org/trial']
... Closing as resolved without modification |
What this PR does / why we need it:
This will add the
KATIB_TRIAL_NAME
env containing the trial name to all the containers.This would simply many interactions, the trial name is injected for every metrics collectors, which made it more difficult to create custom collectors.
The typical example is the following in the #2118
katib/cmd/metricscollector/v1beta1/kfp-metricscollector/v1/main.py
Line 68 in 25ac27f
Parsing the pod_name is not really a good practice. Instead injecting with a proper env is probably more suitable.
Injecting in every pods make it also easier for trial without metrics collector to push themself metrics to katib.
Which issue(s) this PR fixes (optional, in
fixes #<issue number>(, fixes #<issue_number>, ...)
format, will close the issue(s) when PR gets merged):Fixes #
Checklist: