Skip to content

Commit 4ea1b6b

Browse files
authored
Merge pull request #1851 from janhq/chore/v1.0.9-rc1
chore: sync dev to main v1.0.9-rc1
2 parents b94549c + f8c1df6 commit 4ea1b6b

File tree

121 files changed

+11608
-1124
lines changed

Some content is hidden

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

121 files changed

+11608
-1124
lines changed

.github/workflows/beta-build.yml

Lines changed: 23 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ jobs:
6767
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
6868

6969
build-linux-x64:
70-
uses: ./.github/workflows/template-build-linux-x64.yml
70+
uses: ./.github/workflows/template-build-linux.yml
7171
secrets: inherit
7272
needs: [get-update-version, create-draft-release, get-cortex-llamacpp-latest-version]
7373
with:
@@ -79,6 +79,22 @@ jobs:
7979
channel: beta
8080
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
8181
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
82+
arch: amd64
83+
84+
build-linux-arm64:
85+
uses: ./.github/workflows/template-build-linux.yml
86+
secrets: inherit
87+
needs: [get-update-version, create-draft-release, get-cortex-llamacpp-latest-version]
88+
with:
89+
ref: ${{ github.ref }}
90+
public_provider: github
91+
new_version: ${{ needs.get-update-version.outputs.new_version }}
92+
runs-on: ubuntu-2004-arm64
93+
cmake-flags: "-DCORTEX_VARIANT=beta -DCORTEX_CPP_VERSION='v${{ needs.get-update-version.outputs.new_version }}' -DCMAKE_TOOLCHAIN_FILE=/home/runner/actions-runner/_work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake"
94+
channel: beta
95+
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
96+
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
97+
arch: arm64
8298

8399
build-docker-x64:
84100
uses: ./.github/workflows/template-build-docker-x64.yml
@@ -111,7 +127,7 @@ jobs:
111127
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
112128

113129
noti-discord:
114-
needs: [get-update-version, create-draft-release, build-macos, build-windows-x64, build-linux-x64, update_release]
130+
needs: [get-update-version, create-draft-release, build-macos, build-windows-x64, build-linux-x64, build-linux-arm64, update_release]
115131
runs-on: ubuntu-latest
116132
permissions:
117133
contents: write
@@ -136,9 +152,13 @@ jobs:
136152
- Network Installer: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-mac-universal-network-installer.pkg
137153
- Local Installer: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-mac-universal-local-installer.pkg
138154
- Binary: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-mac-universal.tar.gz
139-
- Linux Deb:
155+
- Linux amd64 Deb:
140156
- Network Installer: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-linux-amd64-network-installer.deb
141157
- Local Installer: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-linux-amd64-local-installer.deb
142158
- Binary: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-linux-amd64.tar.gz
159+
- Linux amd64 Deb:
160+
- Network Installer: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-linux-arm64-network-installer.deb
161+
- Local Installer: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-linux-arm64-local-installer.deb
162+
- Binary: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-linux-arm64.tar.gz
143163
- Docker: menloltd/cortex:beta-${{ env.VERSION }}
144164
- Github Release: https://github.com/janhq/cortex.cpp/releases/tag/v${{ env.VERSION }}

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

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,12 @@ jobs:
2020
fail-fast: false
2121
matrix:
2222
include:
23+
- os: "linux"
24+
name: "arm64"
25+
runs-on: "ubuntu-2004-arm64"
26+
cmake-flags: "-DCORTEX_CPP_VERSION=${{github.event.pull_request.head.sha}} -DCMAKE_BUILD_TEST=ON -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake"
27+
build-deps-cmake-flags: ""
28+
ccache-dir: ""
2329
- os: "linux"
2430
name: "amd64"
2531
runs-on: "ubuntu-20-04-cuda-12-0"
@@ -52,6 +58,7 @@ jobs:
5258
submodules: recursive
5359

5460
- name: use python
61+
continue-on-error: true
5562
uses: actions/setup-python@v5
5663
with:
5764
python-version: "3.10"
@@ -90,15 +97,44 @@ jobs:
9097
AWS_DEFAULT_REGION: "${{ secrets.MINIO_REGION }}"
9198

