-
Notifications
You must be signed in to change notification settings - Fork 235
Enable REST protocol between Aggregator and Collaborator #1500
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
Merged
teoparvanov
merged 1 commit into
securefederatedai:develop
from
ishaileshpant:native_rest_api
May 21, 2025
Merged
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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 hidden or 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 hidden or 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 hidden or 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,72 @@ | ||
| # Copyright 2025 Intel Corporation | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
| """AggregatorClientInterface module.""" | ||
|
|
||
| from abc import ABC, abstractmethod | ||
| from typing import Any, List, Tuple | ||
|
|
||
|
|
||
| class AggregatorClientInterface(ABC): | ||
|
ishaileshpant marked this conversation as resolved.
kminhta marked this conversation as resolved.
|
||
| @abstractmethod | ||
| def ping(self): | ||
| """ | ||
| Ping the aggregator to check connectivity. | ||
| """ | ||
| pass | ||
|
|
||
| @abstractmethod | ||
| def get_tasks(self) -> Tuple[List[Any], int, int, bool]: | ||
| """ | ||
| Retrieves tasks for the given collaborator client. | ||
| Returns a tuple: (tasks, round_number, sleep_time, time_to_quit) | ||
| """ | ||
| pass | ||
|
|
||
| @abstractmethod | ||
| def get_aggregated_tensor( | ||
| self, | ||
| tensor_name: str, | ||
| round_number: int, | ||
| report: bool, | ||
| tags: List[str], | ||
| require_lossless: bool, | ||
| ) -> Any: | ||
| """ | ||
| Retrieves the aggregated tensor. | ||
| """ | ||
| pass | ||
|
|
||
| @abstractmethod | ||
| def send_local_task_results( | ||
| self, | ||
| round_number: int, | ||
| task_name: str, | ||
| data_size: int, | ||
| named_tensors: List[Any], | ||
| ) -> Any: | ||
| """ | ||
| Sends local task results. | ||
| Parameters: | ||
| collaborator_name: Name of the collaborator. | ||
| round_number: The current round. | ||
| task_name: Name of the task. | ||
| data_size: Size of the data. | ||
| named_tensors: A list of tensors (or named tensor objects). | ||
| Returns a SendLocalTaskResultsResponse. | ||
| """ | ||
| pass | ||
|
|
||
| @abstractmethod | ||
| def send_message_to_server(self, openfl_message: Any, collaborator_name: str) -> Any: | ||
| """ | ||
| Forwards a converted message from the local client to the OpenFL server and returns the | ||
| response. | ||
| Args: | ||
| openfl_message: The converted message to be sent to the OpenFL server (InteropMessage | ||
| proto). | ||
| collaborator_name: The name of the collaborator. | ||
| Returns: | ||
| The response from the OpenFL server (InteropMessage proto). | ||
| """ | ||
| pass | ||
This file contains hidden or 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 |
|---|---|---|
| @@ -1,5 +1,6 @@ | ||
| # Copyright 2020-2024 Intel Corporation | ||
| # Copyright 2025 Intel Corporation | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
|
|
||
| from openfl.transport.grpc import AggregatorGRPCClient, AggregatorGRPCServer | ||
| from openfl.transport.rest import AggregatorRESTClient, AggregatorRESTServer |
This file contains hidden or 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 hidden or 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,6 @@ | ||
| # Copyright 2020-2025 Intel Corporation | ||
| # SPDX-License-Identifier: Apache-2.0 | ||
|
|
||
|
|
||
| from openfl.transport.rest.aggregator_client import AggregatorRESTClient | ||
| from openfl.transport.rest.aggregator_server import AggregatorRESTServer |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.