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

Support providing api credentials from environment #326

Open
elthariel opened this issue Jul 11, 2024 · 0 comments
Open

Support providing api credentials from environment #326

elthariel opened this issue Jul 11, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@elthariel
Copy link

elthariel commented Jul 11, 2024

Is your feature request related to a problem? Please describe.

When using the API in CI environments, it's inconvenient and sometimes impossible to rely on ~/config/runpod.toml. It's a common practice in those cases to supply those credentials using an environment variables

Describe the solution you'd like
I'd like to see this in __init__py:

_credentials = get_credentials(profile)
_env_api_key = os.environ.get('RUNPOD_API_KEY', None)
if _env_api_key is not None:
     api_key = _env_api_key
elif _credentials is not None:
    api_key = _credentials["api_key"]  # pylint: disable=invalid-name
else:
    api_key = None  # pylint: disable=invalid-name

Describe alternatives you've considered

My CI jobs are currently writing into the config file but this is extremely annoying and prone to race conditions

@elthariel elthariel added the enhancement New feature or request label Jul 11, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant