Skip to content

Commit c082950

Browse files
committed
Merge branch 'develop' into feature/dynamic-pipelines
2 parents 23ca5eb + b32d8aa commit c082950

File tree

47 files changed

+6547
-128
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+6547
-128
lines changed

.cursor/rules/comments.mdc

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
---
2+
description: Project-wide commenting policy — explain WHY the code is the way it is; avoid change-log comments.
3+
alwaysApply: true
4+
---
5+
6+
# Commenting Policy: Explain **Why**, Not **What**
7+
8+
**Goal:** Comments should help a future maintainer understand intent and constraints months later—not narrate edits.
9+
10+
## Use comments to explain
11+
- Non-obvious design decisions / trade-offs and invariants
12+
- Complex logic or algorithms (what makes them tricky)
13+
- Business rules and constraints that drive the design
14+
- Purpose and contract of functions/classes (especially public APIs)
15+
- Edge cases and gotchas being handled and why they matter
16+
17+
## Avoid change-tracking comments
18+
- “Updated from previous version”
19+
- “New implementation”
20+
- “Changed to use X instead of Y”
21+
- “Refactored this section”
22+
23+
## Avoid simple explanatory comments
24+
- Avoid comments that are obvious descriptions of what the code does when it's
25+
already clear from the code itself.
26+
27+
## Guidance
28+
- Prefer self-explanatory code; add comments only where extra context is genuinely needed.
29+
- Write for “future you” 6+ months from now.
30+
- In Python, prefer docstrings for API intent and inline comments only for truly non-obvious lines.

.gitignore

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,16 @@ test_terraform/
189189
# feast registry database
190190
examples/feast_feature_store/feast_feature_repo/data/registry.db
191191

