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

Commit 5bb6dc9

Browse files
authored
Merge branch 'dev' into updateReadme
2 parents e607fbd + d0bd06f commit 5bb6dc9

File tree

73 files changed

+8448
-993
lines changed

Some content is hidden

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

73 files changed

+8448
-993
lines changed

.github/workflows/beta-build.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ jobs:
99
get-update-version:
1010
uses: ./.github/workflows/template-get-update-version.yml
1111

12+
get-cortex-llamacpp-latest-version:
13+
uses: ./.github/workflows/template-cortex-llamacpp-latest-version.yml
14+
1215
create-draft-release:
1316
runs-on: ubuntu-latest
1417
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
@@ -35,7 +38,7 @@ jobs:
3538

3639
build-macos-x64:
3740
uses: ./.github/workflows/template-build-macos.yml
38-
needs: [get-update-version, create-draft-release]
41+
needs: [get-update-version, create-draft-release, get-cortex-llamacpp-latest-version]
3942
secrets: inherit
4043
with:
4144
ref: ${{ github.ref }}
@@ -46,10 +49,11 @@ jobs:
4649
channel: beta
4750
arch: amd64
4851
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
52+
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
4953

5054
build-macos-arm64:
5155
uses: ./.github/workflows/template-build-macos.yml
52-
needs: [get-update-version, create-draft-release]
56+
needs: [get-update-version, create-draft-release, get-cortex-llamacpp-latest-version]
5357
secrets: inherit
5458
with:
5559
ref: ${{ github.ref }}
@@ -60,11 +64,12 @@ jobs:
6064
channel: beta
6165
arch: arm64
6266
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
67+
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
6368

6469
build-windows-x64:
6570
uses: ./.github/workflows/template-build-windows-x64.yml
6671
secrets: inherit
67-
needs: [get-update-version, create-draft-release]
72+
needs: [get-update-version, create-draft-release, get-cortex-llamacpp-latest-version]
6873
with:
6974
ref: ${{ github.ref }}
7075
public_provider: github
@@ -75,11 +80,12 @@ jobs:
7580
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
7681
channel: beta
7782
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
83+
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
7884

7985
build-linux-x64:
8086
uses: ./.github/workflows/template-build-linux-x64.yml
8187
secrets: inherit
82-
needs: [get-update-version, create-draft-release]
88+
needs: [get-update-version, create-draft-release, get-cortex-llamacpp-latest-version]
8389
with:
8490
ref: ${{ github.ref }}
8591
public_provider: github
@@ -88,6 +94,7 @@ jobs:
8894
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"
8995
channel: beta
9096
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
97+
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
9198

9299
update_release_draft:
93100
needs: [build-macos-x64, build-macos-arm64, build-windows-x64, build-linux-x64]

.github/workflows/nightly-build.yml

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,12 @@ jobs:
4343
get-update-version:
4444
uses: ./.github/workflows/template-get-update-version.yml
4545

46+
get-cortex-llamacpp-latest-version:
47+
uses: ./.github/workflows/template-cortex-llamacpp-latest-version.yml
48+
4649
build-macos-x64:
4750
uses: ./.github/workflows/template-build-macos.yml
48-
needs: [get-update-version, set-public-provider]
51+
needs: [get-update-version, set-public-provider, get-cortex-llamacpp-latest-version]
4952
secrets: inherit
5053
with:
5154
ref: ${{ needs.set-public-provider.outputs.ref }}
@@ -55,10 +58,11 @@ jobs:
5558
cmake-flags: "-DCORTEX_VARIANT=nightly -DCORTEX_CPP_VERSION='v${{ needs.get-update-version.outputs.new_version }}' -DCMAKE_TOOLCHAIN_FILE=/Users/runner/work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake"
5659
channel: nightly
5760
arch: amd64
61+
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
5862

5963
build-macos-arm64:
6064
uses: ./.github/workflows/template-build-macos.yml
61-
needs: [get-update-version, set-public-provider]
65+
needs: [get-update-version, set-public-provider, get-cortex-llamacpp-latest-version]
6266
secrets: inherit
6367
with:
6468
ref: ${{ needs.set-public-provider.outputs.ref }}
@@ -68,11 +72,12 @@ jobs:
6872
cmake-flags: "-DCORTEX_VARIANT=nightly -DCORTEX_CPP_VERSION='v${{ needs.get-update-version.outputs.new_version }}' -DMAC_ARM64=ON -DCMAKE_TOOLCHAIN_FILE=/Users/runner/work/cortex.cpp/cortex.cpp/engine/vcpkg/scripts/buildsystems/vcpkg.cmake"
6973
channel: nightly
7074
arch: arm64
75+
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
7176

