Skip to content

Commit 65c4809

Browse files
Add diagrams to artifact and run deletion documentation (#1560)
- Added a comprehensive diagram illustrating the artifact garbage collection process, clarifying the soft-delete mechanism and subsequent file deletion. - Introduced a new section detailing the run deletion workflow, including options for deleting associated artifacts and handling Model Registry links. Resolves DOCS-1005 <!-- preview-links-comment --> 📄 **[View preview links for changed pages](#1560 (comment)
1 parent 0d1f28e commit 65c4809

2 files changed

Lines changed: 95 additions & 3 deletions

File tree

content/en/guides/core/artifacts/manage-data/delete-artifacts.md

Lines changed: 54 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,54 @@ title: Delete an artifact
1010

1111
Delete artifacts interactively with the App UI or programmatically with the W&B SDK. When you delete an artifact, W&B marks that artifact as a *soft-delete*. In other words, the artifact is marked for deletion but files are not immediately deleted from storage.
1212

13-
The contents of the artifact remain as a soft-delete, or pending deletion state, until a regularly run garbage collection process reviews all artifacts marked for deletion. The garbage collection process deletes associated files from storage if the artifact and its associated files are not used by a previous or subsequent artifact versions.
13+
The contents of the artifact remain as a soft-delete, or pending deletion state, until a regularly run garbage collection process reviews all artifacts marked for deletion. The garbage collection process deletes associated files from storage if the artifact and its associated files are not used by a previous or subsequent artifact versions.
14+
15+
## Artifact garbage collection workflow
16+
17+
The following diagram illustrates the complete artifact garbage collection process:
18+
19+
```mermaid
20+
graph TB
21+
Start([Artifact Deletion Initiated]) --> DeleteMethod{Deletion Method}
22+
23+
DeleteMethod -->|UI| UIDelete[Delete via W&B App UI]
24+
DeleteMethod -->|SDK| SDKDelete[Delete via W&B SDK]
25+
DeleteMethod -->|TTL| TTLDelete[TTL Policy Expires]
26+
27+
UIDelete --> SoftDelete[Artifact Marked as<br/>'Soft Delete']
28+
SDKDelete --> SoftDelete
29+
TTLDelete --> SoftDelete
30+
31+
SoftDelete --> GCWait[(Wait for<br/>Garbage Collection<br/>Process)]
32+
33+
GCWait --> GCRun[Garbage Collection<br/>Process Runs<br/><br/>- Reviews all soft-deleted artifacts<br/>- Checks file dependencies]
34+
35+
GCRun --> CheckUsage{Are files used by<br/>other artifact versions?}
36+
37+
CheckUsage -->|Yes| KeepFiles[Files Kept in Storage<br/><br/>- Artifact marked deleted<br/>- Files remain for other versions]
38+
CheckUsage -->|No| DeleteFiles[Files Deleted from Storage<br/><br/>- Artifact fully removed<br/>- Storage space reclaimed]
39+
40+
KeepFiles --> End([End])
41+
DeleteFiles --> End
42+
43+
style Start fill:#e1f5fe,stroke:#333,stroke-width:2px,color:#000
44+
style SoftDelete fill:#fff3e0,stroke:#333,stroke-width:2px,color:#000
45+
style GCRun fill:#f3e5f5,stroke:#333,stroke-width:2px,color:#000
46+
style KeepFiles fill:#e8f5e9,stroke:#333,stroke-width:2px,color:#000
47+
style DeleteFiles fill:#ffebee,stroke:#333,stroke-width:2px,color:#000
48+
style End fill:#e0e0e0,stroke:#333,stroke-width:2px,color:#000
49+
```
1450

1551
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]({{< relref "./ttl.md" >}}).
1652

1753
{{% alert %}}
1854
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.
1955
{{% /alert %}}
2056

57+
{{% alert %}}
58+
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.
59+
{{% /alert %}}
60+
2161
### Delete an artifact version
2262

2363
To delete an artifact version:
@@ -27,7 +67,7 @@ To delete an artifact version:
2767
3. On the right hand side of the workspace, select the kebab dropdown.
2868
4. Choose Delete.
2969

30-
An artifact version can also be deleted programatically via the [delete()]({{< relref "/ref/python/sdk/classes/artifact.md#delete" >}}) method. See the examples below.
70+
An artifact version can also be deleted programmatically via the [delete()]({{< relref "/ref/python/sdk/classes/artifact.md#delete" >}}) method. See the examples below.
3171

3272
### Delete multiple artifact versions with aliases
3373

@@ -71,6 +111,18 @@ for artifact_version in runs.logged_artifacts():
71111
artifact.delete(delete_aliases=True)
72112
```
73113

114+
### Protected aliases and deletion permissions
115+
116+
Artifacts with protected aliases have special deletion restrictions. [Protected aliases]({{< relref "/guides/core/registry/model_registry/access_controls.md" >}}) are aliases in the Model Registry that registry admins can set to prevent unauthorized deletion.
117+
118+
{{% alert %}}
119+
**Important considerations for protected aliases:**
120+
- Artifacts with protected aliases cannot be deleted by non-registry admins
121+
- Within a registry, registry admins can unlink protected artifact versions and delete collections/registries that contain protected aliases
122+
- For source artifacts: if a source artifact is linked to a registry with a protected alias, it cannot be deleted by any user
123+
- Registry admins can remove the protected aliases from source artifacts and then delete them
124+
{{% /alert %}}
125+
74126
### Delete all versions of an artifact that do not have an alias
75127

76128
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 the `project` and `entity` keys in `wandb.Api`, respectively. Replace the `<>` with the name of your artifact:

content/en/guides/models/track/runs/_index.md

Lines changed: 41 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -536,6 +536,46 @@ Once a run with a specific ID is deleted, its ID may not be used again. Trying t
536536
For projects that contain a large number of runs, you can use either the search bar to filter runs you want to delete using Regex or the filter button to filter runs based on their status, tags, or other properties.
537537
{{% /alert %}}
538538

539+
### Run deletion workflow
540+
541+
The following diagram illustrates the complete run deletion process, including the handling of associated artifacts and Model Registry links:
542+
543+
```mermaid
544+
graph TB
545+
Start([User Initiates<br/>Run Deletion]) --> RunSelect[Select Runs<br/>to Delete]
546+
547+
RunSelect --> DeletePrompt{Delete Associated<br/>Artifacts?}
548+
549+
DeletePrompt -->|No| DeleteRunOnly[Delete Run Only<br/><br/>- Run metadata removed<br/>- Artifacts remain available<br/>- Can still access artifacts]
550+
551+
DeletePrompt -->|Yes| CheckArtifacts[Check for<br/>Associated Artifacts]
552+
553+
CheckArtifacts --> HasRegistry{Artifacts Linked to<br/>Model Registry?}
554+
555+
HasRegistry -->|Yes| RegistryWarning[⚠️ Warning<br/><br/>Registry models will be deleted<br/>Production aliases affected]
556+
HasRegistry -->|No| DirectDelete
557+
558+
RegistryWarning --> ConfirmRegistry{Confirm Registry<br/>Model Deletion?}
559+
560+
ConfirmRegistry -->|No| DeleteRunOnly
561+
ConfirmRegistry -->|Yes| DirectDelete[Delete Run + Artifacts<br/><br/>- Run metadata removed<br/>- Artifacts permanently deleted<br/>- Registry links removed<br/>- Cannot be recovered]
562+
563+
DeleteRunOnly --> PartialEnd([Run Deleted<br/>Artifacts Preserved])
564+
DirectDelete --> FullEnd([Run + Artifacts<br/>Permanently Deleted])
565+
566+
style Start fill:#e1f5fe,stroke:#333,stroke-width:2px,color:#000
567+
style DeletePrompt fill:#fff3e0,stroke:#333,stroke-width:2px,color:#000
568+
style RegistryWarning fill:#ffecb3,stroke:#333,stroke-width:2px,color:#000
569+
style DirectDelete fill:#ffebee,stroke:#333,stroke-width:2px,color:#000
570+
style DeleteRunOnly fill:#e8f5e9,stroke:#333,stroke-width:2px,color:#000
571+
style PartialEnd fill:#c8e6c9,stroke:#333,stroke-width:2px,color:#000
572+
style FullEnd fill:#ffcdd2,stroke:#333,stroke-width:2px,color:#000
573+
```
574+
575+
{{% alert title="Important" %}}
576+
When you delete a run and choose to delete associated artifacts, the artifacts are permanently removed and can't be recovered, even if the run is restored later. This includes models linked to the Model Registry.
577+
{{% /alert %}}
578+
539579
## Organize runs
540580

541581
This section provides instructions on how to organize runs using groups and job types. By assigning runs to groups (for example, experiment names) and specifying job types (for example, preprocessing, training, evaluation, debugging), you can streamline your workflow and improve model comparison.
@@ -547,7 +587,7 @@ Each run in W&B can be categorized by **group** and a **job type**:
547587
- **Group**: a broad category for the experiment, used to organize and filter runs.
548588
- **Job type**: the function of the run, such as `preprocessing`, `training`, or `evaluation`.
549589

550-
The proceeding [example workspace](https://wandb.ai/stacey/model_iterz?workspace=user-stacey), trains a baseline model using increasing amounts of data from the Fashion-MNIST dataset. The workspace uses colorts to represent the amount of data used:
590+
The proceeding [example workspace](https://wandb.ai/stacey/model_iterz?workspace=user-stacey), trains a baseline model using increasing amounts of data from the Fashion-MNIST dataset. The workspace uses colors to represent the amount of data used:
551591

552592
- **Yellow to dark green** indicate increasing amounts of data for the baseline model.
553593
- **Light blue to violet to magenta** indicate amounts of data for a more complex "double" model with additional parameters.

0 commit comments

Comments
 (0)