-
Notifications
You must be signed in to change notification settings - Fork 32
Registry: Added section on action history #1689
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,23 +1,30 @@ | ||||||
--- | ||||||
description: Create a lineage map in the W&B Registry. | ||||||
description: Create and view lineage maps to audit a collection's history | ||||||
menu: | ||||||
default: | ||||||
parent: registry | ||||||
identifier: lineage | ||||||
title: Create and view lineage maps | ||||||
title: Lineage maps and audit history | ||||||
weight: 8 | ||||||
--- | ||||||
|
||||||
Use a lineage map to visualize a linked artifact's history. Audit a collection's history to track changes made to artifacts in that collection. | ||||||
|
||||||
## Lineage maps | ||||||
|
||||||
Within a collection in the W&B Registry, you can view a history of the artifacts that an ML experiment uses. This history is called a _lineage graph_. | ||||||
|
||||||
{{% pageinfo color="info" %}} | ||||||
{{% alert color="info" %}} | ||||||
You can also view lineage graphs for artifacts you log to W&B that are not part of a collection. | ||||||
ngrayluna marked this conversation as resolved.
Show resolved
Hide resolved
|
||||||
{{% /pageinfo %}} | ||||||
{{% /alert %}} | ||||||
|
||||||
Lineage graphs can show the specific run that logs an artifact. In addition, lineage graphs can also show which run used an artifact as an input. In other words, lineage graphs can show the input and output of a run. | ||||||
A lineage graph shows: | ||||||
* If a run used an artifact as an input. | ||||||
* If a run created an artifact as an output. | ||||||
|
||||||
In other words, a lineage graph shows the input and output of a run. | ||||||
|
||||||
For example, the proceeding image shows artifacts created and used throughout an ML experiment: | ||||||
For example, the following image shows a typical lineage graph for artifacts created and used throughout an ML experiment: | ||||||
|
||||||
{{< img src="/images/registry/registry_lineage.png" alt="Registry lineage" >}} | ||||||
|
||||||
|
@@ -28,60 +35,76 @@ From left to right, the image shows: | |||||
4. A run called "northern-lake-21" uses the model artifact `zoo-ylbchv20:v0` to evaluate the model. | ||||||
|
||||||
|
||||||
## Track the input of a run | ||||||
### Track the input of a run | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
Mark an artifact as an input or dependency of a run with the `wandb.init.use_artifact` API. | ||||||
Mark an artifact as the input (or dependency) of a run with the [`wandb.Run.use_artifact()`]({{< relref "/ref/python/experiments/run/#method-runuse_artifact" >}}) method. Specify the name of the artifact and an optional alias to reference a specific version of that artifact. The name of the artifact is in the format `<artifact_name>:<version>` or `<artifact_name>:<alias>`. | ||||||
|
||||||
The proceeding code snippet shows how to use the `use_artifact`. Replace values enclosed in angle brackets (`< >`) with your values: | ||||||
Replace values enclosed in angle brackets (`< >`) with your values: | ||||||
|
||||||
```python | ||||||
import wandb | ||||||
|
||||||
# Initialize a run | ||||||
run = wandb.init(project="<project>", entity="<entity>") | ||||||
|
||||||
# Get artifact, mark it as a dependency | ||||||
artifact = run.use_artifact(artifact_or_name="<name>", aliases="<alias>") | ||||||
with wandb.init(entity="<entity>", project="<project>") as run: | ||||||
# Get artifact, mark it as a dependency | ||||||
artifact = run.use_artifact(artifact_or_name="<name>", aliases="<alias>") | ||||||
``` | ||||||
|
||||||
|
||||||
## Track the output of a run | ||||||
### Track the output of a run | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
Use ([`wandb.init.log_artifact`]({{< relref "/ref/python/experiments/run.md#log_artifact" >}})) to declare an artifact as an output of a run. | ||||||
Use [`wandb.Run.log_artifact()`]({{< relref "/ref/python/experiments/run.md#log_artifact" >}}) to declare an artifact as an output of a run. First, create an artifact with the [`wandb.Artifact()`]({{< relref "/ref/python/experiments/artifact/#wandb.Artifact" >}}) constructor. Then, log the artifact as an output of the run with `wandb.Run.log_artifact()`. | ||||||
|
||||||
The proceeding code snippet shows how to use the `wandb.init.log_artifact` API. Ensure to replace values enclosed in angle brackets (`< >`) with your values: | ||||||
Replace values enclosed in angle brackets (`< >`) with your values: | ||||||
|
||||||
```python | ||||||
import wandb | ||||||
|
||||||
# Initialize a run | ||||||
run = wandb.init(entity "<entity>", project = "<project>",) | ||||||
artifact = wandb.Artifact(name = "<artifact_name>", type = "<artifact_type>") | ||||||
artifact.add_file(local_path = "<local_filepath>", name="<optional-name>") | ||||||
|
||||||
# Log the artifact as an output of the run | ||||||
run.log_artifact(artifact_or_path = artifact) | ||||||
with wandb.init(entity="<entity>", project="<project>") as run: | ||||||
|
||||||
# Create an artifact | ||||||
artifact = wandb.Artifact(name = "<artifact_name>", type = "<artifact_type>") | ||||||
artifact.add_file(local_path = "<local_filepath>", name="<optional-name>") | ||||||
|
||||||
# Log the artifact as an output of the run | ||||||
run.log_artifact(artifact_or_path = artifact) | ||||||
``` | ||||||
|
||||||
For more information on about creating artifacts, see [Create an artifact]({{< relref "guides/core/artifacts/construct-an-artifact.md" >}}). | ||||||
|
||||||
|
||||||
## View lineage graphs in a collection | ||||||
### View lineage graphs in a collection | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
||||||
View the lineage of an artifact linked to a collection in the W&B Registry. | ||||||
|
||||||
1. Navigate to the W&B Registry. | ||||||
2. Select the collection that contains the artifact. | ||||||
3. From the dropdown, click the artifact version you want to view its lineage graph. | ||||||
4. Select the "Lineage" tab. | ||||||
3. From the dropdown, select the artifact version you want to view its lineage graph. | ||||||
4. Select the **Lineage** tab. | ||||||
5. Select a node to view detailed information about the run or artifact. | ||||||
|
||||||
|
||||||
Once you are in an artifact's lineage graph page, you can view additional information about any node in that lineage graph. | ||||||
|
||||||
Select a run node to view that run's details, such as the run's ID, the run's name, the run's state, and more. As an example, the proceeding image shows information about the `rural-feather-20` run: | ||||||
The following image shows the expanded detailed view of a run (`rural-feather-20`) when you select a node in the lineage graph: | ||||||
|
||||||
{{< img src="/images/registry/lineage_expanded_node.png" alt="Expanded lineage node" >}} | ||||||
|
||||||
Select an artifact node to view that artifact's details, such as its full name, type, creation time, and associated aliases. | ||||||
The following image shows the expanded detailed view of an artifact (`zoo-ylbchv20:v0`) when you select an artifact node in the lineage graph: | ||||||
|
||||||
{{< img src="/images/registry/lineage_expanded_artifact_node.png" alt="Expanded artifact node details" >}} | ||||||
|
||||||
## Audit a collection's history | ||||||
|
||||||
{{< img src="/images/registry/lineage_expanded_artifact_node.png" alt="Expanded artifact node details" >}} | ||||||
View actions that members of your organization take on that collection. You can view: | ||||||
|
||||||
- If an alias was added or removed from an artifact version. | ||||||
- If an artifact version was added or removed from a collection. | ||||||
|
||||||
For both actions, you can view the user that performed the action and the date the action occurred. | ||||||
|
||||||
To view a collection's action history: | ||||||
|
||||||
1. Navigate to the W&B Registry. | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Do you heed to be an effective Registry admin or just a member? |
||||||
2. Select the collection you want to view its action history. | ||||||
3. Select the dropdown menu next to the collection name. | ||||||
4. Select the **Action History** option. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.