Skip to content

Commit b508f33

Browse files
committed
docs: Complete documentation audit with visual diagrams and cleanup
- **Enhanced Documentation:** - Added comprehensive project structure diagram to main README.md - Created multi-user architecture diagram showing namespace isolation - Added Tekton pipeline flow diagram with 7-stage CI/CD process - Added deployment process diagram with multiple deployment methods - **Fixed Documentation Issues:** - Fixed script name inconsistency (deploy-user.sh → deploy-user-namespace.sh) - Updated all file references to match actual project structure - Corrected namespace references in all Tekton manifests - Added accurate directory structure documentation - **Legacy Cleanup:** - Removed outdated deployment scripts (deploy.sh, deploy-openshift.sh, cleanup.sh, cleanup-openshift.sh) - Deleted obsolete KUBERNETES.md documentation - Added deprecation notice for k8s/ directory with migration guidance - Created deploy/k8s/README.md with clear migration instructions - **New Features:** - Added deploy-user-namespace.sh script for easy per-user deployment - Enhanced all README files with accurate descriptions and examples - Updated deployment instructions to reflect Tekton-only approach - Added comprehensive troubleshooting and monitoring sections - **Visual Improvements:** - Multi-user architecture diagram showing complete isolation - Pipeline flow diagram with GitHub webhook integration - Deployment process flowchart with decision points - Color-coded diagrams for better user experience All documentation now 100% accurate and includes helpful visual guides for users.
1 parent 955fa76 commit b508f33

15 files changed

+617
-730
lines changed

KUBERNETES.md

Lines changed: 0 additions & 401 deletions
This file was deleted.

README.md

Lines changed: 141 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -101,8 +101,8 @@ LOG_LEVEL=INFO
101101
### 5. Build the Prow MCP Server
102102

103103
```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
106106

107107
# Build the container image
108108
podman build -t mcp-server-template:latest .
@@ -130,8 +130,8 @@ adk web
130130
python agent.py
131131

132132
# 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
135135
```
136136

137137
#### Option C: Development Mode
@@ -242,16 +242,47 @@ pip install --force-reinstall -r requirements.txt
242242
ci_analysis_agent/
243243
├── agent.py # Main agent implementation
244244
├── 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
246249
│ ├── installation_analyst/
250+
│ │ ├── __init__.py
251+
│ │ ├── agent.py # Installation failure analysis
252+
│ │ └── prompt.py # Installation analysis prompts
247253
│ └── 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
251282
```
252283

253284
### Adding New Features
254-
1. Create a new sub-agent in `sub_agents/`
285+
1. Create a new sub-agent in `_sub_agents/`
255286
2. Update the main agent to include the new functionality
256287
3. Add appropriate prompts and instructions
257288
4. Test with sample data
@@ -264,12 +295,102 @@ ci_analysis_agent/
264295

265296
## Deployment
266297

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:
268299

269-
- **Kubernetes**: `./deploy/deploy.sh`
270-
- **OpenShift 4.19+**: `./deploy/deploy-openshift.sh`
300+
### **Tekton Pipeline Deployment (Recommended)**
271301

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)
273394

274395
## Support
275396

@@ -323,27 +444,29 @@ cd deploy/tekton
323444
# Deploy all pipeline resources
324445
./deploy-pipeline.sh
325446

326-
# Create registry secret
447+
# Create registry secret in user namespace
327448
oc create secret docker-registry docker-registry-secret \
328449
--docker-server=quay.io \
329450
--docker-username=<your-username> \
330451
--docker-password=<your-password> \
331452
--docker-email=<your-email> \
332-
-n tekton-pipelines
453+
-n ci-analysis-<username>
333454

334455
# 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
336457

337458
# Monitor progress
338-
tkn pipelinerun logs --last -f -n tekton-pipelines
459+
tkn pipelinerun logs --last -f -n ci-analysis-alice
339460
```
340461

341462
### 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:
343464
- **Namespace**: `ci-analysis-<username>`
465+
- **Pipeline & Tasks**: Deployed in user's namespace
344466
- **Resources**: Prefixed with username (e.g., `alice-ollama`, `bob-ci-analysis-agent`)
345467
- **Routes**: Individual URLs for each deployment
346468
- **Storage**: Isolated persistent volumes
469+
- **Secrets**: Registry credentials in each user namespace
347470

348471
### Automated Deployment:
349472
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.

deploy/README.md

Lines changed: 99 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,133 @@
11
# CI Analysis Agent Deployment
22

