Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.

Commit 98ade84

Browse files
committed
Merge branch 'dev' into feat/e2e-test-cortexso-hub
2 parents 2da5f29 + 57ed629 commit 98ade84

File tree

18 files changed

+630
-387
lines changed

18 files changed

+630
-387
lines changed

.github/ISSUE_TEMPLATE/bug_report.yml

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@ body:
99
required: true
1010
attributes:
1111
label: "Cortex version"
12-
description: "**Tip:** The version is in the app's bottom right corner"
13-
12+
description: "**Tip:** `cortex -v` outputs the version number"
13+
1414
- type: textarea
1515
validations:
1616
required: true
1717
attributes:
18-
label: "Describe the Bug"
19-
description: "A clear & concise description of the bug"
18+
label: "Describe the issue and expected behaviour"
19+
description: "A clear & concise description of the issue encountered"
2020

2121
- type: textarea
2222
attributes:
@@ -31,20 +31,30 @@ body:
3131
attributes:
3232
label: "Screenshots / Logs"
3333
description: |
34-
You can find logs in: ~/cortex/logs
34+
Please include cortex-cli.log and cortex.log files in: ~/cortex/logs/
3535
3636
- type: checkboxes
3737
attributes:
3838
label: "What is your OS?"
3939
options:
40-
- label: MacOS
4140
- label: Windows
42-
- label: Linux
41+
- label: Mac Silicon
42+
- label: Mac Intel
43+
- label: Linux / Ubuntu
4344

4445
- type: checkboxes
4546
attributes:
4647
label: "What engine are you running?"
4748
options:
4849
- label: cortex.llamacpp (default)
4950
- label: cortex.tensorrt-llm (Nvidia GPUs)
50-
- label: cortex.onnx (NPUs, DirectML)
51+
- label: cortex.onnx (NPUs, DirectML)
52+
53+
- type: input
54+
validations:
55+
required: true
56+
attributes:
57+
label: "Hardware Specs eg OS version, GPU"
58+
description:
59+
60+

.github/workflows/cortex-cpp-quality-gate.yml

Lines changed: 10 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,7 @@ name: CI Quality Gate Cortex CPP
33
on:
44
pull_request:
55
types: [opened, synchronize, reopened, ready_for_review]
6-
paths:
7-
[
8-
"engine/**",
9-
".github/workflows/cortex-cpp-quality-gate.yml"
10-
]
6+
paths: ["engine/**", ".github/workflows/cortex-cpp-quality-gate.yml"]
117
workflow_dispatch:
128

139
env:
@@ -27,25 +23,25 @@ jobs:
2723
runs-on: "ubuntu-20-04-cuda-12-0"
2824
cmake-flags: "-DCORTEX_CPP_VERSION=${{github.event.pull_request.head.sha}} -DCMAKE_BUILD_TEST=ON -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake"
2925
build-deps-cmake-flags: ""
30-
ccache-dir: ''
26+
ccache-dir: ""
3127
- os: "mac"
3228
name: "amd64"
3329
runs-on: "macos-selfhosted-12"
3430
cmake-flags: "-DCORTEX_CPP_VERSION=${{github.event.pull_request.head.sha}} -DCMAKE_BUILD_TEST=ON -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake"
3531
build-deps-cmake-flags: ""
36-
ccache-dir: ''
32+
ccache-dir: ""
3733
- os: "mac"
3834
name: "arm64"
3935
runs-on: "macos-silicon"
4036
cmake-flags: "-DCORTEX_CPP_VERSION=${{github.event.pull_request.head.sha}} -DCMAKE_BUILD_TEST=ON -DMAC_ARM64=ON -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake"
4137
build-deps-cmake-flags: ""
42-
ccache-dir: ''
38+
ccache-dir: ""
4339
- os: "windows"
4440
name: "amd64"
4541
runs-on: "windows-cuda-12-0"
4642
cmake-flags: "-DCORTEX_CPP_VERSION=${{github.event.pull_request.head.sha}} -DCMAKE_BUILD_TEST=ON -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=C:/w/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static -DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja"
4743
build-deps-cmake-flags: "-DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja"
48-
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
44+
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
4945
steps:
5046
- name: Clone
5147
id: checkout
@@ -56,7 +52,7 @@ jobs:
5652
- name: use python
5753
uses: actions/setup-python@v5
5854
with:
59-
python-version: '3.10'
55+
python-version: "3.10"
6056

