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

Adds callable option to get secrets for the W&B plugin #2449

Merged
merged 4 commits into from
Jun 18, 2024

Conversation

thomasjpfan
Copy link
Member

Why are the changes needed?

Uses can manage their own secrets with .netrc or directly pulling from an AWS secret manager with boto3. With this PR, useres can define a callable to pull their W&B API Key from any of these sources.

What changes were proposed in this pull request?

This PR extends wandb_init.secrets to accept a callable that takes in no arguments and returns a string (The API Key).

How was this patch tested?

I added unit tests to check the new behavior.

kumare3
kumare3 previously approved these changes May 29, 2024
# Get API key with callable
wandb_api_key = self.secret()

os.environ["WANDB_API_KEY"] = wandb_api_key
Copy link
Contributor

Choose a reason for hiding this comment

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

There is no way to not set env vars?

Copy link
Member Author

Choose a reason for hiding this comment

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

We can use wandb.login. I added it in 8480849

@eapolinario eapolinario merged commit 29662e7 into flyteorg:master Jun 18, 2024
45 of 46 checks passed
bgedik pushed a commit to bgedik/flytekit that referenced this pull request Jul 3, 2024
* Adds callable option to get secrets

Signed-off-by: Thomas J. Fan <[email protected]>

* DOC Improve docstring

Signed-off-by: Thomas J. Fan <[email protected]>

* Use wandb.login instead of environment variable

Signed-off-by: Thomas J. Fan <[email protected]>

---------

Signed-off-by: Thomas J. Fan <[email protected]>
Signed-off-by: bugra.gedik <[email protected]>
fiedlerNr9 pushed a commit that referenced this pull request Jul 25, 2024
* Adds callable option to get secrets

Signed-off-by: Thomas J. Fan <[email protected]>

* DOC Improve docstring

Signed-off-by: Thomas J. Fan <[email protected]>

* Use wandb.login instead of environment variable

Signed-off-by: Thomas J. Fan <[email protected]>

---------

Signed-off-by: Thomas J. Fan <[email protected]>
Signed-off-by: Jan Fiedler <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants