-
Notifications
You must be signed in to change notification settings - Fork 941
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feat/base-gpu-image
- Loading branch information
Showing
8 changed files
with
399 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
// Copyright 2024 Flower Labs GmbH. All Rights Reserved. | ||
// | ||
// Licensed under the Apache License, Version 2.0 (the "License"); | ||
// you may not use this file except in compliance with the License. | ||
// You may obtain a copy of the License at | ||
// | ||
// http://www.apache.org/licenses/LICENSE-2.0 | ||
// | ||
// Unless required by applicable law or agreed to in writing, software | ||
// distributed under the License is distributed on an "AS IS" BASIS, | ||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
// ============================================================================== | ||
|
||
syntax = "proto3"; | ||
|
||
package flwr.proto; | ||
|
||
import "flwr/proto/log.proto"; | ||
import "flwr/proto/message.proto"; | ||
import "flwr/proto/run.proto"; | ||
import "flwr/proto/fab.proto"; | ||
|
||
service SimulationIo { | ||
// Pull Simulation inputs | ||
rpc PullSimulationInputs(PullSimulationInputsRequest) | ||
returns (PullSimulationInputsResponse) {} | ||
|
||
// Push Simulation outputs | ||
rpc PushSimulationOutputs(PushSimulationOutputsRequest) | ||
returns (PushSimulationOutputsResponse) {} | ||
|
||
// Update the status of a given run | ||
rpc UpdateRunStatus(UpdateRunStatusRequest) | ||
returns (UpdateRunStatusResponse) {} | ||
|
||
// Push ServerApp logs | ||
rpc PushLogs(PushLogsRequest) returns (PushLogsResponse) {} | ||
} | ||
|
||
// PullSimulationInputs messages | ||
message PullSimulationInputsRequest {} | ||
message PullSimulationInputsResponse { | ||
Context context = 1; | ||
Run run = 2; | ||
Fab fab = 3; | ||
} | ||
|
||
// PushSimulationOutputs messages | ||
message PushSimulationOutputsRequest { | ||
uint64 run_id = 1; | ||
Context context = 2; | ||
} | ||
message PushSimulationOutputsResponse {} |
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
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,65 @@ | ||
""" | ||
@generated by mypy-protobuf. Do not edit manually! | ||
isort:skip_file | ||
""" | ||
import builtins | ||
import flwr.proto.fab_pb2 | ||
import flwr.proto.message_pb2 | ||
import flwr.proto.run_pb2 | ||
import google.protobuf.descriptor | ||
import google.protobuf.message | ||
import typing | ||
import typing_extensions | ||
|
||
DESCRIPTOR: google.protobuf.descriptor.FileDescriptor | ||
|
||
class PullSimulationInputsRequest(google.protobuf.message.Message): | ||
"""PullSimulationInputs messages""" | ||
DESCRIPTOR: google.protobuf.descriptor.Descriptor | ||
def __init__(self, | ||
) -> None: ... | ||
global___PullSimulationInputsRequest = PullSimulationInputsRequest | ||
|
||
class PullSimulationInputsResponse(google.protobuf.message.Message): | ||
DESCRIPTOR: google.protobuf.descriptor.Descriptor | ||
CONTEXT_FIELD_NUMBER: builtins.int | ||
RUN_FIELD_NUMBER: builtins.int | ||
FAB_FIELD_NUMBER: builtins.int | ||
@property | ||
def context(self) -> flwr.proto.message_pb2.Context: ... | ||
@property | ||
def run(self) -> flwr.proto.run_pb2.Run: ... | ||
@property | ||
def fab(self) -> flwr.proto.fab_pb2.Fab: ... | ||
def __init__(self, | ||
*, | ||
context: typing.Optional[flwr.proto.message_pb2.Context] = ..., | ||
run: typing.Optional[flwr.proto.run_pb2.Run] = ..., | ||
fab: typing.Optional[flwr.proto.fab_pb2.Fab] = ..., | ||
) -> None: ... | ||
def HasField(self, field_name: typing_extensions.Literal["context",b"context","fab",b"fab","run",b"run"]) -> builtins.bool: ... | ||
def ClearField(self, field_name: typing_extensions.Literal["context",b"context","fab",b"fab","run",b"run"]) -> None: ... | ||
global___PullSimulationInputsResponse = PullSimulationInputsResponse | ||
|
||
class PushSimulationOutputsRequest(google.protobuf.message.Message): | ||
"""PushSimulationOutputs messages""" | ||
DESCRIPTOR: google.protobuf.descriptor.Descriptor | ||
RUN_ID_FIELD_NUMBER: builtins.int | ||
CONTEXT_FIELD_NUMBER: builtins.int | ||
run_id: builtins.int | ||
@property | ||
def context(self) -> flwr.proto.message_pb2.Context: ... | ||
def __init__(self, | ||
*, | ||
run_id: builtins.int = ..., | ||
context: typing.Optional[flwr.proto.message_pb2.Context] = ..., | ||
) -> None: ... | ||
def HasField(self, field_name: typing_extensions.Literal["context",b"context"]) -> builtins.bool: ... | ||
def ClearField(self, field_name: typing_extensions.Literal["context",b"context","run_id",b"run_id"]) -> None: ... | ||
global___PushSimulationOutputsRequest = PushSimulationOutputsRequest | ||
|
||
class PushSimulationOutputsResponse(google.protobuf.message.Message): | ||
DESCRIPTOR: google.protobuf.descriptor.Descriptor | ||
def __init__(self, | ||
) -> None: ... | ||
global___PushSimulationOutputsResponse = PushSimulationOutputsResponse |
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,171 @@ | ||
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT! | ||
"""Client and server classes corresponding to protobuf-defined services.""" | ||
import grpc | ||
|
||
from flwr.proto import log_pb2 as flwr_dot_proto_dot_log__pb2 | ||
from flwr.proto import run_pb2 as flwr_dot_proto_dot_run__pb2 | ||
from flwr.proto import simulationio_pb2 as flwr_dot_proto_dot_simulationio__pb2 | ||
|
||
|
||
class SimulationIoStub(object): | ||
"""Missing associated documentation comment in .proto file.""" | ||
|
||
def __init__(self, channel): | ||
"""Constructor. | ||
Args: | ||
channel: A grpc.Channel. | ||
""" | ||
self.PullSimulationInputs = channel.unary_unary( | ||
'/flwr.proto.SimulationIo/PullSimulationInputs', | ||
request_serializer=flwr_dot_proto_dot_simulationio__pb2.PullSimulationInputsRequest.SerializeToString, | ||
response_deserializer=flwr_dot_proto_dot_simulationio__pb2.PullSimulationInputsResponse.FromString, | ||
) | ||
self.PushSimulationOutputs = channel.unary_unary( | ||
'/flwr.proto.SimulationIo/PushSimulationOutputs', | ||
request_serializer=flwr_dot_proto_dot_simulationio__pb2.PushSimulationOutputsRequest.SerializeToString, | ||
response_deserializer=flwr_dot_proto_dot_simulationio__pb2.PushSimulationOutputsResponse.FromString, | ||
) | ||
self.UpdateRunStatus = channel.unary_unary( | ||
'/flwr.proto.SimulationIo/UpdateRunStatus', | ||
request_serializer=flwr_dot_proto_dot_run__pb2.UpdateRunStatusRequest.SerializeToString, | ||
response_deserializer=flwr_dot_proto_dot_run__pb2.UpdateRunStatusResponse.FromString, | ||
) | ||
self.PushLogs = channel.unary_unary( | ||
'/flwr.proto.SimulationIo/PushLogs', | ||
request_serializer=flwr_dot_proto_dot_log__pb2.PushLogsRequest.SerializeToString, | ||
response_deserializer=flwr_dot_proto_dot_log__pb2.PushLogsResponse.FromString, | ||
) | ||
|
||
|
||
class SimulationIoServicer(object): | ||
"""Missing associated documentation comment in .proto file.""" | ||
|
||
def PullSimulationInputs(self, request, context): | ||
"""Pull Simulation inputs | ||
""" | ||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) | ||
context.set_details('Method not implemented!') | ||
raise NotImplementedError('Method not implemented!') | ||
|
||
def PushSimulationOutputs(self, request, context): | ||
"""Push Simulation outputs | ||
""" | ||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) | ||
context.set_details('Method not implemented!') | ||
raise NotImplementedError('Method not implemented!') | ||
|
||
def UpdateRunStatus(self, request, context): | ||
"""Update the status of a given run | ||
""" | ||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) | ||
context.set_details('Method not implemented!') | ||
raise NotImplementedError('Method not implemented!') | ||
|
||
def PushLogs(self, request, context): | ||
"""Push ServerApp logs | ||
""" | ||
context.set_code(grpc.StatusCode.UNIMPLEMENTED) | ||
context.set_details('Method not implemented!') | ||
raise NotImplementedError('Method not implemented!') | ||
|
||
|
||
def add_SimulationIoServicer_to_server(servicer, server): | ||
rpc_method_handlers = { | ||
'PullSimulationInputs': grpc.unary_unary_rpc_method_handler( | ||
servicer.PullSimulationInputs, | ||
request_deserializer=flwr_dot_proto_dot_simulationio__pb2.PullSimulationInputsRequest.FromString, | ||
response_serializer=flwr_dot_proto_dot_simulationio__pb2.PullSimulationInputsResponse.SerializeToString, | ||
), | ||
'PushSimulationOutputs': grpc.unary_unary_rpc_method_handler( | ||
servicer.PushSimulationOutputs, | ||
request_deserializer=flwr_dot_proto_dot_simulationio__pb2.PushSimulationOutputsRequest.FromString, | ||
response_serializer=flwr_dot_proto_dot_simulationio__pb2.PushSimulationOutputsResponse.SerializeToString, | ||
), | ||
'UpdateRunStatus': grpc.unary_unary_rpc_method_handler( | ||
servicer.UpdateRunStatus, | ||
request_deserializer=flwr_dot_proto_dot_run__pb2.UpdateRunStatusRequest.FromString, | ||
response_serializer=flwr_dot_proto_dot_run__pb2.UpdateRunStatusResponse.SerializeToString, | ||
), | ||
'PushLogs': grpc.unary_unary_rpc_method_handler( | ||
servicer.PushLogs, | ||
request_deserializer=flwr_dot_proto_dot_log__pb2.PushLogsRequest.FromString, | ||
response_serializer=flwr_dot_proto_dot_log__pb2.PushLogsResponse.SerializeToString, | ||
), | ||
} | ||
generic_handler = grpc.method_handlers_generic_handler( | ||
'flwr.proto.SimulationIo', rpc_method_handlers) | ||
server.add_generic_rpc_handlers((generic_handler,)) | ||
|
||
|
||
# This class is part of an EXPERIMENTAL API. | ||
class SimulationIo(object): | ||
"""Missing associated documentation comment in .proto file.""" | ||
|
||
@staticmethod | ||
def PullSimulationInputs(request, | ||
target, | ||
options=(), | ||
channel_credentials=None, | ||
call_credentials=None, | ||
insecure=False, | ||
compression=None, | ||
wait_for_ready=None, | ||
timeout=None, | ||
metadata=None): | ||
return grpc.experimental.unary_unary(request, target, '/flwr.proto.SimulationIo/PullSimulationInputs', | ||
flwr_dot_proto_dot_simulationio__pb2.PullSimulationInputsRequest.SerializeToString, | ||
flwr_dot_proto_dot_simulationio__pb2.PullSimulationInputsResponse.FromString, | ||
options, channel_credentials, | ||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) | ||
|
||
@staticmethod | ||
def PushSimulationOutputs(request, | ||
target, | ||
options=(), | ||
channel_credentials=None, | ||
call_credentials=None, | ||
insecure=False, | ||
compression=None, | ||
wait_for_ready=None, | ||
timeout=None, | ||
metadata=None): | ||
return grpc.experimental.unary_unary(request, target, '/flwr.proto.SimulationIo/PushSimulationOutputs', | ||
flwr_dot_proto_dot_simulationio__pb2.PushSimulationOutputsRequest.SerializeToString, | ||
flwr_dot_proto_dot_simulationio__pb2.PushSimulationOutputsResponse.FromString, | ||
options, channel_credentials, | ||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) | ||
|
||
@staticmethod | ||
def UpdateRunStatus(request, | ||
target, | ||
options=(), | ||
channel_credentials=None, | ||
call_credentials=None, | ||
insecure=False, | ||
compression=None, | ||
wait_for_ready=None, | ||
timeout=None, | ||
metadata=None): | ||
return grpc.experimental.unary_unary(request, target, '/flwr.proto.SimulationIo/UpdateRunStatus', | ||
flwr_dot_proto_dot_run__pb2.UpdateRunStatusRequest.SerializeToString, | ||
flwr_dot_proto_dot_run__pb2.UpdateRunStatusResponse.FromString, | ||
options, channel_credentials, | ||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) | ||
|
||
@staticmethod | ||
def PushLogs(request, | ||
target, | ||
options=(), | ||
channel_credentials=None, | ||
call_credentials=None, | ||
insecure=False, | ||
compression=None, | ||
wait_for_ready=None, | ||
timeout=None, | ||
metadata=None): | ||
return grpc.experimental.unary_unary(request, target, '/flwr.proto.SimulationIo/PushLogs', | ||
flwr_dot_proto_dot_log__pb2.PushLogsRequest.SerializeToString, | ||
flwr_dot_proto_dot_log__pb2.PushLogsResponse.FromString, | ||
options, channel_credentials, | ||
insecure, call_credentials, compression, wait_for_ready, timeout, metadata) |
Oops, something went wrong.