-
Notifications
You must be signed in to change notification settings - Fork 356
(Feat) Implement init, build and deploy cmd for kagent cli
#838
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) Implement init, build and deploy cmd for kagent cli
#838
Conversation
init, build and `deploy cmd for kagent cliinit, build and deploy cmd for kagent cli
c9bcb22 to
7c23350
Compare
…ld and deploy agent projects to kubernetes Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
7c23350 to
bb66005
Compare
go/cli/internal/frameworks/adk/python/templates/Dockerfile.tmpl
Outdated
Show resolved
Hide resolved
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.
Pull Request Overview
This PR introduces the core CLI functionality for kagent with three new commands: init, build, and deploy. These commands enable developers to bootstrap agent projects, build Docker images, and deploy agents to Kubernetes environments.
- Implements project scaffolding with support for OpenAI, Anthropic, AzureOpenAI, and Gemini model providers
- Adds Docker image building and registry pushing capabilities with configurable image naming
- Provides Kubernetes deployment functionality with automatic secret management for API keys
Reviewed Changes
Copilot reviewed 16 out of 16 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| go/cli/internal/frameworks/frameworks.go | Factory function for creating framework-specific generators |
| go/cli/internal/frameworks/common/manifest_manager.go | Manages kagent.yaml manifest files with validation and persistence |
| go/cli/internal/frameworks/common/base_generator.go | Base generator providing template rendering and project generation |
| go/cli/internal/frameworks/adk/python/templates/* | Python ADK project templates for pyproject.toml, agent code, and Docker configuration |
| go/cli/internal/frameworks/adk/python/generator.go | Python-specific generator implementation with project structure creation |
| go/cli/internal/cli/init.go | Init command implementation with model provider validation |
| go/cli/internal/cli/deploy.go | Deploy command with Kubernetes client setup and Agent CRD creation |
| go/cli/internal/cli/build.go | Build command for Docker image creation and registry operations |
| go/cli/cmd/kagent/main.go | CLI command registration and interactive shell integration |
Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.
go/cli/internal/frameworks/adk/python/templates/Dockerfile.tmpl
Outdated
Show resolved
Hide resolved
- bind cmd flags to config - add better verbose logging - use clientcmd for loading kubeConfig - fix resource existence check logic for secrets and agents Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
69869f9 to
2823ac7
Compare
EItanya
left a comment
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.
Going to approve as is, but I would like to see some of these fixes in a follow-up
go/cli/internal/frameworks/adk/python/templates/agent/agent.py.tmpl
Outdated
Show resolved
Hide resolved
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
| def create_model(): | ||
| """Create an OpenAI model instance using LiteLLM.""" | ||
| return LiteLlm(model="openai/{{.ModelName}}") |
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.
We no longer use LiteLlm for openai, please see the latest code.
| def create_model(): | ||
| """Create an Azure OpenAI model instance using LiteLLM.""" | ||
| return LiteLlm(model="azure/{{.ModelName}}") |
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.
Same for azure
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io>
…ent-dev#838) This PR adds the following new features to the `kagent` CLI. 1. `kagent init` creates a bootstrap agent project. - Currently supports bootstrapping an agent project for the following model providers. The supported models are the models that we currently support in [models.go](https://github.com/kagent-dev/kagent/blob/main/go/internal/httpserver/handlers/models.go) 1. OpenAI 2. Anthropic 3. AzureOpenAI 4. Gemini 2. `kagent build` builds a docker image for an agent project. - By default the image assumes the repository is `localhost:5001`, the name of the image is the `name` specified in the agent project's manifest and the tag is `latest`. 3. `kagent deploy` deploys the agent to a kubernetes environement by creating a . Tested on the following provider and model combinations. 1. Gemini: gemini-2.0-flash ✅ 2. OpenAI: gpt-4 ✅ Following provider and model combinations are currently being tested 1. AzureOpenAI: gpt-4 (in progress) 2. Anthropic: claude-sonnet-4 (in progress) ### Follow Ups 1. Add support for `VertexAI` and `AnthropicVertexAI`. I'm currently blocked on procuring working credentials which is why I have temporarily removed some of my previous implementation and am opting to add support for the above in a follow up PR. --------- Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io> Signed-off-by: krisztianfekete <git@krisztianfekete.org>
…ent-dev#838) This PR adds the following new features to the `kagent` CLI. 1. `kagent init` creates a bootstrap agent project. - Currently supports bootstrapping an agent project for the following model providers. The supported models are the models that we currently support in [models.go](https://github.com/kagent-dev/kagent/blob/main/go/internal/httpserver/handlers/models.go) 1. OpenAI 2. Anthropic 3. AzureOpenAI 4. Gemini 2. `kagent build` builds a docker image for an agent project. - By default the image assumes the repository is `localhost:5001`, the name of the image is the `name` specified in the agent project's manifest and the tag is `latest`. 3. `kagent deploy` deploys the agent to a kubernetes environement by creating a . Tested on the following provider and model combinations. 1. Gemini: gemini-2.0-flash ✅ 2. OpenAI: gpt-4 ✅ Following provider and model combinations are currently being tested 1. AzureOpenAI: gpt-4 (in progress) 2. Anthropic: claude-sonnet-4 (in progress) ### Follow Ups 1. Add support for `VertexAI` and `AnthropicVertexAI`. I'm currently blocked on procuring working credentials which is why I have temporarily removed some of my previous implementation and am opting to add support for the above in a follow up PR. --------- Signed-off-by: JM Huibonhoa <jm.huibonhoa@solo.io> Signed-off-by: krisztianfekete <git@krisztianfekete.org>
This PR adds the following new features to the
kagentCLI.kagent initcreates a bootstrap agent project.kagent buildbuilds a docker image for an agent project.localhost:5001, the name of the image is thenamespecified in the agent project's manifest and the tag islatest.kagent deploydeploys the agent to a kubernetes environement by creating a .Tested on the following provider and model combinations.
Following provider and model combinations are currently being tested
Follow Ups
VertexAIandAnthropicVertexAI. I'm currently blocked on procuring working credentials which is why I have temporarily removed some of my previous implementation and am opting to add support for the above in a follow up PR.