From cfe9ac7e3341938c93fa79210a4216274213edcd Mon Sep 17 00:00:00 2001 From: ishaansehgal99 Date: Wed, 14 Feb 2024 16:01:04 -0800 Subject: [PATCH] fix: makefile edit for unit tests --- .github/workflows/e2e-preset-test.yml | 2 +- .github/workflows/preset-image-build.yml | 3 ++- .github/workflows/tests.yml | 4 ++++ Makefile | 2 ++ docker/presets/llama-2/Dockerfile | 1 - 5 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/e2e-preset-test.yml b/.github/workflows/e2e-preset-test.yml index 641ac2ab1..db96dcec2 100644 --- a/.github/workflows/e2e-preset-test.yml +++ b/.github/workflows/e2e-preset-test.yml @@ -33,7 +33,7 @@ jobs: - name: Determine Affected Models id: affected_models run: | - PR_BRANCH=${{ github.head_ref }} \ + PR_BRANCH=${{ github.ref_name }} \ python3 .github/workflows/kind-cluster/determine_models.py - name: Print Determined Models diff --git a/.github/workflows/preset-image-build.yml b/.github/workflows/preset-image-build.yml index 42ef6c7a6..fd86ac741 100644 --- a/.github/workflows/preset-image-build.yml +++ b/.github/workflows/preset-image-build.yml @@ -118,5 +118,6 @@ jobs: if: ${{ always() }} run: | kubectl get job --no-headers -o custom-columns=":metadata.name" | grep "^docker-build-job-${{ matrix.model.name }}-[0-9]" | xargs -r kubectl delete job - kubectl get pods --no-headers -o custom-columns=":metadata.name" | grep "^docker-build-job-${{ matrix.model.name }}-[0-9]" | xargs -r kubectl delete pod + # Job deletion above deletes associated pods + # kubectl get pods --no-headers -o custom-columns=":metadata.name" | grep "^docker-build-job-${{ matrix.model.name }}-[0-9]" | xargs -r kubectl delete pod diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5b04b414d..29d14ac24 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -38,6 +38,10 @@ jobs: run: | make unit-test + - name: Run inference api unit tests + run: | + make inference-api-e2e + - name: Upload Codecov report uses: codecov/codecov-action@v4 with: diff --git a/Makefile b/Makefile index fd9c5ca54..1a5445c48 100644 --- a/Makefile +++ b/Makefile @@ -82,6 +82,8 @@ fmt: ## Run go fmt against code. unit-test: ## Run unit tests. go test -v $(shell go list ./pkg/... ./api/... | grep -v /vendor) -race -coverprofile=coverage.txt -covermode=atomic go tool cover -func=coverage.txt + +inference-api-e2e: pip install -r presets/inference/text-generation/requirements.txt pytest -o log_cli=true -o log_cli_level=INFO . diff --git a/docker/presets/llama-2/Dockerfile b/docker/presets/llama-2/Dockerfile index 9b7f3d394..103afb297 100644 --- a/docker/presets/llama-2/Dockerfile +++ b/docker/presets/llama-2/Dockerfile @@ -17,7 +17,6 @@ RUN git clone https://github.com/facebookresearch/llama WORKDIR /workspace/llama -# RUN sed -i $'/torch.distributed.init_process_group("nccl")/c\\ import datetime\\\n torch.distributed.init_process_group("nccl", timeout=datetime.timedelta(days=365*100))' /workspace/llama/llama/generation.py RUN ["/bin/bash", "-c", "sed -i $'/torch.distributed.init_process_group(\"nccl\")/c\\ import datetime\\\n torch.distributed.init_process_group(\"nccl\", timeout=datetime.timedelta(days=365*100))' /workspace/llama/llama/generation.py"] RUN pip install -e .