Skip to content

Commit

Permalink
Merge branch 'main' into feat/base-gpu-image
Browse files Browse the repository at this point in the history
  • Loading branch information
Robert-Steiner authored Nov 4, 2024
2 parents e6ebfb0 + 8f92a3d commit e394472
Show file tree
Hide file tree
Showing 8 changed files with 399 additions and 3 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/_docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ jobs:
uses: Wandalen/wretry.action@f8754f79743ba113fedbba4499593f7d73b458eb # v3.7.0
id: build
with:
action: docker/build-push-action@5cd11c3a4ced054e52742c5fd54dca954e0edd85 # v6.7.0
action: docker/build-push-action@4f58ea79222b3b9dc2c8bbdd6debcef730109a75 # v6.9.0
attempt_limit: 60 # 60 attempts * (9 secs delay + 1 sec retry) = ~10 mins
attempt_delay: 9000 # 9 secs
with: |
Expand Down
55 changes: 55 additions & 0 deletions src/proto/flwr/proto/simulationio.proto
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 {}
1 change: 0 additions & 1 deletion src/py/flwr/cli/config_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,6 @@ def validate_federation_in_project_config(

# Validate the federation exists in the configuration
federation_config = config["tool"]["flwr"]["federations"].get(federation)
print(federation_config)
if federation_config is None:
available_feds = {
fed for fed in config["tool"]["flwr"]["federations"] if fed != "default"
Expand Down
38 changes: 38 additions & 0 deletions src/py/flwr/proto/simulationio_pb2.py

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

65 changes: 65 additions & 0 deletions src/py/flwr/proto/simulationio_pb2.pyi
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
171 changes: 171 additions & 0 deletions src/py/flwr/proto/simulationio_pb2_grpc.py
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)
Loading

0 comments on commit e394472

Please sign in to comment.