Skip to content

Run template rework #3856

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

Open
wants to merge 51 commits into
base: develop
Choose a base branch
from
Open

Conversation

schustmi
Copy link
Contributor

@schustmi schustmi commented Jul 22, 2025

Describe changes

This PR prepares the removal of run templates, and instead exposes PipelineDeployments as a user-facing concept as a replacement.

Run templates are already a very thin wrapper (name, description, tags) around the underlying pipeline deployment. Instead of having this wrapper entity, this PR exposes the deployment itself as something that can be triggered from the server and viewed in the dashboard. To achieve feature parity with run templates, these deployments can now have version names and tags. One difference to run templates is that these deployments will require a unique version name per pipeline, instead of the globally unique name that run templates require.

TODO:

  • Docs
  • Update ZENML_SERVER_MAX_CONCURRENT_TEMPLATE_RUNS env variable to ZENML_SERVER_MAX_CONCURRENT_DEPLOYMENT_RUNS

Implementation decisions:

  • Unlisted pipeline runs do not exist anymore. Every pipeline run is now associated with a pipeline, and deleting the pipeline also deletes all its runs.
  • Creating versioned deployments (which means giving them a version name) will only be possible if this deployment can actually be triggered. This means when running with a Pro server, and only for containerized remote stacks without custom components.
  • When creating a versioned deployment, the user can provide a custom version name. If no name is provided, the deployment ID will be used as a version name instead. Both the version as well as the unique UUID of the deployment can be used to trigger it.

Frontend changes:

  • (Required): Require confirmation when deleting a pipeline, and also mention that this will now delete all runs and deployments associated with the pipeline.
  • (Required): Fix the DAG. The response may now contain nodes of type triggered_run, which cause the current implementation to fail. We should instead display them and link to the triggered pipeline run.
  • (Optional): Switch to displaying pipeline deployments and not run templates. This is not required immediately as this PR is implemented in a backwards compatible way, but ideally would happen in the same release still.

Pre-requisites

Please ensure you have done the following:

  • I have read the CONTRIBUTING.md document.
  • I have added tests to cover my changes.
  • I have based my new branch on develop and the open PR is targeting develop. If your branch wasn't based on develop read Contribution guide on rebasing branch to develop.
  • IMPORTANT: I made sure that my changes are reflected properly in the following resources:
    • ZenML Docs
    • Dashboard: Needs to be communicated to the frontend team.
    • Templates: Might need adjustments (that are not reflected in the template tests) in case of non-breaking changes and deprecations.
    • Projects: Depending on the version dependencies, different projects might get affected.

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Other (add details above)

Copy link
Contributor

coderabbitai bot commented Jul 22, 2025

Important

Review skipped

Auto reviews are disabled on this repository.

Please check the settings in the CodeRabbit UI or the .coderabbit.yaml file in this repository. To trigger a single review, invoke the @coderabbitai review command.

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

✨ Finishing Touches
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/run-template-improvements

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@github-actions github-actions bot added internal To filter out internal PRs and issues enhancement New feature or request labels Jul 22, 2025
@schustmi schustmi requested a review from AlexejPenner July 24, 2025 15:38
Copy link
Contributor

@AlexejPenner AlexejPenner left a comment

Choose a reason for hiding this comment

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

reviewed 28/38 files so far - my comments at this point:

"""The `runnable` property.

Returns:
the value of the property.
Copy link
Contributor

Choose a reason for hiding this comment

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

I feel we could elaborate more here, if I know nothing and try to inspect what it means to be runnable, I would love to actually be told somewhere.

Copy link
Contributor

Choose a reason for hiding this comment

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

HAHA just resolved it uncommented, sneaky - I still think this docstring is useless, just added to pass linting - what does it mean to be runnable? If I am in my IDE and i do pipeline_deploymnet.runnable - i would love to be told what it means to be runnable

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes this is just for linting, same as the 1000 other model properties where we do the same thing. This is better than having to manage the same explanation twice, and that can be found in the pedantic model field that this property references.

@schustmi schustmi changed the title Run template improvements Run template rework Aug 1, 2025
@schustmi schustmi requested a review from AlexejPenner August 6, 2025 15:35
@schustmi schustmi marked this pull request as ready for review August 6, 2025 15:35
Copy link
Contributor

github-actions bot commented Aug 6, 2025

ZenML CLI Performance Comparison (Threshold: 1.0s, Timeout: 60s, Slow: 5s)

❌ Failed Commands on Current Branch (feature/run-template-improvements)

  • zenml stack list: Command failed on run 2 (exit code: 1)
  • zenml pipeline list: Command failed on run 1 (exit code: 1)
  • zenml model list: Command failed on run 1 (exit code: 1)

🚨 New Failures Introduced

The following commands fail on your branch but worked on the target branch:

  • zenml stack list
  • zenml pipeline list
  • zenml model list

Performance Comparison

Command develop Time (s) feature/run-template-improvements Time (s) Difference Status
zenml --help 1.618851 ± 0.032619 1.579665 ± 0.041316 -0.039s ✓ No significant change
zenml model list Not tested Failed N/A ❌ Broken in current branch
zenml pipeline list Not tested Failed N/A ❌ Broken in current branch
zenml stack --help 1.570175 ± 0.042849 1.561532 ± 0.010296 -0.009s ✓ No significant change
zenml stack list Not tested Failed N/A ❌ Broken in current branch

Summary

  • Total commands analyzed: 5
  • Commands compared for timing: 2
  • Commands improved: 0 (0.0% of compared)
  • Commands degraded: 0 (0.0% of compared)
  • Commands unchanged: 2 (100.0% of compared)
  • Failed commands: 3 (NEW FAILURES INTRODUCED)
  • Timed out commands: 0
  • Slow commands: 0

Environment Info

  • Target branch: Linux 6.11.0-1018-azure
  • Current branch: Linux 6.11.0-1018-azure
  • Test timestamp: 2025-08-06T15:39:21Z
  • Timeout: 60 seconds
  • Slow threshold: 5 seconds

Copy link
Contributor

@AlexejPenner AlexejPenner left a comment

Choose a reason for hiding this comment

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

Reviewed everything besides client.py and sql_zen_store - will return for those

"""The `runnable` property.

Returns:
the value of the property.
Copy link
Contributor

Choose a reason for hiding this comment

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

HAHA just resolved it uncommented, sneaky - I still think this docstring is useless, just added to pass linting - what does it mean to be runnable? If I am in my IDE and i do pipeline_deploymnet.runnable - i would love to be told what it means to be runnable

@@ -223,6 +240,7 @@ def get_deployment(
get_method=zen_store().get_deployment,
hydrate=hydrate,
step_configuration_filter=step_configuration_filter,
include_config_schema=include_config_schema,
Copy link
Contributor

Choose a reason for hiding this comment

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

is this for simplifying the frontend?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Not so much about simplifying, but including this schema is quite expensive and not necessary anywhere unless trying to run the deployment. The deployment itself gets fetched in quite a few places, which is why I added this.

Comment on lines +67 to +70
raise ValueError(
"Unable to create deployment versions as a component of the "
"associated stack has a custom flavor."
)
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any plan to deal with this in the future, even with a workaround?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Workaround - not possible I think.
Idea how to solve it exists, but I don't think the implementation will happen anytime soon

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request internal To filter out internal PRs and issues
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants