Skip to content

Commit

Permalink
fix: macos updater
Browse files Browse the repository at this point in the history
  • Loading branch information
hiento09 committed Nov 6, 2024
1 parent c179e67 commit 054fd75
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 5 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/nightly-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ jobs:
tags: menloltd/cortex:nightly-${{ needs.get-update-version.outputs.new_version }}

noti-discord-nightly-and-update-url-readme:
needs: [build-macos, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, get-cortex-llamacpp-latest-version, update-latest-version]
needs: [build-macos, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, get-cortex-llamacpp-latest-version, update-latest-version, build-docker-x64]
secrets: inherit
if: github.event_name == 'schedule'
uses: ./.github/workflows/template-noti-discord.yaml
Expand All @@ -133,7 +133,7 @@ jobs:
new_version: ${{ needs.get-update-version.outputs.new_version }}

noti-discord-manual:
needs: [build-macos, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, get-cortex-llamacpp-latest-version]
needs: [build-macos, build-windows-x64, build-linux-x64, get-update-version, set-public-provider, get-cortex-llamacpp-latest-version, build-docker-x64]
secrets: inherit
if: github.event_name == 'workflow_dispatch' && github.event.inputs.public_provider == 'aws-s3'
uses: ./.github/workflows/template-noti-discord.yaml
Expand Down
15 changes: 14 additions & 1 deletion .github/workflows/template-build-docker-x64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,4 +59,17 @@ jobs:
tags: ${{ inputs.tags }}
build-args: |
CORTEX_CPP_VERSION=${{ inputs.new_version }}
CMAKE_EXTRA_FLAGS=${{ inputs.cmake-extra-flags }}
CMAKE_EXTRA_FLAGS=${{ inputs.cmake-extra-flags }}
- name: Update Docker Hub overview
env:
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
run: |
README_CONTENT=$(cat docker/README.md | tr -d '\r' | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/"/\\"/g')
curl -X PATCH \
-H "Content-Type: application/json" \
-H "Authorization: JWT $(curl -s -H "Content-Type: application/json" -X POST -d '{"username": "'"$DOCKERHUB_USERNAME"'", "password": "'"$DOCKERHUB_TOKEN"'"}' https://hub.docker.com/v2/users/login/ | jq -r .token)" \
-d "{\"full_description\": \"$README_CONTENT\"}" \
https://hub.docker.com/v2/repositories/menloltd/cortex/
1 change: 1 addition & 0 deletions .github/workflows/template-noti-discord.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -42,4 +42,5 @@ jobs:
- Network Installer: https://delta.jan.ai/cortex/v${{ env.VERSION }}/linux-amd64/cortex-${{ env.VERSION }}-linux-amd64-network-installer.deb
- Local Installer: https://delta.jan.ai/cortex/v${{ env.VERSION }}/linux-amd64/cortex-${{ env.VERSION }}-linux-amd64-local-installer.deb
- Binary: https://delta.jan.ai/cortex/v${{ env.VERSION }}/linux-amd64/cortex-nightly.tar.gz
- Docker: menloltd/cortex:${{ env.VERSION }}
- Github action run: https://github.com/janhq/cortex.cpp/actions/runs/${{ env.RUNNER_ID }}
11 changes: 11 additions & 0 deletions docker/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,17 @@ This guide will help you set up and run Cortex using Docker.
- nvidia-container-toolkit (for GPU support)

### Instructions

#### Pull Cortex Docker Image from Docker Hub
1. Pull the Cortex Docker image from Docker Hub
```bash
# Pull the latest image
docker pull menloltd/cortex:latest

docker pull menloltd/cortex:1.0.1-224
```

#### Build and Run Cortex Docker Container from Dockerfile
1. Clone the Cortex repository
```bash
git clone https://github.com/janhq/cortex.cpp.git
Expand Down
4 changes: 2 additions & 2 deletions engine/cli/commands/cortex_upd_cmd.cc
Original file line number Diff line number Diff line change
Expand Up @@ -55,10 +55,10 @@ std::string GetNightlyInstallerName(const std::string& v,
// C:\Users\vansa\AppData\Local\Temp\cortex\cortex-windows-amd64-network-installer.exe
std::string GetInstallCmd(const std::string& exe_path) {
#if defined(__APPLE__) && defined(__MACH__)
return "sudo touch /var/tmp/cortex_installer_skip_postinstall && sudo installer "
return "sudo touch /var/tmp/cortex_installer_skip_postinstall_check && sudo installer "
"-pkg " +
exe_path +
" -target / && sudo rm /var/tmp/cortex_installer_skip_postinstall";
" -target / && sudo rm /var/tmp/cortex_installer_skip_postinstall_check";
#elif defined(__linux__)
return "echo -e \"n\\n\" | sudo SKIP_POSTINSTALL=true apt install -y "
"--allow-downgrades " +
Expand Down

0 comments on commit 054fd75

Please sign in to comment.