Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
173 commits
Select commit Hold shift + click to select a range
c2b6eb9
Add pipeline server and pipeline endpoints abstraction, DB schema and…
stefannica Aug 25, 2025
dfca173
Add ZenStore methods and REST API endpoints for pipeline endpoints
stefannica Aug 26, 2025
6153b80
Add DB migration
stefannica Aug 26, 2025
909aee4
Add direct execution engine for ZenML pipeline serving
safoinme Aug 26, 2025
82013ab
Merge branch 'feature/served-pipelines' of https://github.com/zenml-i…
safoinme Aug 26, 2025
d3a4c39
Refactor DirectExecutionEngine to simplify output resolution
safoinme Aug 26, 2025
f9b9afc
Enhance output resolution in DirectExecutionEngine
safoinme Aug 26, 2025
ddcd0c1
Implement docker pipeline server flavor
stefannica Aug 26, 2025
e31efb6
Linter fixes
stefannica Aug 26, 2025
36379f5
First working version
stefannica Aug 26, 2025
2679554
Add chat agent pipeline example for ZenML serving
safoinme Aug 26, 2025
c248b85
Merge branch 'feature/served-pipelines' of https://github.com/zenml-i…
safoinme Aug 26, 2025
b37ab8c
typing and mypy
safoinme Aug 26, 2025
bd048ae
Implement 'zenml pipeline endpoint' CLI commands and logs retrieval
stefannica Aug 26, 2025
03fda77
Merge branch 'feature/served-pipelines' of https://github.com/zenml-i…
safoinme Aug 26, 2025
7426074
Fix remaining linter errors
stefannica Aug 27, 2025
7b44d04
Formalized containerized pipeline server as a base class
stefannica Aug 27, 2025
14fd6b0
Use static port inside container
stefannica Aug 27, 2025
4751d45
Load the code inside the serving container, if necessary
stefannica Aug 27, 2025
871c97c
Remove legacy code from the serving entrypoint
stefannica Aug 27, 2025
25123f2
Merge remote-tracking branch 'origin/develop' into feature/served-pip…
stefannica Aug 27, 2025
6774507
Fix DB migration
stefannica Aug 27, 2025
aa4d398
Rename pipeline server to deployer
stefannica Aug 28, 2025
abeceb4
Add Docker settings for chat and weather pipelines
safoinme Aug 28, 2025
14351f6
Implement deployment-scoped tokens for deployment authentication
stefannica Sep 1, 2025
3c8e797
Merge branch 'feature/served-pipelines' of https://github.com/zenml-i…
safoinme Sep 1, 2025
23cfc3d
Add serving capture policies and step-level annotations
safoinme Aug 30, 2025
8aecb2c
Refactor serving architecture with dependency injection
safoinme Sep 1, 2025
df6830e
Add init and cleanup pipeline hooks
stefannica Sep 1, 2025
b84885c
Merge branch 'feature/served-pipelines' of https://github.com/zenml-i…
safoinme Sep 1, 2025
7293794
Add upgrade functionality to ZenML installation script
safoinme Sep 1, 2025
850e616
Refactor serving module to use deployer architecture
safoinme Sep 1, 2025
b394783
Add serving documentation for capture policies and pipeline serving
safoinme Sep 1, 2025
1780645
Key changes include:
safoinme Sep 2, 2025
f50d450
Implement the GCP Cloud Run Deployer
stefannica Sep 2, 2025
24e0a1a
Add API key authentication and init/cleanup hooks support
stefannica Sep 3, 2025
d8fe2c8
Fixed linter errors
stefannica Sep 3, 2025
2d98b2f
Fix the endpoint authentication
stefannica Sep 3, 2025
b4a58c4
More endpoint authentication fixes
stefannica Sep 3, 2025
8453973
Add utility to call a pipeline endpoint from code
stefannica Sep 4, 2025
3e434fc
Fix linter issues
stefannica Sep 4, 2025
bdb4441
Remove deprecated serving capture policies and related documentation
safoinme Sep 4, 2025
613e300
test-implementation for artifacts handling in memory
safoinme Sep 4, 2025
95cf0dd
Merge branch 'feature/served-pipelines' of https://github.com/zenml-i…
safoinme Sep 4, 2025
9fdd0fe
Remove unused pipeline streaming execution method
safoinme Sep 4, 2025
e406cf6
Add missing files
stefannica Sep 4, 2025
153d487
Refactor serving architecture and remove deprecated components
safoinme Sep 4, 2025
c0046e3
Add return targets mapping in PipelineServingService
safoinme Sep 4, 2025
af9bc47
Implement AWS App Runner Deployer
stefannica Sep 5, 2025
d6a51bb
Merge branch 'feature/served-pipelines' of github.com:zenml-io/zenml …
stefannica Sep 5, 2025
8757956
Reworked the endpoint LCM management to allow "pausing" and "resuming…
stefannica Sep 5, 2025
800601e
Fix some linter errors
stefannica Sep 5, 2025
7bc9dd6
Allow endpoints to be provisioned independent of the active stack
stefannica Sep 5, 2025
c1b7357
Implement generic ResourceSettings support, timeout CLI args and endp…
stefannica Sep 5, 2025
1290e42
Merge branch 'develop' into feature/served-pipelines
safoinme Sep 7, 2025
951188d
Slightly refactor deployer to allow for post-polling cleanup
stefannica Sep 8, 2025
277b7e0
Fix some AWS deployer bugs related to state management
stefannica Sep 8, 2025
5c340c8
Fix AWS deployer bug not cleaning up autoscaling config
stefannica Sep 8, 2025
61c2491
Merge remote-tracking branch 'origin/develop' into feature/served-pip…
stefannica Sep 8, 2025
ee19843
Rebase DB migrations
stefannica Sep 8, 2025
15dd714
Merge branch 'feature/served-pipelines' of https://github.com/zenml-i…
safoinme Sep 8, 2025
331294a
Auto-update of E2E template
actions-user Sep 8, 2025
b69063b
Merge branch 'feature/served-pipelines' of https://github.com/zenml-i…
safoinme Sep 8, 2025
cf2cc68
Enhance runtime parameter handling for serving
safoinme Sep 9, 2025
a110d1b
CLI command renames and other feedback changes
stefannica Sep 10, 2025
c6f8c2b
Remove serving settings and refactor serving service initialization
safoinme Sep 11, 2025
471e700
Refactor serving context and enhance parameter handling
safoinme Sep 11, 2025
e13209c
Add validation for request parameters in serving app
safoinme Sep 11, 2025
10ac9aa
more tests
safoinme Sep 11, 2025
b45398f
Add analytics events, fix linter and docstring errors
stefannica Sep 12, 2025
c43af74
Enhance pipeline parameter handling and response schema generation
safoinme Sep 12, 2025
da19b82
Merge branch 'feature/served-pipelines' of https://github.com/zenml-i…
safoinme Sep 12, 2025
bbe17a0
Merge remote-tracking branch 'origin/develop' into feature/served-pip…
stefannica Sep 12, 2025
3f2afe2
inmemory implementation
safoinme Sep 12, 2025
d915a9f
Implement client-side schema examples and validation for invocations
stefannica Sep 12, 2025
4676016
Refactor in-memory artifact handling and remove legacy components
safoinme Sep 12, 2025
3f6aed6
Merge branch 'feature/served-pipelines' of https://github.com/zenml-i…
safoinme Sep 12, 2025
0476e38
Enhance in-memory artifact handling and response schema generation
safoinme Sep 13, 2025
7c10bb6
Fix type ignore comments for pipeline parameter schemas
safoinme Sep 13, 2025
933909d
mypy
safoinme Sep 14, 2025
30a1d72
Update quickstart with deployable inference pipeline
stefannica Sep 15, 2025
841169b
Merge branch 'feature/served-pipelines' of github.com:zenml-io/zenml …
stefannica Sep 15, 2025
2d6dbc6
Add proper support for init hooks, shared run state and init hook kwargs
stefannica Sep 15, 2025
246ab9b
Merge remote-tracking branch 'origin/develop' into feature/served-pip…
stefannica Sep 15, 2025
d2433a7
Renamed deployment to snapshot in all remaining places
stefannica Sep 15, 2025
9a64c35
add str to runtime
safoinme Sep 15, 2025
8b03493
revert quickstart example
safoinme Sep 15, 2025
89bf7d0
Renamed pipeline endpoint to deployment
stefannica Sep 15, 2025
b05fd74
Fix the snapshot DB migration script
stefannica Sep 15, 2025
722bfeb
Merge branch 'feature/served-pipelines' of github.com:zenml-io/zenml …
stefannica Sep 15, 2025
c51f39e
Last minute deployment renames
stefannica Sep 15, 2025
7bdc463
Fixed some docstrings and made more renaming modifications
stefannica Sep 16, 2025
9cc3012
Fix some unit tests and some bugs revealed by unit test failures
stefannica Sep 16, 2025
7e294d9
docstring
safoinme Sep 16, 2025
38d5170
Merge branch 'feature/served-pipelines' of https://github.com/zenml-i…
safoinme Sep 16, 2025
2e4e502
docstring
safoinme Sep 16, 2025
66cb228
Update src/zenml/deployers/base_deployer.py
stefannica Sep 17, 2025
6f373f7
revert utils
safoinme Sep 17, 2025
c1f3fc0
Code review suggestions
stefannica Sep 17, 2025
9592184
Get rid of jsf library and use best-effort to generate simple examples
stefannica Sep 18, 2025
750abb9
Merge branch 'feature/served-pipelines' of github.com:zenml-io/zenml …
stefannica Sep 18, 2025
13a689f
Cleaned up code and applied minor improvements
stefannica Sep 18, 2025
56cfc58
full cleaning + in memory materializer
safoinme Sep 19, 2025
cafd1bd
misc inmemory
safoinme Sep 19, 2025
7f50873
Merge branch 'feature/served-pipelines' of https://github.com/zenml-i…
safoinme Sep 19, 2025
96730ff
updated tests
safoinme Sep 19, 2025
1c1d51b
Merge branch 'develop' into feature/served-pipelines
safoinme Sep 19, 2025
75b8577
update spec
safoinme Sep 19, 2025
05ce6c2
fix response
safoinme Sep 19, 2025
f2d5373
fix output mapping
safoinme Sep 19, 2025
fae2ef6
mypy
safoinme Sep 19, 2025
cddf44d
Merge branch 'feature/served-pipelines' of github.com:zenml-io/zenml …
stefannica Sep 19, 2025
afc84cb
Applied more code review suggestions
stefannica Sep 19, 2025
c2bde68
Implemented some more code review suggestions and fixed docstrings
stefannica Sep 19, 2025
9df4737
use snapshot request to update parameters
safoinme Sep 19, 2025
b1966f5
Support for parallel requests and better OpenAPI models
stefannica Sep 19, 2025
e57cd55
Merge branch 'feature/served-pipelines' of github.com:zenml-io/zenml …
stefannica Sep 19, 2025
4591b1f
Fix linter errors and remove fastapi override again
stefannica Sep 19, 2025
efbc012
Implement unique output names in the pipeline output
stefannica Sep 19, 2025
045aa19
Fix linter errors
stefannica Sep 19, 2025
9bef95b
Docstring updates
stefannica Sep 22, 2025
be8d103
fix test + remove unused function
safoinme Sep 22, 2025
75ab0de
tests
safoinme Sep 22, 2025
7b3e7c7
test fix
safoinme Sep 22, 2025
03d9358
Add CLI support to use named snapshots to provision deployments
stefannica Sep 22, 2025
a754c26
Merge branch 'feature/served-pipelines' of github.com:zenml-io/zenml …
stefannica Sep 22, 2025
ace894d
Fix init_hook_args occurrence
stefannica Sep 23, 2025
8dbb11b
Merge remote-tracking branch 'origin/develop' into feature/served-pip…
stefannica Sep 23, 2025
4f09054
Update src/zenml/deployers/server/runtime.py
safoinme Sep 23, 2025
f51cb66
Update src/zenml/deployers/server/runtime.py
safoinme Sep 23, 2025
e4bee5a
Refactor parameter model handling and clean up code
safoinme Sep 23, 2025
a6e31a3
Merge branch 'feature/served-pipelines' of https://github.com/zenml-i…
safoinme Sep 23, 2025
a661699
Remove deprecated authentication test for invoke endpoint
safoinme Sep 23, 2025
5cc292f
Update src/zenml/orchestrators/utils.py
safoinme Sep 24, 2025
bf26b24
Applied some code review suggestions
stefannica Sep 24, 2025
fc475ba
Merge branch 'feature/served-pipelines' of github.com:zenml-io/zenml …
stefannica Sep 24, 2025
16855f8
Merge remote-tracking branch 'origin/develop' into feature/served-pip…
stefannica Sep 24, 2025
f30d397
More code review suggestions
stefannica Sep 24, 2025
b41700d
Fixed some linter errors
stefannica Sep 24, 2025
aba28cf
Enhance artifact storage handling for in-memory materializers
safoinme Sep 24, 2025
a1017c0
Merge branch 'feature/served-pipelines' of https://github.com/zenml-i…
safoinme Sep 24, 2025
3f0f05e
More code review suggestions
stefannica Sep 24, 2025
5f879a2
Merge branch 'feature/served-pipelines' of github.com:zenml-io/zenml …
stefannica Sep 24, 2025
72b3c5c
Refactor parameter model construction in deployment service
safoinme Sep 24, 2025
00e212d
Update src/zenml/deployers/server/runtime.py
safoinme Sep 24, 2025
6e8ccc5
Code review suggestions
stefannica Sep 24, 2025
911e14f
Merge branch 'feature/served-pipelines' of github.com:zenml-io/zenml …
stefannica Sep 24, 2025
416e8ff
Fixed all unit tests
stefannica Sep 24, 2025
abb359b
Remove TODOs
stefannica Sep 24, 2025
952eab3
Allow filtering snapshot by deployable
schustmi Sep 25, 2025
b5c821e
Allow filtering deployment by pipeline
schustmi Sep 25, 2025
5a35f29
Add deployment to snapshot response
schustmi Sep 25, 2025
3058093
Allow filtering snapshot by deployed
schustmi Sep 25, 2025
00eecc1
Fix deployer post-deletion checks
stefannica Sep 25, 2025
dc4f1b9
Enable tagging for deployments
schustmi Sep 25, 2025
3377dbd
Install local extra for local deployments connected to DB directly
schustmi Sep 25, 2025
95182d0
Add pipeline to deployment model resources
stefannica Sep 25, 2025
1cd5f9d
Merge branch 'feature/served-pipelines' of github.com:zenml-io/zenml …
stefannica Sep 25, 2025
e74e8af
Fix formatting
stefannica Sep 25, 2025
67cba90
review
safoinme Sep 25, 2025
a5efb43
Merge branch 'feature/served-pipelines' of https://github.com/zenml-i…
safoinme Sep 25, 2025
c12bc74
Add check to prevent users to deploy the same snapshot multiple times
stefannica Sep 25, 2025
06d6732
Merge branch 'feature/served-pipelines' of github.com:zenml-io/zenml …
stefannica Sep 25, 2025
032dced
Merge branch 'develop' into feature/served-pipelines
schustmi Sep 25, 2025
eccde5a
Reworked the init/cleanup hooks and the run context
stefannica Sep 25, 2025
38596be
Fix some failing unit tests
stefannica Sep 25, 2025
ec41296
Merge remote-tracking branch 'origin/develop' into feature/served-pip…
stefannica Sep 26, 2025
11da60b
Reworked hook validation to elliminate duplicated code
stefannica Sep 26, 2025
dd3bd5c
Fix unit tests
stefannica Sep 26, 2025
0778e8f
Fix hook validators to allow for failure hook without any args
stefannica Sep 26, 2025
839f528
Fix docstrings and unit tests
stefannica Sep 26, 2025
b35c9ee
Remove incomplete docs
stefannica Sep 26, 2025
5d2184d
Fix remaining security test and unit test failures
stefannica Sep 26, 2025
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
32 changes: 24 additions & 8 deletions docs/book/getting-started/core-concepts.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ As seen in the image, a step might use the outputs from a previous step and thus

