scaffold.aim_utils.fsspec_artifact_storage ========================================== .. py:module:: scaffold.aim_utils.fsspec_artifact_storage Classes ------- .. autoapisummary:: scaffold.aim_utils.fsspec_artifact_storage.FsspecArtifactStorage scaffold.aim_utils.fsspec_artifact_storage.FsspecArtifactStorageAutoClean Module Contents --------------- .. py:class:: FsspecArtifactStorage(storage_root: str, max_upload_workers: int = 4) Bases: :py:obj:`aim.storage.artifacts.artifact_storage.AbstractArtifactStorage` Fsspec storage backend for Aim. :param storage_root: URL with an optional prefix (e.g., 'gs://my-bucket/path/prefix'). :param fs: Optional filesystem object to be used. It will be created based on the storage root if not specified. Note: Make sure to have the correct fsspec dependencies installed for the protocol you want to use (e.g., 'gcsfs' for 'gs://'). .. py:method:: delete_artifact(artifact_path: str) .. py:method:: download_artifact(artifact_path: str, dest_dir: Optional[str] = None) -> str Using fsspec, download an artifact to a local directory. :param artifact_path: path to the artifact in storage, relative to the storage root specified in the constructor. :param dest_dir: Local directory to download the artifact to. If None, a temporary directory is created. :returns: The local path to the downloaded artifact. .. py:method:: upload_artifact(file_path: str, artifact_path: str, block: bool = False) Using fsspec, upload a local file to the artifact storage in a non-blocking manner by default. :param file_path: Local path to the file to upload. :param artifact_path: Path to the artifact in storage, relative to the storage root specified in the constructor. :param block: If True, the method will block until the upload is complete. .. py:attribute:: scheme .. py:attribute:: thread_pool .. py:class:: FsspecArtifactStorageAutoClean(instance: FsspecArtifactStorage) Bases: :py:obj:`aim.ext.cleanup.AutoClean`\ [\ :py:obj:`FsspecArtifactStorage`\ ] Makes sure all upload threads finish before the FsspecArtifactStorage is destroyed. Initialize object resources that need to be cleaned up automatically.