-
Notifications
You must be signed in to change notification settings - Fork 118
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
Several changes to support why.init for authenticated users #1311
Conversation
0782060
to
2ae41f2
Compare
2ae41f2
to
b2961fb
Compare
1b5f3dd
to
eb5126f
Compare
@jamie256 @andyndang Looks like there are 36 different example notebooks that included WHYLABS_API_KEY. All of those will have to be updated. I'm going to hold off on touching those until I know this PR and the new doc page look good though. I have to take an inventory of the things that need to change on the doc site as well. |
88579c8
to
11b039a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just ran the Writing_Regression_Performance_Metrics_to_WhyLabs
without any changes on this branch, and some things to note:
- There are some rather spammy messages, when logging:
😭 No active session found because why.init() wasn't used. Skipping reference profile upload. Start a session with why.init(session_type='whylabs_anonymous') writing profiles to whylabs...
- and also when calling
results.writer("whylabs").write()
:Initialing session with config /home/felipeadachi/.config/whylogs/config.ini Initialing session with config /home/felipeadachi/.config/whylogs/config.ini No session is initialized. Call whylogs.init(anonymous=True) to create a guest session. No session is initialized. Call whylogs.init(anonymous=True) to create a guest session.
This feels like something wrong is happening, but I'm just logging the usual way by setting os.environ
(and it works normally)
Maybe we could set this as info instead of warning?
Or is this now an unrecommended approach, and we always want to call why.init()
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
b0087ef
to
722a509
Compare
This has been fixed. You'll now only see the warning one time and you won't see any other output unless you actually have a session, so if people run that notebook before we update it with our latest whylogs then they'll just see a warning that they don't have a session set up. |
3ceaf9d
to
6ba7aed
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks close, left two questions.
bc3c303
to
ad88919
Compare
- Add org id and default dataset id support to sessions. - Make sessions depend on the new api key format and update the api key validation to allow for longer api keys that include `:orgId`. - Remove explicit session type configuration and define a fallback system for selecting session type based on `allow*` flags, config, and env state. - Allow specifying default dataset directly to the session config as an alternative to env variables, which is how sessions treat api keys. - Add interactive prompt mode for notebook environments that gets api key and related config via `input()` and saves it to the new whylogs ini config. - Add new why_init as pseudo CLIs for setting api key/default model id in the whylogs config. Without this, the only way to set the config is via interactive prompt. Supplying that info via env vars doesn't result in persisting that to the config which would be a strange side effect at best since the env is presumably still around and definitely taking priority over the config value. This can be run on the cli via `python -m whylogs.api.whylabs.session.why_init` from an environment with whylogs installed. - Enable interactive log output and url generation for batch profiles, with or without authentication. This output is disabled in local mode since no uploading happens there. The output only happens when using the top level transient logger in `why.log`. The loggers themselves don't have any output logic at all. It wouldn't make much sense to add output of this sort to the rolling logger running in the background. - Add lots of docs to `why.init` since that's the main interface to this system for users. The goal with these docs is to make it clear what kind of session you'll be getting since the logic is a little more complicated than before. The upside to this approach is that most notebooks, scripts, and production jobs can just have `why.init()` and not worry about what arguments to supply, so it can truly be ubiquitous.
ad88919
to
9fb196b
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
… validation function (#1391) ## Description Bug fix: removing reference to `_validate_org_and_dataset` in `tag_custom_performance_metric`, which was removed in #1311. - [x] I have reviewed the [Guidelines for Contributing](CONTRIBUTING.md) and the [Code of Conduct](CODE_OF_CONDUCT.md). Co-authored-by: felipe207 <felipe@whylabs.ai>
:orgId
.allow*
flags, config, and env state.input()
and saves it to the new whylogs ini config.why.log
. The loggers themselves don't have any output logic at all. It wouldn't make much sense to add output of this sort to the rolling logger running in the background.why.init
since that's the main interface to this system for users. The goal with these docs is to make it clear what kind of session you'll be getting since the logic is a little more complicated than before. The upside to this approach is that most notebooks, scripts, and production jobs can just havewhy.init()
and not worry about what arguments to supply, so it can truly be ubiquitous.Reviewing
To get a sense of the UX introduced here, I recommend running the Guest Session example notebook, as well as running
python -m whylogs.api.whylabs.session.why_init
from the command line. The first one should be pretty representative of a typical user experience after this change and the second one is a psuedo-cli that users can use to repeat the first UX without having to spin up a notebook. The command is similar to runningaws sso configure
, it just gets everything it needs from a user and stores it locally in the new whylogs.ini config.