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

Commit c0e4191

Browse files
committed
Merge branch 'dev' into feat/installer-windows
2 parents 5a06780 + 4cc7528 commit c0e4191

File tree

5 files changed

+40
-43
lines changed

5 files changed

+40
-43
lines changed

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

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -182,22 +182,26 @@ jobs:
182182
make build-installer PACKAGE_NAME=${{ steps.set-output-params.outputs.package_name }} VERSION=${{ inputs.new_version }} DESTINATION_BINARY_NAME="${{ steps.set-output-params.outputs.destination_binary_name }}"
183183
ls ../
184184
185+
- name: Enable long paths
186+
run: |
187+
reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\FileSystem" /v LongPathsEnabled /t REG_DWORD /d 1 /f
188+
185189
- name: Compile .ISS to .EXE Installer
186-
uses: Minionguyjpro/Inno-Setup-Action@v1.2.2
190+
uses: nadeemjazmawe/inno-setup-action-cli@v6.0.5
187191
with:
188-
path: ${{ steps.set-output-params.outputs.iss_file_name }}
189-
options: /O+
192+
filepath: ./${{ steps.set-output-params.outputs.iss_file_name }}
190193

191194
- name: Codesign for windows installer
195+
shell: pwsh
192196
run: |
193-
%USERPROFILE%\.dotnet\tools\azuresigntool.exe sign -kvu ${{ secrets.AZURE_KEY_VAULT_URI }} -kvi ${{ secrets.AZURE_CLIENT_ID }} -kvt ${{ secrets.AZURE_TENANT_ID }} -kvs ${{ secrets.AZURE_CLIENT_SECRET }} -kvc ${{ secrets.AZURE_CERT_NAME }} -tr http://timestamp.globalsign.com/tsa/r6advanced1 -v ".\setup.exe";'
197+
~\.dotnet\tools\azuresigntool.exe sign -kvu ${{ secrets.AZURE_KEY_VAULT_URI }} -kvi ${{ secrets.AZURE_CLIENT_ID }} -kvt ${{ secrets.AZURE_TENANT_ID }} -kvs ${{ secrets.AZURE_CLIENT_SECRET }} -kvc ${{ secrets.AZURE_CERT_NAME }} -tr http://timestamp.globalsign.com/tsa/r6advanced1 -v ".\setup.exe"
194198
195199
- name: Package
196200
run: |
197201
cd engine
198202
make package
199203
200-
- name: Upload Artifact
204+
- name: Upload Artifact
201205
uses: actions/upload-artifact@v4
202206
with:
203207
name: cortex-${{ inputs.new_version }}-windows-amd64
@@ -212,6 +216,8 @@ jobs:
212216
- name: upload to aws s3 if public provider is aws
213217
if: inputs.public_provider == 'aws-s3'
214218
run: |
219+
Import-Module "$env:ChocolateyInstall\helpers\chocolateyProfile.psm1"
220+
refreshenv
215221
aws s3 cp ./engine/cortex.tar.gz s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/latest/windows-amd64/cortex-nightly.tar.gz
216222
aws s3 cp ./setup.exe s3://${{ secrets.DELTA_AWS_S3_BUCKET_NAME }}/cortex/latest/windows-amd64/cortex-${{ inputs.new_version }}-windows-amd64-installer.exe
217223

