-
Notifications
You must be signed in to change notification settings - Fork 128
[SDCICD-1733] Add KrknAI analysis engine and prompt store extension #3116
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?
Conversation
Introduce a self-contained analysis engine for krkn-ai chaos test results under `pkg/krknai/analysisengine/`, along with PromptStore changes to accept external template sources. Changes: - `pkg/krknai/analysisengine/engine.go`: KrknAI analysis engine that orchestrates aggregation, LLM analysis, result reporting, and Slack notifications - `pkg/krknai/analysisengine/engine_test.go`: Unit tests covering config validation, embedded template loading, summary writing, full Run flow with mock LLM, LLM failure handling, and missing results - `pkg/krknai/analysisengine/prompts/krknai.yaml`: Placeholder prompt template for chaos analysis (needs to be updated) - `internal/prompts/prompts.go`: NewPromptStore now accepts an fs.FS parameter so each consumer provides its own template source - `internal/prompts/prompts_test.go`: Updated tests for new signature - `internal/analysisengine/engine.go`: Updated to use prompts.DefaultTemplates() Co-authored-by: Cursor AI <noreply@cursor.com>
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: varunraokadaparthi The full list of commands accepted by this bot can be found here. The pull request process is described here DetailsNeeds approval from an approver in each of these files:
Approvers can indicate their approval by writing |
|
@varunraokadaparthi: all tests passed! Full PR test history. Your PR dashboard. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes-sigs/prow repository. I understand the commands that are listed here. |
|
|
||
| // DefaultTemplates returns the built-in prompt templates as an fs.FS. | ||
| func DefaultTemplates() fs.FS { | ||
| templatesFS, _ := fs.Sub(defaultTemplates, "templates") |
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.
Should we try to handle this error right here?
| type Config struct { | ||
| ResultsDir string // Directory containing krkn-ai results | ||
| APIKey string // Gemini API key | ||
| LLMConfig *llm.AnalysisConfig // Optional LLM configuration overrides |
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.
Does this need to be repeated? most of these are already defined in a struct here. https://github.com/varunraokadaparthi/osde2e/blob/457bc7fff1cb9b923c325acc53365945b2595964/internal/analysisengine/engine.go#L36
Could you embed the main config here instead? https://medium.com/codex/struct-embedding-in-go-fa9fd9d223ca
Introduce a self-contained analysis engine for krkn-ai chaos test results under
pkg/krknai/analysisengine/, along with PromptStore changes to accept external template sources.Changes:
pkg/krknai/analysisengine/engine.go: KrknAI analysis engine that orchestrates aggregation, LLM analysis, result reporting, and Slack notificationspkg/krknai/analysisengine/engine_test.go: Unit tests covering config validation, embedded template loading, summary writing, full Run flow with mock LLM, LLM failure handling, and missing resultspkg/krknai/analysisengine/prompts/krknai.yaml: Placeholder prompt template for chaos analysis (needs to be updated)internal/prompts/prompts.go: NewPromptStore now accepts an fs.FS parameter so each consumer provides its own template sourceinternal/prompts/prompts_test.go: Updated tests for new signatureinternal/analysisengine/engine.go: Updated to use prompts.DefaultTemplates()