NVIDIA FLARE Workspace¶
NVIDIA FLARE maintains a workspace for keeping the FL apps and execution results of different run_number
experiments. The following is the workspace folder structure when running NVIDIA FLARE for the server and clients.
Server¶
server/
run_1/
app_server/
...
config_fed_server.json
fl_app.txt
run_2/
app_server/
...
config/
config_fed_server.json
fl_app.txt
startup/
fed_server.json
log.config
start.sh
sub_start.sh
Client¶
clientA/
run_1/
app_clientA/
...
config_fed_client.json
fl_app.txt
run_2/
app_clientA/
...
config/
config_fed_client.json
fl_app.txt
startup/
fed_client.json
log.config
start.sh
sub_start.sh
The FL application and run data from different run_number
are kept in the separate run_N
folders for each run
number N
. Under the run_N
folder, the app_server
folder holds the FL application content of the server. The
app_clientName
folder holds the FL application content of the client. The config_fed_server.json and
config_fed_client.json may be in the root folder of the FL App, or in a sub-folder (for example: config) of the FL App.
The fl_app.txt indicates which FL App current run_number
is using. The deploy_app
command will deploy the
corresponding FL app into the current run_number
. If the app_server
or app_clientName
folder
already exists, all the contents within that folder will be wiped out and deployed a new FL application. If you would
like to keep some execution results within the same run_number
, you can keep them in the root directory of the
run_N
folder.
The startup
folder contains the config and the scripts to start the FL server and client program.
The Workspace
object is available through the FLContext. From the Workspace,
you can access each folder location accordingly:
workspace = fl_ctx.get_prop(FLContextKey.WORKSPACE_OBJECT)
Args:
root_dir: root directory of the workspace
name: name of the workspace
config_folder: where to find required config inside an app
"""
self.root_dir = root_dir
self.name = name
self.config_folder = config_folder
def get_startup_kit_dir(self) -> str:
return os.path.join(self.root_dir, "startup")
def get_root_dir(self) -> str:
return self.root_dir
def get_run_dir(self, run_num: int) -> str:
return os.path.join(self.root_dir, "run_" + str(run_num))
def get_app_dir(self, run_num: int) -> str:
return os.path.join(self.get_run_dir(run_num), "app_" + self.name)
def get_app_config_dir(self, run_num) -> str:
return os.path.join(self.get_app_dir(run_num), self.config_folder)
def get_app_custom_dir(self, run_num) -> str:
return os.path.join(self.get_app_dir(run_num), "custom")