engine/commands/engine_get_cmd.cc

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@ void EngineGetCmd::Exec() const {
1313
try {
1414
auto status = engine_service.GetEngineInfo(engine_);
1515
tabulate::Table table;
16-
table.add_row({"name", "description", "version", "product name", "status"});
17-
table.format().font_color(tabulate::Color::green);
18-
table.add_row({status.name, status.description, status.version,
19-
status.product_name, status.status});
16+
table.add_row({"Name", "Supported Formats", "Version", "Status"});
17+
table.add_row(
18+
{status.product_name, status.format, status.version, status.status});
2019
std::cout << table << std::endl;
2120
} catch (const std::runtime_error& e) {
2221
std::cerr << "Engine " << engine_ << " is not supported!" << "\n";

engine/commands/engine_list_cmd.cc

Lines changed: 3 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -9,28 +9,12 @@ bool EngineListCmd::Exec() {
99
auto status_list = engine_service.GetEngineInfoList();
1010

1111
tabulate::Table table;
12-
table.format().font_color(tabulate::Color::green);
13-
table.add_row(
14-
{"(Index)", "name", "description", "version", "product name", "status"});
12+
table.add_row({"#", "Name", "Supported Formats", "Version", "Status"});
1513
for (int i = 0; i < status_list.size(); i++) {
1614
auto status = status_list[i];
1715
std::string index = std::to_string(i + 1);
18-
table.add_row({index, status.name, status.description, status.version,
19-
status.product_name, status.status});
20-
}
21-
22-
for (int i = 0; i < 6; i++) {
23-
table[0][i]
24-
.format()
25-
.font_color(tabulate::Color::white) // Set font color
26-
.font_style({tabulate::FontStyle::bold})
27-
.font_align(tabulate::FontAlign::center);
28-
}
29-
for (int i = 1; i < 4; i++) {
30-
table[i][0]
31-
.format()
32-
.font_color(tabulate::Color::white) // Set font color
33-
.font_align(tabulate::FontAlign::center);
16+
table.add_row({index, status.product_name, status.format, status.version,
17+
status.status});
3418
}
3519

3620
std::cout << table << std::endl;

engine/services/engine_service.cc

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,12 @@
33
#include "algorithm"
44
#include "utils/file_manager_utils.h"
55

6+
namespace {
7+
constexpr static auto kIncompatible = "Incompatible";
8+
constexpr static auto kReady = "Ready";
9+
constexpr static auto kNotInstalled = "Not Installed";
10+
} // namespace
11+
612
EngineInfo EngineService::GetEngineInfo(const std::string& engine) const {
713
// if engine is not found in kSupportEngine, throw runtime error
814
if (std::find(kSupportEngines.begin(), kSupportEngines.end(), engine) ==
@@ -21,42 +27,43 @@ EngineInfo EngineService::GetEngineInfo(const std::string& engine) const {
2127
std::vector<EngineInfo> EngineService::GetEngineInfoList() const {
2228
auto ecp = file_manager_utils::GetEnginesContainerPath();
2329

24-
std::string onnx_status{"not_supported"};
25-
std::string llamacpp_status = std::filesystem::exists(ecp / "cortex.llamacpp")
26-
? "ready"
27-
: "not_initialized";
28-
std::string tensorrt_status{"not_supported"};
30+
std::string onnx_status{kIncompatible};
31+
std::string llamacpp_status =
32+
std::filesystem::exists(ecp / "cortex.llamacpp") ? kReady : kNotInstalled;
33+
std::string tensorrt_status{kIncompatible};
2934

3035
#ifdef _WIN32
31-
onnx_status = std::filesystem::exists(ecp / "cortex.onnx")
32-
? "ready"
33-
: "not_initialized";
36+
onnx_status =
37+
std::filesystem::exists(ecp / "cortex.onnx") ? kReady : kNotInstalled;
3438
tensorrt_status = std::filesystem::exists(ecp / "cortex.tensorrt-llm")
35-
? "ready"
36-
: "not_initialized";
39+
? kReady
40+
: kNotInstalled;
3741
#elif defined(__linux__)
3842
tensorrt_status = std::filesystem::exists(ecp / "cortex.tensorrt-llm")
39-
? "ready"
40-
: "not_initialized";
43+
? kReady
44+
: kNotInstalled;
4145
#endif
4246
std::vector<EngineInfo> engines = {
4347
{.name = "cortex.onnx",
4448
.description = "This extension enables chat completion API calls using "
4549
"the Onnx engine",
50+
.format = "ONNX",
4651
.version = "0.0.1",
47-
.product_name = "Onnx Inference Engine",
52+
.product_name = "ONNXRuntime",
4853
.status = onnx_status},
4954
{.name = "cortex.llamacpp",
5055
.description = "This extension enables chat completion API calls using "
5156
"the LlamaCPP engine",
57+
.format = "GGUF",
5258
.version = "0.0.1",
53-
.product_name = "LlamaCPP Inference Engine",
59+
.product_name = "llama.cpp",
5460
.status = llamacpp_status},
5561
{.name = "cortex.tensorrt-llm",
5662
.description = "This extension enables chat completion API calls using "
5763
"the TensorrtLLM engine",
64+
.format = "TensorRT Engines",
5865
.version = "0.0.1",
59-
.product_name = "TensorrtLLM Inference Engine",
66+
.product_name = "TensorRT-LLM",
6067
.status = tensorrt_status},
6168
};
6269

engine/services/engine_service.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
struct EngineInfo {
88
std::string name;
99
std::string description;
10+
std::string format;
1011
std::string version;
1112
std::string product_name;
1213
std::string status;

0 commit comments

Comments
 (0)