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

Commit 66da6fc

Browse files
committed
Merge branch 'dev' of https://github.com/janhq/cortex.cpp into s/fix/config-rc
2 parents 0776c59 + 7c3788d commit 66da6fc

File tree

76 files changed

+4282
-724
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+4282
-724
lines changed

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

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -137,13 +137,23 @@ jobs:
137137
138138
139139
- name: Run setup config
140+
if: runner.os != 'Linux'
140141
run: |
141142
cd engine
142143
echo "huggingFaceToken: ${{ secrets.HUGGINGFACE_TOKEN_READ }}" > ~/.cortexrc
143144
echo "gitHubToken: ${{ secrets.PAT_SERVICE_ACCOUNT }}" >> ~/.cortexrc
144145
# ./build/cortex
145146
cat ~/.cortexrc
146147
148+
- name: Run setup config
149+
if: runner.os == 'Linux'
150+
run: |
151+
cd engine
152+
echo "huggingFaceToken: ${{ secrets.HUGGINGFACE_TOKEN_READ }}" > ~/.config/cortexcpp/.cortexrc
153+
echo "gitHubToken: ${{ secrets.PAT_SERVICE_ACCOUNT }}" >> ~/.config/cortexcpp/.cortexrc
154+
# ./build/cortex
155+
cat ~/.config/cortexcpp/.cortexrc
156+
147157
- name: Run unit tests
148158
run: |
149159
cd engine
@@ -152,13 +162,24 @@ jobs:
152162
GITHUB_TOKEN: ${{ secrets.PAT_SERVICE_ACCOUNT }}
153163

154164
- name: Run setup config
165+
if: runner.os != 'Linux'
155166
run: |
156167
cd engine
157168
echo "apiServerPort: 3928" > ~/.cortexrc
158169
echo "huggingFaceToken: ${{ secrets.HUGGINGFACE_TOKEN_READ }}" >> ~/.cortexrc
159170
echo "gitHubToken: ${{ secrets.PAT_SERVICE_ACCOUNT }}" >> ~/.cortexrc
160171
# ./build/cortex
161172
cat ~/.cortexrc
173+
174+
- name: Run setup config
175+
if: runner.os == 'Linux'
176+
run: |
177+
cd engine
178+
echo "apiServerPort: 3928" > ~/.config/cortexcpp/.cortexrc
179+
echo "huggingFaceToken: ${{ secrets.HUGGINGFACE_TOKEN_READ }}" >> ~/.config/cortexcpp/.cortexrc
180+
echo "gitHubToken: ${{ secrets.PAT_SERVICE_ACCOUNT }}" >> ~/.config/cortexcpp/.cortexrc
181+
# ./build/cortex
182+
cat ~/.config/cortexcpp/.cortexrc
162183
163184
- name: Run e2e tests
164185
if: github.event_name != 'schedule' && runner.os != 'Windows' && github.event.pull_request.draft == false
@@ -226,6 +247,13 @@ jobs:
226247
cd engine
227248
make package
228249
250+
- name: Upload E2E Log
251+
if: failure()
252+
uses: actions/upload-artifact@v4
253+
with:
254+
name: e2e-log-${{ matrix.os }}-${{ matrix.name }}
255+
path: ./engine/e2e-test/logs
256+
229257
- name: Upload Artifact
230258
uses: actions/upload-artifact@v4
231259
with:
@@ -414,12 +442,21 @@ jobs:
414442
make build CMAKE_EXTRA_FLAGS="${{ matrix.cmake-flags }}" BUILD_DEPS_CMAKE_EXTRA_FLAGS="${{ matrix.build-deps-cmake-flags }}"
415443
416444
- name: Run setup config
445+
if: runner.os != 'Linux'
417446
run: |
418447
cd engine
419448
echo "gitHubToken: ${{ secrets.GITHUB_TOKEN }}" > ~/.cortexrc
420449
# ./build/cortex
421450
cat ~/.cortexrc
422451
452+
- name: Run setup config
453+
if: runner.os == 'Linux'
454+
run: |
455+
cd engine
456+
echo "gitHubToken: ${{ secrets.GITHUB_TOKEN }}" > ~/.config/cortexcpp/.cortexrc
457+
# ./build/cortex
458+
cat ~/.config/cortexcpp/.cortexrc
459+
423460
- name: Run unit tests
424461
run: |
425462
cd engine
@@ -428,12 +465,22 @@ jobs:
428465
GITHUB_TOKEN: ${{ secrets.PAT_SERVICE_ACCOUNT }}
429466

