Follow up T265691: [tbs.maintaindbusers] Update maintain-dbusers to create an envvar with replica.my.cnf to be used by buildpack images by making the python-toolforge library use the envvar values when present rather than loading the replica.my.cnf file from disk.
Description
| Status | Subtype | Assigned | Task | ||
|---|---|---|---|---|---|
| Resolved | Feature | LucasWerkmeister | T339940 Support reading Wiki Replica/ToolsDB credentials from envvars | ||
| Resolved | dcaro | T265691 [tbs.maintaindbusers] Update maintain-dbusers to create an envvar with replica.my.cnf to be used by buildpack images | |||
| Duplicate | None | T291409 [NFS] Update maintain_dbusers so it can run on a VM | |||
| Resolved | dcaro | T334578 [toolforge] Create a secrets management offering to avoid storing on NFS | |||
| Resolved | dcaro | T337538 [toolforge] Create envvars management offering | |||
| Resolved | dcaro | T344155 [toolforge-weld] Allow passing embedded certs in the kubeconfig |
Event Timeline
The current connection logic is in https://gitlab.wikimedia.org/toolforge-repos/python-toolforge/-/blob/main/src/toolforge/__init__.py?ref_type=heads#L75-82. https://wikitech.wikimedia.org/wiki/Help:Toolforge/Building_container_images#Connecting_to_ToolsDB_and_the_Wiki_Replicas is the current documentation for the envvars replacement.
The library needs a small amount of refactoring to take advantage of the newly split envvar credentials for Wiki Replicas vs ToolsDB. It seems like a reasonable implementation of the connect logic would check for the specific username and password envvars for the desired backend, use them if found, and fallback to the the current ~/replica.my.cnf logic if not.
lucaswerkmeister opened https://gitlab.wikimedia.org/toolforge-repos/python-toolforge/-/merge_requests/27
Use toolforge envvars if available
bd808 merged https://gitlab.wikimedia.org/toolforge-repos/python-toolforge/-/merge_requests/27
Use toolforge envvars if available
lucaswerkmeister opened https://gitlab.wikimedia.org/toolforge-repos/python-toolforge/-/merge_requests/28
Release 6.1.0
lucaswerkmeister merged https://gitlab.wikimedia.org/toolforge-repos/python-toolforge/-/merge_requests/28
Release 6.1.0