From 518717379d7a3f52412cf65049e19018e00e0521 Mon Sep 17 00:00:00 2001 From: Baptiste Date: Wed, 8 Jan 2025 08:26:03 +0000 Subject: [PATCH] fix(ci): fix flaky docker build behavior in ci --- .github/workflows/test-pytorch-xla-tpu-tgi-integration.yml | 3 ++- Makefile | 3 +++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test-pytorch-xla-tpu-tgi-integration.yml b/.github/workflows/test-pytorch-xla-tpu-tgi-integration.yml index b0c78471..305f8e10 100644 --- a/.github/workflows/test-pytorch-xla-tpu-tgi-integration.yml +++ b/.github/workflows/test-pytorch-xla-tpu-tgi-integration.yml @@ -32,9 +32,10 @@ jobs: 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 + make tpu-tgi NETWORK=host - name: Run integration tests run: | diff --git a/Makefile b/Makefile index 4a613a10..5d2f4085 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),) \ -t huggingface/optimum-tpu:$(VERSION)-tgi . docker tag huggingface/optimum-tpu:$(VERSION)-tgi huggingface/optimum-tpu:latest