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

Enhancing the orchestrator UX for major cloud providers #3005

Merged
merged 55 commits into from
Sep 24, 2024

Conversation

bcdurak
Copy link
Contributor

@bcdurak bcdurak commented Sep 11, 2024

Describe changes

This PR aims to solve two problems at the same time:

  1. Provide more meaningful URLs (Pipeline UIs and collection of Logs), possibly even before the first step starts.
  2. Implement a way to update the status of a run

Implementation details

For task number 1 (URLs)

  • Adjusted the run_utils.deploy_pipeline and Stack.deploy_pipeline calls to pass the placeholder_run forward.
  • Adjusted the BaseOrchestrator.run to accept the placeholder run. During this call, we fetch everything that prepare_or_run_pipeline yields and we publish it as metadata.
  • Adjusted the azureml, sagemaker and vertex orchestrators to use their respective clients (and created Job objects) to yield their orchestrator_run_ids, orchestrator_log_url and orchestrator_urls preemptively if possible. This helps us to display the URLs, even before the first step starts.

For task number 2 (Pipeline Status Refresh)

  • Added three new extras to the ZenML package: sagemaker, azureml and vertex.
  • Adjusted the base.Dockerfile and zenml-server-dev.Dockerfile to install these new extras as well.
  • Added a fetch_status method to the BaseOrchestrator implementation, which on default throws a NotImplementedError.
  • Added a refresh_status to the PipelineRunResponse model which makes use of the aforementioned fetch_status method.
  • Added the corresponding fetch_status implementation for vertex, sagemaker, and azureml orchestrators.
  • Added a new endpoint runs/<RUN_ID>/refresh which refreshes the status of a pipeline run if possible.
  • Parameterized the old Get Run endpoint with a refresh_status flag that will return a response with a refreshed status if possible.
  • Added a corresponding CLI command (zenml pipeline runs refresh <RUN_ID>) to refresh the status of a pipeline manually.

Docs Updates

  • Fixed the order of instructions in the Azure Guide page.
  • Added new images and instructions for role assignments on Azure.
  • Fixed a command in the GCP terraform deployment.
  • Added the new refresh CLI command to the CLI docs

TODOs

  • Adjust the pipeline run cleanup on the placeholder run to happen at a later point: Handling this on a different PR

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. (NOT YET DONE)

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 Sep 11, 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>, please review it.
    -- 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 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 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 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 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 Sep 11, 2024
@bcdurak bcdurak changed the title (WIP) Enhancing orchestrator metadata (WIP) Enhancing the orchestrator UX for major cloud providers Sep 18, 2024
Copy link

socket-security bot commented Sep 18, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
pypi/[email protected] environment, eval, filesystem, network, shell, unsafe +18 92.4 MB amlpypi, azure-sdk, microsoft

View full report↗︎

@bcdurak bcdurak changed the title (WIP) Enhancing the orchestrator UX for major cloud providers Enhancing the orchestrator UX for major cloud providers Sep 19, 2024
@bcdurak bcdurak marked this pull request as ready for review September 19, 2024 07:12
@stefannica
Copy link
Contributor

I do have a question for both of you @schustmi @stefannica. If you check the changes in the pyproject.toml, you will see that I have added three new extras, sagemaker, vertex, and azureml respectively. We use these extras to install the requirements when we set up a server (like we do with the other cloud requirements).

Now, for GCP for instance, we have connectors-gcp, secrets-gcp, gcsfs, and now the vertex as extras to the zenml package. When we build a server image, we install all of these extras together. At this point, I was considering whether it would be cleaner to

merge them under a single gcp extra

Please don't merge them. Some of them are overlapping, yes, but they generally are used for different purposes.

or use zenml to install the gcp integration. What do you think?

This would be even worse, as running zenml integration install is a sure way to introduce pip conflicts in other places.


# List the Studio domains and get the Studio Domain ID
# TODO: Solve this with the config
domains_response = session.sagemaker_client.list_domains()
Copy link
Contributor

Choose a reason for hiding this comment

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

What's the issue with using any domain? That it won't work? Or lead them to a broken link?
Somehow not a huge fan of having a config attribute just to make a link work

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It would work as long as they have at least one domain. In this case, we take the first domain and then use it to create the link. I am not sure how people are scoping domains though, I lack the Sagemaker UX knowledge here a bit. I thought a config attribute would help them to specify which domain to use but I am also OK with leaving it like this.

Copy link
Contributor

Choose a reason for hiding this comment

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

I guess right now it would just fail if they have 0 domains, if that's a possibility?

Don't have a real opinion here though, do whatever you think makes sense, but if you don't know what makes sense, maybe leave it out for now and see if people complain?

Copy link
Contributor Author

@bcdurak bcdurak Sep 23, 2024

Choose a reason for hiding this comment

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

I mean it would not "fail". In that case, we won't be creating any URLs as it is impossible, that's it. The rest of the code will execute as intended. Leaving it as is if @stefannica is ok with it as well.

@bcdurak
Copy link
Contributor Author

bcdurak commented Sep 23, 2024

@schustmi as a response to your general comment: You are right, I haven't implemented the change in the cleanup logic just yet due to time limitations. I am not sure if I can squeeze it right now but in the worst case, I will handle it in a separate PR.

@bcdurak bcdurak merged commit 3eb3d0d into develop Sep 24, 2024
83 of 84 checks passed
@bcdurak bcdurak deleted the feature/PRD-586-ochestrator-urls branch September 24, 2024 17:34
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.

4 participants