flip.nvflare.components.persist_and_cleanup

Classes

PersistToS3AndCleanup

The component that is executed post training and is a part of the FLIP training model

Module Contents

class flip.nvflare.components.persist_and_cleanup.PersistToS3AndCleanup(model_id: str, persistor_id: str = AppConstants.DEFAULT_PERSISTOR_ID, flip: flip.FLIP = FLIP())[source]

Bases: nvflare.apis.fl_component.FLComponent

The component that is executed post training and is a part of the FLIP training model

The PersistToS3AndCleanup workflow saves the aggregated model (once training has finished) to an S3 bucket, and then deletes files created as part of the run

Parameters:
  • model_id (str) – ID of the model that the training is being performed under.

  • persistor_id (str, optional) – ID of the persistor component. Defaults to “persistor”.

Raises:

ValueError

  • when the model ID is not a valid UUID.

FileNotFoundError: boto3 error for when the zip file does not exist.

model_id[source]
persistor_id: str[source]
model_persistor: nvflare.app_opt.pt.file_model_persistor.PTFileModelPersistor | None = None[source]
model_inventory: dict[source]
model_dir: str = ''[source]
bucket_name: str = ''[source]
flip[source]
execute(fl_ctx: nvflare.apis.fl_context.FLContext)[source]
upload_results_to_s3_bucket(fl_ctx: nvflare.apis.fl_context.FLContext)[source]

Uploads the final aggregated model and reports to an S3 bucket as a zip file.

cleanup(fl_ctx: nvflare.apis.fl_context.FLContext)[source]

Cleans up the workspace by deleting the transfer and save directories for the model ID.