430467
- name: Run setup config
468+
if: runner.os != 'Linux'
431469
run: |
432470
cd engine
433471
echo "apiServerPort: 3928" > ~/.cortexrc
434472
echo "gitHubToken: ${{ secrets.GITHUB_TOKEN }}" > ~/.cortexrc
435473
# ./build/cortex
436474
cat ~/.cortexrc
475+
476+
- name: Run setup config
477+
if: runner.os == 'Linux'
478+
run: |
479+
cd engine
480+
echo "apiServerPort: 3928" > ~/.config/cortexcpp/.cortexrc
481+
echo "gitHubToken: ${{ secrets.GITHUB_TOKEN }}" > ~/.config/cortexcpp/.cortexrc
482+
# ./build/cortex
483+
cat ~/.config/cortexcpp/.cortexrc
437484
438485
- name: Run e2e tests
439486
if: github.event_name != 'schedule' && runner.os != 'Windows' && github.event.pull_request.draft == false

.github/workflows/test-cortexso-model-hub.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
run: |
6868
cd engine
6969
./build/cortex --version
70-
sed -i 's/huggingFaceToken: ""/huggingFaceToken: "${{ secrets.HUGGINGFACE_TOKEN_READ }}"/' ~/.cortexrc
70+
sed -i 's/huggingFaceToken: ""/huggingFaceToken: "${{ secrets.HUGGINGFACE_TOKEN_READ }}"/' ~/.config/cortexcpp/.cortexrc
7171
7272
- name: Run e2e tests
7373
run: |

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ build
1717
platform/cortex.exe
1818
platform/package-lock.json
1919
.vscode
20+
.vs
2021
platform/command
2122
platform/src/infrastructure/commanders/test/test_data
2223
**/vcpkg_installed

BUILDING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,8 @@ cd vcpkg
3333
```bash
3434
mkdir build
3535
cd build
36-
cmake .. -DBUILD_SHARED_LIBS=OFF -DCMAKE_TOOLCHAIN_FILE=../vcpkg/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=x64-windows-static
37-
cmake --build . --config Release
36+
cmake .. -DBUILD_SHARED_LIBS=OFF "-DCMAKE_TOOLCHAIN_FILE=..\vcpkg\scripts\buildsystems\vcpkg.cmake" -DVCPKG_TARGET_TRIPLET=x64-windows-static
37+
cmake --build . --config Release -j4
3838
```
3939

4040
4. Verify that Cortex.cpp is installed correctly by getting help information.

docker/entrypoint.sh

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22

33
# Install cortex.llamacpp engine
44

5-
echo "apiServerHost: 0.0.0.0" > /root/.cortexrc
6-
echo "enableCors: true" >> /root/.cortexrc
5+
mkdir -p /root/.config/cortexcpp
6+
echo "apiServerHost: 0.0.0.0" > /root/.config/cortexcpp/.cortexrc
7+
echo "enableCors: true" >> /root/.config/cortexcpp/.cortexrc
78

89
# Start the cortex server
910
cortex start
@@ -15,6 +16,6 @@ cortex engines list
1516

1617

1718
# Keep the container running by tailing the log files
18-
tail -f /root/cortexcpp/logs/cortex.log &
19-
tail -f /root/cortexcpp/logs/cortex-cli.log &
19+
tail -f /root/.local/share/cortexcpp/logs/cortex.log &
20+
tail -f /root/.local/share/cortexcpp/logs/cortex-cli.log &
2021
wait

0 commit comments

Comments
 (0)