[backend][sdk] Cannot assign values from Kubernetes Metadata to Environment Variables in V2 #10155
Labels
area/backend
kind/bug
lifecycle/stale
The issue / pull request is stale, any activities remove this label.
Environment
How did you deploy Kubeflow Pipelines (KFP)?
Using AWS distribution of Kubeflow.
KFP version:
Built from 1.8 branch the day before 1.8-rc2 was released.
KFP SDK version:
Steps to reproduce
When using
kfp==1.8.21
andkubernetes=26.1.0
I could do the following during pipeline compilation to set kubernetes metadata values to environment variables within a component.However, in
kfp==2.3.0
, there is no longer anadd_env_variable
, and it appears to have been replace withset_env_variable
. However, there are just two mandatory fields,name
andvalue
, and there appears to be no way to set environment values from kubernetes.I tried a workaround where I simply set placeholder values during compilation and then post-processed the YAML to add the kubernetes metadata environment variables back in. This is shown in the code snippet below.
I was optimistic this would work, but when I started a run and logged the values of those environment variables, they were null-valued. If I check out the pod with the following command:
I see the following output. The environment variables I assigned do not have the intended
valueFrom
field. However, other environment variables that have been assigned to the pod by non-user-specified processes do have thevalueFrom
field in exactly the same format as I had in my compiled YAML.Expected result
I should be able to assign kubernetes metadata values as environment variables to a component using Kubeflow's DSL, but if that's not possible, at the very least being able to post-process the YAML to add these values as they were added in V1, and not having them modified to remove the valueFrom metadata tags in the backend would be sufficient. Perhaps the most logical place for this functionality is in the new
kfp-kubernetes
SDKImpacted by this bug? Give it a 👍.
The text was updated successfully, but these errors were encountered: