Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: sync dev to main v1.0.9-rc1 #1851

Merged
merged 20 commits into from
Jan 13, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
20 commits
Select commit Hold shift + click to select a range
a8b2503
feat: add filter compatible for engine variant api (#1819)
namchuai Dec 23, 2024
e408f78
feat: rendering chat_template (#1814)
namchuai Dec 23, 2024
fb72167
Merge pull request #1827 from janhq/main
hiento09 Dec 26, 2024
1a73c0c
fix: forward start model parameters (#1825)
vansangpfiev Dec 26, 2024
3456c7b
fix: not create new folder if is registering paths (#1828)
namchuai Dec 27, 2024
f94527f
feat: add openai assistant (#1826)
namchuai Dec 27, 2024
d9bdb81
fix: using engine variant name for download task id (#1833)
namchuai Dec 30, 2024
3b545de
chore: database service (#1834)
vansangpfiev Dec 30, 2024
22ff0a1
Feat/python engine (#1784)
nguyenhoangthuan99 Dec 31, 2024
c893b4b
Feat/stream request python engine (#1829)
nguyenhoangthuan99 Dec 31, 2024
a77cd96
fix: download recursive (#1838)
nguyenhoangthuan99 Jan 4, 2025
c4b370f
fix: cortex stop child process (#1841)
nguyenhoangthuan99 Jan 6, 2025
7918935
Feat/python package ci (#1792)
nguyenhoangthuan99 Jan 7, 2025
9b96b47
fix: use after std::move
sangjanai Jan 7, 2025
e286092
Merge pull request #1844 from janhq/fix/use-after-move
vansangpfiev Jan 7, 2025
5825412
fix: build linux arm (#1806)
vansangpfiev Jan 8, 2025
d868c0a
Merge branch 'main' of https://github.com/janhq/cortex.cpp into chore…
sangjanai Jan 8, 2025
da7576d
Merge pull request #1846 from janhq/chore/sync-main-to-dev
vansangpfiev Jan 8, 2025
c508e68
fix: add cpu_threads to model.yaml (#1845)
vansangpfiev Jan 13, 2025
f8c1df6
fix: engine Issues & API Issues (#1811)
vansangpfiev Jan 13, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions .github/workflows/beta-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ jobs:
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}

build-linux-x64:
uses: ./.github/workflows/template-build-linux-x64.yml
uses: ./.github/workflows/template-build-linux.yml
secrets: inherit
needs: [get-update-version, create-draft-release, get-cortex-llamacpp-latest-version]
with:
Expand All @@ -79,6 +79,22 @@ jobs:
channel: beta
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
arch: amd64

build-linux-arm64:
uses: ./.github/workflows/template-build-linux.yml
secrets: inherit
needs: [get-update-version, create-draft-release, get-cortex-llamacpp-latest-version]
with:
ref: ${{ github.ref }}
public_provider: github
new_version: ${{ needs.get-update-version.outputs.new_version }}
runs-on: ubuntu-2004-arm64
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"
channel: beta
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
arch: arm64

build-docker-x64:
uses: ./.github/workflows/template-build-docker-x64.yml
Expand Down Expand Up @@ -111,7 +127,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

noti-discord:
needs: [get-update-version, create-draft-release, build-macos, build-windows-x64, build-linux-x64, update_release]
needs: [get-update-version, create-draft-release, build-macos, build-windows-x64, build-linux-x64, build-linux-arm64, update_release]
runs-on: ubuntu-latest
permissions:
contents: write
Expand All @@ -136,9 +152,13 @@ jobs:
- Network Installer: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-mac-universal-network-installer.pkg
- Local Installer: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-mac-universal-local-installer.pkg
- Binary: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-mac-universal.tar.gz
- Linux Deb:
- Linux amd64 Deb:
- Network Installer: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-linux-amd64-network-installer.deb
- Local Installer: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-linux-amd64-local-installer.deb
- Binary: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-linux-amd64.tar.gz
- Linux amd64 Deb:
- Network Installer: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-linux-arm64-network-installer.deb
- Local Installer: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-linux-arm64-local-installer.deb
- Binary: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-linux-arm64.tar.gz
- Docker: menloltd/cortex:beta-${{ env.VERSION }}
- Github Release: https://github.com/janhq/cortex.cpp/releases/tag/v${{ env.VERSION }}
36 changes: 36 additions & 0 deletions .github/workflows/cortex-cpp-quality-gate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ jobs:
fail-fast: false
matrix:
include:
- os: "linux"
name: "arm64"
runs-on: "ubuntu-2004-arm64"
cmake-flags: "-DCORTEX_CPP_VERSION=${{github.event.pull_request.head.sha}} -DCMAKE_BUILD_TEST=ON -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake"
build-deps-cmake-flags: ""
ccache-dir: ""
- os: "linux"
name: "amd64"
runs-on: "ubuntu-20-04-cuda-12-0"
Expand Down Expand Up @@ -52,6 +58,7 @@ jobs:
submodules: recursive

- name: use python
continue-on-error: true
uses: actions/setup-python@v5
with:
python-version: "3.10"
Expand Down Expand Up @@ -90,15 +97,44 @@ jobs:
AWS_DEFAULT_REGION: "${{ secrets.MINIO_REGION }}"

- name: Configure vcpkg
if: runner.os != 'Linux'
run: |
cd engine
make configure-vcpkg

- name: Configure vcpkg linux amd64
if: runner.os != 'Linux'
run: |
cd engine
make configure-vcpkg

- name: Configure vcpkg linux arm64
if: runner.os == 'Linux'
run: |
cd engine
# Set env if arch is arm64
if [ "${{ matrix.name }}" == "arm64" ]; then
sudo apt install ninja-build pkg-config -y
export VCPKG_FORCE_SYSTEM_BINARIES=1
fi
make configure-vcpkg

- name: Build
if: runner.os != 'Linux'
run: |
cd engine
make build CMAKE_EXTRA_FLAGS="${{ matrix.cmake-flags }}" BUILD_DEPS_CMAKE_EXTRA_FLAGS="${{ matrix.build-deps-cmake-flags }}"

- name: Build
if: runner.os == 'Linux'
run: |
cd engine
if [ "${{ matrix.name }}" == "arm64" ]; then
export VCPKG_FORCE_SYSTEM_BINARIES=1
fi
make build CMAKE_EXTRA_FLAGS="${{ matrix.cmake-flags }}" BUILD_DEPS_CMAKE_EXTRA_FLAGS="${{ matrix.build-deps-cmake-flags }}"


- name: Run setup config
run: |
cd engine
Expand Down
21 changes: 19 additions & 2 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,7 @@ jobs:
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}

build-linux-x64:
uses: ./.github/workflows/template-build-linux-x64.yml
uses: ./.github/workflows/template-build-linux.yml
secrets: inherit
needs: [get-update-version, set-public-provider, get-cortex-llamacpp-latest-version]
with:
Expand All @@ -85,11 +85,26 @@ jobs:
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"
channel: nightly
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
arch: amd64

build-linux-arm64:
uses: ./.github/workflows/template-build-linux.yml
secrets: inherit
needs: [get-update-version, set-public-provider, get-cortex-llamacpp-latest-version]
with:
ref: ${{ needs.set-public-provider.outputs.ref }}
public_provider: ${{ needs.set-public-provider.outputs.public_provider }}
new_version: ${{ needs.get-update-version.outputs.new_version }}
runs-on: ubuntu-2004-arm64
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"
channel: nightly
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }}
arch: arm64

update-latest-version:
runs-on: ubuntu-latest
if: needs.set-public-provider.outputs.public_provider == 'aws-s3'
needs: [get-update-version, set-public-provider, build-linux-x64, build-macos, build-windows-x64, get-cortex-llamacpp-latest-version]
needs: [get-update-version, set-public-provider, build-linux-x64, build-linux-arm64, build-macos, build-windows-x64, get-cortex-llamacpp-latest-version]
steps:
- name: Update latest version
id: update-latest-version
Expand All @@ -100,9 +115,11 @@ jobs:
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
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
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
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
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
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
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
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
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

env:
Expand Down
72 changes: 72 additions & 0 deletions .github/workflows/python-script-package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,72 @@
name: Build and Package Python Code

on:
workflow_dispatch:
inputs:
model_dir:
description: "Path to model directory in github repo"
required: true
repo_name:
description: "name of repo to be checked out"
required: true
branch_name:
description: "name of branch to be checked out"
required: true
default: main
hf_repo:
description: "name of huggingface repo to be pushed"
required: true
hf_prefix_branch:
description: "prefix of hf branch"
required: false

env:
MODEL_DIR: ${{ inputs.model_dir }}
REPO_NAME: ${{ inputs.repo_name}}
BRANCH_NAME: ${{ inputs.branch_name }}
HF_REPO: ${{ inputs.hf_repo }}
HF_PREFIX_BRANCH: ${{ inputs.hf_prefix_branch }}

jobs:
build-and-test:
runs-on: ${{ matrix.runs-on }}
timeout-minutes: 3600
strategy:
fail-fast: false
matrix:
include:
- os: "linux"
name: "amd64"
runs-on: "ubuntu-20-04-cuda-12-0"
- os: "mac"
name: "amd64"
runs-on: "macos-selfhosted-12"
- os: "mac"
name: "arm64"
runs-on: "macos-selfhosted-12-arm64"
- os: "windows"
name: "amd64"
runs-on: "windows-cuda-12-0"
steps:
- name: Clone
id: checkout
uses: actions/checkout@v3
with:
submodules: recursive
repository: ${{env.REPO_NAME}}
ref: ${{env.BRANCH_NAME}}
- name: use python
uses: actions/setup-python@v5
with:
python-version: "3.10"

- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install hf-transfer huggingface_hub

- name: Upload Artifact
run: |
huggingface-cli login --token ${{ secrets.HUGGINGFACE_TOKEN_WRITE }} --add-to-git-credential
cd ${{env.MODEL_DIR}} && huggingface-cli upload ${{env.HF_REPO}} . . --revision ${{env.HF_PREFIX_BRANCH}}-${{ matrix.os }}-${{ matrix.name }}
huggingface-cli logout
Loading
Loading