-
Notifications
You must be signed in to change notification settings - Fork 45
115 lines (98 loc) · 3.91 KB
/
integration_run.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
name: Run Pebblo Integration Tests
on:
schedule:
- cron: '30 2,14 * * *'
workflow_dispatch: # Activate this workflow manually
env:
PYTHON_VERSION: ${{ github.event.inputs.python_version || '3.11.x' }}
OPENAI_API_KEY_SECRET: ${{ secrets.OPENAI_API_KEY }}
SLACK_TOKEN: ${{ secrets.SLACK_TOKEN }}
SLACK_CH: ${{ secrets.SLACK_CH }}
jobs:
Setup_Pebblo_Run_Tests:
runs-on: ubuntu-latest
strategy:
matrix:
langchain-community-version: ["0.2.10", "0.2.12", "0.2.16", "0.3.0"]
python-version: ["3.10.15", "3.11.10", "3.12.6"]
name: Running tests on Python ${{ matrix.python-version }} & langchain-community ${{ matrix.langchain-community-version }}
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v4
with:
ref: 'main'
python-version: ${{ matrix.python-version }}
- name: Build Pebblo
run: |
pip install build
python -m build --wheel
ls -la dist/
- name: Install Pebblo Packages
run: |
echo 'Install Pebblo Package'
pkg_file=$(ls dist | grep .whl)
pip3 install dist/$pkg_file --force-reinstall
pip3 install --upgrade pip
- name: Start Pebblo Server
run: |
echo 'Running Pebblo server'
sleep 10
pebblo &
sleep 120
- name: Verify Pebblo Server
run: |
cat /tmp/logs/pebblo.log
if grep -q "Uvicorn running on http://localhost:8000 (Press CTRL+C to quit)" /tmp/logs/pebblo.log; then
echo "Server started successfully."
else
echo "Unexpected issue detected at server."
exit 1
fi
- name: Update requirements.txt with langchain-community version
run: |
sed -i "s/langchain-community/langchain-community==${{ matrix.langchain-community-version }}/" tests/integration/samples/requirements.txt
- name: Install Required Sample Application Dependencies
run: |
echo 'Install Sample Application dependency'
pip3 install --upgrade pip
pip3 install -r tests/integration/samples/requirements.txt --force-reinstall
- name: Run Sample RAG App
run: |
export OPENAI_API_KEY=$OPENAI_API_KEY_SECRET
echo 'Running pebblo_csvloader Samples'
cd tests/integration/samples/pebblo_csv_loader
python3 pebblo_csvloader.py
cd ../../
sleep 300
- name: Check Pebblo App Run Logs
run: |
cat /tmp/logs/pebblo.log
- name: Upload Pebblo App Run Logs as Artifact
uses: actions/upload-artifact@v4
with:
name: Pebblo_Report_${{ matrix.python-version }}_${{ matrix.langchain-community-version }}
path: |
/tmp/logs/pebblo.log
- name: Check logs for Pebblo Report
run: |
if grep -q "INFO - PDF report generated, please check path : /home/runner/.pebblo/" /tmp/logs/pebblo.log; then
echo "Report Generated Successfully."
else
echo "Unexpected issue detected at running sample app."
cat /tmp/logs/pebblo.log
exit 1
fi
- name: Upload Pebblo Report File
run: |
cd /home/runner/.pebblo/Pebblo_Automation_Testing_CSVLoader
curl -F file=@pebblo_report.pdf https://slack.com/api/files.upload -H "Authorization: Bearer $SLACK_TOKEN" -F channels=$SLACK_CH -F "initial_comment=Pebblo Nightly Report"
- name: Report Status if test case or build failure
if: always()
uses: ravsamhq/notify-slack-action@master
with:
status: ${{ job.status }}
notify_when: 'failure'
env:
SLACK_WEBHOOK_URL: ${{ secrets.WEBHOOK_SECRET }}