Skip to content
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

Dynamic (templated) names for model versions #2909

Merged
merged 35 commits into from
Aug 27, 2024

Conversation

avishniakov
Copy link
Contributor

@avishniakov avishniakov commented Aug 6, 2024

Describe changes

This PR gives the ability to name Model Versions using {date} and {time} placeholders to use for automated runs with meaningful naming or for scheduling purposes.
Model(version="my_model_version_{date}_{time}",...) will be translated into a meaningful name upon pipeline execution.

This PR also has some minor improvements/refactors to ensure that the Model Version is created at a proper time and uses the time of the run as a filler.

Results of testing in Pro:

  • Display of ModelVersions associated with Runs is partially working: visible in Pipeline Run, not visible in the Step Run. My best guess: is that the code is relying on the config states, which are not the valid source of truth in the templated world anymore, so we would need a change here. Data is available in the respective resources of the Run Responses.
  • Scheduling with templated names works as expected.
  • Side bug: none of my AWS resources were connected to a connector after creating via UI, something to look into separately.

Pre-requisites

Please ensure you have done the following:

  • I have read the CONTRIBUTING.md document.
  • If my change requires a change to docs, I have updated the documentation accordingly.
  • 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.
  • If my changes require changes to the dashboard, these changes are communicated/requested.

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 Aug 6, 2024

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.


Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media?

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>.
    • Generate unit testing code for this file.
    • 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 generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • 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 generate interesting stats about this repository and render them as a table.
    • @coderabbitai show all the console.log statements in this repository.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (invoked as 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 resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Additionally, you can add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.

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 Aug 6, 2024
@avishniakov avishniakov changed the title Feature/prd 539 dynamic names for model versions Dynamic (templated) names for model versions Aug 6, 2024
@avishniakov
Copy link
Contributor Author

@coderabbitai review

Copy link
Contributor

coderabbitai bot commented Aug 6, 2024

Actions performed

Review triggered.

Note: CodeRabbit is an incremental review system and does not re-review already reviewed commits. This command is applicable only when automatic reviews are paused.

@avishniakov avishniakov marked this pull request as ready for review August 6, 2024 14:29
@avishniakov avishniakov marked this pull request as draft August 6, 2024 14:30
@avishniakov avishniakov changed the title Dynamic (templated) names for model versions [WIP] Dynamic (templated) names for model versions Aug 8, 2024
@avishniakov avishniakov marked this pull request as ready for review August 8, 2024 12:58
@avishniakov avishniakov requested review from schustmi and bcdurak and removed request for schustmi August 9, 2024 09:19
Copy link
Contributor

@schustmi schustmi left a comment

Choose a reason for hiding this comment

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

I tried to review this but I feel I lack the understanding how the whole model linkage to pipeline/step runs is supposed to work. @avishniakov can you maybe explain that before I continue?

  • I can configure a pipeline/step to be associated with a certain model by putting it in the decorator/config file
  • These will be linked to my pipeline run/step run
  • Are there other ways that we link models and pipeline/step runs?

src/zenml/orchestrators/base_orchestrator.py Outdated Show resolved Hide resolved
src/zenml/models/v2/core/model_version.py Outdated Show resolved Hide resolved
src/zenml/orchestrators/step_launcher.py Outdated Show resolved Hide resolved
src/zenml/models/v2/core/pipeline_run.py Outdated Show resolved Hide resolved
src/zenml/new/pipelines/pipeline.py Outdated Show resolved Hide resolved
src/zenml/new/steps/step_context.py Outdated Show resolved Hide resolved
@avishniakov
Copy link
Contributor Author

I tried to review this but I feel I lack the understanding how the whole model linkage to pipeline/step runs is supposed to work. @avishniakov can you maybe explain that before I continue?

  • I can configure a pipeline/step to be associated with a certain model by putting it in the decorator/config file
  • These will be linked to my pipeline run/step run
  • Are there other ways that we link models and pipeline/step runs?

You nailed it!

If you put it in one of the decos - it will be associated with the corresponding run (and also linked to a pipeline run - this is still a separate entity). With these changes, theoretically, it should be possible to sunset the pipeline run model version links table (to be validated and realigned with the model).

If you put model definitions elsewhere, e.g. in step codes - no link will be created. This is by design as of now. Subject to change though, while it might make sense not only to track the links, but also to keep track of link flavor (read, write, own, etc.).

Copy link
Contributor

@bcdurak bcdurak left a comment

Choose a reason for hiding this comment

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

Adding a few more comments on top of Michael's review.

src/zenml/orchestrators/base_orchestrator.py Outdated Show resolved Hide resolved
src/zenml/models/v2/core/pipeline_run.py Outdated Show resolved Hide resolved
src/zenml/models/v2/core/pipeline_run.py Outdated Show resolved Hide resolved
src/zenml/models/v2/core/pipeline_run.py Show resolved Hide resolved
@avishniakov
Copy link
Contributor Author

CI is not progressing much now, but can you re-review please?

Copy link
Contributor

@schustmi schustmi left a comment

Choose a reason for hiding this comment

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

Nice, it already seems much less complex now! Just left a few more small suggestions but for the most part looks good

src/zenml/model/model.py Show resolved Hide resolved
src/zenml/new/steps/step_context.py Outdated Show resolved Hide resolved
src/zenml/zen_stores/schemas/pipeline_run_schemas.py Outdated Show resolved Hide resolved
src/zenml/zen_stores/schemas/pipeline_run_schemas.py Outdated Show resolved Hide resolved
src/zenml/zen_stores/schemas/step_run_schemas.py Outdated Show resolved Hide resolved
src/zenml/new/pipelines/pipeline.py Show resolved Hide resolved
@avishniakov avishniakov merged commit 6b012b2 into develop Aug 27, 2024
80 checks passed
@avishniakov avishniakov deleted the feature/PRD-539-dynamic-names-for-model-versions branch August 27, 2024 12:17
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 run-slow-ci
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants