-
Notifications
You must be signed in to change notification settings - Fork 209
154 lines (140 loc) · 5.13 KB
/
agentic_rag_integration.yml
File metadata and controls
154 lines (140 loc) · 5.13 KB
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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
name: agentic_rag integration tests
on:
push:
branches: [main]
paths:
- 'apps/agentic_rag/src/**'
- 'apps/agentic_rag/tests/conftest.py'
- 'apps/agentic_rag/tests/integration/**'
- 'apps/agentic_rag/requirements.txt'
- 'apps/agentic_rag/docker-compose.test.yml'
- '.github/workflows/agentic_rag_integration.yml'
workflow_dispatch: {}
schedule:
# Nightly at 04:17 UTC. Odd minute to avoid the top-of-hour queue.
- cron: '17 4 * * *'
concurrency:
group: agentic-rag-integration-${{ github.ref }}
cancel-in-progress: true
jobs:
integration:
name: Full-stack integration
runs-on: ubuntu-latest
timeout-minutes: 45
defaults:
run:
working-directory: apps/agentic_rag
env:
ORACLE_DB_USERNAME: SYSTEM
ORACLE_DB_PASSWORD: OraclePW1_
ORACLE_DB_DSN: localhost:1521/FREEPDB1
OLLAMA_HOST: http://127.0.0.1:11434
OLLAMA_TEST_MODEL: gemma3:270m
steps:
- uses: actions/checkout@v4
- name: Free disk space
# Oracle DB Free image is ~2GB, torch deps are ~2GB, Ollama model + binary
# is ~500MB. Default GitHub runner has 14GB free on /. Strip preinstalled
# software we don't need to avoid running out mid-test.
run: |
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/lib/android \
/usr/local/share/boost "${AGENT_TOOLSDIRECTORY}" || true
df -h
working-directory: ${{ github.workspace }}
- name: Set up Python 3.12
uses: actions/setup-python@v5
with:
python-version: '3.12'
cache: 'pip'
cache-dependency-path: apps/agentic_rag/requirements.txt
- name: Start Oracle Database Free container
run: |
docker run -d \
--name oracle-free \
-p 1521:1521 \
-e ORACLE_PWD=${ORACLE_DB_PASSWORD} \
-e ORACLE_CHARACTERSET=AL32UTF8 \
container-registry.oracle.com/database/free:latest
echo "Oracle container started. Waiting for DB to be ready..."
- name: Install Ollama
run: |
curl -fsSL https://ollama.com/install.sh | sh
# Start Ollama in the background.
nohup ollama serve > /tmp/ollama.log 2>&1 &
# Wait for it to accept connections.
for i in {1..30}; do
if curl -sf http://127.0.0.1:11434/api/tags > /dev/null; then
echo "Ollama is up"
break
fi
sleep 2
done
- name: Pull Ollama test model
run: ollama pull ${OLLAMA_TEST_MODEL}
- name: Install Python dependencies
# Install only what the integration tests need, not the full
# requirements.txt (which pulls in torch, docling, etc. and can OOM
# the runner). oracledb + langchain-oracledb drive the DB tests;
# ollama is the Python SDK; playwright drives the Gradio UI test;
# requests + httpx cover HTTP; pytest-asyncio lets us drop back
# to async if needed.
run: |
python -m pip install --upgrade pip
pip install \
pytest \
pytest-asyncio \
oracledb \
"langchain-oracledb" \
"langchain-core" \
ollama \
playwright \
requests \
httpx \
"fastapi" \
"uvicorn" \
"python-multipart" \
pyyaml
- name: Install Playwright Chromium
run: |
python -m playwright install --with-deps chromium
- name: Wait for Oracle DB to be ready
# Oracle DB Free takes ~90-150 seconds to finish startup. Poll the
# container's built-in status script.
run: |
for i in {1..60}; do
if docker exec oracle-free /opt/oracle/checkDBStatus.sh 2>/dev/null | grep -q "READY"; then
echo "Oracle DB is ready"
docker exec oracle-free /opt/oracle/checkDBStatus.sh || true
break
fi
echo "Waiting for Oracle DB... (${i}/60)"
sleep 5
done
# Final readiness probe: can we actually connect?
python -c "
import oracledb, os
c = oracledb.connect(
user=os.environ['ORACLE_DB_USERNAME'],
password=os.environ['ORACLE_DB_PASSWORD'],
dsn=os.environ['ORACLE_DB_DSN'],
)
cur = c.cursor()
cur.execute('SELECT 1 FROM DUAL')
assert cur.fetchone() == (1,)
print('Oracle DB connection verified')
"
- name: Run integration tests
# -m '' overrides the default 'not integration' from pyproject.toml,
# then -m integration selects just the integration suite.
run: |
pytest tests/integration/ -v -m integration \
--tb=short \
-o addopts=""
- name: Dump Oracle container logs on failure
if: failure()
run: |
docker logs --tail 200 oracle-free || true
cat /tmp/ollama.log 2>/dev/null | tail -100 || true
- name: Stop Oracle container
if: always()
run: docker stop oracle-free || true