@@ -101,8 +101,8 @@ LOG_LEVEL=INFO
101
101
### 5. Build the Prow MCP Server
102
102
103
103
``` bash
104
- # Navigate to the prow_mcp_server directory
105
- cd prow_mcp_server
104
+ # Navigate to the _prow_mcp_server directory
105
+ cd _prow_mcp_server
106
106
107
107
# Build the container image
108
108
podman build -t mcp-server-template:latest .
@@ -130,8 +130,8 @@ adk web
130
130
python agent.py
131
131
132
132
# Or run specific sub-agents
133
- python sub_agents /installation_analyst/agent.py
134
- python sub_agents /mustgather_analyst/agent.py
133
+ python _sub_agents /installation_analyst/agent.py
134
+ python _sub_agents /mustgather_analyst/agent.py
135
135
```
136
136
137
137
#### Option C: Development Mode
@@ -242,16 +242,47 @@ pip install --force-reinstall -r requirements.txt
242
242
ci_analysis_agent/
243
243
├── agent.py # Main agent implementation
244
244
├── prompt.py # Agent prompts and instructions
245
- ├── sub_agents/ # Specialized analysis agents
245
+ ├── __init__.py # Package initialization
246
+ ├── requirements.txt # Python dependencies
247
+ ├── Dockerfile # Container image definition
248
+ ├── _sub_agents/ # Specialized analysis agents
246
249
│ ├── installation_analyst/
250
+ │ │ ├── __init__.py
251
+ │ │ ├── agent.py # Installation failure analysis
252
+ │ │ └── prompt.py # Installation analysis prompts
247
253
│ └── mustgather_analyst/
248
- ├── prow_mcp_server/ # MCP server for Prow integration
249
- ├── deploy/ # Deployment configurations
250
- └── requirements.txt # Python dependencies
254
+ │ ├── __init__.py
255
+ │ ├── agent.py # Must-gather analysis
256
+ │ ├── prompt.py # Must-gather analysis prompts
257
+ │ ├── must_gather.py # Must-gather utilities
258
+ │ ├── drain.py # Log pattern extraction
259
+ │ └── drain3.ini # Drain3 configuration
260
+ ├── _prow_mcp_server/ # MCP server for Prow integration
261
+ │ ├── mcp_server.py # MCP server implementation
262
+ │ ├── drain.py # Log pattern extraction
263
+ │ ├── drain3.ini # Drain3 configuration
264
+ │ ├── Containerfile # Container image definition
265
+ │ ├── requirements.txt # Python dependencies
266
+ │ ├── mcp.json # MCP server configuration
267
+ │ └── README.md # MCP server documentation
268
+ └── deploy/ # Deployment configurations
269
+ ├── tekton/ # Tekton pipeline manifests (RECOMMENDED)
270
+ │ ├── pipeline.yaml # Main CI/CD pipeline
271
+ │ ├── tasks.yaml # Custom Tekton tasks
272
+ │ ├── rbac.yaml # Service account and RBAC
273
+ │ ├── triggers.yaml # GitHub webhook triggers
274
+ │ ├── pipeline-run.yaml # Pipeline run template
275
+ │ ├── user-examples.yaml # Multi-user deployment examples
276
+ │ ├── deploy-pipeline.sh # Legacy deployment script
277
+ │ ├── deploy-user-namespace.sh # User-namespace deployment script
278
+ │ └── README.md # Tekton pipeline documentation
279
+ ├── k8s/ # DEPRECATED: Legacy manual manifests
280
+ │ └── README.md # Deprecation notice
281
+ └── README.md # Deployment overview
251
282
```
252
283
253
284
### Adding New Features
254
- 1 . Create a new sub-agent in ` sub_agents /`
285
+ 1 . Create a new sub-agent in ` _sub_agents /`
255
286
2 . Update the main agent to include the new functionality
256
287
3 . Add appropriate prompts and instructions
257
288
4 . Test with sample data
@@ -264,12 +295,102 @@ ci_analysis_agent/
264
295
265
296
## Deployment
266
297
267
- For production deployment on Kubernetes or OpenShift clusters, see the [ ` deploy/ ` ] ( deploy/ ) directory:
298
+ For production deployment on OpenShift clusters with multi-user support , see the [ ` deploy/ ` ] ( deploy/ ) directory:
268
299
269
- - ** Kubernetes** : ` ./deploy/deploy.sh `
270
- - ** OpenShift 4.19+** : ` ./deploy/deploy-openshift.sh `
300
+ ### ** Tekton Pipeline Deployment (Recommended)**
271
301
272
- Full documentation: [ KUBERNETES.md] ( KUBERNETES.md )
302
+ The CI Analysis Agent uses Tekton pipelines for automated CI/CD with complete multi-user isolation:
303
+
304
+ ``` bash
305
+ # Deploy for a specific user
306
+ cd deploy/tekton
307
+ chmod +x deploy-user-namespace.sh
308
+ ./deploy-user-namespace.sh < username>
309
+
310
+ # Example: Deploy for user "alice"
311
+ ./deploy-user-namespace.sh alice
312
+ ```
313
+
314
+ ### ** Multi-User Architecture**
315
+
316
+ The CI Analysis Agent supports complete multi-user isolation on a single OpenShift cluster:
317
+
318
+ ``` mermaid
319
+ graph TB
320
+ subgraph "OpenShift Cluster"
321
+ subgraph "ci-analysis-alice namespace"
322
+ A1[Alice's Pipeline]
323
+ A2[Alice's Ollama]
324
+ A3[Alice's CI Analysis Agent]
325
+ A4[Alice's Route<br/>alice-ci-analysis-agent]
326
+ end
327
+
328
+ subgraph "ci-analysis-bob namespace"
329
+ B1[Bob's Pipeline]
330
+ B2[Bob's Ollama]
331
+ B3[Bob's CI Analysis Agent]
332
+ B4[Bob's Route<br/>bob-ci-analysis-agent]
333
+ end
334
+
335
+ subgraph "ci-analysis-qa namespace"
336
+ Q1[QA Pipeline]
337
+ Q2[QA Ollama]
338
+ Q3[QA CI Analysis Agent]
339
+ Q4[QA Route<br/>qa-ci-analysis-agent]
340
+ end
341
+
342
+ subgraph "Persistent Storage"
343
+ PV1[Alice's Model Data]
344
+ PV2[Bob's Model Data]
345
+ PV3[QA Model Data]
346
+ end
347
+
348
+ A2 --> PV1
349
+ B2 --> PV2
350
+ Q2 --> PV3
351
+ end
352
+
353
+ subgraph "External Systems"
354
+ GH1[Alice's GitHub Repo]
355
+ GH2[Bob's GitHub Repo]
356
+ GH3[QA GitHub Repo]
357
+ REG[Container Registry<br/>Quay.io]
358
+ U1[Alice's Users]
359
+ U2[Bob's Users]
360
+ U3[QA Users]
361
+ end
362
+
363
+ GH1 -->|webhook| A1
364
+ GH2 -->|webhook| B1
365
+ GH3 -->|webhook| Q1
366
+
367
+ A1 -->|push images| REG
368
+ B1 -->|push images| REG
369
+ Q1 -->|push images| REG
370
+
371
+ U1 -->|access| A4
372
+ U2 -->|access| B4
373
+ U3 -->|access| Q4
374
+
375
+ style A1 fill:#e1f5fe
376
+ style B1 fill:#e8f5e8
377
+ style Q1 fill:#fff3e0
378
+ style A2 fill:#e1f5fe
379
+ style B2 fill:#e8f5e8
380
+ style Q2 fill:#fff3e0
381
+ style A3 fill:#e1f5fe
382
+ style B3 fill:#e8f5e8
383
+ style Q3 fill:#fff3e0
384
+ ```
385
+
386
+ ** Key Features:**
387
+ - Each user gets isolated namespace: ` ci-analysis-<username> `
388
+ - Complete resource isolation per user
389
+ - Automated GitHub webhook integration
390
+ - Zero shared infrastructure
391
+ - Persistent model storage per user
392
+
393
+ ** Full documentation** : [ deploy/tekton/README.md] ( deploy/tekton/README.md )
273
394
274
395
## Support
275
396
@@ -323,27 +444,29 @@ cd deploy/tekton
323
444
# Deploy all pipeline resources
324
445
./deploy-pipeline.sh
325
446
326
- # Create registry secret
447
+ # Create registry secret in user namespace
327
448
oc create secret docker-registry docker-registry-secret \
328
449
--docker-server=quay.io \
329
450
--docker-username=< your-username> \
330
451
--docker-password=< your-password> \
331
452
--docker-email=< your-email> \
332
- -n tekton-pipelines
453
+ -n ci-analysis- < username >
333
454
334
455
# Deploy for user "alice"
335
- ./deploy-user.sh alice https://github.com/alice/ci_analysis_agent.git feature/new-analysis alice
456
+ ./deploy-user-namespace .sh alice
336
457
337
458
# Monitor progress
338
- tkn pipelinerun logs --last -f -n tekton-pipelines
459
+ tkn pipelinerun logs --last -f -n ci-analysis-alice
339
460
```
340
461
341
462
### Multi-User Deployment:
342
- The pipeline supports multiple users deploying to isolated namespaces. Each user gets their own:
463
+ The pipeline supports multiple users deploying to completely isolated namespaces. Each user gets their own:
343
464
- ** Namespace** : ` ci-analysis-<username> `
465
+ - ** Pipeline & Tasks** : Deployed in user's namespace
344
466
- ** Resources** : Prefixed with username (e.g., ` alice-ollama ` , ` bob-ci-analysis-agent ` )
345
467
- ** Routes** : Individual URLs for each deployment
346
468
- ** Storage** : Isolated persistent volumes
469
+ - ** Secrets** : Registry credentials in each user namespace
347
470
348
471
### Automated Deployment:
349
472
The pipeline supports GitHub webhooks for automatic deployment on code pushes from any repository. The webhook endpoint automatically creates user-specific deployments based on the repository owner.
0 commit comments