Skip to content
This repository has been archived by the owner on Sep 22, 2023. It is now read-only.

Rename kernel to (compute)session #82

Merged
merged 9 commits into from
Jan 11, 2020
Merged

Conversation

achimnol
Copy link
Member

@achimnol achimnol commented Jan 9, 2020

No longer confusion in docs.
We introduce the API version v5, where kernel is renamed to session in all places.

This PR does the followings:

  • Move "function" class modules into ai.backend.client.func package
    • So now ai.backend.client.session contains the API session base classes with sync/async implementations while ai.backend.client.func.session contains the ComputeSession function class.
  • Implement automatic API version negotiation per-API session and use the negotiated version (api_version attribute) to branch out old "kernel"-prefixed APIs and "session"-prefixed APIs.
    • If the server's API version is higher than the client, shows an explicit APIVersionWarning to suggest package upgrade.
    • If the version detection fails, it fallbacks to the configured API version.
    • Currently not all API functions consider the negotiated version. Only session creation and code execution API functions do.

@codecov
Copy link

codecov bot commented Jan 10, 2020

Codecov Report

Merging #82 into master will increase coverage by 0.36%.
The diff coverage is 56.25%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #82      +/-   ##
==========================================
+ Coverage   43.25%   43.61%   +0.36%     
==========================================
  Files          51       52       +1     
  Lines        5216     5278      +62     
==========================================
+ Hits         2256     2302      +46     
- Misses       2960     2976      +16
Impacted Files Coverage Δ
src/ai/backend/client/request.py 67.46% <ø> (ø) ⬆️
src/ai/backend/client/func/base.py 100% <ø> (ø)
src/ai/backend/client/auth.py 92.59% <ø> (+27.13%) ⬆️
src/ai/backend/client/cli/app.py 23.71% <0%> (ø) ⬆️
src/ai/backend/client/func/group.py 32.55% <100%> (ø)
src/ai/backend/client/func/image.py 38.7% <100%> (ø)
src/ai/backend/client/exceptions.py 77.77% <100%> (+1.77%) ⬆️
.../ai/backend/client/func/keypair_resource_policy.py 32.3% <100%> (ø)
src/ai/backend/client/func/scaling_group.py 32.6% <100%> (ø)
src/ai/backend/client/func/vfolder.py 72.36% <100%> (ø)
... and 20 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update a5b549e...d48b198. Read the comment docs.

* Negotiation fallbacks to the configured API version if fails.
@achimnol achimnol marked this pull request as ready for review January 10, 2020 18:42
@achimnol achimnol merged commit 8f0a238 into master Jan 11, 2020
@achimnol achimnol deleted the feature/kernel-to-session branch January 11, 2020 11:22
achimnol added a commit that referenced this pull request Jan 12, 2020
* Fix missing version-aware naming in cli.app

* Tested with both "api" mode (against local dev) and "session" mode (against 19.09 cloud)
  by running CLI hello-world and Jupyter app service.

* Drop compat.token_hex and compat.token_bytes to use the Python 3.6+
  stdlib secrets module.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant