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

Commit c04b46c

Browse files
committed
Merge branch 'dev' into feat/cicd-docker
2 parents e6cf0ff + 90bcb79 commit c04b46c

File tree

7 files changed

+51
-47
lines changed

7 files changed

+51
-47
lines changed

.github/workflows/beta-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ jobs:
8888
ref: ${{ github.ref }}
8989
new_version: ${{ needs.get-update-version.outputs.new_version }}
9090
runs-on: ubuntu-latest
91-
cmake-extra-flags: "-DCORTEX_VARIANT=beta"
91+
cmake-extra-flags: "-DCORTEX_VARIANT=prod"
9292
tags: "menloltd/cortex:${{ needs.get-update-version.outputs.new_version }}"
9393

9494
update_release:

.github/workflows/cortex-cpp-quality-gate.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,6 +101,8 @@ jobs:
101101
run: |
102102
cd engine
103103
make run-unit-tests
104+
env:
105+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
104106

105107
- name: Run setup config for macos
106108
if: runner.os == 'macOS'

.github/workflows/nightly-build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ jobs:
120120
ref: ${{ needs.set-public-provider.outputs.ref }}
121121
new_version: nightly-${{ needs.get-update-version.outputs.new_version }}
122122
runs-on: ubuntu-latest
123-
cmake-extra-flags: "-DCORTEX_VARIANT=nightly"
123+
cmake-extra-flags: "-DCORTEX_VARIANT=prod"
124124
tags: menloltd/cortex:nightly-${{ needs.get-update-version.outputs.new_version }}
125125

126126
noti-discord-nightly-and-update-url-readme:

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

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -66,10 +66,11 @@ jobs:
6666
DOCKERHUB_USERNAME: ${{ secrets.DOCKERHUB_USERNAME }}
6767
DOCKERHUB_TOKEN: ${{ secrets.DOCKERHUB_TOKEN }}
6868
run: |
69-
README_CONTENT=$(cat docker/README.md | tr -d '\r' | sed ':a;N;$!ba;s/\n/\\n/g' | sed 's/"/\\"/g')
69+
README_CONTENT=$(cat docker/README.md | tr -d '\r' | sed ':a;N;$!ba;s/\n/\\n/g')
70+
JSON_PAYLOAD=$(printf '{"full_description": "%s"}' "$README_CONTENT")
7071
7172
curl -X PATCH \
7273
-H "Content-Type: application/json" \
7374
-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)" \
74-
-d "{\"full_description\": \"$README_CONTENT\"}" \
75+
-d "{\"full_description\": \"$JSON_PAYLOAD\"}" \
7576
https://hub.docker.com/v2/repositories/menloltd/cortex/

.github/workflows/test-cortexso-model-hub.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ jobs:
5959
run: |
6060
cd engine
6161
make run-unit-tests
62+
env:
63+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
6264

6365
- name: Run setup config for linux
6466
shell: bash

docker/README.md