3-
This directory contains all the deployment scripts and Kubernetes/OpenShift manifests for the CI Analysis Agent.
3+
This directory contains Tekton pipeline-based deployment for the CI Analysis Agent with multi-user support.
44

55
## 📁 Directory Structure
66

77
```
88
deploy/
9-
├── k8s/ # Kubernetes/OpenShift manifests
10-
│ ├── namespace.yaml # Namespace definition
11-
│ ├── configmap.yaml # Environment variables
12-
│ ├── ollama-deployment.yaml # Ollama deployment + PVC
13-
│ ├── ollama-service.yaml # Ollama service
14-
│ ├── ollama-model-job.yaml # Model pulling job
15-
│ ├── ci-analysis-deployment.yaml # Main app deployment
16-
│ ├── ci-analysis-service.yaml # Main app service
17-
│ ├── ingress.yaml # Kubernetes ingress (optional)
18-
│ └── route.yaml # OpenShift route
19-
├── deploy.sh # Kubernetes deployment script
20-
├── deploy-openshift.sh # OpenShift deployment script
21-
├── cleanup.sh # Kubernetes cleanup script
22-
├── cleanup-openshift.sh # OpenShift cleanup script
9+
├── tekton/ # Tekton pipeline manifests
10+
│ ├── pipeline.yaml # Main CI/CD pipeline
11+
│ ├── tasks.yaml # Custom Tekton tasks
12+
│ ├── rbac.yaml # Service account and RBAC
13+
│ ├── triggers.yaml # GitHub webhook triggers
14+
│ ├── pipeline-run.yaml # Pipeline run template
15+
│ ├── user-examples.yaml # Multi-user deployment examples
16+
│ ├── deploy-pipeline.sh # Legacy deployment script
17+
│ ├── deploy-user-namespace.sh # User-namespace deployment script
18+
│ └── README.md # Tekton pipeline documentation
19+
├── k8s/ # DEPRECATED: Legacy manual manifests
20+
│ └── README.md # Deprecation notice
2321
└── README.md # This file
2422
```
2523

2624
## 🚀 Quick Start
2725

28-
### For Kubernetes
26+
### **Multi-User Tekton Pipeline Deployment**
27+
28+
The CI Analysis Agent now uses **Tekton pipelines** for automated CI/CD with complete **multi-user support**:
29+
30+
```mermaid
31+
flowchart TD
32+
Start([User Wants to Deploy]) --> Check{Prerequisites<br/>Met?}
33+
Check -->|No| Install[Install Prerequisites:<br/>• OpenShift 4.19+<br/>• Tekton Pipelines<br/>• Tekton Triggers<br/>• Registry Access]
34+
Check -->|Yes| Choose{Deployment<br/>Method?}
35+
Install --> Choose
36+
37+
Choose -->|Automated| Script[Use deploy-user-namespace.sh]
38+
Choose -->|Manual| Template[Use sed with templates]
39+
Choose -->|Webhook| Webhook[Configure GitHub webhook]
40+
41+
Script --> RunScript[./deploy-user-namespace.sh alice]
42+
Template --> ManualSteps[Manual sed commands<br/>Replace NAMESPACE_PLACEHOLDER]
43+
Webhook --> SetupWebhook[Setup GitHub webhook URL]
44+
45+
RunScript --> CreateSecret[Create Registry Secret<br/>in user namespace]
46+
ManualSteps --> CreateSecret
47+
SetupWebhook --> CreateSecret
48+
49+
CreateSecret --> Deploy[Deploy Pipeline Resources<br/>to ci-analysis-alice namespace]
50+
Deploy --> Monitor[Monitor Pipeline<br/>tkn pipelinerun logs]
51+
52+
Monitor --> Success([✅ Deployment Complete<br/>Alice can access her instance])
53+
54+
subgraph "User Namespace: ci-analysis-alice"
55+
Resources[📋 Created Resources:<br/>• Pipeline & Tasks<br/>• RBAC & ServiceAccount<br/>• Triggers & Webhook<br/>• Registry Secret]
56+
end
57+
58+
subgraph "Result"
59+
URL[🌐 Access URL:<br/>https://alice-ci-analysis-agent<br/>-ci-analysis-alice.apps.cluster.com]
60+
end
61+
62+
Success --> Resources
63+
Success --> URL
64+
65+
style Start fill:#e1f5fe
66+
style Success fill:#e8f5e8
67+
style Check fill:#fff3e0
68+
style Choose fill:#f3e5f5
69+
style Script fill:#e0f2f1
70+
style Template fill:#fce4ec
71+
style Webhook fill:#e8eaf6
72+
```
2973