7277
build-windows-x64:
7378
uses: ./.github/workflows/template-build-windows-x64.yml
7479
secrets: inherit
75-
needs: [get-update-version, set-public-provider]
80+
needs: [get-update-version, set-public-provider, get-cortex-llamacpp-latest-version]
7681
with:
7782
ref: ${{ needs.set-public-provider.outputs.ref }}
7883
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
@@ -82,23 +87,25 @@ jobs:
8287
build-deps-cmake-flags: "-DCMAKE_BUILD_TYPE=RELEASE -DCMAKE_CXX_COMPILER_LAUNCHER=ccache -DCMAKE_C_COMPILER_LAUNCHER=ccache -DCMAKE_CUDA_COMPILER_LAUNCHER=ccache -GNinja"
8388
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
8489
channel: nightly
90+
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
8591

8692
build-linux-x64:
8793
uses: ./.github/workflows/template-build-linux-x64.yml
8894
secrets: inherit
89-
needs: [get-update-version, set-public-provider]
95+
needs: [get-update-version, set-public-provider, get-cortex-llamacpp-latest-version]
9096
with:
9197
ref: ${{ needs.set-public-provider.outputs.ref }}
9298
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
9399
new_version: ${{ needs.get-update-version.outputs.new_version }}
94100
runs-on: ubuntu-20-04
95101
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"
96102
channel: nightly
103+
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
97104

98105
update-latest-version:
99106
runs-on: ubuntu-latest
100107
if: needs.set-public-provider.outputs.public_provider == 'aws-s3'
101-
needs: [get-update-version, set-public-provider, build-linux-x64, build-macos-x64, build-macos-arm64, build-windows-x64]
108+
needs: [get-update-version, set-public-provider, build-linux-x64, build-macos-x64, build-macos-arm64, build-windows-x64, get-cortex-llamacpp-latest-version]
102109
steps:
103110
- name: Update latest version
104111
id: update-latest-version
@@ -117,7 +124,7 @@ jobs:
117124
AWS_EC2_METADATA_DISABLED: "true"
118125

119126
noti-discord-nightly-and-update-url-readme:
120-
needs: [build-macos-x64, build-macos-arm64, build-windows-x64, build-linux-x64, get-update-version, set-public-provider]
127+
needs: [build-macos-x64, build-macos-arm64, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, get-cortex-llamacpp-latest-version]
121128
secrets: inherit
122129
if: github.event_name == 'schedule'
123130
uses: ./.github/workflows/template-noti-discord.yaml
@@ -126,7 +133,7 @@ jobs:
126133
new_version: ${{ needs.get-update-version.outputs.new_version }}
127134

128135
noti-discord-manual:
129-
needs: [build-macos-x64, build-macos-arm64, build-windows-x64, build-linux-x64, get-update-version, set-public-provider]
136+
needs: [build-macos-x64, build-macos-arm64, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, get-cortex-llamacpp-latest-version]
130137
secrets: inherit
131138
if: github.event_name == 'workflow_dispatch' && github.event.inputs.public_provider == 'aws-s3'
132139
uses: ./.github/workflows/template-noti-discord.yaml

.github/workflows/stable-build.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ jobs:
99
get-update-version:
1010
uses: ./.github/workflows/template-get-update-version.yml
1111

12+
get-cortex-llamacpp-latest-version:
13+
uses: ./.github/workflows/template-cortex-llamacpp-latest-version.yml
14+
1215
create-draft-release:
1316
runs-on: ubuntu-latest
1417
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
@@ -35,7 +38,7 @@ jobs:
3538

3639
build-macos-x64:
3740
uses: ./.github/workflows/template-build-macos.yml
38-
needs: [get-update-version, create-draft-release]
41+
needs: [get-update-version, create-draft-release, get-cortex-llamacpp-latest-version]
3942
secrets: inherit
4043
with:
4144
ref: ${{ github.ref }}
@@ -46,10 +49,11 @@ jobs:
4649
channel: stable
4750
arch: amd64
4851
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
52+
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
4953

