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

WIP: fix(Backend+SDK): Update kubernetes.use_secret_as_env to accept secret name dynamically at runtime #11121

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DharmitD
Copy link
Contributor

@DharmitD DharmitD commented Aug 20, 2024

Description of your changes:
Resolves #10914
Similar to #11039

  • Updated SDK DSL compile code to have the secret_name accepted as a PipelineParameterChannel type this way:
@dsl.component(base_image=<base_image>)
def print_secret():
    import os
    # print(os.environ['SECRET_VAR'])

@dsl.pipeline
def pipeline(secret_name: str):
    task = print_secret()
    kubernetes.use_secret_as_env(task,
                                 secret_name=secret_name,
                                 secret_key_to_env={'password': 'SECRET_VAR'})
  • Implemented support for dynamically specifying secret names in the use_secret_as_env function.
  • Updated driver code to handle secret name substitution at runtime based on input parameters.
  • Introduced a {{secret_name}} template string representation for secret names in the compiled DSL.
  • Added a test to validate secret name template creation in IR.

Checklist:

Copy link

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by:
Once this PR has been reviewed and has the lgtm label, please assign chensun for approval. For more information see the Kubernetes Code Review Process.

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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@DharmitD
Copy link
Contributor Author

@chensun updates same as that in #11039
Could you please take a look at both PRs and let us know if this approach works? Thank you!

@VaniHaripriya
Copy link
Contributor

Looks good to me.

@DharmitD
Copy link
Contributor Author

@chensun updates same as that in #11039
Could you please take a look at both PRs and let us know if this approach works? Thank you!

@DharmitD
Copy link
Contributor Author

@chensun bumping :)

cc: @gregsheremeta @rimolive

Copy link
Member

@chensun chensun left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@DharmitD DharmitD changed the title fix(SDK): Update kubernetes.use_secret_as_env to accept secret name dynamically at runtime WIP: fix(Backend+SDK): Update kubernetes.use_secret_as_env to accept secret name dynamically at runtime Oct 9, 2024
@HumairAK HumairAK added this to the KFP 2.4.0 milestone Oct 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants