-
Notifications
You must be signed in to change notification settings - Fork 24
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
👷 Add integration test to the CI #140
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
name: Optimum TPU / Test TGI on TPU / Integration Tests | ||
|
||
on: | ||
schedule: | ||
- cron: '0 4 * * *' # run at 4 AM UTC | ||
# This can be used to allow manually triggering nightlies from the web interface | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
integration-tests: | ||
name: Run TGI Integration Tests | ||
runs-on: | ||
group: gcp-ct5lp-hightpu-8t | ||
|
||
env: | ||
PJRT_DEVICE: TPU | ||
HF_HUB_CACHE: /mnt/hf_cache/cache_huggingface | ||
HF_TOKEN: ${{ secrets.HF_TOKEN_OPTIMUM_TPU_CI }} | ||
TPU_ENV: ${{ vars.V5_LITEPOD_8_ENV}} | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Install Python | ||
run: | | ||
sudo apt-get update -y | ||
sudo apt-get install -y python3 python3-pip | ||
sudo ln -s /usr/bin/python3 /usr/bin/python | ||
|
||
# To build the docker image in the ci, we need to use the network host option | ||
- name: Build TGI Docker Image | ||
run: | | ||
make tpu-tgi NETWORK=host | ||
|
||
- name: Run integration tests | ||
run: | | ||
make tgi_docker_test |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,11 +42,14 @@ clean: | |
rm -rf dist deps | ||
make -C text-generation-inference/server/ clean | ||
|
||
# normal usage: make tpu-tgi | ||
# ci usage: make tpu-tgi NETWORK=host, to build the docker image with the network host option | ||
tpu-tgi: | ||
docker build --rm -f text-generation-inference/docker/Dockerfile \ | ||
--build-arg VERSION=$(VERSION) \ | ||
--build-arg TGI_VERSION=$(TGI_VERSION) \ | ||
--ulimit nofile=100000:100000 \ | ||
$(if $(NETWORK),--network $(NETWORK),) \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why do we need the network hot at this step? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is needed for the CI. If you build with the default network, some requests during the build process are blocked. For example, the protobuf installation fails. |
||
-t huggingface/optimum-tpu:$(VERSION)-tgi . | ||
docker tag huggingface/optimum-tpu:$(VERSION)-tgi huggingface/optimum-tpu:latest | ||
|
||
|
@@ -111,6 +114,6 @@ tgi_test: test_installs tgi_server | |
-exec python -m pip install --force-reinstall {} \; | ||
python -m pytest -sv text-generation-inference/tests -m torch_xla | ||
|
||
tgi_docker_test: tpu-tgi | ||
tgi_docker_test: | ||
python -m pip install -r text-generation-inference/integration-tests/requirements.txt | ||
python -m pytest -sv text-generation-inference/integration-tests |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -16,3 +16,4 @@ pytest >= 7.4.0 | |
pytest-asyncio >= 0.21.1 | ||
docker >= 6.1.3 | ||
Levenshtein | ||
loguru |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this does not have
container
section, does it means it runs on the VM directly?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, indeed, if you run in the container directly, you have networking issues. So we use the VM directly that spawn the container