5054
build-macos-arm64:
5155
uses: ./.github/workflows/template-build-macos.yml
52-
needs: [get-update-version, create-draft-release]
56+
needs: [get-update-version, create-draft-release, get-cortex-llamacpp-latest-version]
5357
secrets: inherit
5458
with:
5559
ref: ${{ github.ref }}
@@ -60,11 +64,12 @@ jobs:
6064
channel: stable
6165
arch: arm64
6266
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
67+
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
6368

6469
build-windows-x64:
6570
uses: ./.github/workflows/template-build-windows-x64.yml
6671
secrets: inherit
67-
needs: [get-update-version, create-draft-release]
72+
needs: [get-update-version, create-draft-release, get-cortex-llamacpp-latest-version]
6873
with:
6974
ref: ${{ github.ref }}
7075
public_provider: github
@@ -75,11 +80,12 @@ jobs:
7580
ccache-dir: 'C:\Users\ContainerAdministrator\AppData\Local\ccache'
7681
channel: stable
7782
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
83+
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
7884

7985
build-linux-x64:
8086
uses: ./.github/workflows/template-build-linux-x64.yml
8187
secrets: inherit
82-
needs: [get-update-version, create-draft-release]
88+
needs: [get-update-version, create-draft-release, get-cortex-llamacpp-latest-version]
8389
with:
8490
ref: ${{ github.ref }}
8591
public_provider: github
@@ -88,6 +94,7 @@ jobs:
8894
cmake-flags: "-DCORTEX_VARIANT=prod -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"
8995
channel: stable
9096
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
97+
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
9198

9299
update_release_draft:
93100
needs: [build-macos-x64, build-macos-arm64, build-windows-x64, build-linux-x64]

.github/workflows/template-build-linux-x64.yml

Lines changed: 59 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,11 @@ on:
4444
type: string
4545
default: 'nightly'
4646
description: 'The channel to use for this job'
47+
cortex-llamacpp-version:
48+
required: true
49+
type: string
50+
default: '0.0.0'
51+
description: 'The version of cortex-llamacpp to use for this job'
4752
secrets:
4853
DELTA_AWS_S3_BUCKET_NAME:
4954
required: false
@@ -128,11 +133,41 @@ jobs:
128133
cd engine
129134
make pre-package DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}"
130135
131-
- name: Build Installers
136+
- name: Build network Installers
132137
shell: bash
133138
run: |
134139
cd engine
135140
make build-installer PACKAGE_NAME="${{ steps.set-output-params.outputs.package_name }}" SOURCE_BINARY_PATH="../../cortex/${{ steps.set-output-params.outputs.destination_binary_name }}" VERSION=${{ inputs.new_version }} DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}" DATA_FOLDER_NAME="${{ steps.set-output-params.outputs.data_folder_name }}" CONFIGURATION_FILE_NAME="${{ steps.set-output-params.outputs.configuration_file_name }}" UNINSTALLER_FILE_NAME="${{ steps.set-output-params.outputs.uninstaller_file_name }}"
141+
mv ${{ steps.set-output-params.outputs.package_name }}.deb ${{ steps.set-output-params.outputs.package_name }}-network.deb
142+
143+
- name: Build local Installers
144+
run: |
145+
mkdir -p engine/templates/linux/dependencies
146+
cd engine/templates/linux/dependencies
147+
wget https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-linux-amd64-avx-cuda-11-7.tar.gz
148+
wget https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-linux-amd64-avx-cuda-12-0.tar.gz
149+
wget https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-linux-amd64-avx.tar.gz
150+
wget https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-linux-amd64-avx2-cuda-11-7.tar.gz
151+
wget https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-linux-amd64-avx2-cuda-12-0.tar.gz
152+
wget https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-linux-amd64-avx2.tar.gz
153+
wget https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-linux-amd64-avx512-cuda-11-7.tar.gz
154+
wget https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-linux-amd64-avx512-cuda-12-0.tar.gz
155+
wget https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-linux-amd64-avx512.tar.gz
156+
wget https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-linux-amd64-noavx-cuda-11-7.tar.gz
157+
wget https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-linux-amd64-noavx-cuda-12-0.tar.gz
158+
wget https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-linux-amd64-noavx.tar.gz
159+
wget https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cortex.llamacpp-${{ inputs.cortex-llamacpp-version }}-linux-amd64-vulkan.tar.gz
160+
wget https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cuda-11-7-linux-amd64.tar.gz
161+
wget https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cuda-12-0-linux-amd64.tar.gz
162+
cd ..
163+
164+
# Remove network package
165+
ls -al
166+
rm -rf ${{ steps.set-output-params.outputs.package_name }}
167+
rm ${{ steps.set-output-params.outputs.package_name }}.deb
168+
chmod +x create_deb_local.sh
169+
./create_deb_local.sh ${{ steps.set-output-params.outputs.package_name }} ${{ inputs.new_version }} ../../cortex/${{ steps.set-output-params.outputs.destination_binary_name }} ${{ steps.set-output-params.outputs.destination_binary_name }} ${{ steps.set-output-params.outputs.data_folder_name }} ${{ steps.set-output-params.outputs.configuration_file_name }};
170+
cp ${{ steps.set-output-params.outputs.package_name }}.deb ../../${{ steps.set-output-params.outputs.package_name }}-local.deb
136171
137172
- name: Package
138173
run: |
@@ -148,16 +183,23 @@ jobs:
148183
- name: Upload Artifact
149184
uses: actions/upload-artifact@v4
150185
with:
151-
name: cortex-${{ inputs.new_version }}-linux-amd64-installer
152-
path: ./engine/${{ steps.set-output-params.outputs.package_name }}.deb
186+
name: cortex-${{ inputs.new_version }}-linux-amd64-network-installer
187+
path: ./engine/${{ steps.set-output-params.outputs.package_name }}-network.deb
188+
189+
- name: Upload Artifact
190+
uses: actions/upload-artifact@v4
191+
with:
192+
name: cortex-${{ inputs.new_version }}-linux-amd64-local-installer
193+
path: ./engine/${{ steps.set-output-params.outputs.package_name }}-local.deb
153194