6157
- name: Install tools on Linux
6258
if: runner.os == 'Linux'
@@ -128,8 +124,7 @@ jobs:
128124
cp build/cortex build/cortex-nightly
129125
cp build/cortex build/cortex-beta
130126
python -m pip install --upgrade pip
131-
python -m pip install pytest
132-
python -m pip install requests
127+
python -m pip install -r e2e-test/requirements.txt
133128
python e2e-test/main.py
134129
rm build/cortex-nightly
135130
rm build/cortex-beta
@@ -143,8 +138,7 @@ jobs:
143138
cp build/cortex.exe build/cortex-nightly.exe
144139
cp build/cortex.exe build/cortex-beta.exe
145140
python -m pip install --upgrade pip
146-
python -m pip install pytest
147-
python -m pip install requests
141+
python -m pip install -r e2e-test/requirements.txt
148142
python e2e-test/main.py
149143
rm build/cortex-nightly.exe
150144
rm build/cortex-beta.exe
@@ -155,7 +149,7 @@ jobs:
155149
run: |
156150
cd engine
157151
make pre-package DESTINATION_BINARY_NAME="cortex"
158-
152+
159153
- name: Package
160154
run: |
161155
cd engine
@@ -188,4 +182,4 @@ jobs:
188182
env:
189183
AWS_ACCESS_KEY_ID: "${{ secrets.MINIO_ACCESS_KEY_ID }}"
190184
AWS_SECRET_ACCESS_KEY: "${{ secrets.MINIO_SECRET_ACCESS_KEY }}"
191-
AWS_DEFAULT_REGION: "${{ secrets.MINIO_REGION }}"
185+
AWS_DEFAULT_REGION: "${{ secrets.MINIO_REGION }}"
Lines changed: 110 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,110 @@
1+
name: Test cortexso Model Hub
2+
3+
on:
4+
schedule:
5+
- cron: "0 16 * * *" # every day at 23:00 UTC+7
6+
workflow_dispatch:
7+
8+
jobs:
9+
build-and-test:
10+
runs-on: ${{ matrix.runs-on }}
11+
timeout-minutes: 1440
12+
strategy:
13+
fail-fast: false
14+
matrix:
15+
include:
16+
- os: "linux"
17+
name: "amd64"
18+
runs-on: "ubuntu-20-04-e2e-cortexcpp-model-hub"
19+
cmake-flags: "-DCORTEX_CPP_VERSION=${{github.head_ref}} -DCMAKE_BUILD_TEST=ON -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake"
20+
build-deps-cmake-flags: ""
21+
ccache-dir: ""
22+
steps:
23+
- name: Clone
24+
id: checkout
25+
uses: actions/checkout@v3
26+
with:
27+
submodules: recursive
28+
29+
- name: use python
30+
uses: actions/setup-python@v5
31+
with:
32+
python-version: "3.10"
33+
34+
- name: Install tools on Linux
35+
run: |
36+
sudo chown -R runner:runner /home/runner/cortexcpp
37+
python3 -m pip install awscli
38+
39+
- name: Download vcpkg cache from s3
40+
continue-on-error: true
41+
run: |
42+
aws s3 sync s3://${{ secrets.MINIO_BUCKET_NAME }}/cortex-cpp-vcpkg-linux /home/runner/.cache/vcpkg --endpoint ${{ secrets.MINIO_ENDPOINT }} --cli-read-timeout 0
43+
env:
44+
AWS_ACCESS_KEY_ID: "${{ secrets.MINIO_ACCESS_KEY_ID }}"
45+
AWS_SECRET_ACCESS_KEY: "${{ secrets.MINIO_SECRET_ACCESS_KEY }}"
46+
AWS_DEFAULT_REGION: "${{ secrets.MINIO_REGION }}"
47+
48+
- name: Configure vcpkg
49+
run: |
50+
cd engine
51+
make configure-vcpkg
52+
53+
- name: Build
54+
run: |
55+
cd engine
56+
make build CMAKE_EXTRA_FLAGS="${{ matrix.cmake-flags }}" BUILD_DEPS_CMAKE_EXTRA_FLAGS="${{ matrix.build-deps-cmake-flags }}"
57+
58+
- name: Run unit tests
59+
run: |
60+
cd engine
61+
make run-unit-tests
62+
63+
- name: Run setup config for linux
64+
shell: bash
65+
run: |
66+
cd engine
67+
./build/cortex --version
68+
sed -i 's/huggingFaceToken: ""/huggingFaceToken: "${{ secrets.HUGGINGFACE_TOKEN_READ }}"/' ~/.cortexrc
69+
70+
- name: Run e2e tests
71+
run: |
72+
cd engine
73+
cp build/cortex build/cortex-nightly
74+
cp build/cortex build/cortex-beta
75+
python -m pip install --upgrade pip
76+
python -m pip install -r e2e-test/requirements.txt
77+
python e2e-test/main.py
78+
pytest e2e-test/test_api_cortexso_hub_llamacpp_engine.py
79+
rm build/cortex-nightly
80+
rm build/cortex-beta
81+
env:
82+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
83+
HF_TOKEN: ${{ secrets.HUGGINGFACE_TOKEN_E2E }}
84+
85+
- name: Pre-package
86+
run: |
87+
cd engine
88+
make pre-package DESTINATION_BINARY_NAME="cortex"
89+
90+
- name: Package
91+
run: |
92+
cd engine
93+
make package
94+
95+
- name: Upload Artifact
96+
uses: actions/upload-artifact@v4
97+
with:
98+
name: cortex-${{ matrix.os }}-${{ matrix.name }}
99+
path: ./engine/cortex
100+
101+
102+
- name: Upload linux vcpkg cache to s3
103+
continue-on-error: true
104+
if: always()
105+
run: |
106+
aws s3 sync /home/runner/.cache/vcpkg s3://${{ secrets.MINIO_BUCKET_NAME }}/cortex-cpp-vcpkg-linux --endpoint ${{ secrets.MINIO_ENDPOINT }}
107+
env:
108+
AWS_ACCESS_KEY_ID: "${{ secrets.MINIO_ACCESS_KEY_ID }}"
109+
AWS_SECRET_ACCESS_KEY: "${{ secrets.MINIO_SECRET_ACCESS_KEY }}"
110+
AWS_DEFAULT_REGION: "${{ secrets.MINIO_REGION }}"

0 commit comments

Comments
 (0)