Artifact garbage collection workflow
The following diagram illustrates the complete artifact garbage collection process: The sections in this page describe how to delete specific artifact versions, how to delete an artifact collection, how to delete artifacts with and without aliases, and more. You can schedule when artifacts are deleted from W&B with TTL policies. For more information, see Manage data retention with Artifact TTL policy.Artifacts that are scheduled for deletion with a TTL policy, deleted with the W&B SDK, or deleted with the W&B App UI are first soft-deleted. Artifacts that are soft deleted undergo garbage collection before they are hard-deleted.
Deleting an entity, project, or artifact collection will also trigger the artifact deletion process described on this page. When deleting a run, if you choose to delete associated artifacts, those artifacts will follow the same soft-delete and garbage collection workflow.
Delete an artifact version
To delete an artifact version:- Select the name of the artifact. This will expand the artifact view and list all the artifact versions associated with that artifact.
- From the list of artifacts, select the artifact version you want to delete.
- On the right hand side of the workspace, select the kebab dropdown.
- Choose Delete.
Delete multiple artifact versions with aliases
The following code example demonstrates how to delete artifacts that have aliases associated with them. Provide the entity, project name, and run ID that created the artifacts.delete_aliases
parameter to the boolean value, True
to delete aliases if the artifact has one or more aliases.
Delete multiple artifact versions with a specific alias
The proceeding code demonstrates how to delete multiple artifact versions that have a specific alias. Provide the entity, project name, and run ID that created the artifacts. Replace the deletion logic with your own:Protected aliases and deletion permissions
Artifacts with protected aliases have special deletion restrictions. Protected aliases are aliases in the Model Registry that registry admins can set to prevent unauthorized deletion.Important considerations for protected aliases:
- Artifacts with protected aliases cannot be deleted by non-registry admins
- Within a registry, registry admins can unlink protected artifact versions and delete collections/registries that contain protected aliases
- For source artifacts: if a source artifact is linked to a registry with a protected alias, it cannot be deleted by any user
- Registry admins can remove the protected aliases from source artifacts and then delete them
Delete all versions of an artifact that do not have an alias
The following code snippet demonstrates how to delete all versions of an artifact that do not have an alias. Provide the name of the project and entity for theproject
and entity
keys in wandb.Api
, respectively. Replace the <>
with the name of your artifact:
Delete an artifact collection
To delete an artifact collection:- Navigate to the artifact collection you want to delete and hover over it.
- Select the kebab dropdown next to the artifact collection name.
- Choose Delete.
project
and entity
keys in wandb.Api
, respectively:
How to enable garbage collection based on how W&B is hosted
Garbage collection is enabled by default if you use W&B’s shared cloud. Based on how you host W&B, you might need to take additional steps to enable garbage collection, this includes:- Set the
GORILLA_ARTIFACT_GC_ENABLED
environment variable to true:GORILLA_ARTIFACT_GC_ENABLED=true
- Enable bucket versioning if you use AWS, GCP or any other storage provider such as Minio. If you use Azure, enable soft deletion.
Soft deletion in Azure is equivalent to bucket versioning in other storage providers.
X
indicates you must satisfy the requirement:
Environment variable | Enable versioning | |
---|---|---|
Shared cloud | ||
Shared cloud with secure storage connector | X | |
Dedicated Cloud | ||
Dedicated Cloud with secure storage connector | X | |
Self-Managed cloud | X | X |
Self-Managed on-prem | X | X |
note
Secure storage connector is currently only available for Google Cloud Platform and Amazon Web Services.