flip.nvflare.components.persist_and_cleanup =========================================== .. py:module:: flip.nvflare.components.persist_and_cleanup Classes ------- .. autoapisummary:: flip.nvflare.components.persist_and_cleanup.PersistToS3AndCleanup Module Contents --------------- .. py:class:: PersistToS3AndCleanup(model_id: str, persistor_id: str = AppConstants.DEFAULT_PERSISTOR_ID, flip: flip.FLIP = FLIP()) Bases: :py:obj:`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 :param model_id: ID of the model that the training is being performed under. :type model_id: str :param persistor_id: ID of the persistor component. Defaults to "persistor". :type persistor_id: str, optional :raises ValueError: - when the model ID is not a valid UUID. FileNotFoundError: boto3 error for when the zip file does not exist. .. py:attribute:: model_id .. py:attribute:: persistor_id :type: str .. py:attribute:: model_persistor :type: nvflare.app_opt.pt.file_model_persistor.PTFileModelPersistor | None :value: None .. py:attribute:: model_inventory :type: dict .. py:attribute:: model_dir :type: str :value: '' .. py:attribute:: bucket_name :type: str :value: '' .. py:attribute:: flip .. py:method:: execute(fl_ctx: nvflare.apis.fl_context.FLContext) .. py:method:: upload_results_to_s3_bucket(fl_ctx: nvflare.apis.fl_context.FLContext) Uploads the final aggregated model and reports to an S3 bucket as a zip file. .. py:method:: cleanup(fl_ctx: nvflare.apis.fl_context.FLContext) Cleans up the workspace by deleting the transfer and save directories for the model ID.