From a32ec2a95a901edc5f1e454066ebe3bc365ab548 Mon Sep 17 00:00:00 2001 From: Fredrik Wrede Date: Mon, 17 Jun 2024 11:53:29 +0000 Subject: [PATCH] fix --- .github/workflows/branch-name-check.yaml | 2 +- fedn/network/api/interface.py | 2 -- fedn/network/grpc/server.py | 20 ++++++++++++-------- 3 files changed, 13 insertions(+), 11 deletions(-) diff --git a/.github/workflows/branch-name-check.yaml b/.github/workflows/branch-name-check.yaml index 67ff4d04c..41f431cc1 100644 --- a/.github/workflows/branch-name-check.yaml +++ b/.github/workflows/branch-name-check.yaml @@ -7,7 +7,7 @@ on: - master env: - BRANCH_REGEX: '^((feature|github|hotfix|bugfix|fix|bug|docs|refactor)\/.+)|(release\/v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?))$' + BRANCH_REGEX: '^((feature|github|dependabot|hotfix|bugfix|fix|bug|docs|refactor)\/.+)|(release\/v((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?)(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?))$' jobs: branch-name-check: diff --git a/fedn/network/api/interface.py b/fedn/network/api/interface.py index 5cd465085..d3e43c8df 100644 --- a/fedn/network/api/interface.py +++ b/fedn/network/api/interface.py @@ -626,8 +626,6 @@ def add_client(self, client_id, preferred_combiner, remote_addr): "certificate": cert, "helper_type": self.control.statestore.get_helper(), } - logger.info(f"Sending payload: {payload}") - return jsonify(payload) def get_initial_model(self): diff --git a/fedn/network/grpc/server.py b/fedn/network/grpc/server.py index 4354a7aa5..a23691505 100644 --- a/fedn/network/grpc/server.py +++ b/fedn/network/grpc/server.py @@ -9,10 +9,9 @@ class Server: - """ Class for configuring and launching the gRPC server.""" + """Class for configuring and launching the gRPC server.""" def __init__(self, servicer, modelservicer, config): - set_log_level_from_string(config.get("verbosity", "INFO")) set_log_stream(config.get("logfile", None)) @@ -34,21 +33,26 @@ def __init__(self, servicer, modelservicer, config): health_pb2_grpc.add_HealthServicer_to_server(self.health_servicer, self.server) if config["secure"]: - logger.info(f'Creating secure gRPCS server using certificate: {config["certificate"]}') + logger.info("Creating secure gRPCS server using certificate") server_credentials = grpc.ssl_server_credentials( - ((config["key"], config["certificate"],),)) - self.server.add_secure_port( - "[::]:" + str(config["port"]), server_credentials) + ( + ( + config["key"], + config["certificate"], + ), + ) + ) + self.server.add_secure_port("[::]:" + str(config["port"]), server_credentials) else: logger.info("Creating gRPC server") self.server.add_insecure_port("[::]:" + str(config["port"])) def start(self): - """ Start the gRPC server.""" + """Start the gRPC server.""" logger.info("gRPC Server started") self.server.start() def stop(self): - """ Stop the gRPC server.""" + """Stop the gRPC server.""" logger.info("gRPC Server stopped") self.server.stop(0)