Use intent model from archfc to pick prompt gateway (#328)

This commit is contained in:
Shuguang Chen 2024-12-20 13:25:01 -08:00 committed by GitHub
parent 67b8fd635e
commit ba7279becb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
151 changed files with 8642 additions and 10932 deletions

58
.github/workflows/e2e_archgw.yml vendored Normal file
View file

@ -0,0 +1,58 @@
name: e2e archgw tests
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest-m
defaults:
run:
working-directory: ./tests/archgw
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: build arch docker image
run: |
cd ../../ && docker build -f arch/Dockerfile . -t katanemo/archgw
- name: start archgw
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
run: |
docker compose up | tee &> archgw.logs &
- name: wait for archgw to be healthy
run: |
source common.sh && wait_for_healthz http://localhost:10000/healthz
- name: install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
export PATH="$HOME/.local/bin:$PATH"
- name: install test dependencies
run: |
poetry install
- name: run archgw tests
run: |
poetry run pytest || tail -100 archgw.logs
- name: stop archgw docker container
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
run: |
docker compose down

40
.github/workflows/e2e_model_server.yml vendored Normal file
View file

@ -0,0 +1,40 @@
name: e2e model server tests
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest-m
defaults:
run:
working-directory: ./tests/modelserver
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
export PATH="$HOME/.local/bin:$PATH"
- name: install model server and start it
run: |
cd ../../model_server/ && poetry install && poetry run archgw_modelserver start
- name: install test dependencies
run: |
poetry install
- name: run tests
run: |
poetry run pytest

47
.github/workflows/e2e_test_demos.yml vendored Normal file
View file

@ -0,0 +1,47 @@
name: e2e demo tests
on:
push:
branches:
- main
pull_request:
jobs:
test:
runs-on: ubuntu-latest-m
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
- name: build arch docker image
run: |
docker build -f arch/Dockerfile . -t katanemo/archgw
- name: install poetry
run: |
curl -sSL https://install.python-poetry.org | python3 -
- name: setup python venv
run: |
python -m venv venv
- name: install model server, arch gateway and test dependencies
run: |
source venv/bin/activate
cd model_server/ && echo "installing model server" && poetry install
cd ../arch/tools && echo "installing archgw cli" && poetry install
cd ../../demos/test_runner && echo "installing test dependencies" && poetry install
- name: run demo tests
env:
OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
run: |
source venv/bin/activate
cd demos/test_runner && sh run_demo_tests.sh

View file

@ -8,8 +8,7 @@ on:
jobs:
test:
runs-on: ubuntu-latest-m
# runs-on: gh-large-150gb-ssd
runs-on: ubuntu-latest
steps:
- name: Checkout code
@ -31,4 +30,4 @@ jobs:
MISTRAL_API_KEY: ${{ secrets.MISTRAL_API_KEY }}
run: |
python -mvenv venv
source venv/bin/activate && cd e2e_tests && bash run_e2e_tests.sh
source venv/bin/activate && cd tests/e2e && bash run_e2e_tests.sh

View file

@ -41,4 +41,4 @@ jobs:
PYTHONPATH: model_server # Ensure the app's path is available
run: |
cd model_server
poetry run pytest --maxfail=5 --disable-warnings
poetry run pytest