Open tumido opened 1 day ago
Same thing actually happens for kfp.kubernetes.use_secret_as_volume
etc:
from kfp import compiler, dsl
from kfp.kubernetes import use_secret_as_volume
@dsl.component() def op(): pass
@dsl.pipeline() def pipeline(param: str): # <-- Pipeline param declared here task = op() use_secret_as_volume(task=task, secret_name=param, mount_path="/tmp") # <-- Value passed here as templated string reference
if name == "main": compiler.Compiler().compile(pipeline, "pipeline.yaml")
2. Try to compile it:
```bash
$ python pipeline.py
...
File ".../lib/python3.12/site-packages/kfp/kubernetes/secret.py", line 81, in use_secret_as_volume
secret_as_vol = pb.SecretAsVolume(
^^^^^^^^^^^^^^^^^^
TypeError: bad argument type for built-in operation
Is this the same as: https://github.com/kubeflow/pipelines/issues/10914
But just manifesting in a different place?
Something weird is going on with env variables and pipeline parameters in the SDK:
Environment
KFP version: 2.3
KFP SDK version: 2.10.1
Steps to reproduce
Reference a pipeline param directly:
Have a
pipeline.py
:Reference a pipeline param directly with default value
""
:Have a
pipeline.py
:Templated/indirect reference (probably missuse of the DSL:
Have a
pipeline.py
:Compiles successfully
See the IR YAML:
Submit the pipeline and see the logs. The environment variable value is
{{channel:task=;name=param;type=String;}}
and it never gets templated.Expected result
Be able to pass a pipeline parameter to environment variable of a component.
Materials and Reference
Impacted by this bug? Give it a 👍.