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

[FEATURE] Customizable location for .activeloop directory and handling multiple users with the same client #2797

Closed
maximevw opened this issue Mar 14, 2024 · 2 comments
Labels
enhancement New feature or request

Comments

@maximevw
Copy link

Description

I'm developing an API using Deeplake. The API can be called by different users, each user can specify its own Activeloop token which is used in the API like this:

deeplake = DeepLake(
            dataset_path=f"hub://{deeplake_organisation}/{deeplake_repository}",
            token=activeloop_token,
            ...)

Since the version 3.8.21, the DeepLakeBackendClient has been modified like this:

else:
username = self.get_user_profile()["name"]
if get_reporting_config().get("username") != username:
save_reporting_config(True, username=username)
set_username(username)

So, it creates a file ~/.activeloop/reporting_config.json as soon as we are using a non-public organisation through a specific token not defined in the environment variable ACTIVELOOP_TOKEN.
Previously, the reporting config was only created when the token came from the environment variable:

if self._token_from_env:
username = self.get_user_profile()["name"]
if get_reporting_config().get("username") != username:
save_reporting_config(True, username=username)
set_username(username)

But, the content of reporting_config.json is designed to specify only one username/client id. So, if different users call my API, this file will be overwritten by each different user leading to an inconsistent state.
If I understand well, this configuration is only used to send bug reports to Activeloop, so potentially the bug reports could be wrong in such case.

In conclusion:

  • could we customize the location of this configuration (it is similar to this issue: [FEATURE] Move directory ~/.activeloop Linux #2545), for example to have different configurations for the different users? Or at least the report configuration should support several users.
  • is it possible to easily deactivate the bug reporting for specific users in the same way we are able to specify a token? For now, the consent to send bug reports is not explicit and set to True by default without possibility to easily modify it in my use case.

Use Cases

No response

@maximevw maximevw added the enhancement New feature or request label Mar 14, 2024
@nvoxland-al
Copy link
Contributor

We're currently working on some larger changes to our configuration handling, and improving the .activeloop directory handling is part of that. So the fix will be coming, but not a quick fix on it's own.

As you mention, the username setting in there is really only used for the activeloop usage reporting scenario at this point. We've been cutting down usage of it recently (the commits you pointed to are part of that) and the reporting is all that's left.

Since any reporting we do from that data is in aggregate, cases where the username is wrong ends up not really impacting the results significantly, which is why cleaning up that last usage of the username in there wasn't a priority. But, we will get to it and I'll leave this bug open until we do.

If you'd like to opt-out of the reporting for whatever reason, we look for the consent field in the reporting_config.json file and setting that to "false" will stop anything from being sent. That setting would apply to all the users on your system, since it's a global file. But if it's hard for you to set that, don't worry if the data is slightly wrong. And as part of our general config handling improvements we'll have additional ways of setting that which will hopefully work well for you too.

@maximevw
Copy link
Author

Thank you @nvoxland-al for this detailed answer and clarification. I will follow these future developments carefully.

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

3 participants