Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion snippets/_includes/api-key-create-streamlined.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<Note>
For a more streamlined approach, create an API key by going directly to [User Settings](https://wandb.ai/settings). Copy the newly created API key immediately and save it in a secure location such as a password manager.
For a more streamlined approach, go to [User Settings](https://wandb.ai/settings) and create an API key. Copy the API key immediately and save it in a secure location such as a password manager.
</Note>
2 changes: 1 addition & 1 deletion snippets/_includes/api-key-create.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ To create an API key, select the **Personal API key** or **Service Account API k
<Tab title="Personal API key">
To create a personal API key owned by your user ID:

1. Log in to W&B, click your user profile icon, then click **User Settings**.
1. Log in to W&B, then click your user profile icon **> User Settings**.
2. Click **Create new API key**.
3. Provide a descriptive name for your API key.
4. Click **Create**.
Expand Down
6 changes: 3 additions & 3 deletions snippets/_includes/api-key-find.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ In **Dedicated Cloud** and **Self-Managed**:
- Non-admin users can find or list their own API keys.
</Note>

To find an API key, select the **Personal API key** or **Service Account API key** tab for details.
To find an API key, select the **Personal API key** or **Service account API key** tab for details.

<Tabs>
<Tab title="Personal API key">
Expand All @@ -18,10 +18,10 @@ To find a personal API key owned by your user ID:
<Tab title="Service account API key">
To find an API key owned by an organization or team service account:

1. Navigate to the **API Keys** tab in your organization settings.
1. In your organization settings, go to the **API Keys** tab.
2. Find the API key in the list. You can search or filter the list by owner, key name, or key ID.

</Tab>
</Tabs>

The API keys table shows the key ID (the first part of each API key) for identification purposes. The full secret API key is only displayed once when you create it. If you need to use an existing key but do not have the full secret stored, you must create a new API key.
The API keys table shows the key ID (the first part of each API key) for identification. W&B only displays the full secret API key once, when you create it. If you need to use an existing key but don't have the full secret stored, you must create a new API key.
26 changes: 16 additions & 10 deletions snippets/_includes/api-key-security.mdx
Original file line number Diff line number Diff line change
@@ -1,45 +1,49 @@
## Store and handle API keys securely

API keys provide access to your W&B account and should be protected like passwords. Follow these best practices:
API keys provide access to your W&B account and should be protected like passwords. The following sections describe recommended storage methods, practices to avoid, how to pass keys to your code, and SDK version requirements for newer keys.

### Recommended storage methods

Use one of the following methods to store your API key securely.

- **Secrets manager**: Use a dedicated secrets management system such as [AWS Secrets Manager](https://aws.amazon.com/secrets-manager/), [HashiCorp Vault](https://developer.hashicorp.com/vault), [Azure Key Vault](https://azure.microsoft.com/en-us/products/key-vault), or [Google Secret Manager](https://cloud.google.com/security/products/secret-manager).
- **Password manager**: Use a reputable password manager application.
- **OS-level keychains**: Store keys in macOS Keychain, Windows Credential Manager, or Linux secret service. Not suggested for production.

### What to avoid

Avoid the following practices, which can expose your API key:

- Never commit API keys to version control systems such as Git.
- Do not store API keys in plain text configuration files.
- Do not pass API keys on the command line, because they will be visible in the output of OS commands like `ps`.
- Don't store API keys in plain text configuration files.
- Don't pass API keys on the command line, because they're visible in the output of OS commands like `ps`.
- Avoid sharing API keys through email, chat, or other unencrypted channels.
- Do not hard-code API keys in your source code.
- Don't hard-code API keys in your source code.

If an API key is exposed, delete the API key from your W&B account immediately and contact [support](mailto:support@wandb.ai) or your AISE.

### Environment variables

When using API keys in your code, pass them through environment variables:
When you use API keys in your code, pass them through environment variables:

```bash
export WANDB_API_KEY="your-api-key-here"
export WANDB_API_KEY="[YOUR-API-KEY]"
```

This approach keeps keys out of your source code and makes it easier to rotate them when needed.

<Warning>
Avoid setting the environment variable in line with the command, because it will be visible in the output of OS commands like `ps`:
Avoid setting the environment variable in line with the command, because it's visible in the output of OS commands like `ps`:

```bash
# Avoid this pattern, which can expose the API key in process managers
export WANDB_API_KEY="your-api-key-here" ./my-script.sh
export WANDB_API_KEY="[YOUR-API-KEY]" ./my-script.sh
```
</Warning>

### SDK version compatibility

New API keys are longer than legacy keys. When authenticating with older versions of the `wandb` or `weave` SDKs, you may encounter an API key length error.
If you use a newer API key, confirm that your SDK version supports it. Newer API keys are longer than legacy keys. When you authenticate with older versions of the `wandb` or `weave` SDKs, you may encounter an API key length error.

**Solution**: Update to a newer SDK version:
- `wandb` SDK v0.22.3+
Expand All @@ -48,7 +52,9 @@ New API keys are longer than legacy keys. When authenticating with older version
pip install --upgrade wandb==0.22.3
```
- `weave` SDK v0.52.17+

```bash
pip install --upgrade weave==0.52.17
```
If you cannot upgrade the SDK immediately, set the API key using the `WANDB_API_KEY` environment variable as a workaround.

If you can't upgrade the SDK immediately, set the API key using the `WANDB_API_KEY` environment variable as a workaround.
2 changes: 1 addition & 1 deletion snippets/_includes/api-key-view-once-warning.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<Warning>
The full API key is only shown once at creation time. After you close the dialog, you cannot view the full API key again. Only the key ID (first part of the key) is visible in your settings. If you lose the full API key, you must create a new API key.
W&B shows the full API key only once, when you create it. After you close the dialog, you cannot view the full API key again. Your settings display only the key ID (the first part of the key). If you lose the full API key, you must create a new one.
</Warning>
4 changes: 2 additions & 2 deletions snippets/_includes/automations/actions-list.mdx
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
- **Slack notification**: Send a message to a Slack channel with details about the triggering event. The message summarizes the event, with a link to view more details in W&B.
- **Webhook**: Call a webhook URL with a JSON payload containing information about the triggering event. This enables integration with external systems such as CI/CD pipelines, model deployment services, or custom workflows.
- **Slack notification**: Sends a message to a Slack channel with details about the triggering event. The message summarizes the event and includes a link to view more details in W&B.
- **Webhook**: Calls a webhook URL with a JSON payload containing information about the triggering event. Use webhooks to integrate with external systems such as CI/CD pipelines, model deployment services, or custom workflows.
2 changes: 1 addition & 1 deletion snippets/_includes/automations/best-practices.mdx
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
- **Start small**: Begin with one or two automations for high-value events (for example, run failures or production alias changes). Validate that they work as expected before adding more.
- **Test before production**: Create automations in a test project or with a test webhook or Slack channel first. Manually trigger the event and confirm the action runs and the payload or message looks correct.
- **Test before production**: Create automations in a test project or with a test webhook or Slack channel first. Manually trigger the event, then confirm that the action runs and that the payload or message looks correct.
- **Avoid alert fatigue**: Use run filters, metric thresholds, or alias patterns to limit how often an automation fires. If you have multiple severities, route them to different channels.
2 changes: 1 addition & 1 deletion snippets/_includes/automations/tutorial-go-further.mdx
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
## Go further

For more information, see the following resources:
To learn more about W&B automations beyond what this tutorial covers, see the following resources:

- [Automation events and scopes](/models/automations/automation-events) for all project and registry event types.
- [Create a Slack automation](/models/automations/create-automations/slack) and [Create a webhook automation](/models/automations/create-automations/webhook) for full UI and payload details.
Expand Down
4 changes: 2 additions & 2 deletions snippets/_includes/byob-provisioning-link.mdx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
### Provision your storage bucket

Before configuring W&B, provision your object storage bucket with proper IAM policies, CORS configuration, and access credentials.
Before configuring W&B, you must provision your object storage bucket with the required IAM policies, CORS configuration, and access credentials.

**See the [Bring Your Own Bucket (BYOB) guide](/platform/hosting/data-security/secure-storage-connector) for detailed step-by-step provisioning instructions for:**
See the [Bring Your Own Bucket (BYOB) guide](/platform/hosting/data-security/secure-storage-connector) for detailed step-by-step provisioning instructions for:
- Amazon S3 (including IAM policies and bucket policies)
- Google Cloud Storage (including PubSub notifications)
- Azure Blob Storage (including managed identities)
Expand Down
39 changes: 20 additions & 19 deletions snippets/_includes/cli/README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# CLI Reference Intro Snippets
# CLI reference intro snippets

This directory contains introductory content for W&B CLI commands that gets included in the auto-generated CLI reference pages.
This directory contains introductory content for W&B CLI commands that gets included in the autogenerated CLI reference pages. It's intended for docs contributors who need to add hand-written context to a specific CLI command's reference page.

## Purpose

The CLI reference pages (`models/ref/cli/`) are auto-generated from the W&B CLI source code using `scripts/cli-docs-generator.py`. However, some commands benefit from additional context, examples, or explanations beyond what's in the CLI help text. This directory holds that supplementary content.
The script `scripts/cli-docs-generator.py` autogenerates the CLI reference pages (`models/ref/cli/`) from the W&B CLI source code. However, some commands benefit from additional context, examples, or explanations beyond what's in the CLI help text. This directory holds that supplementary content.

## How It Works
## How it works

1. **Snippet files** are created here with the naming pattern: `wandb-{command}.mdx`
- Example: `wandb-login.mdx`, `wandb-sync.mdx`, `wandb-verify.mdx`
- For nested commands, use the full command with dashes: `wandb-artifact-get.mdx`
1. **Snippet files**: Create snippet files here with the naming pattern `wandb-{command}.mdx`.
- Example: `wandb-login.mdx`, `wandb-sync.mdx`, `wandb-verify.mdx`.
- For nested commands, use the full command with dashes: `wandb-artifact-get.mdx`.

2. **Generation script** automatically detects these snippets and:
- Adds an import statement at the top of the generated page
- Includes the snippet content right after the front matter, before the Usage section
- For pages without snippets, adds a commented-out template showing how to add one
2. **Generation script**: The generator automatically detects these snippets and does the following:
- Adds an import statement at the top of the generated page.
- Includes the snippet content right after the front matter, before the Usage section.
- For pages without snippets, adds a commented-out template showing how to add one.

3. **Generated page structure**:
```markdown
Expand All @@ -30,19 +30,20 @@ The CLI reference pages (`models/ref/cli/`) are auto-generated from the W&B CLI
[auto-generated content from CLI]
```

## Adding Intro Content for a Command
## Add intro content for a command

To add introductory content for a command:

1. Create a new snippet with the correct naming: `wandb-{command-name}.mdx`.
2. Write the intro content in MDX format (can include markdown, code blocks, etc.).
3. In the generated CLI reference for the command, uncomment the lines to include and use the snippet. No need to regenerate all of the references.
4. Next time the references are generated, the generator will automatically detect and include your snippet.
2. Write the intro content in MDX format (can include markdown, code blocks, and similar elements).
3. In the generated CLI reference for the command, uncomment the lines to include and use the snippet. You don't need to regenerate all of the references.
4. The next time the references are generated, the generator automatically detects and includes your snippet.

After completing these steps, your intro content appears at the top of the matching CLI reference page, between the front matter and the autogenerated Usage section.

## Guidelines

- Keep content concise and focused on what users need to know before the command details
- Use code blocks for examples
- Avoid duplicating information that's already in the auto-generated command options/arguments
- Test locally after adding a snippet to ensure it renders correctly
- Keep content concise and focused on what users need to know before the command details.
- Use code blocks for examples.
- Avoid duplicating information that's already in the autogenerated command options or arguments.
- Test locally after adding a snippet to ensure it renders correctly.
Loading
Loading