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

fixed poc start command and simulator error message #3157

Merged
merged 1 commit into from
Jan 20, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions nvflare/lighter/dummy_project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,12 +67,12 @@ builders:
args:
sp_end_point: server1:8002:8003

docker_image: localhost/nvflare:0.0.1

- path: nvflare.lighter.impl.docker.DockerBuilder
args:
docker_image: localhost/nvflare:0.0.1
base_image: python:3.10
requirements_file: docker_compose_requirements.txt
# docker_image: localhost/nvflare:0.0.1
#
# - path: nvflare.lighter.impl.docker.DockerBuilder
# args:
# docker_image: localhost/nvflare:0.0.1
# base_image: python:3.10
# requirements_file: docker_compose_requirements.txt
- path: nvflare.lighter.impl.cert.CertBuilder
- path: nvflare.lighter.impl.signature.SignatureBuilder
20 changes: 20 additions & 0 deletions nvflare/private/fed/simulator/simulator_server.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@

from ..server.fed_server import FederatedServer
from ..server.server_engine import ServerEngine
from ..utils.identity_utils import IdentityAsserter


class SimulatorServerEngine(ServerEngine):
Expand Down Expand Up @@ -77,6 +78,22 @@ def create_job_processing_context_properties(self, workspace, job_id):
return {}


class SimulatorIdentityAsserter(IdentityAsserter):

def __init__(self, private_key_file: str, cert_file: str):
self.private_key_file = private_key_file
self.cert_file = cert_file

def sign_common_name(self, nonce: str) -> str:
return nonce

def sign(self, content, return_str: bool) -> str:
return "signature"

def verify_signature(self, content, signature) -> bool:
return True


class SimulatorServer(FederatedServer):
def __init__(
self,
Expand Down Expand Up @@ -143,6 +160,9 @@ def _create_server_engine(self, args, snapshot_persistor):
server=self, args=args, client_manager=self.client_manager, snapshot_persistor=snapshot_persistor
)

def _get_id_asserter(self):
return SimulatorIdentityAsserter("private_key_file", "cert_file")

def deploy(self, args, grpc_args=None, secure_train=False):
super(FederatedServer, self).deploy(args, grpc_args, secure_train)
os.makedirs(os.path.join(args.workspace, "local"), exist_ok=True)
Expand Down
Loading