mirror of
https://github.com/BerriAI/litellm.git
synced 2026-08-28 05:25:59 +00:00
81 lines
2.4 KiB
YAML
81 lines
2.4 KiB
YAML
name: "Weekly Load Anomaly Check"
|
|
|
|
on:
|
|
schedule:
|
|
- cron: "0 12 * * 6"
|
|
workflow_dispatch:
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
weekly-load-anomaly:
|
|
if: github.event_name != 'schedule' || github.repository == 'BerriAI/litellm'
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 45
|
|
services:
|
|
postgres:
|
|
image: postgres:16.6
|
|
env:
|
|
POSTGRES_USER: llmproxy
|
|
POSTGRES_PASSWORD: dbpassword9090
|
|
POSTGRES_DB: litellm
|
|
ports:
|
|
- 5432:5432
|
|
options: >-
|
|
--health-cmd "pg_isready -U llmproxy"
|
|
--health-interval 5s
|
|
--health-timeout 5s
|
|
--health-retries 10
|
|
env:
|
|
DATABASE_URL: postgresql://llmproxy:dbpassword9090@localhost:5432/litellm
|
|
LITELLM_MASTER_KEY: sk-weekly-anomaly-check
|
|
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
|
|
AWS_BEARER_TOKEN_BEDROCK: ${{ secrets.AWS_BEARER_TOKEN_BEDROCK }}
|
|
steps:
|
|
- uses: actions/checkout@08eba0b27e820071cde6df949e0beb9ba4906955 # v4.3.0
|
|
with:
|
|
persist-credentials: false
|
|
|
|
- name: Set up Python
|
|
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5.6.0
|
|
with:
|
|
python-version: "3.12"
|
|
|
|
- name: Set up uv
|
|
uses: ./.github/actions/setup-uv-with-retries
|
|
with:
|
|
version: "0.10.9"
|
|
|
|
- name: Install dependencies
|
|
run: |
|
|
.github/scripts/uv_sync_with_retries.sh --frozen --group ci --group proxy-dev --extra proxy
|
|
|
|
- name: Generate Prisma client
|
|
env:
|
|
PRISMA_BINARY_CACHE_DIR: ${{ runner.temp }}/prisma-cache
|
|
run: |
|
|
uv run --no-sync prisma generate --schema litellm/proxy/schema.prisma
|
|
|
|
- name: Start the proxy
|
|
run: |
|
|
nohup uv run --no-sync litellm --config tests/e2e/load/weekly_anomaly_config.yml --port 4000 > proxy.log 2>&1 &
|
|
for _ in $(seq 1 90); do
|
|
if curl -fs http://localhost:4000/health/liveliness > /dev/null; then
|
|
exit 0
|
|
fi
|
|
sleep 2
|
|
done
|
|
echo "proxy never became live"
|
|
tail -n 100 proxy.log
|
|
exit 1
|
|
|
|
- name: Run the weekly session anomaly test
|
|
env:
|
|
E2E_WEEKLY_ANOMALY: "1"
|
|
run: |
|
|
uv run --no-sync pytest tests/e2e/load/test_weekly_session_anomaly_e2e.py -v --tb=short -rA
|
|
|
|
- name: Show proxy log on failure
|
|
if: failure()
|
|
run: tail -n 300 proxy.log
|