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

Commit 9f89860

Browse files
vansangpfievsangjanaihiento09jan-service-account
authored
fix: binaries for CLI and Server (#1499)
* fix: update swagger * fix: start stop model with API call * fix: model del * fix: model get * fix: model alias * fix: model import * fix: model status * fix: model list * fix: models update * fix: engine list * fix: engine get * fix: engine uninstall * fix: add cmake for cli * fix: binary name * fix: test CMakeLists * fix: Makefile * fix: installer for 2 binaries * fix: installer for 2 binaries * fix: windows installer disable dir page * fix: add upd server cmd (in-progress) * fix: add installer file to latest folder s3 for nightly updater * fix: installer adds param skip post install * fix: skip postinstall macos * fix: nightly installer * fix: remove update server cmd * fix: pre-package * fix: build * fix: support cortex update --server * fix: installer adds param skip post install * fix: installer adds param skip post install * fix: correct command * fix: update beta and stable * fix: build * chore: move commands to cli * fix: models start timeout * chore: refactor main cli * fix: log * fix: log * fix: support --port for server * fix: build --------- Co-authored-by: vansangpfiev <sang@jan.ai> Co-authored-by: Hien To <tominhhien97@gmail.com> Co-authored-by: Service Account <service@jan.ai>
1 parent 00a26cc commit 9f89860

Some content is hidden

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

74 files changed

+637
-130
lines changed

.github/workflows/nightly-build.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,10 @@ jobs:
101101
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
102102
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
103103
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
104+
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
105+
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
106+
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
107+
104108
105109
env:
106110
AWS_ACCESS_KEY_ID: ${{ secrets.DELTA_AWS_ACCESS_KEY_ID }}

.github/workflows/template-build-linux-x64.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ jobs:
8484
if [ "${{ inputs.channel }}" == "stable" ]; then
8585
echo "::set-output name=package_name::cortexcpp"
8686
echo "::set-output name=destination_binary_name::cortex"
87+
echo "::set-output name=destination_binary_server_name::cortex-server"
8788
echo "::set-output name=data_folder_name::cortexcpp"
8889
echo "::set-output name=configuration_file_name::.cortexrc"
8990
echo "::set-output name=uninstaller_file_name::cortex-uninstall.sh"
@@ -94,6 +95,7 @@ jobs:
9495
if [ "${{ inputs.channel }}" == "beta" ]; then
9596
echo "::set-output name=package_name::cortexcpp-beta"
9697
echo "::set-output name=destination_binary_name::cortex-beta"
98+
echo "::set-output name=destination_binary_server_name::cortex-server-beta"
9799
echo "::set-output name=data_folder_name::cortexcpp-beta"
98100
echo "::set-output name=configuration_file_name::.cortexrc-beta"
99101
echo "::set-output name=uninstaller_file_name::cortex-beta-uninstall.sh"
@@ -104,6 +106,7 @@ jobs:
104106
if [ "${{ inputs.channel }}" == "nightly" ]; then
105107
echo "::set-output name=package_name::cortexcpp-nightly"
106108
echo "::set-output name=destination_binary_name::cortex-nightly"
109+
echo "::set-output name=destination_binary_server_name::cortex-server-nightly"
107110
echo "::set-output name=data_folder_name::cortexcpp-nightly"
108111
echo "::set-output name=configuration_file_name::.cortexrc-nightly"
109112
echo "::set-output name=uninstaller_file_name::cortex-nightly-uninstall.sh"
@@ -150,13 +153,13 @@ jobs:
150153
- name: Pre-package
151154
run: |
152155
cd engine
153-
make pre-package DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}"
156+
make pre-package DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}" DESTINATION_BINARY_SERVER_NAME="${{ steps.set-output-params.outputs.destination_binary_server_name }}"
154157
155158
- name: Build network Installers
156159
shell: bash
157160
run: |
158161
cd engine
159-
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 }}"
162+
make build-installer PACKAGE_NAME="${{ steps.set-output-params.outputs.package_name }}" SOURCE_BINARY_PATH="../../cortex/${{ steps.set-output-params.outputs.destination_binary_name }}" SOURCE_BINARY_SERVER_PATH="../../cortex/${{ steps.set-output-params.outputs.destination_binary_server_name }}" VERSION=${{ inputs.new_version }} DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}" DESTINATION_BINARY_SERVER_NAME="${{ steps.set-output-params.outputs.destination_binary_server_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 }}"
160163
mv ${{ steps.set-output-params.outputs.package_name }}.deb ${{ steps.set-output-params.outputs.package_name }}-network.deb
161164
162165
- name: Build local Installers
@@ -185,7 +188,7 @@ jobs:
185188
rm -rf ${{ steps.set-output-params.outputs.package_name }}
186189
rm ${{ steps.set-output-params.outputs.package_name }}.deb
187190
chmod +x create_deb_local.sh
188-
./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 }};
191+
./create_deb_local.sh ${{ steps.set-output-params.outputs.package_name }} ${{ inputs.new_version }} ../../cortex/${{ steps.set-output-params.outputs.destination_binary_name }} ../../cortex/${{ steps.set-output-params.outputs.destination_binary_server_name }} ${{ steps.set-output-params.outputs.destination_binary_name }} ${{ steps.set-output-params.outputs.destination_binary_server_name }} ${{ steps.set-output-params.outputs.data_folder_name }} ${{ steps.set-output-params.outputs.configuration_file_name }};
189192
cp ${{ steps.set-output-params.outputs.package_name }}.deb ../../${{ steps.set-output-params.outputs.package_name }}-local.deb
190193
191194
- name: Package
@@ -215,6 +218,7 @@ jobs:
215218
if: inputs.public_provider == 'aws-s3'
216219
run: |
217220
aws s3 cp ./engine/cortex.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/temp-latest/linux-amd64-cortex-nightly.tar.gz
221+
aws s3 cp ./engine/${{ steps.set-output-params.outputs.package_name }}-network.deb s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/temp-latest/cortex-linux-amd64-network-installer.deb
218222
219223
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
220224
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

