-
Notifications
You must be signed in to change notification settings - Fork 135
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'dev' into feat/api-docs
- Loading branch information
Showing
17 changed files
with
534 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -35,6 +35,7 @@ jobs: | |
name: "${{ env.VERSION }}" | ||
draft: true | ||
prerelease: false | ||
generate_release_notes: true | ||
|
||
build-macos: | ||
uses: ./.github/workflows/template-build-macos.yml | ||
|
@@ -79,26 +80,52 @@ jobs: | |
upload_url: ${{ needs.create-draft-release.outputs.upload_url }} | ||
cortex-llamacpp-version: ${{ needs.get-cortex-llamacpp-latest-version.outputs.cortex_llamacpp_latest_version }} | ||
|
||
update_release_draft: | ||
needs: [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] | ||
permissions: | ||
# write permission is required to create a github release | ||
contents: write | ||
# write permission is required for autolabeler | ||
# otherwise, read permission is required at least | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Getting the repo | ||
uses: actions/checkout@v4 | ||
- name: set release to prerelease | ||
run: | | ||
gh release edit v${{ needs.get-update-version.outputs.new_version }} --draft=false --prerelease | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
noti-discord: | ||
needs: [get-update-version, create-draft-release, build-macos, build-windows-x64, build-linux-x64, update_release] | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# write permission is required to create a github release | ||
contents: write | ||
# write permission is required for autolabeler | ||
# otherwise, read permission is required at least | ||
pull-requests: write | ||
runs-on: ubuntu-latest | ||
steps: | ||
# (Optional) GitHub Enterprise requires GHE_HOST variable set | ||
#- name: Set GHE_HOST | ||
# run: | | ||
# echo "GHE_HOST=${GITHUB_SERVER_URL##https:\/\/}" >> $GITHUB_ENV | ||
- name: Set version to environment variable | ||
run: | | ||
echo "VERSION=${{ needs.get-update-version.outputs.new_version }}" >> $GITHUB_ENV | ||
echo "RUNNER_ID=$GITHUB_RUN_ID" >> $GITHUB_ENV | ||
# Drafts your next Release notes as Pull Requests are merged into "master" | ||
- uses: release-drafter/release-drafter@v5 | ||
# (Optional) specify config name to use, relative to .github/. Default: release-drafter.yml | ||
# with: | ||
# config-name: my-config.yml | ||
# disable-autolabeler: true | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
- name: Notify Discord | ||
uses: appleboy/[email protected] | ||
with: | ||
webhook_id: ${{ secrets.WEBHOOK_ID_BETA }} | ||
webhook_token: ${{ secrets.WEBHOOK_TOKEN_BETA }} | ||
message: | | ||
Cortex.cpp beta build artifact version ${{ env.VERSION }}: | ||
- Windows: | ||
- Network Installer: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-windows-amd64-network-installer.exe | ||
- Local Installer: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-windows-amd64-local-installer.exe | ||
- Binary: https://github.com/janhq/cortex.cpp/releases/download/v${{ env.VERSION }}/cortex-${{ env.VERSION }}-windows-amd64.tar.gz | ||
- macOS Universal: | ||
- 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: | ||
- 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 | ||
- Github Release: https://github.com/janhq/cortex.cpp/releases/tag/v${{ env.VERSION }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,109 @@ | ||
name: Test cortexso Model Hub | ||
|
||
on: | ||
schedule: | ||
- cron: "0 16 * * 5" # every Friday at 23:00 UTC+7 | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ${{ matrix.runs-on }} | ||
timeout-minutes: 1440 | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
include: | ||
- os: "linux" | ||
name: "amd64" | ||
runs-on: "ubuntu-20-04-e2e-cortexcpp-model-hub" | ||
cmake-flags: "-DCORTEX_CPP_VERSION=${{github.head_ref}} -DCMAKE_BUILD_TEST=ON -DCMAKE_TOOLCHAIN_FILE=vcpkg/scripts/buildsystems/vcpkg.cmake" | ||
build-deps-cmake-flags: "" | ||
ccache-dir: "" | ||
steps: | ||
- name: Clone | ||
id: checkout | ||
uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
|
||
- name: use python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: "3.10" | ||
|
||
- name: Install tools on Linux | ||
run: | | ||
sudo chown -R runner:runner /home/runner/cortexcpp | ||
python3 -m pip install awscli | ||
- name: Download vcpkg cache from s3 | ||
continue-on-error: true | ||
run: | | ||
aws s3 sync s3://${{ secrets.MINIO_BUCKET_NAME }}/cortex-cpp-vcpkg-linux /home/runner/.cache/vcpkg --endpoint ${{ secrets.MINIO_ENDPOINT }} --cli-read-timeout 0 | ||
env: | ||
AWS_ACCESS_KEY_ID: "${{ secrets.MINIO_ACCESS_KEY_ID }}" | ||
AWS_SECRET_ACCESS_KEY: "${{ secrets.MINIO_SECRET_ACCESS_KEY }}" | ||
AWS_DEFAULT_REGION: "${{ secrets.MINIO_REGION }}" | ||
|
||
- name: Configure vcpkg | ||
run: | | ||
cd engine | ||
make configure-vcpkg | ||
- name: Build | ||
run: | | ||
cd engine | ||
make build CMAKE_EXTRA_FLAGS="${{ matrix.cmake-flags }}" BUILD_DEPS_CMAKE_EXTRA_FLAGS="${{ matrix.build-deps-cmake-flags }}" | ||
- name: Run unit tests | ||
run: | | ||
cd engine | ||
make run-unit-tests | ||
- name: Run setup config for linux | ||
shell: bash | ||
run: | | ||
cd engine | ||
./build/cortex --version | ||
sed -i 's/huggingFaceToken: ""/huggingFaceToken: "${{ secrets.HUGGINGFACE_TOKEN_READ }}"/' ~/.cortexrc | ||
- name: Run e2e tests | ||
run: | | ||
cd engine | ||
cp build/cortex build/cortex-nightly | ||
cp build/cortex build/cortex-beta | ||
python -m pip install --upgrade pip | ||
python -m pip install -r e2e-test/requirements.txt | ||
pytest e2e-test/test_api_cortexso_hub_llamacpp_engine.py | ||
rm build/cortex-nightly | ||
rm build/cortex-beta | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
HF_TOKEN: ${{ secrets.HUGGINGFACE_TOKEN_E2E }} | ||
|
||
- name: Pre-package | ||
run: | | ||
cd engine | ||
make pre-package DESTINATION_BINARY_NAME="cortex" | ||
- name: Package | ||
run: | | ||
cd engine | ||
make package | ||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: cortex-${{ matrix.os }}-${{ matrix.name }} | ||
path: ./engine/cortex | ||
|
||
|
||
- name: Upload linux vcpkg cache to s3 | ||
continue-on-error: true | ||
if: always() | ||
run: | | ||
aws s3 sync /home/runner/.cache/vcpkg s3://${{ secrets.MINIO_BUCKET_NAME }}/cortex-cpp-vcpkg-linux --endpoint ${{ secrets.MINIO_ENDPOINT }} | ||
env: | ||
AWS_ACCESS_KEY_ID: "${{ secrets.MINIO_ACCESS_KEY_ID }}" | ||
AWS_SECRET_ACCESS_KEY: "${{ secrets.MINIO_SECRET_ACCESS_KEY }}" | ||
AWS_DEFAULT_REGION: "${{ secrets.MINIO_REGION }}" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.