Pipelines and steps are defined in code using Python _decorators_ or _classes_. This is where the core business logic and value of your work live, and you will spend most of your time defining these two things.

Even though pipelines are simple Python functions, you are only allowed to call steps within this function. The inputs for steps called within a pipeline can either be the outputs of previous steps or alternatively, you can pass in values directly (as long as they're JSON-serializable).
Even though pipelines are simple Python functions, you are only allowed to call steps within this function. The inputs for steps called within a pipeline can either be the outputs of previous steps or alternatively, you can pass in values directly or map them onto pipeline parameters (as long as they're JSON-serializable). Similarly, you can return values from a pipeline that are step outputs as long as they are JSON-serializable.

```python
from zenml import pipeline
Expand All @@ -71,19 +71,19 @@ def my_pipeline():
step_2(input_one="hello", input_two=output_step_one)

@pipeline
def agent_evaluation_pipeline():
def agent_evaluation_pipeline(query: str = "What is machine learning?") -> str:
"""An AI agent evaluation pipeline."""
prompt = "You are a helpful assistant. Please answer: {query}"
test_query = "What is machine learning?"
evaluation_result = evaluate_agent_response(prompt, test_query)
evaluation_result = evaluate_agent_response(prompt, query)
return evaluation_result
```

Executing the Pipeline is as easy as calling the function that you decorated with the `@pipeline` decorator.

```python
if __name__ == "__main__":
my_pipeline()
agent_evaluation_pipeline()
agent_evaluation_pipeline(query="What is an LLM?")
```

#### Artifacts
Expand Down Expand Up @@ -118,9 +118,11 @@ Once you have implemented your workflow by using the concepts described above, y

#### Stacks & Components

When you want to execute a pipeline run with ZenML, **Stacks** come into play. A **Stack** is a collection of **stack components**, where each component represents the respective configuration regarding a particular function in your MLOps pipeline, such as orchestration systems, artifact repositories, and model deployment platforms.
When you want to execute a pipeline run with ZenML, **Stacks** come into play. A **Stack** is a collection of **stack components**, where each component represents the respective configuration regarding a particular function in your MLOps pipeline, such as pipeline orchestration or deployment systems, artifact repositories and container registries.

For instance, if you take a close look at the default local stack of ZenML, you will see two components that are **required** in every stack in ZenML, namely an _orchestrator_ and an _artifact store_.
Pipelines can be executed in two ways: in **batch mode** (traditional execution through an orchestrator) or in **online mode** (long-running HTTP servers that can be invoked via REST API calls). Deploying pipelines for online mode execution allows you to serve your ML workflows as real-time endpoints, making them accessible for live inference and interactive use cases.

For instance, if you take a close look at the default local stack of ZenML, you will see two components that are **required** in every stack in ZenML, namely an _orchestrator_ and an _artifact store_. Additional components like _deployers_ can be added to enable specific functionality such as deploying pipelines as HTTP endpoints.

![ZenML running code on the Local Stack.](../.gitbook/assets/02_pipeline_local_stack.png)

Expand All @@ -130,16 +132,30 @@ Keep in mind that each one of these components is built on top of base abstracti

#### Orchestrator

An **Orchestrator** is a workhorse that coordinates all the steps to run in a pipeline. Since pipelines can be set up with complex combinations of steps with various asynchronous dependencies between them, the orchestrator acts as the component that decides what steps to run and when to run them.
An **Orchestrator** is a workhorse that coordinates all the steps to run in a pipeline in batch mode. Since pipelines can be set up with complex combinations of steps with various asynchronous dependencies between them, the orchestrator acts as the component that decides what steps to run and when to run them.

ZenML comes with a default _local orchestrator_ designed to run on your local machine. This is useful, especially during the exploration phase of your project. You don't have to rent a cloud instance just to try out basic things.

#### Deployer

A **Deployer** is a stack component that manages the deployment of pipelines as long-running HTTP servers useful for online mode execution. Unlike orchestrators that execute pipelines in batch mode, deployers can create and manage persistent services that wrap your pipeline in a web application, usually containerized, allowing it to be invoked through HTTP requests.

ZenML comes with a _Docker deployer_ that can run deployments on your local machine as Docker containers, making it easy to test and develop real-time pipeline endpoints before moving to production infrastructure.

#### Pipeline Run

A **Pipeline Run** is a record of a pipeline execution. When you run a pipeline using an orchestrator, a pipeline run is created tracking information about the execution such as the status, the artifacts and metadata produced by the pipeline and all its steps. When a pipeline is deployed for online mode execution, a pipeline run is similarly created for every HTTP request made to it.

#### Artifact Store

An **Artifact Store** is a component that houses all data that passes through the pipeline as inputs and outputs. Each artifact that gets stored in the artifact store is tracked and versioned and this allows for extremely useful features like data caching, which speeds up your workflows.

Similar to the orchestrator, ZenML comes with a default _local artifact store_ designed to run on your local machine. This is useful, especially during the exploration phase of your project. You don't have to set up a cloud storage system to try out basic things.

#### Deployment

A **Deployment** is a running instance of a pipeline deployed as an HTTP endpoint. When you deploy a pipeline using a deployer, it becomes a long-running service that can be invoked through REST API calls. Each HTTP request to a deployment triggers a new pipeline run, creating the same artifacts and metadata tracking as traditional batch pipeline executions. This enables real-time inference, interactive ML workflows, and seamless integration with web applications and external services.

#### Flavor

ZenML provides a dedicated base abstraction for each stack component type. These abstractions are used to develop solutions, called **Flavors**, tailored to specific use cases/tools. With ZenML installed, you get access to a variety of built-in and integrated Flavors for each component type, but users can also leverage the base abstractions to create their own custom flavors.
Expand Down
9 changes: 7 additions & 2 deletions docs/book/how-to/steps-pipelines/advanced_features.md
Original file line number Diff line number Diff line change
Expand Up @@ -628,8 +628,8 @@ This is particularly useful for steps that interact with external services or re
Hooks allow you to execute custom code at specific points in the pipeline or step lifecycle:

```python
def success_hook(step_name, step_output):
print(f"Step {step_name} completed successfully with output: {step_output}")
def success_hook():
print(f"Step completed successfully")

def failure_hook(exception: BaseException):
print(f"Step failed with error: {str(exception)}")
Expand All @@ -639,6 +639,11 @@ def my_step():
return 42
```

The following conventions apply to hooks:

* the success hook takes no arguments
* the failure hook optionally takes a single `BaseException` typed argument

You can also define hooks at the pipeline level to apply to all steps:

```python
Expand Down
1 change: 1 addition & 0 deletions docs/book/toc.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@
* [Templates](how-to/templates/templates.md)
* [Dashboard](how-to/dashboard/dashboard-features.md)


## Reference

* [Community & content](reference/community-and-content.md)
Expand Down
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ dependencies = [
"distro>=1.6.0,<2.0.0",
"docker~=7.1.0",
"gitpython>=3.1.18,<4.0.0",
"jsonref",
"packaging>=24.1",
"psutil>=5.0.0",
"pydantic>=2.0,<=2.11.9",
Expand Down Expand Up @@ -368,5 +369,6 @@ module = [
"numba.*",
"uvloop.*",
"litellm",
"jsonref",
]
ignore_missing_imports = true
116 changes: 106 additions & 10 deletions scripts/install-zenml-dev.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,40 @@

INTEGRATIONS=no
PIP_ARGS=
UPGRADE_ALL=no

show_help() {
cat << EOF
Usage: $0 [OPTIONS]

Install ZenML in development mode with optional integrations.

OPTIONS:
-i, --integrations yes|no Install integrations (default: no)
-s, --system Install packages system-wide instead of in virtual environment
-u, --upgrade-all Uninstall existing ZenML, clear caches, and install latest versions
-h, --help Show this help message

EXAMPLES:
# Basic installation
$0

# Install with integrations
$0 --integrations yes

# Force reinstall with latest versions of all dependencies
$0 --upgrade-all --integrations yes

# System-wide installation with latest versions
$0 --system --upgrade-all

NOTES:
- The --upgrade-all flag will uninstall existing ZenML installation and clear all caches
- This ensures you get the latest compatible versions of all dependencies
- Use this when you want to refresh your environment with the newest packages

EOF
}

parse_args () {
while [ $# -gt 0 ]; do
Expand All @@ -15,8 +49,17 @@ parse_args () {
PIP_ARGS="--system"
shift # past argument
;;
-u|--upgrade-all)
UPGRADE_ALL="yes"
shift # past argument
;;
-h|--help)
show_help
exit 0
;;
-*|--*)
echo "Unknown option $1"
show_help
exit 1
;;
*)
Expand All @@ -26,12 +69,39 @@ parse_args () {
done
}

clean_and_uninstall() {
echo "🧹 Cleaning existing ZenML installation and clearing caches..."

# Uninstall ZenML (if installed) and clear pip cache
uv pip uninstall $PIP_ARGS zenml || true

# Clear uv cache to ensure fresh downloads
uv cache clean || true

# Clear pip cache as well (in case pip was used previously)
python -m pip cache purge 2>/dev/null || true

echo "✅ Cleanup completed"
}

install_zenml() {
echo "📦 Installing ZenML in editable mode..."

# Build upgrade arguments based on UPGRADE_ALL flag
upgrade_args=""
if [ "$UPGRADE_ALL" = "yes" ]; then
upgrade_args="--upgrade --force-reinstall"
echo "🔄 Using --upgrade --force-reinstall to get latest versions"
fi

# install ZenML in editable mode
uv pip install $PIP_ARGS -e ".[server,templates,terraform,secrets-aws,secrets-gcp,secrets-azure,secrets-hashicorp,s3fs,gcsfs,adlfs,dev,connectors-aws,connectors-gcp,connectors-azure,azureml,sagemaker,vertex]"
uv pip install $PIP_ARGS $upgrade_args -e ".[server,templates,terraform,secrets-aws,secrets-gcp,secrets-azure,secrets-hashicorp,s3fs,gcsfs,adlfs,dev,connectors-aws,connectors-gcp,connectors-azure,azureml,sagemaker,vertex]"

echo "✅ ZenML installation completed"
}

install_integrations() {
echo "🔌 Installing ZenML integrations..."

# figure out the python version
python_version=$(python -c "import sys; print('.'.join(map(str, sys.version_info[:2])))")
Expand All @@ -54,18 +124,37 @@ install_integrations() {
--output-file integration-requirements.txt \
$ignore_integrations_args

# pin pyyaml>=6.0.1
echo "" >> integration-requirements.txt
echo "pyyaml>=6.0.1" >> integration-requirements.txt
echo "pyopenssl" >> integration-requirements.txt
echo "typing-extensions" >> integration-requirements.txt
# Handle package pins based on upgrade mode
if [ "$UPGRADE_ALL" = "yes" ]; then
echo "🔄 Using latest versions for integration dependencies"
# When upgrading, use minimum versions to allow latest compatible
echo "" >> integration-requirements.txt
echo "pyyaml>=6.0.1" >> integration-requirements.txt
echo "pyopenssl" >> integration-requirements.txt
echo "typing-extensions" >> integration-requirements.txt
echo "maison<2" >> integration-requirements.txt
else
# Original behavior with specific pins
echo "" >> integration-requirements.txt
echo "pyyaml>=6.0.1" >> integration-requirements.txt
echo "pyopenssl" >> integration-requirements.txt
echo "typing-extensions" >> integration-requirements.txt
echo "maison<2" >> integration-requirements.txt
fi

echo "-e .[server,templates,terraform,secrets-aws,secrets-gcp,secrets-azure,secrets-hashicorp,s3fs,gcsfs,adlfs,dev,connectors-aws,connectors-gcp,connectors-azure,azureml,sagemaker,vertex]" >> integration-requirements.txt

# workaround to make yamlfix work
echo "maison<2" >> integration-requirements.txt
# Build upgrade arguments based on UPGRADE_ALL flag
upgrade_args=""
if [ "$UPGRADE_ALL" = "yes" ]; then
upgrade_args="--upgrade --force-reinstall"
echo "🔄 Using --upgrade --force-reinstall for integration dependencies"
fi

uv pip install $PIP_ARGS -r integration-requirements.txt
uv pip install $PIP_ARGS $upgrade_args -r integration-requirements.txt
rm integration-requirements.txt

echo "✅ Integration installation completed"

# https://github.com/Kludex/python-multipart/pull/166
# There is an install conflict between multipart and python_multipart
Expand All @@ -83,7 +172,14 @@ export ZENML_ANALYTICS_OPT_IN=false

parse_args "$@"

python -m pip install --upgrade wheel pip uv
# Clean and upgrade tooling packages if upgrading all
if [ "$UPGRADE_ALL" = "yes" ]; then
echo "🚀 Upgrading all dependencies to latest versions..."
clean_and_uninstall
python -m pip install --upgrade --force-reinstall wheel pip uv
else
python -m pip install --upgrade wheel pip uv
fi

install_zenml

Expand Down
6 changes: 6 additions & 0 deletions src/zenml/analytics/enums.py
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,9 @@ class AnalyticsEvent(str, Enum):

# Server Settings
SERVER_SETTINGS_UPDATED = "Server Settings Updated"

# Deployment
DEPLOY_PIPELINE = "Pipeline deployed"
CREATE_DEPLOYMENT = "Deployment created"
STOP_DEPLOYMENT = "Deployment stopped"
DELETE_DEPLOYMENT = "Deployment deleted"
9 changes: 9 additions & 0 deletions src/zenml/artifact_stores/base_artifact_store.py
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ def _validate_path(self, path: str) -> None:
IllegalOperationError: If the path is a local file and the server
is not configured to allow local file access.
"""
# Skip validation for memory:// URIs used in serving mode
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems like we removed generating these in-memory output artifact URIs? If that's the case, I assume we also don't need the logic in this file?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

now it's back with the idea of having a uri that users wouldn't search for in artifact store

if path.startswith("memory://"):
return

if not self.allow_local_file_access and not io_utils.is_remote(path):
raise IllegalOperationError(
"Files in a local artifact store cannot be accessed from the "
Expand Down Expand Up @@ -139,6 +143,11 @@ def _sanitize_potential_path(self, potential_path: Any) -> Any:
# Neither string nor bytes, this is not a path
return potential_path

# Preserve special in-memory scheme used by serving mode as-is
# to avoid treating it as a local filesystem path.
if isinstance(path, str) and path.startswith("memory://"):
return path

if io_utils.is_remote(path):
# If we have a remote path, replace windows path separators with
# slashes
Expand Down
18 changes: 16 additions & 2 deletions src/zenml/artifacts/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,21 @@ def _store_artifact_data_and_prepare_request(
Artifact version request for the artifact data that was stored.
"""
artifact_store = Client().active_stack.artifact_store
artifact_store.makedirs(uri)

# Detect in-memory materializer to avoid touching the artifact store.
# Local import to minimize import-time dependencies.
from zenml.materializers.in_memory_materializer import (
InMemoryMaterializer,
)

is_in_memory = issubclass(materializer_class, InMemoryMaterializer)

if not is_in_memory:
artifact_store.makedirs(uri)
else:
# Ensure URI clearly indicates in-memory storage and not the artifact store
if not uri.startswith("memory://"):
uri = f"memory://custom_artifacts/{name}/{uuid4()}"

materializer = materializer_class(uri=uri, artifact_store=artifact_store)
materializer.uri = materializer.uri.replace("\\", "/")
Expand Down Expand Up @@ -190,7 +204,7 @@ def _store_artifact_data_and_prepare_request(
data_type=source_utils.resolve(data_type),
content_hash=content_hash,
project=Client().active_project.id,
artifact_store_id=artifact_store.id,
artifact_store_id=None if is_in_memory else artifact_store.id,
visualizations=visualizations,
has_custom_name=has_custom_name,
save_type=save_type,
Expand Down
1 change: 1 addition & 0 deletions src/zenml/cli/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2506,6 +2506,7 @@ def my_pipeline(...):
from zenml.cli.base import * # noqa
from zenml.cli.code_repository import * # noqa
from zenml.cli.config import * # noqa
from zenml.cli.deployment import * # noqa
from zenml.cli.downgrade import * # noqa
from zenml.cli.feature import * # noqa
from zenml.cli.integration import * # noqa
Expand Down
Loading
Loading