9299
- name: Configure vcpkg
100+
if: runner.os != 'Linux'
101+
run: |
102+
cd engine
103+
make configure-vcpkg
104+
105+
- name: Configure vcpkg linux amd64
106+
if: runner.os != 'Linux'
107+
run: |
108+
cd engine
109+
make configure-vcpkg
110+
111+
- name: Configure vcpkg linux arm64
112+
if: runner.os == 'Linux'
93113
run: |
94114
cd engine
115+
# Set env if arch is arm64
116+
if [ "${{ matrix.name }}" == "arm64" ]; then
117+
sudo apt install ninja-build pkg-config -y
118+
export VCPKG_FORCE_SYSTEM_BINARIES=1
119+
fi
95120
make configure-vcpkg
96121
97122
- name: Build
123+
if: runner.os != 'Linux'
98124
run: |
99125
cd engine
100126
make build CMAKE_EXTRA_FLAGS="${{ matrix.cmake-flags }}" BUILD_DEPS_CMAKE_EXTRA_FLAGS="${{ matrix.build-deps-cmake-flags }}"
101127
128+
- name: Build
129+
if: runner.os == 'Linux'
130+
run: |
131+
cd engine
132+
if [ "${{ matrix.name }}" == "arm64" ]; then
133+
export VCPKG_FORCE_SYSTEM_BINARIES=1
134+
fi
135+
make build CMAKE_EXTRA_FLAGS="${{ matrix.cmake-flags }}" BUILD_DEPS_CMAKE_EXTRA_FLAGS="${{ matrix.build-deps-cmake-flags }}"
136+
137+
102138
- name: Run setup config
103139
run: |
104140
cd engine

.github/workflows/nightly-build.yml

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@ jobs:
7474
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
7575

7676
build-linux-x64:
77-
uses: ./.github/workflows/template-build-linux-x64.yml
77+
uses: ./.github/workflows/template-build-linux.yml
7878
secrets: inherit
7979
needs: [get-update-version, set-public-provider, get-cortex-llamacpp-latest-version]
8080
with:
@@ -85,11 +85,26 @@ jobs:
8585
cmake-flags: "-DCORTEX_VARIANT=nightly -DCORTEX_CPP_VERSION='v${{ needs.get-update-version.outputs.new_version }}' -DCMAKE_TOOLCHAIN_FILE=/home/runner/actions-runner/_work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake"
8686
channel: nightly
8787
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
88+
arch: amd64
89+
90+
build-linux-arm64:
91+
uses: ./.github/workflows/template-build-linux.yml
92+
secrets: inherit
93+
needs: [get-update-version, set-public-provider, get-cortex-llamacpp-latest-version]
94+
with:
95+
ref: ${{ needs.set-public-provider.outputs.ref }}
96+
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
97+
new_version: ${{ needs.get-update-version.outputs.new_version }}
98+
runs-on: ubuntu-2004-arm64
99+
cmake-flags: "-DCORTEX_VARIANT=nightly -DCORTEX_CPP_VERSION='v${{ needs.get-update-version.outputs.new_version }}' -DCMAKE_TOOLCHAIN_FILE=/home/runner/actions-runner/_work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake"
100+
channel: nightly
101+
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
102+
arch: arm64
88103

