mirror of
https://github.com/frappe/gunicorn.git
synced 2026-07-01 18:21:30 +08:00
Add a complete example demonstrating dirty workers with sentence-transformers for text embeddings via FastAPI: - EmbeddingApp DirtyApp that loads and manages the ML model - FastAPI endpoints for /embed and /health - Docker and docker-compose configuration - Integration tests with numpy similarity checks - GitHub Actions CI workflow
43 lines
947 B
YAML
43 lines
947 B
YAML
name: Embedding Service Integration Tests
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'examples/embedding_service/**'
|
|
- 'gunicorn/dirty/**'
|
|
pull_request:
|
|
paths:
|
|
- 'examples/embedding_service/**'
|
|
- 'gunicorn/dirty/**'
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
timeout-minutes: 15
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Build and start service
|
|
run: |
|
|
cd examples/embedding_service
|
|
docker compose up -d --build
|
|
docker compose logs -f &
|
|
|
|
- name: Wait for healthy
|
|
run: |
|
|
for i in {1..30}; do
|
|
curl -s http://127.0.0.1:8000/health && break
|
|
sleep 2
|
|
done
|
|
|
|
- name: Run tests
|
|
run: |
|
|
pip install requests numpy
|
|
python examples/embedding_service/test_embedding.py
|
|
|
|
- name: Cleanup
|
|
if: always()
|
|
run: |
|
|
cd examples/embedding_service
|
|
docker compose down
|