Skip to content
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
54e0ab6
feat: add intial docker compose setup
saurabhraghuvanshii Dec 28, 2025
d5344f0
Merge branch 'main' into docker
saurabhraghuvanshii Dec 29, 2025
632f070
feat: add for GPU docker
saurabhraghuvanshii Dec 29, 2025
0db7b23
fix: forntend build
saurabhraghuvanshii Dec 29, 2025
8980fe1
fix: api in ngix
saurabhraghuvanshii Dec 29, 2025
f45e7e3
Merge branch 'main' into docker
saurabhraghuvanshii Dec 30, 2025
32f372a
Merge branch 'main' into docker
saurabhraghuvanshii Jan 3, 2026
a9ef3a1
chore: update readme with new instructions
saurabhraghuvanshii Jan 3, 2026
e434872
update address
saurabhraghuvanshii Jan 3, 2026
ebb18ed
Merge branch 'main' into docker
saurabhraghuvanshii Jan 3, 2026
23d05a9
chore: update Dockergpu for cuda faling address
saurabhraghuvanshii Jan 3, 2026
65db612
Merge branch 'main' into docker
cnu1812 Jan 5, 2026
ad9e97c
chore: python 3.12
saurabhraghuvanshii Jan 5, 2026
4b48937
fix: typescript typerror
saurabhraghuvanshii Jan 7, 2026
a5949bd
fix: module error
saurabhraghuvanshii Jan 9, 2026
a78e262
fix: eslint and module for frontend and backend pytest install
saurabhraghuvanshii Jan 9, 2026
a7aaa00
fix pytest
saurabhraghuvanshii Jan 9, 2026
e23ab27
Add extra pytest install
saurabhraghuvanshii Jan 9, 2026
aaf60d1
Changed from CommonJS to nodenext
saurabhraghuvanshii Jan 9, 2026
cddb7a4
add pytest install in requirements.txt
saurabhraghuvanshii Jan 9, 2026
e266b7f
revert requirment.txt
saurabhraghuvanshii Jan 9, 2026
7b386b1
add support for import at build time
saurabhraghuvanshii Jan 9, 2026
7f2bddf
Merge branch 'main' into docker
saurabhraghuvanshii Jan 16, 2026
f165537
fix: import issue of env
saurabhraghuvanshii Jan 16, 2026
b870f8f
Merge branch 'main' into docker
berviantoleo Jan 21, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -44,3 +44,5 @@ src/main/webapp/static/*
.settings
.classpath
.project

.env
135 changes: 111 additions & 24 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,11 @@ This plugin was developed as part of a Google Summer of Code 2025 project.
## Prerequisites

- **Python**: 3.11+
- **Build tools**: `make`, `cmake` (≥3.14), C/C++ compiler (`gcc`/`clang`/MSVC)
- **Java**: JDK 11+ and Maven 3.6+ (for plugin development)
- **Node.js**: 20+ (for frontend)
- **Build tools**: `make`, `cmake` (≥3.14), C/C++ compiler
- **Java**: JDK 11+ and Maven 3.6+ (for Jenkins plugin)

### Example system package installation
**Install system dependencies:**

```bash
# Ubuntu/Debian/WSL
Expand All @@ -24,57 +25,143 @@ sudo apt install -y make cmake gcc g++ python3.11 python3.11-venv python3.11-dev
brew install cmake [email protected] && xcode-select --install
```

## Quick Start

### 1. Setup Backend

## Getting Started
From project root:

### Setup
```bash
# For CPU-only (recommended for most systems)
make setup-backend IS_CPU_REQ=1

# For GPU support
make setup-backend
```

Complete the full setup process in [docs/setup.md](docs/setup.md) before running any commands. This includes creating a virtual environment, installing Python dependencies (including llama-cpp-python), and configuring the data pipeline.
### 2. Download LLM Model

### Running the API
Download the Mistral model and place it in the correct location:

```bash
mkdir -p chatbot-core/api/models/mistral
# Download mistral-7b-instruct-v0.2.Q4_K_M.gguf from:
# https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.2-GGUF
# Place it in: chatbot-core/api/models/mistral/
```

### 3. Run API

Once setup is complete, from the **project root directory** run:
```bash
make api
```

The API will be available at `http://127.0.0.1:8000`.
API will be available at `http://127.0.0.1:8000`

**Verify it's working:**

Verify it's working:
```bash
curl -X POST http://127.0.0.1:8000/api/chatbot/sessions
```

### 4. Build Frontend

```bash
make build-frontend
```

See [docs/README.md](docs/README.md) for detailed explanations.
### 5. Run with Docker (Alternative)

## Troubleshooting
**Prerequisites:**

- Docker and Docker Compose installed

**llama-cpp-python installation fails**: Ensure build tools are installed and use Python 3.11+
**Steps:**

**API crashes on startup**:
This may be caused by missing optional dependencies (e.g. `retriv`).
1. **Download LLM Model** (if not already done):

```bash
mkdir -p chatbot-core/api/models/mistral
# Download mistral-7b-instruct-v0.2.Q4_K_M.gguf from:
# https://huggingface.co/TheBloke/Mistral-7B-Instruct-v0.2-GGUF
# Place it in: chatbot-core/api/models/mistral/
```

2. **Build and run containers:**

```bash
docker-compose up --build
```

3. **Access services:**
- Backend API: `http://localhost:8000`
- Frontend UI: `http://localhost:80`
- API Docs: `http://localhost:8000/docs`

**Stop containers:**

Try installing missing packages:
```bash
pip install llama-cpp-python retriv
docker-compose down
```

**General issues**: Run `make clean && make <target>`, verify your virtual environment is activated, and ensure all dependencies from [docs/setup.md](docs/setup.md) are installed.
**For GPU support:**

## Developer Documentation
```bash
docker-compose -f docker-compose.gpu.yml up --build
```

## Data Pipeline

Development-related documentation can be found in the [`docs/`](docs/) directory.
To populate the knowledge base with Jenkins documentation:

## Contributing
```bash
make run-data-pipeline
```

Refer to our [contribution guidelines](https://github.com/jenkinsci/.github/blob/master/CONTRIBUTING.md)
This collects, preprocesses, chunks, and stores data in the vector database.

## Testing

```bash
# Run all tests
make run-test

# Frontend tests only
make run-frontend-tests

# Backend tests only
make run-backend-tests
```

## Troubleshooting

**llama-cpp-python installation fails:**

```bash
sudo apt install build-essential cmake # Linux
brew install cmake # macOS
pip install llama-cpp-python
```

**API crashes on startup:**

```bash
cd chatbot-core && source venv/bin/activate
pip install llama-cpp-python retriv
```

**Clean and rebuild:**

```bash
make clean && make setup-backend IS_CPU_REQ=1
```

## LICENSE
## Documentation

Licensed under MIT, see [LICENSE](LICENSE.md)
- Setup details: [docs/setup.md](docs/setup.md)
- Architecture: [docs/README.md](docs/README.md)
- API docs: [docs/chatbot-core/api/](docs/chatbot-core/api/)

## License

MIT License - see [LICENSE.md](LICENSE.md)
49 changes: 49 additions & 0 deletions chatbot-core/.dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Python
__pycache__/
*.py[cod]
*$py.class
*.so
.Python
venv/
env/
ENV/
.venv

# IDE
.vscode/
.idea/
*.swp
*.swo
*~

# Testing
.pytest_cache/
.coverage
htmlcov/
.tox/

# Logs
*.log
logs/

# Data directories (will be mounted as volumes)
data/raw/
data/processed/
data/embeddings/
data/chunking/

# Model files (will be mounted as volumes)
api/models/mistral/

# Git
.git/
.gitignore

# Documentation
docs/
*.md

# OS
.DS_Store
Thumbs.db

52 changes: 52 additions & 0 deletions chatbot-core/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
FROM python:3.14-slim AS builder

RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
gfortran \
pkg-config \
libxml2-dev \
libxslt1-dev \
libopenblas-dev \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY requirements-cpu.txt /app/requirements.cpu.txt

RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.cpu.txt

FROM python:3.14-slim

RUN apt-get update && apt-get install -y \
libstdc++6 \
libxml2 \
libxslt1.1 \
libopenblas0 \
curl \
&& rm -rf /var/lib/apt/lists/*

RUN useradd -m -u 1000 appuser && \
mkdir -p /app/data /app/models && \
chown -R appuser:appuser /app

WORKDIR /app

COPY --from=builder /usr/local/lib/python3.14/site-packages /usr/local/lib/python3.14/site-packages
COPY --from=builder /usr/local/bin/uvicorn /usr/local/bin/

COPY --chown=appuser:appuser . /app

ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1

USER appuser

EXPOSE 8000

HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -f http://localhost:8000/docs || exit 1

CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]
68 changes: 68 additions & 0 deletions chatbot-core/Dockerfile.gpu
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
FROM nvidia/cuda:12.6.0-runtime-ubuntu22.04 AS base

RUN apt-get update && apt-get install -y \
software-properties-common \
&& add-apt-repository ppa:deadsnakes/ppa \
&& apt-get update && apt-get install -y \
python3.14 \
python3.14-dev \
python3.14-distutils \
&& rm -rf /var/lib/apt/lists/*

RUN curl -sS https://bootstrap.pypa.io/get-pip.py | python3.14

RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.14 1 && \
update-alternatives --install /usr/bin/python3 python3 /usr/bin/python3.14 1

FROM base AS builder

RUN apt-get update && apt-get install -y \
build-essential \
cmake \
git \
gfortran \
pkg-config \
libxml2-dev \
libxslt1-dev \
libopenblas-dev \
&& rm -rf /var/lib/apt/lists/*

WORKDIR /app

COPY requirements.txt /app/requirements.gpu.txt

RUN pip install --no-cache-dir --upgrade pip && \
pip install --no-cache-dir -r requirements.gpu.txt

FROM base

RUN apt-get update && apt-get install -y \
libstdc++6 \
libxml2 \
libxslt1.1 \
libopenblas0 \
curl \
&& rm -rf /var/lib/apt/lists/*

RUN useradd -m -u 1000 appuser && \
mkdir -p /app/data /app/models && \
chown -R appuser:appuser /app

WORKDIR /app

COPY --from=builder /usr/local/lib/python3.14/site-packages /usr/local/lib/python3.14/site-packages
COPY --from=builder /usr/local/bin/uvicorn /usr/local/bin/

COPY --chown=appuser:appuser . /app

ENV PYTHONPATH=/app
ENV PYTHONUNBUFFERED=1

USER appuser

EXPOSE 8000

HEALTHCHECK --interval=30s --timeout=10s --start-period=40s --retries=3 \
CMD curl -f http://localhost:8000/docs || exit 1

CMD ["uvicorn", "api.main:app", "--host", "0.0.0.0", "--port", "8000"]
2 changes: 2 additions & 0 deletions chatbot-core/requirements-cpu.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ python-dateutil==2.9.0.post0
setuptools==80.9.0
typing-extensions>=4.14.1
diskcache==5.6.3
faiss-cpu==1.13.2
fastapi==0.115.12
filelock==3.18.0
fsspec==2025.5.1
greenlet==3.2.2
Expand Down
22 changes: 12 additions & 10 deletions chatbot-core/requirements.txt
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
# =========================
# Testing
# =========================
pytest==8.4.1
pytest-cov==6.2.1
pytest-mock==3.14.1

# =========================
# Core API Dependencies
# =========================
annotated-types==0.7.0
anyio==4.9.0
astroid==3.3.10
beautifulsoup4==4.13.4
certifi==2025.4.26
charset-normalizer==3.4.2
click==8.2.1
contourpy==1.3.2
cycler==0.12.1
dill==0.4.0
diskcache==5.6.3
faiss-cpu==1.13.2
fastapi==0.115.12
pydantic==2.12.5
uvicorn[standard]==0.34.3
Expand Down
Loading