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

Commit 2d294ac

Browse files
author
Harry Le
committed
Merge branch 'dev' into test/harry-reorganize-api-folder
2 parents 08dd5db + 4a4fff4 commit 2d294ac

File tree

231 files changed

+21381
-3338
lines changed

Some content is hidden

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

231 files changed

+21381
-3338
lines changed

.devcontainer/Dockerfile

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
FROM mcr.microsoft.com/devcontainers/cpp:1-ubuntu-24.04
2+
3+
ARG REINSTALL_CMAKE_VERSION_FROM_SOURCE="none"
4+
5+
# Optionally install the cmake for vcpkg
6+
COPY ./reinstall-cmake.sh /tmp/
7+
8+
RUN if [ "${REINSTALL_CMAKE_VERSION_FROM_SOURCE}" != "none" ]; then \
9+
chmod +x /tmp/reinstall-cmake.sh && /tmp/reinstall-cmake.sh ${REINSTALL_CMAKE_VERSION_FROM_SOURCE}; \
10+
fi \
11+
&& rm -f /tmp/reinstall-cmake.sh
12+
13+
# [Optional] Uncomment this section to install additional vcpkg ports.
14+
# RUN su vscode -c "${VCPKG_ROOT}/vcpkg install <your-port-name-here>"
15+
16+
# [Optional] Uncomment this section to install additional packages.
17+
# RUN apt-get update && export DEBIAN_FRONTEND=noninteractive \
18+
# && apt-get -y install --no-install-recommends <your-package-list-here>

.devcontainer/devcontainer.json

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
3+
{
4+
"hostRequirements": {
5+
"cpus": 4,
6+
"memory": "8gb",
7+
"storage": "32gb"
8+
},
9+
"name": "C++",
10+
"build": {
11+
"dockerfile": "Dockerfile"
12+
},
13+
"features": {
14+
"ghcr.io/stuartleeks/dev-container-features/shell-history:0": {},
15+
"ghcr.io/sebst/devcontainer-features/pkgx:1": {},
16+
"ghcr.io/devcontainers-extra/features/apt-packages:1": {
17+
"clean_ppas": true,
18+
"preserve_apt_list": true,
19+
"packages": "build-essential linux-libc-dev",
20+
"ppas": "ppa:deadsnakes/ppa"
21+
}
22+
},
23+
// Features to add to the dev container. More info: https://containers.dev/features.
24+
// "features": {},
25+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
26+
// "forwardPorts": [],
27+
// Use 'postCreateCommand' to run commands after the container is created.
28+
"postCreateCommand": "git submodule update --init",
29+
// Use 'postAttachCommand' to run commands after the container is attached.
30+
"postAttachCommand": "pkgx install npx && npx -y runme run --filename README.md -t devcontainer -y"
31+
// Configure tool-specific properties.
32+
// "customizations": {},
33+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
34+
// "remoteUser": "root"
35+
}

.devcontainer/reinstall-cmake.sh

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
#!/usr/bin/env bash
2+
#-------------------------------------------------------------------------------------------------------------
3+
# Copyright (c) Microsoft Corporation. All rights reserved.
4+
# Licensed under the MIT License. See https://go.microsoft.com/fwlink/?linkid=2090316 for license information.
5+
#-------------------------------------------------------------------------------------------------------------
6+
#
7+
set -e
8+
9+
CMAKE_VERSION=${1:-"none"}
10+
11+
if [ "${CMAKE_VERSION}" = "none" ]; then
12+
echo "No CMake version specified, skipping CMake reinstallation"
13+
exit 0
14+
fi
15+
16+
# Cleanup temporary directory and associated files when exiting the script.
17+
cleanup() {
18+
EXIT_CODE=$?
19+
set +e
20+
if [[ -n "${TMP_DIR}" ]]; then
21+
echo "Executing cleanup of tmp files"
22+
rm -Rf "${TMP_DIR}"
23+
fi
24+
exit $EXIT_CODE
25+
}
26+
trap cleanup EXIT
27+
28+
29+
echo "Installing CMake..."
30+
apt-get -y purge --auto-remove cmake
31+
mkdir -p /opt/cmake
32+
33+
architecture=$(dpkg --print-architecture)
34+
case "${architecture}" in
35+
arm64)
36+
ARCH=aarch64 ;;
37+
amd64)
38+
ARCH=x86_64 ;;
39+
*)
40+
echo "Unsupported architecture ${architecture}."
41+
exit 1
42+
;;
43+
esac
44+
45+
CMAKE_BINARY_NAME="cmake-${CMAKE_VERSION}-linux-${ARCH}.sh"
46+
CMAKE_CHECKSUM_NAME="cmake-${CMAKE_VERSION}-SHA-256.txt"
47+
TMP_DIR=$(mktemp -d -t cmake-XXXXXXXXXX)
48+
49+
echo "${TMP_DIR}"
50+
cd "${TMP_DIR}"
51+
52+
curl -sSL "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_BINARY_NAME}" -O
53+
curl -sSL "https://github.com/Kitware/CMake/releases/download/v${CMAKE_VERSION}/${CMAKE_CHECKSUM_NAME}" -O
54+
55+
sha256sum -c --ignore-missing "${CMAKE_CHECKSUM_NAME}"
56+
sh "${TMP_DIR}/${CMAKE_BINARY_NAME}" --prefix=/opt/cmake --skip-license
57+
58+
ln -s /opt/cmake/bin/cmake /usr/local/bin/cmake
59+
ln -s /opt/cmake/bin/ctest /usr/local/bin/ctest

.github/workflows/beta-build.yml

Lines changed: 24 additions & 4 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 arm64 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 }}
144-
- Github Release: https://github.com/janhq/cortex.cpp/releases/tag/v${{ env.VERSION }}
164+
- Github Release: https://github.com/janhq/cortex.cpp/releases/tag/v${{ env.VERSION }}

0 commit comments

Comments
 (0)