zenml-io / zenml

ZenML 🙏: The bridge between ML and Ops. https://zenml.io.
https://zenml.io
Apache License 2.0
3.97k stars 431 forks source link

In-browser assisted full cloud stack deployments #2816

Closed stefannica closed 3 months ago

stefannica commented 3 months ago

Describe changes

Implements a new automated experience of deploying cloud infrastructure and registering full cloud ZenML stacks two-in-one with minimal user input. This experience is meant to reduce the friction and technical difficulties usually encountered when a user has to create a cloud ZenML stack from scratch.

The zenml stack deploy CLI command has been repurposed to support this new experience as showcased here:

$ zenml stack deploy -p aws --set

AWS ZenML Cloud Stack Deployment                                                                                                                                                                                   
================================

Provision and register a basic AWS ZenML stack authenticated and connected to all the necessary cloud infrastructure resources required to run pipelines in AWS.                                                   

**Instructions**                                                                                                                                                                                                       

You will be redirected to the AWS console in your browser where you'll be asked to log into your AWS account and create a CloudFormation ZenML stack. The stack parameters will be pre-filled with the necessary   
information to connect ZenML to your AWS account, so you should only need to review and confirm the stack.                                                                                                         

After the CloudFormation stack is deployed, you can return to the CLI to view details about the associated ZenML stack automatically registered with ZenML.                                                        

NOTE: The CloudFormation stack will create the following new resources in your AWS account. Please ensure you have the necessary permissions and are aware of any potential costs:                                 

 • An S3 bucket registered as a ZenML artifact store.                                                                                                                                                              
 • An ECR repository registered as a ZenML container registry.                                                                                                                                                     
 • Sagemaker registered as a ZenML orchestrator.                                                                                                                                                                   
 • An IAM user and IAM role with the minimum necessary permissions to access the above resources.                                                                                                                  
 • An AWS access key used to give access to ZenML to connect to the above resources through a ZenML service connector.                                                                                             

The CloudFormation stack will automatically create an AWS secret key and will share it with ZenML to give it permissions to access the resources created by the stack. You can revoke these permissions at any time
by deleting the CloudFormation stack.                                                                                                                                                                              

Proceed to continue with the deployment. You will be automatically redirected to AWS in your browser. [y/n]: y
If your browser did not open automatically, please open the following URL into your browser to deploy the stack to AWS: AWS CloudFormation Console.                                                                

**Stack successfully registered! 🚀**                                                                                                                                                                                  

Stack stack:                                                                                                                                                                                                       

 • sagemaker orchestrator: aws-cf-eu-central-1-wpyh                                                                                                                                                                
 • s3 artifact_store: aws-cf-eu-central-1-iaiy                                                                                                                                                                     
 • aws container_registry: aws-cf-eu-central-1-smep                                                                                                                                                                
 • Service Connector: aws-cf-eu-central-1-pabl                                                                                                                                                                     

**Follow-up**                                                                                                                                                                                                          

The ZenML stack has been successfully deployed and registered. You can delete the CloudFormation at any time to revoke ZenML's access to your AWS account and to clean up the resources created by the stack by    
using the AWS CloudFormation console.                                                                                                                   

AWS is currently the only supported provider with Google and Azure to follow shortly.

Side changes

Make the zenml repository name configurable in the container registry stack component

Currently, ZenML uses the .../zenml docker repository by default for all pipeline images it builds/pushes. This can be overridden, but it's a docker settings that must be configured in code. At the same time, we want these full stack deployment templates to create unique cloud resources, which includes container registries. Therefore, we need the ability to configure the container registry stack components to use a "default repository name" that is different than zenml. This PR also adds that capability by modeling a new (optional) default_repository configuration attribute to all container registry stack components.

Use the region from the AWS service connector in the S3 artifact store

The S3 artifact store doesn't explicitly configure the AWS region in the s3fs client. This can lead to errors in environments such as Sagemaker, because the region might default to something else. This PR now uses the AWS region in the service connector to explicitly configure the s3fs client.

Deprecations

The zenml stack deploy CLI command has been renamed to zenml stack deploy-mlstack and marked as deprecated. Users should use the new zenml stack deploy CLI command to benefit from the new experience or use the mlstacks project stacks separately.

Pre-requisites

Please ensure you have done the following:

Types of changes

coderabbitai[bot] commented 3 months ago

[!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 - [X](https://twitter.com/intent/tweet?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A&url=https%3A//coderabbit.ai) - [Mastodon](https://mastodon.social/share?text=I%20just%20used%20%40coderabbitai%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20the%20proprietary%20code.%20Check%20it%20out%3A%20https%3A%2F%2Fcoderabbit.ai) - [Reddit](https://www.reddit.com/submit?title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&text=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code.%20Check%20it%20out%3A%20https%3A//coderabbit.ai) - [LinkedIn](https://www.linkedin.com/sharing/share-offsite/?url=https%3A%2F%2Fcoderabbit.ai&mini=true&title=Great%20tool%20for%20code%20review%20-%20CodeRabbit&summary=I%20just%20used%20CodeRabbit%20for%20my%20code%20review%2C%20and%20it%27s%20fantastic%21%20It%27s%20free%20for%20OSS%20and%20offers%20a%20free%20trial%20for%20proprietary%20code)
Tips ### Chat There are 3 ways to chat with [CodeRabbit](https://coderabbit.ai): - Review comments: Directly reply to a review comment made by CodeRabbit. Example: - `I pushed a fix in commit .` - `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. ### 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](https://docs.coderabbit.ai/guides/configure-coderabbit) 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](https://coderabbit.ai/docs) for detailed information on how to use CodeRabbit. - Join our [Discord Community](https://discord.com/invite/GsXnASn26c) to get help, request features, and share feedback. - Follow us on [X/Twitter](https://twitter.com/coderabbitai) for updates and announcements.
stefannica commented 3 months ago

@schustmi I might need you to take a quick look at the side-change documented in the PR description. It affects the way we build docker container images to run pipelines.

github-actions[bot] commented 3 months ago

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

github-actions[bot] commented 3 months ago

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