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

Adaptation for API v5 revisions (Phase 1) #97

Merged
merged 13 commits into from
Apr 19, 2020
Merged

Adaptation for API v5 revisions (Phase 1) #97

merged 13 commits into from
Apr 19, 2020

Conversation

achimnol
Copy link
Member

No description provided.

@codecov
Copy link

codecov bot commented Apr 17, 2020

Codecov Report

Merging #97 into master will decrease coverage by 0.92%.
The diff coverage is 55.69%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master      #97      +/-   ##
==========================================
- Coverage   42.50%   41.58%   -0.93%     
==========================================
  Files          58       59       +1     
  Lines        5578     5668      +90     
==========================================
- Hits         2371     2357      -14     
- Misses       3207     3311     +104     
Impacted Files Coverage Δ
src/ai/backend/client/test_utils.py 0.00% <0.00%> (ø)
src/ai/backend/client/utils.py 44.44% <ø> (-11.12%) ⬇️
src/ai/backend/client/versioning.py 53.84% <ø> (ø)
src/ai/backend/client/func/scaling_group.py 32.60% <11.53%> (ø)
src/ai/backend/client/func/group.py 32.55% <16.00%> (ø)
src/ai/backend/client/cli/admin/images.py 27.16% <16.66%> (-6.18%) ⬇️
src/ai/backend/client/cli/app.py 22.42% <20.00%> (-0.22%) ⬇️
src/ai/backend/client/func/user.py 30.20% <21.05%> (ø)
src/ai/backend/client/func/image.py 37.50% <22.22%> (-1.21%) ⬇️
src/ai/backend/client/func/domain.py 33.84% <23.07%> (ø)
... and 26 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 1ce0454...8ad10f7. Read the comment docs.

* Previously, to bind the current session with API function classes,
  we generated new type objects at runtime.

  - This has confused IDEs and type checkers.

  - Now type checkers can statically deduce the types for individual API
    function classes.

  - TODO: many many type errors are there still...

* Now we use contextvars (ai.backend.client.session.api_session)
  to keep the reference to the current session.

  - There are no public Session/AsyncSession API changes!

  - Only the API function classes need to be rewritten.

  - For synchronous Session, we pass the context to the separate worker
    thread using copy_context() whenever calling API functions, which is
    a light-weight operation.

* Remove redundant src/ai/backend/client/etcd.py which had been already
  copied to src/ai/backend/client/func/etcd.py

BREAKING-CHANGE: Dropped Python 3.6 support. Now it requires Python 3.7 or higher.
* All test cases in tests/test_cli_proxy.py are marked "xfail"
  because there is an upstream issue rendering those tests always
  failing while real-world use cases have no problems.

  - ref) pytest-dev/pytest-asyncio#153
@achimnol achimnol added this to the 20.03 milestone Apr 19, 2020
@achimnol achimnol marked this pull request as ready for review April 19, 2020 16:31
@achimnol
Copy link
Member Author

Marking this as the phase 1 of the API v5 adaptation.
I will start a new PR for the phase 2 (updates for session GQL queries and additional image list filters) after merging @adrysn's new PRs.

@achimnol achimnol changed the title Adaptation for API v5 revisions Adaptation for API v5 revisions (Phase 1) Apr 19, 2020
@achimnol achimnol merged commit f930759 into master Apr 19, 2020
@achimnol achimnol deleted the feature/api-v5 branch April 19, 2020 16:36
achimnol added a commit that referenced this pull request Apr 20, 2020
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.

1 participant