mirror of
https://github.com/fauxpilot/fauxpilot.git
synced 2025-08-14 02:28:06 -07:00
Add basic CI that tests the Python backend (#124)
* Basic action that runs pytest * fix indentation * debugging actions :( * pull the images in a separate step so it doesn't take so long to build * Split out the container build * Another try, fixing missing env vars
This commit is contained in:
parent
fd484a2b03
commit
1b2b8ec251
3 changed files with 31 additions and 1 deletions
22
.github/workflows/python_backend_tests.yaml
vendored
Normal file
22
.github/workflows/python_backend_tests.yaml
vendored
Normal file
|
@ -0,0 +1,22 @@
|
|||
name: FauxPilot Python Backend Tests
|
||||
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v3
|
||||
- uses: actions/setup-python@v4
|
||||
- name: Install dependencies
|
||||
run: |
|
||||
python -m pip install --upgrade pip
|
||||
pip install -r tests/python_backend/requirements.txt
|
||||
- name: Build container
|
||||
run: |
|
||||
cp tests/python_backend/runner.env .env &&
|
||||
docker compose build &&
|
||||
rm -f .env
|
||||
- name: Run tests
|
||||
run: pytest tests
|
||||
|
8
tests/python_backend/runner.env
Normal file
8
tests/python_backend/runner.env
Normal file
|
@ -0,0 +1,8 @@
|
|||
NUM_GPUS=1
|
||||
GPUS=0
|
||||
API_EXTERNAL_PORT=5000
|
||||
TRITON_HOST=triton
|
||||
TRITON_PORT=8001
|
||||
MODEL=py-codegen-350M-mono
|
||||
MODEL_DIR=${HOME}/models/py-Salesforce-codegen-350M-mono
|
||||
HF_CACHE_DIR=${HOME}/.cache/huggingface
|
|
@ -128,7 +128,7 @@ def test_python_backend(n_gpus: int):
|
|||
enter_input(proc, r".*share (your )?huggingface cache[^:]+: ?", "y")
|
||||
enter_input(proc, r".*cache directory[^:]+: ?", "") # default
|
||||
enter_input(proc, r".*use int8[^:]+: ?", "n")
|
||||
enter_input(proc, r".*run FauxPilot\? \[y/n\] ", "n")
|
||||
enter_input(proc, r".*run FauxPilot\? \[y/n\] ", "n", timeout=120)
|
||||
|
||||
# copy $root/.env to $curdir/test.env
|
||||
shutil.copy(str(root/".env"), str(curdir/"test.env"))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue