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

Catch missing jupyter installation for zenml go #2571

Merged
merged 16 commits into from
Apr 9, 2024

Conversation

strickvl
Copy link
Contributor

@strickvl strickvl commented Mar 28, 2024

I added a check to catch when someone runs zenml go and they don't have Jupyter notebooks installed.

Summary by CodeRabbit

  • Documentation

    • Updated the README to include optional steps for running Jupyter notebooks.
  • New Features

    • Integrated a check to ensure Jupyter is installed before launching it, with user-friendly error messages if not found.
  • Refactor

    • Improved formatting and readability in various CLI utility functions for better user experience.

@strickvl strickvl requested review from safoinme and bcdurak March 28, 2024 17:00
@github-actions github-actions bot added internal To filter out internal PRs and issues enhancement New feature or request labels Mar 28, 2024
@strickvl strickvl added bug Something isn't working and removed enhancement New feature or request labels Mar 28, 2024
Copy link
Contributor

coderabbitai bot commented Mar 28, 2024

Important

Auto 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.

Walkthrough

The updates primarily focus on enhancing user experience and functionality around running Jupyter notebooks with ZenML. A notable addition is the optional step for installing the notebook package to facilitate Jupyter notebook usage. Furthermore, the implementation includes checking for Jupyter's installation before attempting to launch it, coupled with improved error handling and readability enhancements across various utility functions.

Changes

Files Summary
README.md Added note about optional notebook package installation for Jupyter notebooks.
src/zenml/cli/base.py Added check for Jupyter installation before launching, with improved error messages.
src/zenml/cli/utils.py Enhanced readability and logic in several functions; Added is_jupyter_installed function.

Possibly related issues

Poem

In the land of code where the ZenML flows,
A rabbit hopped, tweaking lines and rows.
"Let's check for Jupyter," it said with glee,
Making notebooks run so smoothly, you see. 📓✨
With each commit, the rabbit danced around,
Enhancing ZenML, where solutions are found.
"To improve, to fix, to make it all bright,
With joyful hops, we code into the night!" 🌙🐰

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.

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 a review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai help to get help.

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

CodeRabbit Configration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

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.

@strickvl strickvl linked an issue Mar 28, 2024 that may be closed by this pull request
Copy link
Contributor

E2E template updates in examples/e2e have been pushed.

@strickvl
Copy link
Contributor Author

@coderabbitai review

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

Review Status

Configuration used: .coderabbit.yaml

Commits Files that changed from the base of the PR and between 22c53b0 and 5e58a0a.
Files selected for processing (3)
  • README.md (1 hunks)
  • src/zenml/cli/base.py (2 hunks)
  • src/zenml/cli/utils.py (7 hunks)
Additional Context Used
Path-based Instructions (2)
src/zenml/cli/base.py (1)

src/zenml/**/*.py:
Review the Python code for conformity with Python best practices.

src/zenml/cli/utils.py (1)

src/zenml/**/*.py:
Review the Python code for conformity with Python best practices.

Additional comments not posted (2)
src/zenml/cli/base.py (1)

484-501: The addition of a pre-emptive check for Jupyter installation in the go function is a thoughtful usability improvement. It ensures users are informed about the missing Jupyter Notebook or JupyterLab installation before attempting to run the tutorial notebooks, providing a better user experience.

src/zenml/cli/utils.py (1)

2670-2683: The implementation of the is_jupyter_installed function correctly checks for the presence of the notebook package, which is a common way to verify if Jupyter notebooks are installed. However, it's worth noting that JupyterLab, a next-generation web-based user interface for Project Jupyter, might also be used by some users in place of the classic Jupyter notebooks. While JupyterLab can run notebooks without the notebook package, it's a common scenario where users have both installed. Therefore, this check is generally sufficient but might not cover all Jupyter-related use cases.

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.

Looks good.

A few small notes (feel free to ignore):

  • Do you think that the version of the notebook package could change anything here?
  • I like how you added a comment to the README, it might be nice to do the same to the docs if we have it anywhere.
  • Just out of curiosity, did you do the formatting manually?

src/zenml/cli/utils.py Outdated Show resolved Hide resolved
@strickvl
Copy link
Contributor Author

strickvl commented Apr 2, 2024

  • Do you think that the version of the notebook package could change anything here?

No I think jupyter takes pretty good care with backwards compatibility. I don't think we need to specify a specific version.

  • I like how you added a comment to the README, it might be nice to do the same to the docs if we have it anywhere.

I'll take a look to see where is appropriate.

  • Just out of curiosity, did you do the formatting manually?

Not sure what you mean here.

@strickvl strickvl requested a review from bcdurak April 2, 2024 13:19
Copy link
Contributor

github-actions bot commented Apr 5, 2024

Quickstart template updates in examples/quickstart have been pushed.

Copy link
Contributor

github-actions bot commented Apr 5, 2024

LLM Finetuning template updates in examples/llm_finetuning have been pushed.

Copy link
Contributor

github-actions bot commented Apr 8, 2024

LLM Finetuning template updates in examples/llm_finetuning have been pushed.

Copy link
Contributor

@avishniakov avishniakov left a comment

Choose a reason for hiding this comment

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

Tiny nit

src/zenml/cli/base.py Show resolved Hide resolved
@strickvl strickvl merged commit 92ac760 into develop Apr 9, 2024
58 checks passed
@strickvl strickvl deleted the feature/catch-missing-jupyter-zenml-go branch April 9, 2024 09:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working internal To filter out internal PRs and issues run-slow-ci
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Check if Juypter is installed
4 participants