Skip to content

Commit bfd5d49

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

File tree

18 files changed

+633
-387
lines changed

18 files changed

+633
-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: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
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+
push:
8+
branches:
9+
- feat/e2e-test-cortexso-hub
10+
11+
jobs:
12+
build-and-test:
13+
runs-on: ${{ matrix.runs-on }}
14+
timeout-minutes: 1440
15+
strategy:
16+
fail-fast: false
17+
matrix:
18+
include:
19+
- os: "linux"
20+
name: "amd64"
21+
runs-on: "ubuntu-20-04-e2e-cortexcpp-model-hub"
22+
cmake-flags: "-DCORTEX_CPP_VERSION=${{github.head_ref}} -DCMAKE_BUILD_TEST=ON -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake"
23+
build-deps-cmake-flags: ""
24+
ccache-dir: ""
25+
steps:
26+
- name: Clone
27+
id: checkout
28+
uses: actions/checkout@v3
29+
with:
30+
submodules: recursive
31+
32+
- name: use python
33+
uses: actions/setup-python@v5
34+
with:
35+
python-version: "3.10"
36+
37+
- name: Install tools on Linux
38+
run: |
39+
sudo chown -R runner:runner /home/runner/cortexcpp
40+
python3 -m pip install awscli
41+
42+
- name: Download vcpkg cache from s3
43+
continue-on-error: true
44+
run: |
45+
aws s3 sync s3://${{ secrets.MINIO_BUCKET_NAME }}/cortex-cpp-vcpkg-linux /home/runner/.cache/vcpkg --endpoint ${{ secrets.MINIO_ENDPOINT }} --cli-read-timeout 0
46+
env:
47+
AWS_ACCESS_KEY_ID: "${{ secrets.MINIO_ACCESS_KEY_ID }}"
48+
AWS_SECRET_ACCESS_KEY: "${{ secrets.MINIO_SECRET_ACCESS_KEY }}"
49+
AWS_DEFAULT_REGION: "${{ secrets.MINIO_REGION }}"
50+
51+
- name: Configure vcpkg
52+
run: |
53+
cd engine
54+
make configure-vcpkg
55+
56+
- name: Build
57+
run: |
58+
cd engine
59+
make build CMAKE_EXTRA_FLAGS="${{ matrix.cmake-flags }}" BUILD_DEPS_CMAKE_EXTRA_FLAGS="${{ matrix.build-deps-cmake-flags }}"
60+
61+
- name: Run unit tests
62+
run: |
63+
cd engine
64+
make run-unit-tests
65+
66+
- name: Run setup config for linux
67+
shell: bash
68+
run: |
69+
cd engine
70+
./build/cortex --version
71+
sed -i 's/huggingFaceToken: ""/huggingFaceToken: "${{ secrets.HUGGINGFACE_TOKEN_READ }}"/' ~/.cortexrc
72+
73+
- name: Run e2e tests
74+
run: |
75+
cd engine
76+
cp build/cortex build/cortex-nightly
77+
cp build/cortex build/cortex-beta
78+
python -m pip install --upgrade pip
79+
python -m pip install -r e2e-test/requirements.txt
80+
python e2e-test/main.py
81+
pytest e2e-test\test_api_cortexso_hub_llamacpp_engine.py
82+
rm build/cortex-nightly
83+
rm build/cortex-beta
84+
env:
85+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86+
HF_TOKEN: ${{ secrets.HUGGINGFACE_TOKEN_E2E }}
87+
88+
- name: Pre-package
89+
run: |
90+
cd engine
91+
make pre-package DESTINATION_BINARY_NAME="cortex"
92+
93+
- name: Package
94+
run: |
95+
cd engine
96+
make package
97+
98+
- name: Upload Artifact
99+
uses: actions/upload-artifact@v4
100+
with:
101+
name: cortex-${{ matrix.os }}-${{ matrix.name }}
102+
path: ./engine/cortex
103+
104+
105+
- name: Upload linux vcpkg cache to s3
106+
continue-on-error: true
107+
if: always()
108+
run: |
109+
aws s3 sync /home/runner/.cache/vcpkg s3://${{ secrets.MINIO_BUCKET_NAME }}/cortex-cpp-vcpkg-linux --endpoint ${{ secrets.MINIO_ENDPOINT }}
110+
env:
111+
AWS_ACCESS_KEY_ID: "${{ secrets.MINIO_ACCESS_KEY_ID }}"
112+
AWS_SECRET_ACCESS_KEY: "${{ secrets.MINIO_SECRET_ACCESS_KEY }}"
113+
AWS_DEFAULT_REGION: "${{ secrets.MINIO_REGION }}"

0 commit comments

Comments
 (0)