154195
- name: upload to aws s3 if public provider is aws
155196
if: inputs.public_provider == 'aws-s3'
156197
run: |
157198
aws s3 cp ./engine/cortex.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/temp-latest/linux-amd64-cortex-nightly.tar.gz
158199
159200
aws s3 cp ./engine/cortex.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/v${{ inputs.new_version }}/linux-amd64/cortex-nightly.tar.gz
160-
aws s3 cp ./engine/${{ steps.set-output-params.outputs.package_name }}.deb s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/v${{ inputs.new_version }}/linux-amd64/cortex-${{ inputs.new_version }}-linux-amd64-installer.deb
201+
aws s3 cp ./engine/${{ steps.set-output-params.outputs.package_name }}-network.deb s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/v${{ inputs.new_version }}/linux-amd64/cortex-${{ inputs.new_version }}-linux-amd64-network-installer.deb
202+
aws s3 cp ./engine/${{ steps.set-output-params.outputs.package_name }}-local.deb s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/v${{ inputs.new_version }}/linux-amd64/cortex-${{ inputs.new_version }}-linux-amd64-local-installer.deb
161203
env:
162204
AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }}
163205
AWS_SECRET_ACCESS_KEY: ${{ secrets.DELTA_AWS_SECRET_ACCESS_KEY }}
@@ -182,6 +224,17 @@ jobs:
182224
uses: actions/upload-release-asset@v1.0.1
183225
with:
184226
upload_url: ${{ inputs.upload_url }}
185-
asset_path: ./engine/${{ steps.set-output-params.outputs.package_name }}.deb
186-
asset_name: cortex-${{ inputs.new_version }}-linux-amd64-installer.deb
227+
asset_path: ./engine/${{ steps.set-output-params.outputs.package_name }}-network.deb
228+
asset_name: cortex-${{ inputs.new_version }}-linux-amd64-network-installer.deb
229+
asset_content_type: application/octet-stream
230+
231+
- name: Upload release assert if public provider is github
232+
if: inputs.public_provider == 'github'
233+
env:
234+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
235+
uses: actions/upload-release-asset@v1.0.1
236+
with:
237+
upload_url: ${{ inputs.upload_url }}
238+
asset_path: ./engine/${{ steps.set-output-params.outputs.package_name }}-local.deb
239+
asset_name: cortex-${{ inputs.new_version }}-linux-amd64-local-installer.deb
187240
asset_content_type: application/octet-stream

0 commit comments

Comments
 (0)