Hi! Quick question, since I repeatedly wondered ab...
# help
a
Hi! Quick question, since I repeatedly wondered about that during development on our lakefs-spec package, where I frequently switch between multiple lakeFS server instances: would it make sense to allow specifying the path to the
lakectl
config file through an env var (e.g.,
LAKECTL_CONFIG
) in addition to passing it through the command line? I could see that also feeding into the high-level Python SDK to facilitate config auto-discovery. If that sounds like a useful addition, I can also put together a draft PR soon.
e
Hi @Adrian Rumpold, Although the use case might be niche, I can see how this would be a very convenient option to have, and I agree it can enable a better workflow for the SDK My suggestion would be to open an issue for it I’ll discuss it with the team and see if we’ve got any input And, of course, contributions are always very much appreciated 🫢🏻
a
Cool, I'll open an issue for it! Another spin on the motivation for this feature could be using
lakectl
in a CI environment, where it's usually easy to mount secret credentials as files and have their path exposed as an environment variable.
e
Thank you for the detailed context on the issue πŸ™πŸ» Seems like a useful addition, both for
lakectl
and the SDKs
n
@Adrian Rumpold Hi - out of curiosity: What's the advantage of providing an env variable for the lakectl config over just providing the env variables for the configuration parameters themselves?
i.e.
Copy code
LAKECTL_CREDENTIALS_ACCESS_KEY_ID=AKIAIOSFDNN7EXAMPLEQ
etc.
a
That's a possible solution, but harder to keep consistent (especially when switching between instances, where you might also have to remember to unset variables - less of a problem for CI environments, obviously)
Tbh, what I would find most attractive, is a unification of the way that lakectl and the Python SDK handle config discovery, since that is my/our primary use case (being in the Python ecosystem). Since the Python SDK doesn't honor the
LAKECTL_
env vars for individual settings, we end up with some sort of diverging logic between the tools
n
The SDK does in fact honor the LAKECTL env vars. If you've encountered a bug with this mechanism please report it πŸ™πŸ½
a
Huh, then I must have been doing something wrong - I'll check my setup!
n
Are you using the default client?
a
Hm, I can't figure out what initially was my problem from the current state of my code, but looking at https://github.com/treeverse/lakeFS/blob/master/clients/python-wrapper/lakefs/config.py#L75-L77, I believe your argument πŸ˜„
πŸ˜„ 1
n
Code looks familiar
πŸ˜… 1
a
Either way, would you agree that
_LAKECTL_YAML_PATH
could benefit from being user-specified, with the
~/.lakectl.yaml
as a default?
That would be a fully backwards-compatible change, unless I'm missing something
n
Sorry, I missed your messages. I think it's something we can do, though I'm not fully convinced this has a significant added value over the other env vars. I suggest opening an issue on this and we'll discuss with the team
πŸ‘ 1
a
No worries! I have opened an issue already, link is further up in this thread πŸ™‚
πŸŽ‰ 2