192+
# Computer vision example
193+
examples/computer_vision/*.jpg
194+
examples/computer_vision/*.jpeg
195+
examples/computer_vision/*.pt
196+
examples/computer_vision/data
197+
examples/computer_vision/runs
198+
examples/computer_vision/predictions
199+
examples/computer_vision/test_fixed_training
200+
examples/computer_vision/test_runs
201+
192202
#neptune
193203
*.neptune/
194204

@@ -200,5 +210,4 @@ zenml_tutorial/
200210
.claude/
201211

202212
.local/
203-
# PLEASE KEEP THIS LINE AT THE EOF: never include here src/zenml/zen_server/dashboard, since it is affecting release flow
204-
213+
# PLEASE KEEP THIS LINE AT THE EOF: never include here src/zenml/zen_server/dashboard, since it is affecting release flow

.typos.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ cachable = "cachable"
3838
OT = "OT"
3939
cll = "cll"
4040
ser = "ser"
41+
fo = "fo"
4142

4243
[default]
4344
locale = "en-us"

AGENTS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,12 @@ Use filesystem navigation tools to explore the codebase structure as needed.
1414

1515
## Code Style & Quality Standards
1616

17+
### Commenting policy — explain why, not what
18+
- Use comments to document intent, trade‑offs, constraints, invariants, and tricky edge cases—i.e., why the code is this way—rather than narrating changes. Prefer self‑explanatory code; add comments only where extra context is needed. Write for a reader 6+ months later.
19+
- Use for: complex logic/algorithms, non‑obvious design decisions, business rules/constraints, API purpose/contracts, edge cases.
20+
- Avoid: change‑tracking comments (“Updated from previous version”, “New implementation”, “Changed to use X instead of Y”, “Refactored this section”).
21+
- Avoid simple explanatory comments, where it is already clear from the code itself.
22+
1723
### Formatting and Linting
1824
- Format code with: `bash scripts/format.sh` (requires Python environment with dev dependencies)
1925
- Run this before every commit to ensure proper formatting

CLAUDE.md

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@ Note: The MCP server indexes the latest released docs, not the develop branch. F
2424

2525
## Code Style & Quality Standards
2626

27+
### Commenting policy — explain why, not what
28+
- Use comments to document intent, trade‑offs, constraints, invariants, and tricky edge cases—i.e., why the code is this way—rather than narrating changes. Prefer self‑explanatory code; add comments only where extra context is needed. Write for a reader 6+ months later.
29+
- Use for: complex logic/algorithms, non‑obvious design decisions, business rules/constraints, API purpose/contracts, edge cases.
30+
- Avoid: change‑tracking comments (“Updated from previous version”, “New implementation”, “Changed to use X instead of Y”, “Refactored this section”).
31+
- Avoid simple explanatory comments, where it is already clear from the code itself.
32+
2733
### Formatting and Linting
2834
- Format code with: `bash scripts/format.sh` (requires Python environment with dev dependencies)
2935
- Run this before every commit to ensure proper formatting
@@ -297,4 +303,4 @@ When tackling complex tasks:
297303
---
298304

299305
*This document is maintained to help Claude Code work effectively with the
300-
ZenML codebase. For human contributors, see CONTRIBUTING.md.*
306+
ZenML codebase. For human contributors, see CONTRIBUTING.md.*

docs/book/api-docs/oss-api/oss-api/getting-started.md

Lines changed: 54 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -38,9 +38,10 @@ Choosing a method:
3838

3939
### Using a short-lived API token
4040

41-
You can generate a short-lived (1 hour) API token from your ZenML dashboard. This is useful when you need a fast way to make authenticated HTTP requests to the ZenML API endpoints and you don't need a long-term solution.
41+
You can generate a short-lived API token using the CLI or the ZenML UI. This is useful when you need a fast way to make authenticated HTTP requests to the ZenML API endpoints and you don't need a long-term solution.
42+
43+
1. Generate a short-lived API token through the API Tokens page under your ZenML UI server settings, or the `zenml token` CLI command, as documented in the [Using an API token](../../../how-to/manage-zenml-server/connecting-to-zenml/connect-with-an-api-token.md) guide.
4244

43-
1. Generate a short-lived API token through the API Tokens page under your ZenML dashboard server settings, as documented in the [Using an API token](../../../how-to/manage-zenml-server/connecting-to-zenml/connect-with-an-api-token.md) guide.
4445
2. Use the API token as the bearer token in your HTTP requests. For example, you can use the following command to check your current user:
4546
* using `curl`:
4647

@@ -67,24 +68,63 @@ You can generate a short-lived (1 hour) API token from your ZenML dashboard. Thi
6768
{% hint style="info" %}
6869
**Important Notes**
6970

70-
* API tokens expire after 1 hour and cannot be retrieved after the initial generation
71-
* Tokens are scoped to your user account and inherit your permissions
72-
* For long-term programmatic access, it is instead recommended to [set up a service account and an API key](./#using-a-service-account-and-an-api-key)
71+
* API tokens expire after the configured expiration time (default 1 hour) and need to be renewed periodically.
72+
* individual API tokens cannot be revoked after they are generated. If a token is compromised, you may need to lock the user account or service account to prevent further access.
73+
* Tokens are scoped to the user account or service account that was used to generate them and inherit their permissions.
74+
* For long-term programmatic access, it is instead recommended to [set up a service account API key](./#using-a-service-account-and-an-api-key).
7375
{% endhint %}
7476

7577
### Using a service account and an API key
7678

77-
You can use a service account's API key to obtain short-lived API tokens for programmatic access to the ZenML server's REST API. This is particularly useful when you need a long-term, secure way to make authenticated HTTP requests to the ZenML API endpoints.
79+
You can use a service account's API key to authenticate to the ZenML server's REST API programmatically. This is particularly useful when you need a long-term, secure way to make authenticated HTTP requests to the ZenML API endpoints.
7880

79-
1. Create a [service account](https://docs.zenml.io/how-to/manage-zenml-server/connecting-to-zenml/connect-with-a-service-account):
81+
Start by [creating a service account and an API key](https://docs.zenml.io/how-to/manage-zenml-server/connecting-to-zenml/connect-with-a-service-account), e.g.:
8082

8183
```shell
8284
zenml service-account create myserviceaccount
8385
```
8486

85-
This will print out the `<ZENML_API_KEY>`, you can use in the next steps.
87+
Then, there are two methods to authenticate with the API using the API key - one is simpler but less secure, the other is secure and recommended but more complex:
88+
89+
{% tabs %}
90+
{% tab title="Direct API key authentication" %}
91+
92+
{% hint style="warning" %}
93+
This approach, albeit simple, is not recommended because the long-lived API key is exposed with every API request, which makes it easier to be compromised. Use it only in low-risk circumstances.
94+
{% endhint %}
95+
96+
Use the API key directly to authenticate your API requests by including it in the `Authorization` header. For example, you can use the following command to check your current user:
8697

87-
2. To obtain an API token using your API key, send a POST request to the `/api/v1/login` endpoint. Here are examples using common HTTP clients:
98+
* using curl:
99+
100+
```bash
101+
curl -H "Authorization: Bearer YOUR_API_KEY" https://your-zenml-server/api/v1/current-user
102+
```
103+
* using wget:
104+
105+
```bash
106+
wget -qO- --header="Authorization: Bearer YOUR_API_KEY" https://your-zenml-server/api/v1/current-user
107+
```
108+
* using python:
109+
110+
```python
111+
import requests
112+
113+
response = requests.get(
114+
"https://your-zenml-server/api/v1/current-user",
115+
headers={"Authorization": f"Bearer {YOUR_API_KEY}"}
116+
)
117+
118+
print(response.json())
119+
```
120+
121+
{% endtab %}
122+
123+
{% tab title="Token exchange authentication" %}
124+
125+
Reduce the risk of API key exposure by periodically exchanging the API key for a short-lived API access token.
126+
127+
1. To obtain an API access token using your API key, send a POST request to the `/api/v1/login` endpoint. Here are examples using common HTTP clients:
88128
* using curl:
89129

90130
```bash
@@ -112,7 +152,7 @@ This will print out the `<ZENML_API_KEY>`, you can use in the next steps.
112152
print(response.json())
113153
```
114154

115-
This will return a response like this:
155+
This will return a response like this (the API token is the `access_token` field):
116156

117157
```json
118158
{
@@ -124,7 +164,7 @@ This will return a response like this:
124164
}
125165
```
126166

127-
3. Once you have obtained an API token, you can use it to authenticate your API requests by including it in the `Authorization` header. For example, you can use the following command to check your current user:
167+
2. Once you have obtained an API token, you can use it to authenticate your API requests by including it in the `Authorization` header. When the token expires, simply repeat the steps above to obtain a new token. For example, you can use the following command to check your current user:
128168
* using curl:
129169

130170
```bash
@@ -148,6 +188,9 @@ This will return a response like this:
148188
print(response.json())
149189
```
150190

191+
{% endtab %}
192+
{% endtabs %}
193+
151194
{% hint style="info" %}
152195
**Important notes**
153196

docs/book/api-docs/pro-api/pro-api/getting-started.md

Lines changed: 13 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -53,10 +53,10 @@ Similar to [short-lived tokens for OSS and Workspace servers](../../oss-api/oss-
5353
To generate a new API token for the ZenML Pro API:
5454

5555
1. Navigate to the organization settings page in your ZenML Pro dashboard
56-
2. Select "API Tokens" from the left sidebar
56+
2. Select "API Tokens" from the left sidebar
5757

5858
![API Tokens](../../../.gitbook/assets/zenml-pro-api-token-01.png)
59-
3. Click the "Create new token" button. Once generated, you'll see a dialog showing your new API token.
59+
3. Click the "Create new token" button. Once generated, you'll see a dialog showing your new API token.
6060

6161
![API Tokens](../../../.gitbook/assets/zenml-pro-api-token-02.png)
6262
4. Simply use the API token as the bearer token in your HTTP requests. For example, you can use the following command to check your current user:
@@ -85,8 +85,9 @@ To generate a new API token for the ZenML Pro API:
8585
{% hint style="info" %}
8686
**Important Notes**
8787

88-
* API tokens expire after 1 hour and cannot be retrieved after initial generation
89-
* Tokens are scoped to your user account and inherit your permissions
88+
* API tokens expire after 1 hour and need to be renewed periodically.
89+
* individual API tokens cannot be revoked after they are generated. If a token is compromised, you may need to lock the user account or service account to prevent further access.
90+
* Tokens are scoped to the user account or service account that was used to generate them and inherit their permissions.
9091
* As an alternative to API tokens, you can use [service accounts and API keys](./#programmatic-access-with-service-accounts-and-api-keys) for long-term access.
9192
{% endhint %}
9293

@@ -100,22 +101,9 @@ To generate a new API token for the ZenML Pro API:
100101
* Follow the migration guide in [Migration of workspace level service accounts](https://docs.zenml.io/pro/core-concepts/service-accounts#migration-of-workspace-level-service-accounts) to learn how to migrate from your existing service accounts.
101102
{% endhint %}
102103

103-
Organization‑level service accounts and API keys can be used to authenticate to the ZenML Pro API and to obtain short‑lived tokens for the Workspace API across all workspaces. See [Service Accounts](https://docs.zenml.io/pro/core-concepts/service-accounts) for setup and examples.
104+
Organization‑level service accounts and API keys can be used to authenticate to the ZenML Pro API and the Workspace API across all workspaces in your organization. See [Service Accounts](https://docs.zenml.io/pro/core-concepts/service-accounts) for setup and examples.
104105

105-
{% hint style="warning" %}
106-
Which credentials should you use?
107-
108-
- For organization/workspace/user management on the Pro management API (`cloudapi.zenml.io`), use short‑lived Pro API tokens (no service accounts).
109-
- For pipeline/run‑template operations on your Workspace API (your workspace URL), use temporary user tokens or—recommended for automation—service accounts + API keys.
110-
111-
See the high‑level overview: [Connect to a server](https://docs.zenml.io/how-to/manage-zenml-server/connecting-to-zenml#choose-how-to-connect).
112-
{% endhint %}
113-
114-
## Workspace API Authentication
115-
116-
The **Workspace API** is different from the ZenML Pro API and supports different authentication methods. This is the API you'll use for running snapshots and other pipeline operations.
117-
118-
### When to Use Which API
106+
## When to Use Which API
119107

120108
| Task | Use This API | Authentication Method |
121109
|------|-------------|----------------------|
@@ -124,6 +112,12 @@ The **Workspace API** is different from the ZenML Pro API and supports different
124112
| Running snapshots, pipeline operations | **Workspace API** (your workspace URL) | Service accounts + API keys (recommended for automation) |
125113
| Pipeline development, artifact management | **Workspace API** (your workspace URL) | Temporary API tokens or service accounts |
126114

115+
See the high‑level overview: [Connect to a server](https://docs.zenml.io/how-to/manage-zenml-server/connecting-to-zenml#choose-how-to-connect).
116+
117+
## Workspace API Authentication
118+
119+
The **Workspace API** is different from the ZenML Pro API and supports different authentication methods. This is the API you'll use for running snapshots and other pipeline operations.
120+
127121
### Workspace API Authentication Methods
128122
129123
Programmatic access to the ZenML Pro workspace API is achieved mostly the same way as the ZenML OSS server API. This is because the Workspace API in ZenML Pro is an extension of the OSS API with some additional endpoints. The only exception is that workspace level service accounts and API keys are disabled and organization level service accounts and API keys are used instead (see [Service Accounts](https://docs.zenml.io/pro/core-concepts/service-accounts)).

docs/book/getting-started/zenml-pro/secrets-stores.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ This operation has two main stages:
1717

1818
## AWS Secrets Manager
1919

20-
The authentication used by the AWS secrets store is built on the [ZenML Service Connector](https://docs.zenml.io/stacks/service-connectors/overview) of the same type as the secrets store. This means that you can use any of the [authentication methods supported by the Service Connector](https://docs.zenml.io/stacks/service-connectors/connector-types/aws-service-connector#authentication-methods) to authenticate with the secrets store.
20+
The authentication used by the AWS secrets store is built on the [ZenML Service Connector](https://docs.zenml.io/stacks/service-connectors/auth-management) of the same type as the secrets store. This means that you can use any of the [authentication methods supported by the Service Connector](https://docs.zenml.io/stacks/service-connectors/connector-types/aws-service-connector#authentication-methods) to authenticate with the secrets store.
2121

2222
The recommended authentication method documented here is to use the [implicit authentication method](https://docs.zenml.io/stacks/service-connectors/connector-types/aws-service-connector#implicit-authentication), because this doesn't need any sensitive credentials to be exchanged with the ZenML Pro support team.
2323

@@ -236,4 +236,4 @@ After your workspace is updated, you will see the following changes in the works
236236
}
237237
}
238238
}
239-
```
239+
```

0 commit comments

Comments
 (0)