mirror of
https://github.com/Canner/WrenAI.git
synced 2026-10-29 17:51:48 +08:00
* update readme * update poetry version to 1.8.3 * explicitly use uvloop * explicitly using httptools * use ORJSON * refine readme
65 lines
2.4 KiB
YAML
65 lines
2.4 KiB
YAML
# This workflow will install Python dependencies, run tests and lint with a single version of Python
|
|
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python
|
|
|
|
name: AI Service CI
|
|
|
|
on:
|
|
push:
|
|
paths:
|
|
- 'wren-ai-service/**'
|
|
pull_request:
|
|
types: [ labeled ]
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
concurrency:
|
|
# avoid mis-canceling the ci runs while other labels are added to the PR, so we add the label name as the condition
|
|
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.event.label.name == 'ci/ai-service' && github.event.number || github.sha }}
|
|
cancel-in-progress: true
|
|
|
|
defaults:
|
|
run:
|
|
working-directory: wren-ai-service
|
|
|
|
jobs:
|
|
ci:
|
|
if: ${{ github.event.label.name == 'ci/ai-service' || github.event_name == 'push' }}
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
python-version: [ "3.12.0" ]
|
|
poetry-version: [ "1.8.3" ]
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- name: Set up Python 3.12.0
|
|
uses: actions/setup-python@v4
|
|
with:
|
|
python-version: ${{ matrix.python-version }}
|
|
- name: Install Poetry
|
|
uses: abatilo/actions-poetry@v2
|
|
with:
|
|
poetry-version: ${{ matrix.poetry-version }}
|
|
- name: Install the project dependencies
|
|
run: poetry install
|
|
- name: Prepare testing environment and Run tests
|
|
run: |
|
|
mkdir -p src/eval/wren-engine/etc
|
|
cp src/eval/wren-engine/config.properties.example src/eval/wren-engine/etc/config.properties
|
|
sed -i "s|bigquery.credentials-key=.*|bigquery.credentials-key=${{ secrets.BIGQUERY_CREDENTIALS_KEY }}|" src/eval/wren-engine/etc/config.properties
|
|
poetry run python -m src.prepare_mdl_json --dataset_name book_2
|
|
docker run -d -p 8080:8080 --name wren-engine -v $(pwd)/src/eval/wren-engine/etc:/usr/src/app/etc ghcr.io/canner/wren-engine:latest
|
|
make run-qdrant
|
|
poetry run pytest
|
|
make stop-qdrant
|
|
docker stop wren-engine && docker rm wren-engine
|
|
env:
|
|
ENV: dev
|
|
LLM_PROVIDER: openai
|
|
DOCUMENT_STORE_PROVIDER: qdrant
|
|
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
|
|
OPENAI_GENERATION_MODEL: gpt-3.5-turbo
|
|
WREN_ENGINE_ENDPOINT: http://localhost:8080
|
|
QDRANT_HOST: localhost
|