-
Notifications
You must be signed in to change notification settings - Fork 304
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
Adds secret env_var #3048
base: master
Are you sure you want to change the base?
Adds secret env_var #3048
Conversation
Signed-off-by: Thomas J. Fan <[email protected]>
Code Review Agent Run #f2a7e1Actionable Suggestions - 0Review Details
|
Changelist by BitoThis pull request implements the following key changes.
|
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #3048 +/- ##
===========================================
+ Coverage 47.23% 78.54% +31.30%
===========================================
Files 202 246 +44
Lines 21355 23238 +1883
Branches 2744 2744
===========================================
+ Hits 10088 18253 +8165
+ Misses 10776 4236 -6540
- Partials 491 749 +258 ☔ View full report in Codecov by Sentry. |
lgtm, tests will pass in this PR once this is merged right? flyteorg/flyte#6160 |
Yea and when a new flyteidl version is released. |
Signed-off-by: Thomas J. Fan <[email protected]>
Code Review Agent Run #7c9e36Actionable Suggestions - 0Review Details
|
Tracking issue
Related to flyteorg/flyte#6141 (comment)
Requires flyteorg/flyte#6160
Why are the changes needed?
This PR adds an env_var to the Secrets IDL, which has the follow behavior:
If mount_requirement is ENV_VAR, then we set an environment variable named env_name to the value of the secret.
If mount_requirement is FILE, then we set an environment variable named env_name to the path of the mounted secret.
What changes were proposed in this pull request?
This PR adds
env_name
to theSecrets IDL
. This makes it easy to configure a secret in a Flyte task. For example, one can easily set a hugging face secret:Or for secrets that require a file:
How was this patch tested?
I ran the following to try the two different modes:
Docs link
Summary by Bito
Enhanced Secret class in flytekit by renaming env_name to env_var parameter for improved clarity and consistency. The parameter enables direct secret value access through environment variables when mount_requirement is ENV_VAR, and provides file path access when set to FILE. Updates include changes to class definition, documentation, and protobuf conversion methods for more intuitive secret management configuration.Unit tests added: False
Estimated effort to review (1-5, lower is better): 1