From a184423db9f8d34d1d2eb57ff302759778b2e289 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 2 Dec 2024 16:37:53 -0800 Subject: [PATCH 1/3] Bump cross-spawn from 7.0.3 to 7.0.6 in /web (#3084) Bumps [cross-spawn](https://github.com/moxystudio/node-cross-spawn) from 7.0.3 to 7.0.6. - [Changelog](https://github.com/moxystudio/node-cross-spawn/blob/master/CHANGELOG.md) - [Commits](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.3...v7.0.6) --- updated-dependencies: - dependency-name: cross-spawn dependency-type: indirect ... Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- web/package-lock.json | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/web/package-lock.json b/web/package-lock.json index 7ee1b1b20e..ee30c4ef79 100644 --- a/web/package-lock.json +++ b/web/package-lock.json @@ -2922,9 +2922,10 @@ } }, "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "license": "MIT", "dependencies": { "path-key": "^3.1.0", "shebang-command": "^2.0.0", From 5012b4bb25dd38cb34a6dc4be33762c8b0234bdb Mon Sep 17 00:00:00 2001 From: Yan Cheng <58191769+yanchengnv@users.noreply.github.com> Date: Tue, 3 Dec 2024 18:49:24 -0500 Subject: [PATCH 2/3] fix poc command (#3087) Co-authored-by: Chester Chen <512707+chesterxgchen@users.noreply.github.com> --- nvflare/lighter/impl/static_file.py | 7 +++++++ nvflare/lighter/spec.py | 6 +++++- nvflare/tool/poc/poc_commands.py | 3 ++- 3 files changed, 14 insertions(+), 2 deletions(-) diff --git a/nvflare/lighter/impl/static_file.py b/nvflare/lighter/impl/static_file.py index 830844a8bd..e6feb7ee77 100644 --- a/nvflare/lighter/impl/static_file.py +++ b/nvflare/lighter/impl/static_file.py @@ -386,6 +386,13 @@ def prepare_admin_config(self, admin, ctx): agent_config = dict() self._prepare_overseer_agent(admin, agent_config, "admin", ctx) config["admin"].update(agent_config) + + provision_mode = ctx.get("provision_mode") + if provision_mode == "poc": + # in poc mode, we change to use "local_cert" as the cred_type so that the user won't be + # prompted for username when starting the admin console + config["admin"]["username"] = admin.name + config["admin"]["cred_type"] = "local_cert" return config def build(self, project, ctx): diff --git a/nvflare/lighter/spec.py b/nvflare/lighter/spec.py index 633fbb49ba..f2e5369866 100644 --- a/nvflare/lighter/spec.py +++ b/nvflare/lighter/spec.py @@ -246,12 +246,16 @@ def _prepare_workspace(self, ctx): dirs = [workspace, resources_dir, wip_dir, state_dir] self._make_dir(dirs) - def provision(self, project: Project): + def provision(self, project: Project, mode=None): # ctx = {"workspace": os.path.join(self.root_dir, project.name), "project": project} workspace = os.path.join(self.root_dir, project.name) ctx = {"workspace": workspace} # project is more static information while ctx is dynamic self._prepare_workspace(ctx) ctx["project"] = project + + if mode: + ctx["provision_mode"] = mode + try: for b in self.builders: b.initialize(ctx) diff --git a/nvflare/tool/poc/poc_commands.py b/nvflare/tool/poc/poc_commands.py index 2d821f5323..0acc690a5c 100644 --- a/nvflare/tool/poc/poc_commands.py +++ b/nvflare/tool/poc/poc_commands.py @@ -306,8 +306,9 @@ def local_provision( service_config = get_service_config(project_config) project = prepare_project(project_config) builders = prepare_builders(project_config) + provisioner = Provisioner(workspace, builders) - provisioner.provision(project) + provisioner.provision(project, mode="poc") return project_config, service_config From d249ef703b9ffa4e9b316f59fb1b3479db20f6c2 Mon Sep 17 00:00:00 2001 From: Yuhong Wen Date: Tue, 3 Dec 2024 19:05:30 -0500 Subject: [PATCH 3/3] Fixed the simulator without custom folder job run error. (#3091) --- nvflare/private/fed/app/simulator/simulator_runner.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/nvflare/private/fed/app/simulator/simulator_runner.py b/nvflare/private/fed/app/simulator/simulator_runner.py index 2d5e3fbfdf..40fde024ad 100644 --- a/nvflare/private/fed/app/simulator/simulator_runner.py +++ b/nvflare/private/fed/app/simulator/simulator_runner.py @@ -707,9 +707,10 @@ def do_one_task(self, client, num_of_threads, gpu, lock, timeout=60.0, task_name command += " --gpu " + str(gpu) new_env = os.environ.copy() add_custom_dir_to_path(app_custom_folder, new_env) - if self.server_custom_folder: + if os.path.isdir(self.server_custom_folder): python_paths = new_env[SystemVarName.PYTHONPATH].split(os.pathsep) - python_paths.remove(self.server_custom_folder) + if self.server_custom_folder in python_paths: + python_paths.remove(self.server_custom_folder) new_env[SystemVarName.PYTHONPATH] = os.pathsep.join(python_paths) _ = subprocess.Popen(shlex.split(command, True), preexec_fn=os.setsid, env=new_env)