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

feat: Add deploy into Cloud Run service support #1580

Open
wants to merge 6 commits into
base: main
Choose a base branch
from

Conversation

zorrofox
Copy link

Description

Thank you for opening a Pull Request!
Before submitting your PR, there are a few things you can do to make sure it goes smoothly:

  • Follow the CONTRIBUTING Guide.
  • You are listed as the author in your notebook or README file.
    • Your account is listed in CODEOWNERS for the file(s).
  • Make your Pull Request title in the https://www.conventionalcommits.org/ specification.
  • Ensure the tests and linter pass (Run nox -s format from the repository root to format).
  • Appropriate docs were updated (if necessary)

Fixes #<issue_number_goes_here> 🦕

@zorrofox zorrofox requested a review from a team as a code owner December 25, 2024 01:51
Copy link
Contributor

@code-review-assist code-review-assist bot left a comment

Choose a reason for hiding this comment

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

Hi team,

I'm currently reviewing this pull request and will have a full review ready in a few minutes. In the meantime, here's a quick summary to get everyone up to speed:

This pull request, authored by zorrofox, adds support for deploying the websocket-demo-app into a Cloud Run service. The intent is to provide a streamlined deployment process for this application.

Here's a breakdown of the changes:

  • gemini/multimodal-live-api/websocket-demo-app/Dockerfile: This file has been completely rewritten to create a Docker image based on nginx:alpine. It includes instructions to install Python 3, pip, copy frontend and backend code, install supervisord, install project dependencies (requirements.txt), and copy the supervisord.conf and nginx.conf files. The final command starts supervisord to manage the application processes.
    • Lines 1-21: The entire Dockerfile is new, setting up the environment for the application to run in Cloud Run.
  • gemini/multimodal-live-api/websocket-demo-app/README.md: This file has been updated with detailed instructions on how to deploy the application to Cloud Run. This includes steps for modifying the frontend code, deploying with gcloud, obtaining a Google Cloud access token, and interacting with the deployed application.
    • Lines 168-220: A new section, "Setup in Cloud Run," has been added, providing a comprehensive guide for deployment.
  • gemini/multimodal-live-api/websocket-demo-app/nginx.conf: This file defines the Nginx configuration for the application, including a reverse proxy for the WebSocket connection to the backend application running on port 8080.
    • Lines 1-43: The entire file is new, configuring Nginx to serve the frontend and proxy WebSocket connections.
  • gemini/multimodal-live-api/websocket-demo-app/supervisord.conf: This file configures supervisord to manage the Nginx and Python application processes.
    • Lines 1-9: The entire file is new, setting up supervisord to manage Nginx and the backend Python application.

Overall, this PR significantly improves the deployability of the websocket-demo-app, making it easier to run in a Cloud Run environment. The added documentation is clear and comprehensive.


And now, a little haiku to lighten the mood:

Cloud Run's swift grace,
Deploys code with gentle ease,
Smooth workflow unfolds.

Copy link
Contributor

@code-review-assist code-review-assist bot left a comment

Choose a reason for hiding this comment

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

This pull request adds support for deploying the websocket demo app to Cloud Run. This enhances the accessibility of the demo and simplifies the setup process for users. The changes are well-structured and the documentation is clear. A few minor improvements can further enhance the clarity and completeness of the documentation, and a suggestion for the Dockerfile can improve security and maintainability.

  • README.md: The instructions for setting up the application in Cloud Run can be improved by clarifying the purpose of certain steps and providing more context. There's also a repeated section that should be removed for conciseness.
  • Dockerfile: Using a multi-stage build can significantly reduce the final image size, which improves build times, reduces the attack surface, and optimizes resource utilization in Cloud Run.
  • nginx.conf and supervisord.conf: These configuration files are well-structured and effectively support the deployment to Cloud Run. No major issues found.

@zorrofox
Copy link
Author

Does anyone can review this? Thanks!

Copy link
Collaborator

@holtskinner holtskinner left a comment

Choose a reason for hiding this comment

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

LGTM, waiting on @ZackAkil 's approval

@holtskinner holtskinner requested a review from ZackAkil December 26, 2024 17:27
@holtskinner holtskinner removed their assignment Dec 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants