Skip to content

Conversation

raflFaisal
Copy link

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.

Copy link

Summary of Changes

Hello @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 adk deploy command by introducing a flexible and extensible deployment interface. The core change involves refactoring the deployment logic into a modular, provider-agnostic system using a factory pattern, which now supports both Docker and Google Cloud Run, with a clear path for future cloud integrations. This improves the command's scalability and ease of use, allowing developers to deploy agents to various environments with greater control over configuration and environment variables.

Highlights

  • Modular Deployment Interface: The adk deploy command has been refactored to use a modular interface with a factory pattern, allowing for easy extension to new cloud providers. This includes new --cloud-provider and --provider-args options.
  • Generalized Dockerfile and Environment Variables: The Dockerfile template has been generalized, removing provider-specific hard-coded variables. Environment variables can now be injected using .env files for local development or directly via the adk deploy command for production.
  • New Deployment Commands: New adk deploy docker and adk deploy cloud_run commands have been introduced, simplifying the deployment process with clear and flexible syntax for both local Docker containers and Google Cloud Run.
  • Centralized CLI Options: Common CLI options for deployment commands (e.g., service_name, env, port, with_ui) have been centralized using a decorator, improving consistency and maintainability.
  • Updated Documentation: The README.md file has been updated to include new usage instructions for the Docker and Cloud Run deployment options, demonstrating how to deploy agents and set environment variables.
Using Gemini Code Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link

@gemini-code-assist gemini-code-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.

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.

@adk-bot adk-bot added the live [Component] This issue is related to live, voice and video chat label Oct 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

live [Component] This issue is related to live, voice and video chat

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants