forked from SciPhi-AI/R2R
-
Notifications
You must be signed in to change notification settings - Fork 0
131 lines (104 loc) · 3.37 KB
/
integration-test-workflow-debian.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: Debian R2R Docker Build and Integration Test (Debian GNU/Linux 12 (bookworm) amd64)
on:
push:
branches:
- '**'
workflow_dispatch:
jobs:
build-and-test:
runs-on: [ self-hosted, Linux ]
permissions:
packages: write
contents: read
id-token: write
actions: write
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
TELEMETRY_ENABLED: false
steps:
- uses: actions/checkout@v4
- name: Clean up disk space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: true
android: true
dotnet: true
haskell: true
large-packages: true
swap-storage: true
- name: Docker Auth
uses: docker/login-action@v3
with:
username: ${{ secrets.RAGTORICHES_DOCKER_UNAME }}
password: ${{ secrets.RAGTORICHES_DOCKER_TOKEN }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set image name
id: image
run: |
echo "IMAGE_NAME=ragtoriches/dev" >> $GITHUB_OUTPUT
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: ./py/Dockerfile
push: true
tags: ragtoriches/dev:latest
platforms: linux/amd64
no-cache: true
pull: true
- name: Run cloud LLM integration tests in Docker
working-directory: ./py
run: |
python3 -m venv venv
source venv/bin/activate
pip install -e .
echo "R2R Version"
r2r version
echo "R2R Serve --docker"
r2r serve --docker --exclude-neo4j=true --exclude-ollama=true --image=ragtoriches/dev:latest
echo "Waiting for services to start..."
sleep 30
echo "Ingest Data"
r2r ingest-sample-files
echo "Get Documents Overview"
r2r documents-overview
echo "Get Document Chunks"
r2r document-chunks 93123a68-d668-51de-8291-92162730dc87
echo "Delete Documents"
r2r delete --keys=document_id --values=b736292c-11e6-5453-9686-055da3edb866
echo "Vector Search"
r2r search --query="What was Uber'\''s profit in 2020?"
echo "Hybrid Search"
r2r search --query="What is a fierce nerd?" --use-hybrid-search
echo "Basic RAG"
r2r rag --query="What was Uber'\''s profit in 2020?"
echo "RAG with Hybrid Search"
r2r rag --query="Who is John Snow?" --use-hybrid-search
echo "Streaming RAG"
r2r rag --query="What was Lyft'\''s profit in 2020?" --stream
echo "Users Overview"
r2r users-overview
echo "Analytics"
r2r analytics --filters '{"search_latencies": "search_latency"}' --analysis-types '{"search_latencies": ["basic_statistics", "search_latency"]}'
echo "Logging"
r2r logs
echo "Docker Down"
r2r docker-down
cleanup:
needs: build-and-test
runs-on: [ self-hosted, Linux ]
if: always()
steps:
- name: Clean up Virtual Environment
run: |
if [ -d "venv" ]; then
deactivate || true
rm -rf venv
fi
docker stop $(docker ps -a -q) || true
docker system prune -af --volumes
docker network prune --force
docker volume rm $(docker volume ls -qf dangling=true) || true