-
Notifications
You must be signed in to change notification settings - Fork 2k
enhancement: generalising docker build and run for multicloud environ… #3132
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
base: main
Are you sure you want to change the base?
enhancement: generalising docker build and run for multicloud environ… #3132
Conversation
Summary of ChangesHello @raflFaisal, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the Highlights
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request introduces a significant and well-structured refactoring to generalize the adk deploy
command. The use of a factory pattern and deployer-specific classes for different cloud providers is a great improvement for extensibility. The code is cleaner and more modular. I've identified a few issues, mainly a copy-paste error in the new docker
command logic, some type hint inconsistencies, and other minor improvements for code style and correctness. Overall, this is a solid enhancement to the ADK CLI.
This PR introduces a flexible and extensible deployment interface for the adk deploy command to support multiple cloud providers (e.g., GCP, AWS, Kubernetes, etc.) and Docker environments.
This proposed changes improves the adk deploy interface to be more flexible, and scalable, enabling easier integration with various cloud environments and future cloud provider support. For more details please refer this #184
Key Changes:
Generalised Dockerfile:
Removed provider-specific hard-coded variables.
Introduced two options for injecting environment variables:
(1) Using .env files for local development (docker).
(2)Passing environment variables directly via the adk deploy command for production environments.
Modular Deployment Interface:
(1) Introduced --cloud-provider to specify the target platform (default: gcp).
(2) Introduced --provider-args for provider-specific parameters (e.g., aws-region, project).
(3) Implemented cloud-specific deployers for each platform (e.g., GCPDeployer, DockerDeployer).
Used a factory pattern to route deployment logic based on the cloud provider.
Simplified deployment commands with clear, flexible syntax for docker, GCP (AWS, k8s and other cloud providers in future)
Readme.md file is updated with usage instructions
What Will Not Be Supported:
(1) Non-containerized deployments (e.g., serverless functions).
(2) CI/CD integration.
(3) Credential management (assumes provider CLIs are pre-configured).
Test Plan:
Unit Tests:
✅ Existing unittest cases adopted to test deployment logic for 'cloud run'
✅ implemented unitest case for Docker environment handling.
Manual Verification: Successfully deployed and verified agent behavior using the following commands:
✅ adk deploy cloud_run agents/llm_auditor
✅ adk deploy cloud_run --with_ui agents/llm_auditor
✅ adk deploy cloud_run --project=myproject-9094 --region=europe-west3 agents/llm_auditor
✅ adk deploy cloud_run --project=myproject-9094 --region=europe-west3 --with_ui agents/llm_auditor
✅ adk deploy cloud_run --project=myproject-9094 --region=europe-west3 --with_ui
--env GOOGLE_GENAI_USE_VERTEXAI=0
--env GOOGLE_API_KEY=secret-key
agents/llm_auditor
✅ adk deploy docker agents/llm_auditor
✅ adk deploy docker agents/llm_auditor --with_ui
✅ adk deploy docker --with_ui
--env GOOGLE_GENAI_USE_VERTEXAI=0
--env GOOGLE_API_KEY=secret-key
agents/llm_auditor
Note: This PR is a refreshed version of #395, which was closed due to staleness during repository cleanup. All feedback from the previous thread has been addressed.