From 0f1eb880ab40931c00309ac152ee968bde950eb1 Mon Sep 17 00:00:00 2001 From: sangjanai Date: Fri, 28 Feb 2025 12:01:15 +0700 Subject: [PATCH 1/2] fix: docker CI --- .github/workflows/cortex-cpp-quality-gate.yml | 40 +++++++++++++++++++ .github/workflows/test-cortexso-model-hub.yml | 2 +- docker/entrypoint.sh | 8 ++-- 3 files changed, 45 insertions(+), 5 deletions(-) diff --git a/.github/workflows/cortex-cpp-quality-gate.yml b/.github/workflows/cortex-cpp-quality-gate.yml index 68d4d9c09..2918840b6 100644 --- a/.github/workflows/cortex-cpp-quality-gate.yml +++ b/.github/workflows/cortex-cpp-quality-gate.yml @@ -137,6 +137,7 @@ jobs: - name: Run setup config + if: runner.os != 'Linux' run: | cd engine echo "huggingFaceToken: ${{ secrets.HUGGINGFACE_TOKEN_READ }}" > ~/.cortexrc @@ -144,6 +145,15 @@ jobs: # ./build/cortex cat ~/.cortexrc + - name: Run setup config + if: runner.os == 'Linux' + run: | + cd engine + echo "huggingFaceToken: ${{ secrets.HUGGINGFACE_TOKEN_READ }}" > ~/.config/cortexcpp/.cortexrc + echo "gitHubToken: ${{ secrets.PAT_SERVICE_ACCOUNT }}" >> ~/.config/cortexcpp/.cortexrc + # ./build/cortex + cat ~/.config/cortexcpp/.cortexrc + - name: Run unit tests run: | cd engine @@ -152,6 +162,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.PAT_SERVICE_ACCOUNT }} - name: Run setup config + if: runner.os != 'Linux' run: | cd engine echo "apiServerPort: 3928" > ~/.cortexrc @@ -159,6 +170,16 @@ jobs: echo "gitHubToken: ${{ secrets.PAT_SERVICE_ACCOUNT }}" >> ~/.cortexrc # ./build/cortex cat ~/.cortexrc + + - name: Run setup config + if: runner.os == 'Linux' + run: | + cd engine + echo "apiServerPort: 3928" > ~/.config/cortexcpp/.cortexrc + echo "huggingFaceToken: ${{ secrets.HUGGINGFACE_TOKEN_READ }}" >> ~/.config/cortexcpp/.cortexrc + echo "gitHubToken: ${{ secrets.PAT_SERVICE_ACCOUNT }}" >> ~/.config/cortexcpp/.cortexrc + # ./build/cortex + cat ~/.config/cortexcpp/.cortexrc - name: Run e2e tests if: github.event_name != 'schedule' && runner.os != 'Windows' && github.event.pull_request.draft == false @@ -414,12 +435,21 @@ jobs: make build CMAKE_EXTRA_FLAGS="${{ matrix.cmake-flags }}" BUILD_DEPS_CMAKE_EXTRA_FLAGS="${{ matrix.build-deps-cmake-flags }}" - name: Run setup config + if: runner.os != 'Linux' run: | cd engine echo "gitHubToken: ${{ secrets.GITHUB_TOKEN }}" > ~/.cortexrc # ./build/cortex cat ~/.cortexrc + - name: Run setup config + if: runner.os == 'Linux' + run: | + cd engine + echo "gitHubToken: ${{ secrets.GITHUB_TOKEN }}" > ~/.config/cortexcpp/.cortexrc + # ./build/cortex + cat ~/.config/cortexcpp/.cortexrc + - name: Run unit tests run: | cd engine @@ -428,12 +458,22 @@ jobs: GITHUB_TOKEN: ${{ secrets.PAT_SERVICE_ACCOUNT }} - name: Run setup config + if: runner.os != 'Linux' run: | cd engine echo "apiServerPort: 3928" > ~/.cortexrc echo "gitHubToken: ${{ secrets.GITHUB_TOKEN }}" > ~/.cortexrc # ./build/cortex cat ~/.cortexrc + + - name: Run setup config + if: runner.os == 'Linux' + run: | + cd engine + echo "apiServerPort: 3928" > ~/.config/cortexcpp/.cortexrc + echo "gitHubToken: ${{ secrets.GITHUB_TOKEN }}" > ~/.config/cortexcpp/.cortexrc + # ./build/cortex + cat ~/.config/cortexcpp/.cortexrc - name: Run e2e tests if: github.event_name != 'schedule' && runner.os != 'Windows' && github.event.pull_request.draft == false diff --git a/.github/workflows/test-cortexso-model-hub.yml b/.github/workflows/test-cortexso-model-hub.yml index 6e1539420..3bf7f96ab 100644 --- a/.github/workflows/test-cortexso-model-hub.yml +++ b/.github/workflows/test-cortexso-model-hub.yml @@ -67,7 +67,7 @@ jobs: run: | cd engine ./build/cortex --version - sed -i 's/huggingFaceToken: ""/huggingFaceToken: "${{ secrets.HUGGINGFACE_TOKEN_READ }}"/' ~/.cortexrc + sed -i 's/huggingFaceToken: ""/huggingFaceToken: "${{ secrets.HUGGINGFACE_TOKEN_READ }}"/' ~/.config/cortexcpp/.cortexrc - name: Run e2e tests run: | diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index 761c5bc19..d8d4c4522 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -2,8 +2,8 @@ # Install cortex.llamacpp engine -echo "apiServerHost: 0.0.0.0" > /root/.cortexrc -echo "enableCors: true" >> /root/.cortexrc +echo "apiServerHost: 0.0.0.0" > /root/.config/cortexcpp/.cortexrc +echo "enableCors: true" >> /root/.config/cortexcpp/.cortexrc # Start the cortex server cortex start @@ -15,6 +15,6 @@ cortex engines list # Keep the container running by tailing the log files -tail -f /root/cortexcpp/logs/cortex.log & -tail -f /root/cortexcpp/logs/cortex-cli.log & +tail -f /root/.local/share/cortexcpp/logs/cortex.log & +tail -f /root/.local/share/cortexcpp/logs/cortex-cli.log & wait \ No newline at end of file From 3c0da9e186c4e853b4f909a58fdfc2297e5cc4d3 Mon Sep 17 00:00:00 2001 From: sangjanai Date: Fri, 28 Feb 2025 12:46:39 +0700 Subject: [PATCH 2/2] fix: create cortexcpp folder --- docker/entrypoint.sh | 1 + engine/e2e-test/api/engines/test_api_get_list_engine.py | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/docker/entrypoint.sh b/docker/entrypoint.sh index d8d4c4522..a3880e2ef 100644 --- a/docker/entrypoint.sh +++ b/docker/entrypoint.sh @@ -2,6 +2,7 @@ # Install cortex.llamacpp engine +mkdir -p /root/.config/cortexcpp echo "apiServerHost: 0.0.0.0" > /root/.config/cortexcpp/.cortexrc echo "enableCors: true" >> /root/.config/cortexcpp/.cortexrc diff --git a/engine/e2e-test/api/engines/test_api_get_list_engine.py b/engine/e2e-test/api/engines/test_api_get_list_engine.py index 9a1552de6..7a77057c2 100644 --- a/engine/e2e-test/api/engines/test_api_get_list_engine.py +++ b/engine/e2e-test/api/engines/test_api_get_list_engine.py @@ -24,7 +24,7 @@ def setup_and_teardown(self): def test_api_get_list_engines_successfully(self): # Data test engine= "llama-cpp" - name= "linux-amd64-avx-cuda-11-7" + name= "linux-amd64-avx" version= "v0.1.35-27.10.24" data = {"version": version, "variant": name}