-
Notifications
You must be signed in to change notification settings - Fork 363
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: refactor a bunch of auth-related python (#8347)
- Remove the Authentication object. Authentication was both a dataclass containing username and token, as well as a complex login function disguised as an __init__. Now the dataclass is called UsernameTokenPair and the complex login function is called `login()` or `login_with_cache()`. - Make Session the core of API calls, not the api.request() function. The Session has a cache of authentication information and cert customization, and is easy to reuse. The api.request() function encourages the use of singletons and creates really confusing configure-singleton-in-every-entrypoint behaviors. - Introduce an UnauthSession which doesn't have an authentication token, for those few calls that we need to make which are not authenticated. - Add a detproc helper module to the e2e tests, so even tests requiring the cli can be based on explicit sessions. - Remove cli_auth and cli_cert singletons. - Delete all singleton-based @authentication.required decorators from the cli; just create a session instead. - Remove all api.{get,post,whatever} calls. - Refactor the Profiler a bit to accept a Session object. It used to depend on the cli_auth as well. - Add some Session helpers to the e2e tests, with much better caching. - Redesign the e2e auth to be Session-centric rather than cached-login centric, in particular: - redesign api_utils.create_test_user() - remove test_users.logged_in_user() - remove test_users.log_in_cli() - remove test_users.login_admin() - replace any call to Determined() with Determined._from_session() - Introduce detproc module in e2e tests for session-centric CLI calls, replacing various adhoc helpers: - test_user.det_spawn() - test_user.det_run() - test_exp_continue.det_cmd() - test_groups.det_cmd() - test_groups.det_cmd_json() - test_groups.det_cmd_expect_error() BREAKING CHANGE: This refactor removes the Session object from all public API namespaces, and also adds the new requirement that all tasks have a writable HOME directory. Previously, a small subset of functionality existed for tasks which had no writable HOME directory.
- Loading branch information
1 parent
66b1e6c
commit 76ec233
Showing
171 changed files
with
5,411 additions
and
6,530 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
:orphan: | ||
|
||
**Removed Features** | ||
|
||
- **Breaking Change** Removed the accidentally-exposed Session object from the | ||
``det.experimental.client`` namespace. It was never meant to be a public API and it was not | ||
documented in :ref:`python-sdk`, but was nonetheless exposed in that namespace. It was also | ||
available as a deprecated legacy alias, ``det.experimental.Session``. It is expected that most | ||
users use the Python SDK normally and are unaffected by this change, since the | ||
``det.experimental.client``'s ``login()`` and ``Determined()`` are unaffected. | ||
|
||
- **Breaking Change** Add a new requirement for runtime configurations that there be a writable | ||
``$HOME`` directory in every container. Previously, there was limited support for containers | ||
without a writable ``$HOME``, merely by coincidence. This change could impact users in scenarios | ||
where jobs were configured to run as the ``nobody`` user inside a container, instead of the | ||
``det-nobody`` alternative recommended in :ref:`run-unprivileged-tasks`. Users combining non-root | ||
tasks with custom images not based on Determined's official images may also be affected. Overall, | ||
it is expected that few or no users are affected by this change. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.