Skip to content
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

[bug] <Bug Name>set_env_variable doesn't set env var in a component when running with local.DockerRunner #11341

Open
EladProject opened this issue Oct 30, 2024 · 0 comments

Comments

@EladProject
Copy link

Environment

  • How do you deploy Kubeflow Pipelines (KFP)?
    Installed with poetry

  • KFP version:
    1.7.1

  • KFP SDK version:
    kfp 2.9.0
    kfp-pipeline-spec 0.4.0
    kfp-server-api 2.3.0

Steps to reproduce

I try to run the following test:

from kfp import dsl
from kfp import local

local.init(runner=local.DockerRunner())

@dsl.component
def print_and_return_env_var() -> str:
    import os
    val = os.environ.get('ENV1')
    print("ENV1:", val)
    return val


@dsl.pipeline
def env_var_test() -> str:
    res = print_and_return_env_var()
    res = res.set_env_variable(name="ENV1", value="yoyo")
    return res.output


def test_env_var_local():
    res = env_var_test()
    assert res.output == "yoyo"

Expected result

To print "ENV1: yoyo"
To return "yoyo" in the pipeline result

Materials and reference

When I compile the pipeline, I do see the env var in the pipeline.yaml

Labels

/area backend


Impacted by this bug? Give it a 👍.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant