nvflare.lighter.impl.workspace module¶
- class DistributionBuilder(zip_password=False)[source]¶
Bases:
Builder
Build the zip files for each folder.
Creates the zip files containing the archives for each startup kit. It will add password protection if the argument (zip_password) is true.
- Parameters
zip_password – if true, will create zipped packages with passwords
- build(project: Project, ctx: dict)[source]¶
Create a zip for each individual folder. Note that if zip_password is True, the zip command will be used to encrypt zip files. Users have to to install this zip utility before provisioning. In Ubuntu system, use this command to install zip utility: sudo apt-get install zip
- Parameters
project (Project) – project instance
ctx (dict) – the provision context
- class WorkspaceBuilder(template_file)[source]¶
Bases:
Builder
Manages the folder structure for provisioned projects.
Sets the template_file containing scripts and configs to put into startup folders, creates directories for the participants, and moves the provisioned project to the final location at the end ($WORKSPACE/$PROJECT_NAME/prod_XX). WorkspaceBuilder manages and sets the number in prod_XX by incrementing from the last time provision was run for this project in this workspace, starting with 00 to a max of 99.
Each time the provisioning tool runs, it requires a workspace folder in the local file system. The workspace will have the following folder structure:
$WORKSPACE/ <--- this is assigned by -w option of provision command (default is workspace) $PROJECT_NAME/ <--- this is the name value in the project.yml file prod_00/ <--- a new prod_NN folder is created if provision does not have any errors. prod_01/ ... resources/ <--- this folder stores resources for other builders to load state/ <--- this folder stores persistent information (such as certificates) so subsequent runs of the provision command can load the state back. wip/ <--- this is only used during runtime, and will be removed when the provision command exits
- Parameters
template_file – name of template file containing scripts and configs to put into startup folders