.github/workflows/template-build-macos.yml

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,7 @@ jobs:
108108
if [ "${{ inputs.channel }}" == "stable" ]; then
109109
echo "::set-output name=package_name::cortexcpp"
110110
echo "::set-output name=destination_binary_name::cortex"
111+
echo "::set-output name=destination_binary_server_name::cortex-server"
111112
echo "::set-output name=data_folder_name::cortexcpp"
112113
echo "::set-output name=configuration_file_name::.cortexrc"
113114
echo "::set-output name=uninstaller_file_name::cortex-uninstall.sh"
@@ -118,6 +119,7 @@ jobs:
118119
if [ "${{ inputs.channel }}" == "beta" ]; then
119120
echo "::set-output name=package_name::cortexcpp-beta"
120121
echo "::set-output name=destination_binary_name::cortex-beta"
122+
echo "::set-output name=destination_binary_server_name::cortex-server-beta"
121123
echo "::set-output name=data_folder_name::cortexcpp-beta"
122124
echo "::set-output name=configuration_file_name::.cortexrc-beta"
123125
echo "::set-output name=uninstaller_file_name::cortex-beta-uninstall.sh"
@@ -128,6 +130,7 @@ jobs:
128130
if [ "${{ inputs.channel }}" == "nightly" ]; then
129131
echo "::set-output name=package_name::cortexcpp-nightly"
130132
echo "::set-output name=destination_binary_name::cortex-nightly"
133+
echo "::set-output name=destination_binary_server_name::cortex-server-nightly"
131134
echo "::set-output name=data_folder_name::cortexcpp-nightly"
132135
echo "::set-output name=configuration_file_name::.cortexrc-nightly"
133136
echo "::set-output name=uninstaller_file_name::cortex-nightly-uninstall.sh"
@@ -164,7 +167,7 @@ jobs:
164167
- name: Pre-package
165168
run: |
166169
cd engine
167-
make pre-package DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}"
170+
make pre-package DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}" DESTINATION_BINARY_SERVER_NAME="${{ steps.set-output-params.outputs.destination_binary_server_name }}"
168171
169172
- name: Upload Artifact
170173
uses: actions/upload-artifact@v4
@@ -192,6 +195,7 @@ jobs:
192195
if [ "${{ inputs.channel }}" == "stable" ]; then
193196
echo "::set-output name=package_name::cortexcpp"
194197
echo "::set-output name=destination_binary_name::cortex"
198+
echo "::set-output name=destination_binary_server_name::cortex-server"
195199
echo "::set-output name=data_folder_name::cortexcpp"
196200
echo "::set-output name=configuration_file_name::.cortexrc"
197201
echo "::set-output name=uninstaller_file_name::cortex-uninstall.sh"
@@ -202,6 +206,7 @@ jobs:
202206
if [ "${{ inputs.channel }}" == "beta" ]; then
203207
echo "::set-output name=package_name::cortexcpp-beta"
204208
echo "::set-output name=destination_binary_name::cortex-beta"
209+
echo "::set-output name=destination_binary_server_name::cortex-server-beta"
205210
echo "::set-output name=data_folder_name::cortexcpp-beta"
206211
echo "::set-output name=configuration_file_name::.cortexrc-beta"
207212
echo "::set-output name=uninstaller_file_name::cortex-beta-uninstall.sh"
@@ -212,6 +217,7 @@ jobs:
212217
if [ "${{ inputs.channel }}" == "nightly" ]; then
213218
echo "::set-output name=package_name::cortexcpp-nightly"
214219
echo "::set-output name=destination_binary_name::cortex-nightly"
220+
echo "::set-output name=destination_binary_server_name::cortex-server-nightly"
215221
echo "::set-output name=data_folder_name::cortexcpp-nightly"
216222
echo "::set-output name=configuration_file_name::.cortexrc-nightly"
217223
echo "::set-output name=uninstaller_file_name::cortex-nightly-uninstall.sh"
@@ -250,20 +256,24 @@ jobs:
250256
mkdir -p engine/cortex
251257
ls -al
252258
find . | grep ${{ steps.set-output-params.outputs.destination_binary_name }}
259+
find . | grep ${{ steps.set-output-params.outputs.destination_binary_server_name }}
253260
lipo -create cortex-${{ inputs.new_version }}-mac-arm64/${{ steps.set-output-params.outputs.destination_binary_name }} cortex-${{ inputs.new_version }}-mac-amd64/${{ steps.set-output-params.outputs.destination_binary_name }} -output engine/cortex/${{ steps.set-output-params.outputs.destination_binary_name }}
261+
lipo -create cortex-${{ inputs.new_version }}-mac-arm64/${{ steps.set-output-params.outputs.destination_binary_server_name }} cortex-${{ inputs.new_version }}-mac-amd64/${{ steps.set-output-params.outputs.destination_binary_server_name }} -output engine/cortex/${{ steps.set-output-params.outputs.destination_binary_server_name }}
254262
chmod +x engine/cortex/${{ steps.set-output-params.outputs.destination_binary_name }}
263+
chmod +x engine/cortex/${{ steps.set-output-params.outputs.destination_binary_server_name }}
255264
256265
- name: Code Signing binaries
257266
run: |
258267
cd engine
259-
make codesign-binary CODE_SIGN=true DEVELOPER_ID="${{ secrets.DEVELOPER_ID }}" DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}"
268+
make codesign-binary CODE_SIGN=true DEVELOPER_ID="${{ secrets.DEVELOPER_ID }}" DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}" DESTINATION_BINARY_SERVER_NAME="${{ steps.set-output-params.outputs.destination_binary_server_name }}"
260269
261270
- name: Notary macOS Binary
262271
run: |
263272
curl -sSfL https://raw.githubusercontent.com/anchore/quill/main/install.sh | sh -s -- -b /usr/local/bin
264273
cd engine/cortex
265274
# Notarize the binary
266275
quill notarize ./${{ steps.set-output-params.outputs.destination_binary_name }}
276+
quill notarize ./${{ steps.set-output-params.outputs.destination_binary_server_name }}
267277
env:
268278
QUILL_NOTARY_KEY_ID: ${{ secrets.NOTARY_KEY_ID }}
269279
QUILL_NOTARY_ISSUER: ${{ secrets.NOTARY_ISSUER }}
@@ -273,7 +283,7 @@ jobs:
273283
shell: bash
274284
run: |
275285
cd engine
276-
make build-installer PACKAGE_NAME="${{ steps.set-output-params.outputs.package_name }}" VERSION=${{ inputs.new_version }} SOURCE_BINARY_PATH="../../cortex/${{ steps.set-output-params.outputs.destination_binary_name }}" 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 }}"
286+
make build-installer PACKAGE_NAME="${{ steps.set-output-params.outputs.package_name }}" VERSION=${{ inputs.new_version }} SOURCE_BINARY_PATH="../../cortex/${{ steps.set-output-params.outputs.destination_binary_name }}" SOURCE_BINARY_SERVER_PATH="../../cortex/${{ steps.set-output-params.outputs.destination_binary_server_name }}" DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}" DESTINATION_BINARY_SERVER_NAME="${{ steps.set-output-params.outputs.destination_binary_server_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 }}"
277287
cat templates/macos/Scripts/postinstall
278288
279289
- name: Codesign and notary for macos installer
@@ -298,7 +308,7 @@ jobs:
298308
299309
cd ../../
300310
chmod +x create_pkg_local.sh
301-
./create_pkg_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 }} ${{ steps.set-output-params.outputs.uninstaller_file_name }}
311+
./create_pkg_local.sh ${{ steps.set-output-params.outputs.package_name }} ${{ inputs.new_version }} ../../cortex/${{ steps.set-output-params.outputs.destination_binary_name }} ../../cortex/${{ steps.set-output-params.outputs.destination_binary_server_name }} ${{ steps.set-output-params.outputs.destination_binary_name }} ${{ steps.set-output-params.outputs.destination_binary_server_name }} ${{ steps.set-output-params.outputs.data_folder_name }} ${{ steps.set-output-params.outputs.configuration_file_name }} ${{ steps.set-output-params.outputs.uninstaller_file_name }}
302312
cp ${{ steps.set-output-params.outputs.package_name }}.pkg ../../
303313
304314
- name: Codesign and notary for macos installer
@@ -340,6 +350,7 @@ jobs:
340350
if: inputs.public_provider == 'aws-s3'
341351
run: |
342352
aws s3 cp ./engine/cortex.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/temp-latest/mac-universal-cortex-nightly.tar.gz
353+
aws s3 cp ./engine/${{ steps.set-output-params.outputs.package_name }}-network.pkg s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/temp-latest/cortex-mac-universal-network-installer.pkg
343354
344355
aws s3 cp ./engine/cortex.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/v${{ inputs.new_version }}/mac-universal/cortex-nightly.tar.gz
345356
aws s3 cp ./engine/${{ steps.set-output-params.outputs.package_name }}-network.pkg s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/v${{ inputs.new_version }}/mac-universal/cortex-${{ inputs.new_version }}-mac-universal-network-installer.pkg

0 commit comments

Comments
 (0)