89104
update-latest-version:
90105
runs-on: ubuntu-latest
91106
if: needs.set-public-provider.outputs.public_provider == 'aws-s3'
92-
needs: [get-update-version, set-public-provider, build-linux-x64, build-macos, build-windows-x64, get-cortex-llamacpp-latest-version]
107+
needs: [get-update-version, set-public-provider, build-linux-x64, build-linux-arm64, build-macos, build-windows-x64, get-cortex-llamacpp-latest-version]
93108
steps:
94109
- name: Update latest version
95110
id: update-latest-version
@@ -100,9 +115,11 @@ jobs:
100115
aws s3 cp s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/temp-latest/mac-universal-cortex-nightly.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/latest/mac-arm64/cortex-nightly.tar.gz
101116
aws s3 cp s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/temp-latest/mac-universal-cortex-nightly.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/latest/mac-universal/cortex-nightly.tar.gz
102117
aws s3 cp s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/temp-latest/linux-amd64-cortex-nightly.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/latest/linux-amd64/cortex-nightly.tar.gz
118+
aws s3 cp s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/temp-latest/linux-arm64-cortex-nightly.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/latest/linux-arm64/cortex-nightly.tar.gz
103119
aws s3 cp s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/temp-latest/windows-amd64-cortex-nightly.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/latest/windows-amd64/cortex-nightly.tar.gz
104120
aws s3 cp s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/temp-latest/cortex-mac-universal-network-installer.pkg s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/latest/mac-universal/cortex-mac-universal-network-installer.pkg
105121
aws s3 cp s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/temp-latest/cortex-linux-amd64-network-installer.deb s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/latest/linux-amd64/cortex-linux-amd64-network-installer.deb
122+
aws s3 cp s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/temp-latest/cortex-linux-arm64-network-installer.deb s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/latest/linux-arm64/cortex-linux-arm64-network-installer.deb
106123
aws s3 cp s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/temp-latest/cortex-windows-amd64-network-installer.exe s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/latest/windows-amd64/cortex-windows-amd64-network-installer.exe
107124
108125
env:
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: Build and Package Python Code
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
model_dir:
7+
description: "Path to model directory in github repo"
8+
required: true
9+
repo_name:
10+
description: "name of repo to be checked out"
11+
required: true
12+
branch_name:
13+
description: "name of branch to be checked out"
14+
required: true
15+
default: main
16+
hf_repo:
17+
description: "name of huggingface repo to be pushed"
18+
required: true
19+
hf_prefix_branch:
20+
description: "prefix of hf branch"
21+
required: false
22+
23+
env:
24+
MODEL_DIR: ${{ inputs.model_dir }}
25+
REPO_NAME: ${{ inputs.repo_name}}
26+
BRANCH_NAME: ${{ inputs.branch_name }}
27+
HF_REPO: ${{ inputs.hf_repo }}
28+
HF_PREFIX_BRANCH: ${{ inputs.hf_prefix_branch }}
29+
30+
jobs:
31+
build-and-test:
32+
runs-on: ${{ matrix.runs-on }}
33+
timeout-minutes: 3600
34+
strategy:
35+
fail-fast: false
36+
matrix:
37+
include:
38+
- os: "linux"
39+
name: "amd64"
40+
runs-on: "ubuntu-20-04-cuda-12-0"
41+
- os: "mac"
42+
name: "amd64"
43+
runs-on: "macos-selfhosted-12"
44+
- os: "mac"
45+
name: "arm64"
46+
runs-on: "macos-selfhosted-12-arm64"
47+
- os: "windows"
48+
name: "amd64"
49+
runs-on: "windows-cuda-12-0"
50+
steps:
51+
- name: Clone
52+
id: checkout
53+
uses: actions/checkout@v3
54+
with:
55+
submodules: recursive
56+
repository: ${{env.REPO_NAME}}
57+
ref: ${{env.BRANCH_NAME}}
58+
- name: use python
59+
uses: actions/setup-python@v5
60+
with:
61+
python-version: "3.10"
62+
63+
- name: Install dependencies
64+
run: |
65+
python -m pip install --upgrade pip
66+
python -m pip install hf-transfer huggingface_hub
67+
68+
- name: Upload Artifact
69+
run: |
70+
huggingface-cli login --token ${{ secrets.HUGGINGFACE_TOKEN_WRITE }} --add-to-git-credential
71+
cd ${{env.MODEL_DIR}} && huggingface-cli upload ${{env.HF_REPO}} . . --revision ${{env.HF_PREFIX_BRANCH}}-${{ matrix.os }}-${{ matrix.name }}
72+
huggingface-cli logout

0 commit comments

Comments
 (0)