ersilia.hub.delete package

Submodules

ersilia.hub.delete.delete module

class ersilia.hub.delete.delete.ModelBentoDeleter(config_json=None)[source]

Bases: ErsiliaBase

Deletes BentoML services related to a model.

Parameters:

config_json (dict, optional) – Configuration settings for the deleter.

delete(model_id)[source]

Deletes all BentoML services related to the model.

clean(model_id)[source]

Deletes all but the latest BentoML service related to the model.

clean(model_id: str)[source]

Deletes all but the latest BentoML service related to the model.

Parameters:

model_id (str) – Identifier of the model to be cleaned.

delete(model_id: str)[source]

Deletes all BentoML services related to the model.

Parameters:

model_id (str) – Identifier of the model to be deleted.

class ersilia.hub.delete.delete.ModelBundleDeleter(config_json=None)[source]

Bases: ErsiliaBase

Deletes model bundles from the EOS directory.

Parameters:

config_json (dict, optional) – Configuration settings for the deleter.

delete(model_id)[source]

Deletes the model bundle.

delete(model_id: str)[source]

Deletes the model bundle.

Parameters:

model_id (str) – Identifier of the model to be deleted.

class ersilia.hub.delete.delete.ModelCondaDeleter(config_json=None)[source]

Bases: ErsiliaBase

Deletes Conda environments related to a model.

Parameters:

config_json (dict, optional) – Configuration settings for the deleter.

delete(model_id)[source]

Deletes the Conda environment related to the model.

delete(model_id: str)[source]

Deletes the Conda environment related to the model.

Parameters:

model_id (str) – Identifier of the model to be deleted.

class ersilia.hub.delete.delete.ModelDockerDeleter(config_json=None)[source]

Bases: ErsiliaBase

Deletes Docker images and stops containers related to a model.

Parameters:

config_json (dict, optional) – Configuration settings for the deleter.

delete(model_id)[source]

Deletes Docker images and stops containers related to the model.

delete(model_id: str)[source]

Deletes Docker images and stops containers related to the model.

Parameters:

model_id (str) – Identifier of the model to be deleted.

class ersilia.hub.delete.delete.ModelEosDeleter(config_json=None)[source]

Bases: ErsiliaBase

Deletes model data from the EOS storage directory, a directory to store fetched models locally.

Parameters:

config_json (dict, optional) – Configuration settings for the deleter.

delete(model_id)[source]

Deletes the model data from the EOS storage directory, a directory to store fetched models locally.

delete(model_id: str)[source]

Deletes the model data from the EOS storage directory, a directory to store fetched models locally..

Parameters:

model_id (str) – Identifier of the model to be deleted.

class ersilia.hub.delete.delete.ModelFetchedEntryDeleter(config_json=None)[source]

Bases: ErsiliaBase

Deletes fetched model entries from the database.

Parameters:

config_json (dict, optional) – Configuration settings for the deleter.

delete(model_id)[source]

Deletes the fetched model entry from the database.

delete(model_id: str)[source]

Deletes the fetched model entry from the database.

Parameters:

model_id (str) – Identifier of the model to be deleted.

class ersilia.hub.delete.delete.ModelFullDeleter(config_json=None, overwrite=True)[source]

Bases: ErsiliaBase

Deletes all data related to a model.

Parameters:
  • config_json (dict, optional) – Configuration settings for the deleter.

  • overwrite (bool, optional) – Whether to overwrite existing data, by default True.

needs_delete(model_id)

Checks if the model needs to be deleted.

delete(model_id)[source]

Deletes all data related to the model.

can_be_deleted(model_id: str) Tuple[bool, str][source]

Checks if the model can be deleted.

Parameters:

model_id (str) – Identifier of the model.

Returns:

True if the model can be deleted, False otherwise.

Return type:

bool

delete(model_id: str)[source]

Deletes all data related to the model.

Parameters:

model_id (str) – Identifier of the model to be deleted.

class ersilia.hub.delete.delete.ModelLakeDeleter(config_json=None)[source]

Bases: ErsiliaBase

Deletes model data from the Lake storage.

Parameters:

config_json (dict, optional) – Configuration settings for the deleter.

delete(model_id)[source]

Deletes the model data from the Lake storage.

delete_local(model_id)[source]

Deletes the local model data from the Lake storage.

delete_public(model_id)[source]

Deletes the public model data from the Lake storage.

delete(model_id: str)[source]

Deletes the model data from the Lake storage.

Parameters:

model_id (str) – Identifier of the model to be deleted.

delete_if_exists(path)[source]

Delete the file or symbolic link at the given path if it exists. :param path: The path to the file or symbolic link to be deleted. :type path: str

Notes

This function checks if the given path is a file or a symbolic link. If it is, the file or symbolic link is removed.

delete_local(model_id: str)[source]

Deletes the local model data from the Lake storage.

Parameters:

model_id (str) – Identifier of the model to be deleted.

delete_public(model_id: str)[source]

Deletes the public model data from the Lake storage.

Parameters:

model_id (str) – Identifier of the model to be deleted.

class ersilia.hub.delete.delete.ModelPipDeleter(config_json=None)[source]

Bases: ErsiliaBase

Uninstalls pip packages related to a model.

Parameters:

config_json (dict, optional) – Configuration settings for the deleter.

delete(model_id)[source]

Uninstalls the pip package related to the model.

delete(model_id: str)[source]

Uninstalls the pip package related to the model.

Parameters:

model_id (str) – Identifier of the model to be deleted.

pip_uninstall(model_id)[source]

Uninstalls a Python package using pip. :param model_id: The name of the package to uninstall. :type model_id: str

class ersilia.hub.delete.delete.ModelSlugDeleter(config_json=None)[source]

Bases: ErsiliaBase

Deletes model slugs from the database.

Parameters:

config_json (dict, optional) – Configuration settings for the deleter.

delete(model_id)[source]

Deletes the model slug from the database.

delete(model_id: str)[source]

Deletes the model slug from the database.

Parameters:

model_id (str) – Identifier of the model to be deleted.

class ersilia.hub.delete.delete.ModelTmpDeleter(config_json=None)[source]

Bases: ErsiliaBase

Deletes temporary model data.

Parameters:

config_json (dict, optional) – Configuration settings for the deleter.

delete(model_id)[source]

Deletes the temporary model data.

delete(model_id: str)[source]

Deletes the temporary model data from the EOS directory.

Parameters:

model_id (str) – Identifier of the model to be deleted.

class ersilia.hub.delete.delete.TmpCleaner(config_json=None)[source]

Bases: ErsiliaBase

Cleans temporary directories.

Parameters:

config_json (dict, optional) – Configuration settings for the cleaner.

delete()[source]

Deletes the temporary directory.

delete()[source]

Deletes the temporary directory.

ersilia.hub.delete.delete.rmtree(path)[source]

Recursively delete a directory tree.

Parameters:

path (str) – Path to the directory to be deleted.

Module contents