ZenML release 0.40.0 introduces two big updates: a fresh and more flexible pipeline interface and a new way to connect and authenticate with external services in ZenML Connectors. See below for full details on these two major new sets of functionality.
The release also contains many bug fixes and quality-of-life improvements. Specifically, we reworked our documentation from the ground up with particular attention to the structure to help you find what you need. Our [Label Studio integration example](https://github.com/zenml-io/zenml/tree/main/examples/label_studio_annotation) is now working again and allows you to use more recent versions of the `label-studio` package that backs it.
A Fresh Pipeline Interface
This release introduces a completely reworked interface for developing your ZenML steps and pipelines:
No More BaseParameters Class
In the previous version, you had to define a separate class for step parameters using `BaseParameters`. This is no longer necessary, although it is still supported for backward compatibility. You can now pass parameters directly in the step function:
python
step
def trainer(data: pd.Dataframe, lr: float = 0.1, gamma: Optional[float] = 0.02) -> ...:
print(lr)
print(gamma)
Simplified Pipeline Execution
With the new changes, you no longer need to create a pipeline instance and then run it separately. You can now pass parameters directly at pipeline instance creation and execute the pipeline in a single step:
python
my_pipeline(lr=0.000001)
Multiple step invocations
You can now call steps multiple times inside a pipeline, allowing you to create more complex workflows and reuse steps with different parameters:
python
pipeline
def my_pipeline(step_count: int) -> None:
data = load_data_step()
after = []
for i in range(step_count):
train_step(data, learning_rate=i * 0.0001, id=f"train_step_{i}")
after.append(f"train_step_{i}")
model = select_model_step(..., after=after)
Pipeline inputs and outputs
Pipelines can now define inputs and outputs, providing a clearer interface for working with data and dependencies between pipelines:
python
pipeline(enable_cache=False)
def subpipeline(pipeline_param: int):
out = step_1(k=None)
step_2(a=3, b=pipeline_param)
return 17
Call pipelines from within pipelines (alpha)
You can now call pipelines within other pipelines. This currently does not execute the inner pipeline but instead adds its steps to the parent pipeline, allowing you to create modular and reusable workflows:
python
pipeline(enable_cache=False)
def my_pipeline(a: int = 1):
p1_output = subpipeline(pipeline_param=22)
step_2(a=a, b=p1_output)
Flexible types on steps
Increased flexibility when defining steps: Steps can now have `Optional`, `Union`, and `Any` type annotations for their inputs and outputs. Additionally, default values are allowed for step inputs.
python
step
def trainer(data: pd.Dataframe, start_model: Union[svm.SVC, svm.SVR], coef0: Optional[int] = None) -> Any:
pass
Easy to debug steps
You can now easily run a step outside of a pipeline, making it easier to test and debug your code:
python
trainer(data=pd.Dataframe(...), start_model=svc.SVC(...))
External Artifacts
External artifacts can be used to pass values to steps that are not produced by an upstream step. This provides more flexibility when working with external data or models:
python
from zenml.steps import ExternalArtifact
pipeline
def my_pipeline(lr: float):
data = process_data()
trainer(data=data, start_model=ExternalArtifact(svc.SVC(...)))
Get Started with the new interface and features!
To get started, simply import the new `step` and `pipeline` decorator and check out our new [starter guide](https://docs.zenml.io/user-guide/starter-guide) for more information.
python
from zenml import step, pipeline
step
def my_step(...):
...
pipeline
def my_pipeline(...):
...
The old pipeline and step interface is still working using the imports from previous ZenML releases but is deprecated and will be removed in the future.
'Connectors' for authentication
In this update, we're pleased to present a new feature to ZenML: Service Connectors. The intention behind these connectors is to offer a reliable and more user-friendly method for integrating ZenML with external resources and services. We aim to simplify processes such as validating, storing, and generating security-sensitive data, along with the authentication and authorization of access to external services. We believe ZenML Service Connectors will be a useful tool to alleviate some of the common challenges in managing pipeline across various Stack Components.
Regardless of your background in infrastructure management - whether you're a beginner looking for quick cloud stack integration, or an experienced engineer focused on maintaining robust infrastructure security practices - our Service Connectors are designed to assist your work while maintaining high security standards.
Here are just a few ways you could use ZenML Service Connectors:
- Easy utilization of cloud resources: With ZenML's Service Connectors, you can use resources from AWS, GCP, and Azure without the need for extensive knowledge of cloud infrastructure or environment configuration. All you'll need is a ZenML Service Connector and a few Python libraries.
- Assisted setup with security in mind: Our Service Connectors come with features for configuration validation and verification, the generation of temporary, low-privilege credentials, and pre-authenticated and pre-configured clients for Python libraries.
- Easy local configuration transfer: ZenML's Service Connectors aim to resolve the reproducibility issue in ML pipelines. They do this by automatically transferring authentication configurations and credentials from your local machine, storing them securely, and allowing for effortless sharing across different environments.
[Visit our documentation pages](https://docs.zenml.io/platform-guide/set-up-your-mlops-platform/connect-to-your-cloud-provider) to learn more about ZenML Connectors and how you can use them in a way that supports your ML workflows.
What's Changed
* Cleanup remaining references of `zenml.artifacts` by fa9r in https://github.com/zenml-io/zenml/pull/1534
* Upgrading the `black` version by bcdurak in https://github.com/zenml-io/zenml/pull/1535
* Remove dev breakpoints by strickvl in https://github.com/zenml-io/zenml/pull/1540
* Removing old option command from contribution doc by bhatt-priyadutt in https://github.com/zenml-io/zenml/pull/1544
* Improve CLI help text for `zenml integration install -i ...` by strickvl in https://github.com/zenml-io/zenml/pull/1545
* Fix RestZenStore error handling for list responses by fa9r in https://github.com/zenml-io/zenml/pull/1539
* Simplify Dashboard UX via `zenml.show()` by fa9r in https://github.com/zenml-io/zenml/pull/1511
* Removed hardcoded variable by bhatt-priyadutt in https://github.com/zenml-io/zenml/pull/1543
* Revert Quickstart Changes by fa9r in https://github.com/zenml-io/zenml/pull/1546
* Deprecate some long overdue functions by AlexejPenner in https://github.com/zenml-io/zenml/pull/1541
* ZenML Connectors by stefannica in https://github.com/zenml-io/zenml/pull/1514
* Fix automatic dashboard opening after `zenml up` by fa9r in https://github.com/zenml-io/zenml/pull/1551
* Update Neptune README by strickvl in https://github.com/zenml-io/zenml/pull/1554
* Update example READMEs following deployment PR by strickvl in https://github.com/zenml-io/zenml/pull/1555
* Fix and update Label Studio example by strickvl in https://github.com/zenml-io/zenml/pull/1542
* Fix linter errors by stefannica in https://github.com/zenml-io/zenml/pull/1557
* Add Vertex as orchestrator and step operator to deploy CLI by wjayesh in https://github.com/zenml-io/zenml/pull/1559
* Fix dashboard secret references by stefannica in https://github.com/zenml-io/zenml/pull/1561
* New pipeline and step interface by schustmi in https://github.com/zenml-io/zenml/pull/1466
* Major Documentation Rehaul by AlexejPenner in https://github.com/zenml-io/zenml/pull/1562
* Easy CSV Visualization by fa9r in https://github.com/zenml-io/zenml/pull/1556
New Contributors
* bhatt-priyadutt made their first contribution in https://github.com/zenml-io/zenml/pull/1544
**Full Changelog**: https://github.com/zenml-io/zenml/compare/0.39.1...0.40