Skip to content

Commit 3e9be1b

Browse files
committed
docs: Complete README.md overhaul with comprehensive setup guide
- Expand from 30 to 200+ lines with detailed documentation - Add prerequisites section with system requirements and software versions - Add step-by-step setup guide covering installation, configuration, and deployment - Add configuration options for model switching and log analysis - Add usage examples for supported input types and analysis workflow - Add comprehensive troubleshooting section with common error solutions - Add development section with project structure and contribution guidelines - Add support information and license details This provides a complete getting-started guide for new users cloning the repository and running the CI Analysis Agent from scratch.
1 parent 6b25854 commit 3e9be1b

File tree

1 file changed

+274
-11
lines changed

1 file changed

+274
-11
lines changed

README.md

Lines changed: 274 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,20 +2,283 @@
22

33
## What is it?
44

5-
This tool is experimentation to find root cause analysis for multi-arch release test failures.
5+
This tool is experimentation to find root cause analysis for multi-arch release test failures. It uses Google's Agent Development Kit (ADK) with local LLM models via Ollama to analyze CI/CD pipeline failures and provide intelligent insights.
66

7-
## How to use
7+
## Prerequisites
88

9-
1. [Install ADK](https://google.github.io/adk-docs/get-started/installation/)
10-
2. If you intend to use local models with LiteLLM, install ollama
11-
3. Build the Prow MCP server this agent uses:
12-
```sh
9+
Before getting started, ensure you have the following installed:
10+
11+
### Required Software
12+
- **Python 3.11+** (recommended 3.13)
13+
- **Git** for version control
14+
- **Ollama** for local LLM models
15+
- **Docker/Podman** for containerization
16+
- **Node.js 18+** (for ADK web interface)
17+
18+
### System Requirements
19+
- **RAM**: 8GB minimum, 16GB recommended (for running local LLM models)
20+
- **Storage**: 10GB free space (for models and dependencies)
21+
- **OS**: Linux (recommended), macOS, or Windows with WSL2
22+
23+
## Getting Started
24+
25+
### 1. Clone the Repository
26+
27+
```bash
28+
# Clone your fork
29+
git clone [email protected]:jeffdyoung/ci_analysis_agent.git
30+
cd ci_analysis_agent
31+
32+
# Add upstream remote (optional, for contributing)
33+
git remote add upstream [email protected]:sherine-k/ci_analysis_agent.git
34+
```
35+
36+
### 2. Install Dependencies
37+
38+
#### Install Python Dependencies
39+
```bash
40+
# Create virtual environment (recommended)
41+
python3 -m venv venv
42+
source venv/bin/activate # On Windows: venv\Scripts\activate
43+
44+
# Install Python packages
45+
pip install -r requirements.txt
46+
47+
# If requirements.txt doesn't exist, install core dependencies:
48+
pip install google-adk litellm drain3 google-cloud-storage python-dotenv
49+
```
50+
51+
#### Install Ollama
52+
```bash
53+
# On Linux/macOS
54+
curl -fsSL https://ollama.com/install.sh | sh
55+
56+
# On Windows (PowerShell)
57+
# Download from https://ollama.com/download/windows
58+
59+
# Start Ollama service
60+
ollama serve
61+
```
62+
63+
#### Install ADK (Agent Development Kit)
64+
```bash
65+
# Install ADK globally
66+
npm install -g @google/adk
67+
68+
# Or install locally
69+
npm install @google/adk
70+
```
71+
72+
### 3. Setup Local LLM Model
73+
74+
```bash
75+
# Pull the qwen3:4b model (recommended)
76+
ollama pull qwen3:4b
77+
78+
# Verify model is available
79+
ollama list
80+
81+
# Test the model (optional)
82+
ollama run qwen3:4b "Hello, how are you?"
83+
```
84+
85+
### 4. Environment Configuration
86+
87+
Create a `.env` file in the project root:
88+
89+
```bash
90+
# For local Ollama models (default)
91+
OLLAMA_API_BASE=http://localhost:11434
92+
93+
# For Google Gemini (alternative)
94+
# GOOGLE_GENAI_USE_VERTEXAI=FALSE
95+
# GOOGLE_API_KEY=your_google_api_key_here
96+
97+
# Optional: Logging level
98+
LOG_LEVEL=INFO
99+
```
100+
101+
### 5. Build the Prow MCP Server
102+
103+
```bash
104+
# Navigate to the prow_mcp_server directory
105+
cd prow_mcp_server
106+
107+
# Build the container image
13108
podman build -t mcp-server-template:latest .
109+
# Or with Docker:
110+
# docker build -t mcp-server-template:latest .
111+
112+
# Return to project root
113+
cd ..
114+
```
115+
116+
### 6. Run the Application
117+
118+
#### Option A: Using ADK Web Interface (Recommended)
119+
```bash
120+
# Start the web interface
121+
adk web
122+
123+
# Open your browser to http://localhost:3000
124+
# Select "CI Analysis Agent" from the available agents
125+
```
126+
127+
#### Option B: Command Line Interface
128+
```bash
129+
# Run the agent directly
130+
python agent.py
131+
132+
# Or run specific sub-agents
133+
python sub_agents/installation_analyst/agent.py
134+
python sub_agents/mustgather_analyst/agent.py
14135
```
15-
4. run `adk web` from the parent folder of ci_analysis_agent
16136

17-
PS: If you're using Gemini (not a local model), create a .env file with content:
137+
#### Option C: Development Mode
138+
```bash
139+
# Run with auto-reload for development
140+
adk dev
141+
142+
# Or use Python's development server
143+
python -m adk.cli dev
144+
```
145+
146+
## Configuration Options
147+
148+
### Model Configuration
149+
Edit `agent.py` to change the model:
150+
```python
151+
# For local Ollama models
152+
MODEL = LiteLlm(model="ollama_chat/qwen3:4b")
153+
154+
# For other Ollama models
155+
MODEL = LiteLlm(model="ollama_chat/llama3:8b")
156+
MODEL = LiteLlm(model="ollama_chat/codellama:7b")
157+
158+
# For Google Gemini
159+
MODEL = LiteLlm(model="gemini/gemini-1.5-flash")
18160
```
19-
GOOGLE_GENAI_USE_VERTEXAI=FALSE
20-
GOOGLE_API_KEY={{YOUR_TOKEN_HERE}}
21-
```
161+
162+
### Log Analysis Configuration
163+
The system uses Drain3 for log pattern detection. Configure in `drain3.ini`:
164+
```ini
165+
[DRAIN]
166+
sim_th = 0.4
167+
depth = 4
168+
max_children = 100
169+
max_clusters = 1000
170+
```
171+
172+
## Usage Examples
173+
174+
### Analyzing CI Failures
175+
1. Upload your CI logs or must-gather files
176+
2. The agent will automatically:
177+
- Parse and categorize logs
178+
- Identify failure patterns
179+
- Provide root cause analysis
180+
- Suggest remediation steps
181+
182+
### Supported Input Types
183+
- **Prow job logs**
184+
- **OpenShift must-gather archives**
185+
- **Installation logs**
186+
- **Test execution reports**
187+
188+
## Troubleshooting
189+
190+
### Common Issues
191+
192+
#### "Model not found" Error
193+
```bash
194+
# Check if Ollama is running
195+
ollama list
196+
197+
# If model missing, pull it
198+
ollama pull qwen3:4b
199+
200+
# Verify environment variable
201+
echo $OLLAMA_API_BASE
202+
```
203+
204+
#### "Connection refused" Error
205+
```bash
206+
# Start Ollama service
207+
ollama serve
208+
209+
# Check if port 11434 is available
210+
netstat -tlnp | grep 11434
211+
```
212+
213+
#### ADK Web Interface Issues
214+
```bash
215+
# Clear ADK cache
216+
adk cache clear
217+
218+
# Reinstall ADK
219+
npm uninstall -g @google/adk
220+
npm install -g @google/adk
221+
```
222+
223+
#### Python Import Errors
224+
```bash
225+
# Activate virtual environment
226+
source venv/bin/activate
227+
228+
# Reinstall dependencies
229+
pip install --force-reinstall -r requirements.txt
230+
```
231+
232+
### Performance Tips
233+
- Use smaller models (qwen3:4b) for faster responses
234+
- Increase system RAM for better model performance
235+
- Use SSD storage for faster model loading
236+
- Monitor system resources during analysis
237+
238+
## Development
239+
240+
### Project Structure
241+
```
242+
ci_analysis_agent/
243+
├── agent.py # Main agent implementation
244+
├── prompt.py # Agent prompts and instructions
245+
├── sub_agents/ # Specialized analysis agents
246+
│ ├── installation_analyst/
247+
│ └── mustgather_analyst/
248+
├── prow_mcp_server/ # MCP server for Prow integration
249+
├── deploy/ # Deployment configurations
250+
└── requirements.txt # Python dependencies
251+
```
252+
253+
### Adding New Features
254+
1. Create a new sub-agent in `sub_agents/`
255+
2. Update the main agent to include the new functionality
256+
3. Add appropriate prompts and instructions
257+
4. Test with sample data
258+
259+
### Contributing
260+
1. Fork the repository
261+
2. Create a feature branch: `git checkout -b feature-name`
262+
3. Make your changes and test thoroughly
263+
4. Submit a pull request to the upstream repository
264+
265+
## Deployment
266+
267+
For production deployment on Kubernetes or OpenShift clusters, see the [`deploy/`](deploy/) directory:
268+
269+
- **Kubernetes**: `./deploy/deploy.sh`
270+
- **OpenShift 4.19+**: `./deploy/deploy-openshift.sh`
271+
272+
Full documentation: [KUBERNETES.md](KUBERNETES.md)
273+
274+
## Support
275+
276+
For issues and questions:
277+
1. Check the troubleshooting section above
278+
2. Search existing issues in the repository
279+
3. Create a new issue with detailed information
280+
4. Include system information and error logs
281+
282+
## License
283+
284+
This project is licensed under the Apache License 2.0 - see the LICENSE file for details.

0 commit comments

Comments
 (0)