From b81c461cc30fb95730f0787c1f782ff910e29902 Mon Sep 17 00:00:00 2001 From: Baptiste Date: Wed, 8 Jan 2025 08:40:18 +0000 Subject: [PATCH] wip --- .../workflows/test-pytorch-xla-tpu-tgi-integration.yml | 10 ++-------- Makefile | 3 +++ 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/test-pytorch-xla-tpu-tgi-integration.yml b/.github/workflows/test-pytorch-xla-tpu-tgi-integration.yml index 4d2e848f..c7eacbff 100644 --- a/.github/workflows/test-pytorch-xla-tpu-tgi-integration.yml +++ b/.github/workflows/test-pytorch-xla-tpu-tgi-integration.yml @@ -33,16 +33,10 @@ jobs: sudo apt-get install -y python3 python3-pip sudo ln -s /usr/bin/python3 /usr/bin/python - # We cannot use make tpu-tgi here because we need to build the docker image with the network host option + # To build the docker image in the ci, we need to use the network host option - name: Build TGI Docker Image run: | - docker build --rm -f text-generation-inference/docker/Dockerfile \ - --build-arg VERSION=$(VERSION) \ - --build-arg TGI_VERSION=$(TGI_VERSION) \ - --ulimit nofile=100000:100000 \ - --network host \ - -t huggingface/optimum-tpu:$(VERSION)-tgi . - docker tag huggingface/optimum-tpu:$(VERSION)-tgi huggingface/optimum-tpu:latest + make tpu-tgi NETWORK=host - name: Run integration tests run: | diff --git a/Makefile b/Makefile index 4a613a10..8a1600ed 100644 --- a/Makefile +++ b/Makefile @@ -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),) \ # b -t huggingface/optimum-tpu:$(VERSION)-tgi . docker tag huggingface/optimum-tpu:$(VERSION)-tgi huggingface/optimum-tpu:latest