Skip to content

Commit

Permalink
Add -u option to provision command. Launch HTML helper to generate pr…
Browse files Browse the repository at this point in the history
…oject.yml. (#29)

Signed-off-by: Isaac Yang <[email protected]>
  • Loading branch information
IsaacYangSLA authored Dec 2, 2021
1 parent 849becf commit 2bb31db
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions nvflare/lighter/provision.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
import pathlib
import shutil
import sys
import webbrowser

import yaml

Expand All @@ -31,6 +32,12 @@ def main():
parser.add_argument("-p", "--project_file", type=str, default="project.yml", help="file to describe FL project")
parser.add_argument("-w", "--workspace", type=str, default="workspace", help="directory used by provision")
parser.add_argument("-c", "--custom_folder", type=str, default=".", help="additional folder to load python codes")
parser.add_argument(
"-u",
"--ui_tool",
action="store_true",
help="Run provisioning UI tool to generate project.yml file",
)

args = parser.parse_args()

Expand All @@ -52,6 +59,18 @@ def main():
print(f"{current_project_yml} was created. Please edit it to fit your FL configuration.")
exit(0)

if args.ui_tool:
ui_helper_path = os.path.join(file_path, "NVIDIAFLARE2ProvisioningHelper.html")
ui_helper_url = f"file://{ui_helper_path}"
webbrowser.open_new_tab(ui_helper_url)
print(
"\n******\n"
"Now launching provisioning UI tool.\n"
"After generating project.yml in the browser and saving it to your local folder,\n"
"please re-run provision with -p option, pointing to the generated project.yml, to generate all packages.\n******\n"
)
exit(0)

workspace = args.workspace
workspace_full_path = os.path.join(current_path, workspace)

Expand Down

0 comments on commit 2bb31db

Please sign in to comment.