Skip to content

Commit ac00448

Browse files
committed
fix: select linux arm64
1 parent 51e7aef commit ac00448

File tree

5 files changed

+26
-3
lines changed

5 files changed

+26
-3
lines changed

engine/e2e-test/test_api_engine.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,8 @@ def test_engines_install_llamacpp_specific_version_and_null_variant(self):
4444
# engines uninstall
4545
@pytest.mark.asyncio
4646
async def test_engines_install_uninstall_llamacpp_should_be_successful(self):
47-
response = requests.post("http://localhost:3928/v1/engines/llama-cpp/install")
47+
data = {"version": "v0.1.43"}
48+
response = requests.post("http://localhost:3928/v1/engines/llama-cpp/install", json=data)
4849
assert response.status_code == 200
4950
await wait_for_websocket_download_success_event(timeout=None)
5051
time.sleep(30)

engine/e2e-test/test_api_engine_install_nightly.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,8 @@ def setup_and_teardown(self):
1919
stop_server()
2020

2121
def test_engines_install_llamacpp_should_be_successful(self):
22-
response = requests.post("http://localhost:3928/v1/engines/llama-cpp/install")
22+
data = {"version": "v0.1.43"}
23+
response = requests.post("http://localhost:3928/v1/engines/llama-cpp/install", json=data)
2324
assert response.status_code == 200
2425

2526
def test_engines_install_llamacpp_specific_version_and_variant(self):

engine/e2e-test/test_api_model.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,9 +85,12 @@ async def test_model_pull_with_direct_url_should_have_desired_name(self):
8585
],
8686
)
8787

88+
@pytest.mark.asyncio
8889
async def test_models_start_stop_should_be_successful(self):
8990
print("Install engine")
90-
response = requests.post("http://localhost:3928/v1/engines/llama-cpp/install")
91+
# TODO(sang) Remove version after marking 0.1.43 as stable
92+
data = {"version": "v0.1.43"}
93+
response = requests.post("http://localhost:3928/v1/engines/llama-cpp/install", json=data)
9194
assert response.status_code == 200
9295
await wait_for_websocket_download_success_event(timeout=None)
9396
# TODO(sang) need to fix for cuda download

engine/test/components/test_engine_matcher_utils.cc

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ class EngineMatcherUtilsTestSuite : public ::testing::Test {
1919
"cortex.llamacpp-0.1.25-25.08.24-linux-amd64-noavx-cuda-12-0.tar.gz",
2020
"cortex.llamacpp-0.1.25-25.08.24-linux-amd64-noavx.tar.gz",
2121
"cortex.llamacpp-0.1.25-25.08.24-linux-amd64-vulkan.tar.gz",
22+
"cortex.llamacpp-0.1.43-linux-arm64.tar.gz",
2223
"cortex.llamacpp-0.1.25-25.08.24-mac-amd64.tar.gz",
2324
"cortex.llamacpp-0.1.25-25.08.24-mac-arm64.tar.gz",
2425
"cortex.llamacpp-0.1.25-25.08.24-windows-amd64-avx-cuda-11-7.tar.gz",
@@ -134,6 +135,18 @@ TEST_F(EngineMatcherUtilsTestSuite, TestValidate) {
134135
EXPECT_EQ(variant,
135136
"cortex.llamacpp-0.1.25-25.08.24-windows-amd64-avx2.tar.gz");
136137
}
138+
139+
{
140+
auto os{"linux"};
141+
auto cpu_arch{"arm64"};
142+
auto suitable_avx{""};
143+
auto cuda_version{""};
144+
145+
auto variant = engine_matcher_utils::Validate(
146+
cortex_llamacpp_variants, os, cpu_arch, suitable_avx, cuda_version);
147+
148+
EXPECT_EQ(variant, "cortex.llamacpp-0.1.43-linux-arm64.tar.gz");
149+
}
137150
}
138151

139152
TEST_F(EngineMatcherUtilsTestSuite, TestGetVersionAndArch) {

engine/utils/engine_matcher_utils.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -156,6 +156,11 @@ inline std::string Validate(const std::vector<std::string>& variants,
156156
if (os == "mac" && !os_and_arch_compatible_list.empty())
157157
return os_and_arch_compatible_list[0];
158158

159+
if (os == "linux" && cpu_arch == "arm64" &&
160+
!os_and_arch_compatible_list.empty()) {
161+
return os_and_arch_compatible_list[0];
162+
}
163+
159164
std::vector<std::string> avx_compatible_list;
160165

161166
std::copy_if(os_and_arch_compatible_list.begin(),

0 commit comments

Comments
 (0)