-
Notifications
You must be signed in to change notification settings - Fork 116
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1d1104e
commit b67e373
Showing
7 changed files
with
109 additions
and
7 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
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 |
---|---|---|
|
@@ -44,6 +44,11 @@ on: | |
type: string | ||
default: 'nightly' | ||
description: 'The channel to use for this job' | ||
cortex-llamacpp-version: | ||
required: true | ||
type: string | ||
default: '0.0.0' | ||
description: 'The version of cortex-llamacpp to use for this job' | ||
secrets: | ||
DELTA_AWS_S3_BUCKET_NAME: | ||
required: false | ||
|
@@ -128,11 +133,41 @@ jobs: | |
cd engine | ||
make pre-package DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}" | ||
- name: Build Installers | ||
- name: Build network Installers | ||
shell: bash | ||
run: | | ||
cd engine | ||
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 }}" | ||
mv ${{ steps.set-output-params.outputs.package_name }}.deb ${{ steps.set-output-params.outputs.package_name }}-network.deb | ||
- name: Build local Installers | ||
run: | | ||
mkdir -p engine/templates/linux/dependencies | ||
cd engine/templates/linux/dependencies | ||
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 | ||
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 | ||
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 | ||
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 | ||
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 | ||
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 | ||
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 | ||
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 | ||
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 | ||
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 | ||
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 | ||
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 | ||
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 | ||
wget https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cuda-11-7-linux-amd64.tar.gz | ||
wget https://github.com/janhq/cortex.llamacpp/releases/download/v${{ inputs.cortex-llamacpp-version }}/cuda-12-0-linux-amd64.tar.gz | ||
cd .. | ||
# Remove network package | ||
ls -al | ||
rm -rf ${{ steps.set-output-params.outputs.package_name }} | ||
rm ${{ steps.set-output-params.outputs.package_name }}.deb | ||
chmod +x create_deb_local.sh | ||
./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 }}; | ||
cp ${{ steps.set-output-params.outputs.package_name }}.deb ../../${{ steps.set-output-params.outputs.package_name }}-local.deb | ||
- name: Package | ||
run: | | ||
|
@@ -148,16 +183,23 @@ jobs: | |
- name: Upload Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: cortex-${{ inputs.new_version }}-linux-amd64-installer | ||
path: ./engine/${{ steps.set-output-params.outputs.package_name }}.deb | ||
name: cortex-${{ inputs.new_version }}-linux-amd64-network-installer | ||
path: ./engine/${{ steps.set-output-params.outputs.package_name }}-network.deb | ||
|
||
- name: Upload Artifact | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: cortex-${{ inputs.new_version }}-linux-amd64-local-installer | ||
path: ./engine/${{ steps.set-output-params.outputs.package_name }}-local.deb | ||
|
||
- name: upload to aws s3 if public provider is aws | ||
if: inputs.public_provider == 'aws-s3' | ||
run: | | ||
aws s3 cp ./engine/cortex.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/temp-latest/linux-amd64-cortex-nightly.tar.gz | ||
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 | ||
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 | ||
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 | ||
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 | ||
env: | ||
AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }} | ||
AWS_SECRET_ACCESS_KEY: ${{ secrets.DELTA_AWS_SECRET_ACCESS_KEY }} | ||
|
@@ -182,6 +224,17 @@ jobs: | |
uses: actions/[email protected] | ||
with: | ||
upload_url: ${{ inputs.upload_url }} | ||
asset_path: ./engine/${{ steps.set-output-params.outputs.package_name }}.deb | ||
asset_name: cortex-${{ inputs.new_version }}-linux-amd64-installer.deb | ||
asset_path: ./engine/${{ steps.set-output-params.outputs.package_name }}-network.deb | ||
asset_name: cortex-${{ inputs.new_version }}-linux-amd64-network-installer.deb | ||
asset_content_type: application/octet-stream | ||
|
||
- name: Upload release assert if public provider is github | ||
if: inputs.public_provider == 'github' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
uses: actions/[email protected] | ||
with: | ||
upload_url: ${{ inputs.upload_url }} | ||
asset_path: ./engine/${{ steps.set-output-params.outputs.package_name }}-local.deb | ||
asset_name: cortex-${{ inputs.new_version }}-linux-amd64-local-installer.deb | ||
asset_content_type: application/octet-stream |
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,38 @@ | ||
PACKAGE_NAME=$1 | ||
VERSION=$2 | ||
SOURCE_BINARY_PATH=$3 | ||
DESTINATION_BINARY_NAME=$4 | ||
DATA_FOLDER_NAME=$5 | ||
CONFIGURATION_FILE_NAME=$6 | ||
|
||
mkdir -p $PACKAGE_NAME/DEBIAN | ||
|
||
mkdir -p $PACKAGE_NAME/usr/bin | ||
cp $SOURCE_BINARY_PATH $PACKAGE_NAME/usr/bin/$DESTINATION_BINARY_NAME | ||
|
||
mkdir -p $PACKAGE_NAME/tmp/$DESTINATION_BINARY_NAME-dependencies | ||
cp dependencies/* $PACKAGE_NAME/tmp/$DESTINATION_BINARY_NAME-dependencies | ||
|
||
export DESTINATION_BINARY_NAME | ||
|
||
cp postinst_local $PACKAGE_NAME/DEBIAN/postinst | ||
sed -i "2s/.*/DESTINATION_BINARY_NAME=$DESTINATION_BINARY_NAME/" $PACKAGE_NAME/DEBIAN/postinst | ||
|
||
cp prerm $PACKAGE_NAME/DEBIAN/prerm | ||
sed -i "3s/.*/DESTINATION_BINARY_NAME=$DESTINATION_BINARY_NAME/" $PACKAGE_NAME/DEBIAN/prerm | ||
|
||
export DATA_FOLDER_NAME CONFIGURATION_FILE_NAME | ||
|
||
cp postrm $PACKAGE_NAME/DEBIAN/postrm | ||
sed -i "3s/.*/DATA_FOLDER_NAME=$DATA_FOLDER_NAME/" $PACKAGE_NAME/DEBIAN/postrm | ||
sed -i "4s/.*/CONFIGURATION_FILE_NAME=$CONFIGURATION_FILE_NAME/" $PACKAGE_NAME/DEBIAN/postrm | ||
|
||
chmod 755 $PACKAGE_NAME/DEBIAN/postinst | ||
chmod 755 $PACKAGE_NAME/DEBIAN/postrm | ||
chmod 755 $PACKAGE_NAME/DEBIAN/prerm | ||
|
||
export PACKAGE_NAME VERSION | ||
|
||
envsubst < control > $PACKAGE_NAME/DEBIAN/control | ||
|
||
dpkg-deb --build $PACKAGE_NAME $PACKAGE_NAME.deb |
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,6 @@ | ||
#!/bin/sh | ||
DESTINATION_BINARY_NAME=cortex | ||
USER_TO_RUN_AS=${SUDO_USER:-$(whoami)} | ||
echo "Download cortex.llamacpp engines by default for user $USER_TO_RUN_AS" | ||
sudo -u $USER_TO_RUN_AS /usr/bin/$DESTINATION_BINARY_NAME --verbose engines install cortex.llamacpp -s /tmp/$DESTINATION_BINARY_NAME-dependencies | ||
rm -rf /tmp/$DESTINATION_BINARY_NAME-dependencies |