Skip to content

Commit e6d843c

Browse files
author
TaimoorKhan10
committed
Initial commit: Enterprise-RAG-Framework - Production-grade Retrieval Augmented Generation system
0 parents  commit e6d843c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

56 files changed

+12615
-0
lines changed

.github/workflows/ci-cd.yml

Lines changed: 86 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,86 @@
1+
name: Enterprise RAG CI/CD
2+
3+
on:
4+
push:
5+
branches: [ main, master, dev ]
6+
pull_request:
7+
branches: [ main, master ]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
strategy:
13+
matrix:
14+
python-version: [3.8, 3.9, '3.10']
15+
16+
steps:
17+
- uses: actions/checkout@v3
18+
- name: Set up Python ${{ matrix.python-version }}
19+
uses: actions/setup-python@v4
20+
with:
21+
python-version: ${{ matrix.python-version }}
22+
- name: Install dependencies
23+
run: |
24+
python -m pip install --upgrade pip
25+
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
26+
pip install pytest pytest-cov flake8 black
27+
- name: Lint with flake8
28+
run: |
29+
# stop the build if there are Python syntax errors or undefined names
30+
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
31+
# exit-zero treats all errors as warnings
32+
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
33+
- name: Format check with black
34+
run: |
35+
black --check .
36+
- name: Test with pytest
37+
run: |
38+
pytest --cov=src tests/
39+
40+
build-and-push:
41+
needs: test
42+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
43+
runs-on: ubuntu-latest
44+
steps:
45+
- uses: actions/checkout@v3
46+
47+
- name: Set up Docker Buildx
48+
uses: docker/setup-buildx-action@v2
49+
50+
- name: Login to DockerHub
51+
uses: docker/login-action@v2
52+
with:
53+
username: ${{ secrets.DOCKERHUB_USERNAME }}
54+
password: ${{ secrets.DOCKERHUB_TOKEN }}
55+
56+
- name: Build and push
57+
uses: docker/build-push-action@v4
58+
with:
59+
context: .
60+
file: ./docker/Dockerfile
61+
push: true
62+
tags: ${{ secrets.DOCKERHUB_USERNAME }}/enterprise-rag:latest
63+
64+
deploy:
65+
needs: build-and-push
66+
if: github.event_name == 'push' && (github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master')
67+
runs-on: ubuntu-latest
68+
69+
steps:
70+
- uses: actions/checkout@v3
71+
72+
- name: Install kubectl
73+
uses: azure/setup-kubectl@v3
74+
with:
75+
version: 'latest'
76+
77+
- name: Set Kubernetes context
78+
uses: azure/k8s-set-context@v3
79+
with:
80+
kubeconfig: ${{ secrets.KUBE_CONFIG }}
81+
82+
- name: Deploy to Kubernetes
83+
run: |
84+
# Update image tag in deployment if needed
85+
kubectl apply -f k8s/deployment.yaml
86+
kubectl rollout status deployment/enterprise-rag

.gitignore

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
# Python
2+
__pycache__/
3+
*.py[cod]
4+
*$py.class
5+
*.so
6+
.Python
7+
build/
8+
develop-eggs/
9+
dist/
10+
downloads/
11+
eggs/
12+
.eggs/
13+
lib/
14+
lib64/
15+
parts/
16+
sdist/
17+
var/
18+
wheels/
19+
*.egg-info/
20+
.installed.cfg
21+
*.egg
22+
23+
# Virtual Environments
24+
venv/
25+
env/
26+
ENV/
27+
28+
# IDE files
29+
.idea/
30+
.vscode/
31+
*.swp
32+
*.swo
33+
.DS_Store
34+
35+
# Jupyter Notebook
36+
.ipynb_checkpoints
37+
38+
# Project specific
39+
data/index/
40+
logs/
41+
*.log
42+
.env
43+
*.pem
44+
45+
# Vector store files
46+
*.faiss
47+
*.index
48+
*.bin
49+
*.pkl
50+
51+
# Test cache
52+
.pytest_cache/
53+
.coverage
54+
htmlcov/
55+
56+
# Documentation builds
57+
_build/
58+
_static/
59+
_templates/
60+
61+
# Misc
62+
tmp/
63+
temp/

0 commit comments

Comments
 (0)