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/SK-523 | Refactor REST and add APIClient #477

Merged
merged 29 commits into from
Aug 24, 2023
Merged

Conversation

Wrede
Copy link
Member

@Wrede Wrede commented Aug 14, 2023

Description

This is a major refactor of the REST-API. A seperate service called api-server has been implemented. Further APIClient has been added which can be imported by:
fedn import APIClient
client = APIClient(host="localhost", port=8092)

With the client you can query the statestore and send requests to the controller. e.g upload package, initial models, download package, list clients, list validations, list events etc.

To consider before merge:

  • should the dashboard be removed/relocated?
  • connect.py and package.py has been moved to its corresponding service where they are used from the "common" folder. Should old one be removed?
  • POST endpoints include json where key, value will be sent at kwargs to logic functions, i.e add_combiner, add_client and start_session. This means that any client sending a request need to have json keys corresponding to the arguments in the API calss functions.
  • get_reducer and set_reducer is no longer used except for in the old dashboard...remove?

Extras

Add docsstring is almost complete for the whole network package. SDK should be added to sphinx docs. The Client class have many private functions (_) which makes the SDK doc very sparse for this class! Loadbalancer have two files with the same class names!

@Wrede Wrede added the HOLD label Aug 14, 2023
@Wrede Wrede requested a review from ahellander August 14, 2023 14:48
Copy link
Member

@ahellander ahellander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great progress!

fedn/fedn/network/api/client.py Show resolved Hide resolved
fedn/fedn/network/api/client.py Outdated Show resolved Hide resolved
fedn/fedn/network/api/client.py Show resolved Hide resolved
@Wrede Wrede requested a review from ahellander August 21, 2023 07:49
Copy link
Member

@ahellander ahellander left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great! We can merge this and iterate from there.

@ahellander ahellander self-requested a review August 23, 2023 13:09
@Wrede Wrede removed the HOLD label Aug 23, 2023
@Wrede Wrede merged commit 7a18790 into develop Aug 24, 2023
@Wrede Wrede deleted the feature/SK-523 branch August 24, 2023 12:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants