Skip to content

Commit a48a84a

Browse files
committed
feat: cicd arm64
1 parent f8e5051 commit a48a84a

File tree

6 files changed

+162
-43
lines changed

6 files changed

+162
-43
lines changed

.github/workflows/beta-build.yml

+23-3
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

+36
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

+19-2
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:

.github/workflows/stable-build.yml

+17-1
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: stable
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=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"
94+
channel: stable
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

0 commit comments

Comments
 (0)