Lines changed: 40 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -10,58 +10,56 @@ For more information on how to use Cortex, please refer to the [Cortex Documenta
1010

1111
### Instructions
1212

13-
#### Build Cortex Docker Image from source or Pull from Docker Hub
13+
**Build Cortex Docker Image from source or Pull from Docker Hub**
1414

15-
##### Pull Cortex Docker Image from Docker Hub
15+
- Pull Cortex Docker Image from Docker Hub
1616

17-
```bash
18-
# Pull the latest image
19-
docker pull menloltd/cortex:latest
17+
```bash
18+
# Pull the latest image
19+
docker pull menloltd/cortex:latest
2020

21-
# Pull a specific version
22-
docker pull menloltd/cortex:nightly-1.0.1-224
23-
```
21+
# Pull a specific version
22+
docker pull menloltd/cortex:nightly-1.0.1-224
23+
```
2424

25-
##### Build and Run Cortex Docker Container from Dockerfile
25+
- Build and Run Cortex Docker Container from Dockerfile
2626

27-
1. Clone the Cortex repository
28-
```bash
29-
git clone https://github.com/janhq/cortex.cpp.git
30-
cd cortex.cpp
31-
git submodule update --init
32-
```
33-
2. Build the Docker image
34-
```bash
35-
# Default always uses the latest cortex.cpp and cortex.llamacpp
36-
docker build -t cortex --build-arg CORTEX_CPP_VERSION=$(git rev-parse HEAD) -f docker/Dockerfile .
27+
```bash
28+
git clone https://github.com/janhq/cortex.cpp.git
29+
cd cortex.cpp
30+
git submodule update --init
3731

38-
# Use specific version of cortex.cpp and cortex.llamacpp
39-
docker build --build-arg CORTEX_LLAMACPP_VERSION=0.1.34 --build-arg CORTEX_CPP_VERSION=$(git rev-parse HEAD) -t cortex -f docker/Dockerfile .
40-
```
32+
# Default always uses the latest cortex.cpp and cortex.llamacpp
33+
docker build -t menloltd/cortex --build-arg CORTEX_CPP_VERSION=$(git rev-parse HEAD) -f docker/Dockerfile .
4134

42-
#### Run Cortex Docker Container
35+
# Use specific version of cortex.cpp and cortex.llamacpp
36+
docker build --build-arg CORTEX_LLAMACPP_VERSION=0.1.34 --build-arg CORTEX_CPP_VERSION=$(git rev-parse HEAD) -t menloltd/cortex -f docker/Dockerfile .
37+
```
4338

44-
1. Run the Docker container
45-
```bash
46-
# Create Volume to store models and data
47-
docker volume create cortex_data
39+
**Run Cortex Docker Container**
4840

49-
# CPU mode
50-
docker run -it -d --name cortex -v cortex_data:/root/cortexcpp -p 39281:39281 cortex
41+
```bash
42+
# Create Volume to store models and data
43+
docker volume create cortex_data
5144

52-
# GPU mode - nvidia-docker required, it will automatically use all available GPUs
53-
docker run --gpus all -it -d --name cortex -v cortex_data:/root/cortexcpp -p 39281:39281 cortex
54-
```
45+
# GPU mode - nvidia-docker required, it will automatically use all available GPUs
46+
docker run --gpus all -it -d --name cortex -v cortex_data:/root/cortexcpp -p 39281:39281 menloltd/cortex
5547

56-
2. Check logs (Optional)
57-
```bash
58-
docker logs cortex
59-
```
48+
# CPU mode
49+
docker run -it -d --name cortex -v cortex_data:/root/cortexcpp -p 39281:39281 menloltd/cortex
50+
```
6051

61-
3. Access to http://localhost:39281 to check the cortex docs API.
52+
**Check logs (Optional)**
6253

63-
4. Execute to container and try out cortex cli
64-
```bash
65-
docker exec -it cortex bash
66-
cortex --help
67-
```
54+
```bash
55+
docker logs cortex
56+
```
57+
58+
**Access to http://localhost:39281 to check the cortex docs API.**
59+
60+
**Execute to container and try out cortex cli**
61+
62+
```bash
63+
docker exec -it cortex bash
64+
cortex --help
65+
```

engine/cli/commands/cortex_upd_cmd.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,8 @@ std::unique_ptr<system_info_utils::SystemInfo> GetSystemInfoWithUniversal() {
4242
std::string GetNightlyInstallerName(const std::string& v,
4343
const std::string& os_arch) {
4444
const std::string kCortex = "cortex";
45-
std::string version = v == "latest" ? "" : (v + "-");
45+
// Remove 'v' in file name
46+
std::string version = v == "latest" ? "" : (v.substr(1) + "-");
4647
#if defined(__APPLE__) && defined(__MACH__)
4748
return kCortex + "-" + version + os_arch + "-network-installer.pkg";
4849
#elif defined(__linux__)

0 commit comments

Comments
 (0)