-
Notifications
You must be signed in to change notification settings - Fork 456
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 KATIB_EXPERIMENT_NAME to pod env. #2488
base: master
Are you sure you want to change the base?
Add KATIB_EXPERIMENT_NAME to pod env. #2488
Conversation
Signed-off-by: Electronic-Waste <[email protected]>
@Electronic-Waste: GitHub didn't allow me to request PR reviews from the following users: mickvangelderen, tariq-hasan. Note that only kubeflow members and repo collaborators can review this PR, and authors cannot review their own PRs. In response to this:
Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. |
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 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 |
Name: consts.EnvExperimentName, | ||
ValueFrom: &v1.EnvVarSource{ | ||
FieldRef: &v1.ObjectFieldSelector{ | ||
FieldPath: fmt.Sprintf("metadata.labels['%s']", consts.LabelExperimentName), |
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.
This label exists in Trial Pod. Here is an example:
Name: tune-experiment-lhs5mrsh-9xqwd
Namespace: kubeflow
Priority: 0
Service Account: default
Start Time: Wed, 15 Jan 2025 06:29:28 +0000
Labels: batch.kubernetes.io/controller-uid=859791df-d3da-404d-841c-86eca6c9148f
batch.kubernetes.io/job-name=tune-experiment-lhs5mrsh
controller-uid=859791df-d3da-404d-841c-86eca6c9148f
job-name=tune-experiment-lhs5mrsh
katib.kubeflow.org/experiment=tune-experiment
katib.kubeflow.org/trial=tune-experiment-lhs5mrsh
Annotations: sidecar.istio.io/inject: false
Status: Running
...
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.
Oh so we can already reference metadata.labels['katib.kubeflow.org/experiment']
in the spec? That means that the issue #2473 can already be closed as completed as we can obtain the namespace from /var/run/secrets/kubernetes.io/serviceaccount/namespace
and the experiment name from the metadata.labels['katib.kubeflow.org/experiment']
.
Still, I think it would be convenient to have these values exposed as environment variables by default.
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.
@mickvangelderen We could not access metadata.labels['katib.kubeflow.org/experiment']
directly since it's not included in .trialSpec.Labels
field. The label lies in .Labels
field in Trial and Pod.
And also, I agree with you that it will be more convenient if we could also pass KATIB_NAMESPACE
to env of Pod by default. WDTY👀 @kubeflow/wg-automl-leads
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.
@mickvangelderen And it will also be okay to pass namespace and trial name as env variables like this:
env: | |
- name: TRIAL_NAME | |
value: ${trialParameters.trialName} | |
- name: TRIAL_NAMESPACE | |
value: ${trialParameters.trialNamespace} |
Signed-off-by: Electronic-Waste <[email protected]>
/rerun-all |
3 similar comments
/rerun-all |
/rerun-all |
/rerun-all |
What this PR does / why we need it:
Users sometimes may need experiment metadata for their customized applications like: #2473
As we discussed in #2390, we can get namespace of experiment from:
So we only need to pass experiment name as
KATIB_EXPERIMENT_NAME
to the Pod Env just likeKATIB_TRIAL_NAME
:)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 #2473
Also related to: #2390
Checklist:
/cc @kubeflow/wg-automl-leads @mickvangelderen @helenxie-bit @tariq-hasan