Skip to content

Support MongoDB cache credentials outside URI#4276

Open
mindbomber wants to merge 1 commit into
stanford-crfm:mainfrom
mindbomber:codex/mongo-cache-credentials
Open

Support MongoDB cache credentials outside URI#4276
mindbomber wants to merge 1 commit into
stanford-crfm:mainfrom
mindbomber:codex/mongo-cache-credentials

Conversation

@mindbomber

Copy link
Copy Markdown
Contributor

Fixes #2522.

Summary

  • Resolve MongoDB cache settings from --mongo-uri, HELM_MONGODB_URI, or mongoUri in credentials.conf.
  • Allow MongoDB username/password to be supplied via HELM_MONGODB_USERNAME / HELM_MONGODB_PASSWORD or mongoUsername / mongoPassword in credentials.conf.
  • Pass MongoDB credentials to MongoClient separately and redact credentials from cache config representations and cache stats keys.
  • Document the new credentials and environment variable options.

Verification

  • python -m compileall src\helm\common\cache_backend_config.py src\helm\common\cache.py src\helm\common\mongo_key_value_store.py src\helm\benchmark\run.py src\helm\proxy\server.py
  • $env:PYTHONPATH='src'; $env:PYTHONUTF8='1'; python -m pytest -o addopts='' src\helm\common\test_cache_backend_config.py -q
  • python -m ruff check src/helm/common/cache_backend_config.py src/helm/common/cache.py src/helm/common/mongo_key_value_store.py src/helm/benchmark/run.py src/helm/proxy/server.py src/helm/common/test_cache_backend_config.py
  • python -m black --check src/helm/common/cache_backend_config.py src/helm/common/cache.py src/helm/common/mongo_key_value_store.py src/helm/benchmark/run.py src/helm/proxy/server.py src/helm/common/test_cache_backend_config.py
  • git diff --check

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.

Allow specifying MongoDB password via alternate means

1 participant