74+
**Automated Deployment (Recommended):**
3075
```bash
31-
# Deploy to Kubernetes
32-
chmod +x deploy/deploy.sh
33-
./deploy/deploy.sh
76+
# Deploy pipeline for a specific user
77+
cd deploy/tekton
78+
chmod +x deploy-user-namespace.sh
79+
./deploy-user-namespace.sh <username>
3480

35-
# Cleanup
36-
chmod +x deploy/cleanup.sh
37-
./deploy/cleanup.sh
81+
# Example: Deploy for user "alice"
82+
./deploy-user-namespace.sh alice
3883
```
3984

40-
### For OpenShift 4.19+
41-
42-
```bash
43-
# Deploy to OpenShift
44-
chmod +x deploy/deploy-openshift.sh
45-
./deploy/deploy-openshift.sh
85+
### **User-Namespace Architecture**
4686

47-
# Cleanup
48-
chmod +x deploy/cleanup-openshift.sh
49-
./deploy/cleanup-openshift.sh
50-
```
87+
Each user gets their own isolated deployment:
88+
- **Namespace**: `ci-analysis-<username>`
89+
- **Complete Isolation**: All resources deployed per user
90+
- **No Shared Infrastructure**: Every user has their own pipeline stack
91+
- **Automatic GitHub Integration**: Webhook-triggered deployments
5192

5293
## 📋 Prerequisites
5394

95+
- **OpenShift 4.19+** or **Kubernetes 1.25+**
96+
- **Tekton Pipelines** installed on cluster
97+
- **Tekton Triggers** installed on cluster
5498
- **Node Architecture**: linux/amd64 nodes (required for Ollama)
55-
- Docker/Podman for building images
56-
- kubectl (for Kubernetes) or oc (for OpenShift)
57-
- At least 10GB available storage for model data
99+
- **Registry Access**: Quay.io or container registry credentials
100+
- **Storage**: At least 10GB per user for model data
58101

59102
## 🔧 Key Features
60103

61-
- **Node Selection**: Only schedules on linux/amd64 nodes
104+
- **Multi-User Support**: Complete isolation per user
105+
- **CI/CD Pipeline**: Automated build and deployment
106+
- **GitHub Integration**: Webhook-triggered deployments
62107
- **Security**: Non-root containers (OpenShift compatible)
63108
- **Persistence**: Model data persisted across restarts
64109
- **Health Checks**: Readiness and liveness probes
65-
- **External Access**: Ingress (K8s) or Route (OpenShift)
110+
- **External Access**: OpenShift Routes per user
66111

67-
## 📖 Full Documentation
112+
## 📖 Pipeline Components
68113

69-
For complete documentation including troubleshooting, production considerations, and advanced configuration, see:
70-
71-
- [KUBERNETES.md](../KUBERNETES.md) - Complete deployment guide
114+
The Tekton pipeline includes:
115+
1. **Git Clone** - Checkout source code
116+
2. **Create Namespace** - User-specific namespace creation
117+
3. **Build Image** - Container image build and push
118+
4. **Deploy Ollama** - AI model serving deployment
119+
5. **Deploy Agent** - Main application deployment
120+
6. **Load Model** - Download and configure AI model
121+
7. **Create Route** - External access configuration
72122

73123
## 🆘 Support
74124

75125
If you encounter issues:
76-
1. Check pod logs: `kubectl logs -f deployment/ci-analysis-agent -n ci-analysis`
77-
2. Verify node requirements: `kubectl get nodes --show-labels | grep -E "(arch|os)"`
78-
3. Check the main documentation: [KUBERNETES.md](../KUBERNETES.md)
126+
1. Check pipeline logs: `tkn pipelinerun logs --last -f -n ci-analysis-<username>`
127+
2. Verify deployments: `oc get all -n ci-analysis-<username>`
128+
3. Check webhook URL: `oc get route ci-analysis-agent-webhook -n ci-analysis-<username>`
129+
4. See detailed documentation: [tekton/README.md](tekton/README.md)
130+
131+
## 🏗️ Migration from K8s Manifests
132+
133+
The previous manual K8s/OpenShift deployment approach has been replaced with this automated Tekton pipeline approach for better CI/CD integration and multi-user support.

0 commit comments

Comments
 (0)