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

Commit 83918cb

Browse files
authored
Merge pull request #224 from janhq/chore/bump_llamacpp_version
Chore: Bump Nitro version
2 parents c2cde4c + 0f9c64b commit 83918cb

File tree

4 files changed

+20
-11
lines changed

4 files changed

+20
-11
lines changed

.github/scripts/e2e-test-linux-and-mac.sh

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,14 @@ rm /tmp/response1.log /tmp/response2.log /tmp/nitro.log
1414
BINARY_PATH=$1
1515
DOWNLOAD_URL=$2
1616

17+
# Random port to ensure it's not used
18+
min=10000
19+
max=11000
20+
range=$((max - min + 1))
21+
PORT=$((RANDOM % range + min))
22+
1723
# Start the binary file
18-
"$BINARY_PATH" 1 127.0.0.1 5000 > /tmp/nitro.log 2>&1 &
24+
"$BINARY_PATH" 1 127.0.0.1 $PORT > /tmp/nitro.log 2>&1 &
1925

2026
# Get the process id of the binary file
2127
pid=$!
@@ -29,15 +35,13 @@ fi
2935
# Wait for a few seconds to let the server start
3036
sleep 5
3137

32-
33-
3438
# Check if /tmp/testmodel exists, if not, download it
3539
if [[ ! -f "/tmp/testmodel" ]]; then
3640
wget $DOWNLOAD_URL -O /tmp/testmodel
3741
fi
3842

3943
# Run the curl commands
40-
response1=$(curl -o /tmp/response1.log -s -w "%{http_code}" --location 'http://127.0.0.1:5000/inferences/llamacpp/loadModel' \
44+
response1=$(curl -o /tmp/response1.log -s -w "%{http_code}" --location "http://127.0.0.1:$PORT/inferences/llamacpp/loadModel" \
4145
--header 'Content-Type: application/json' \
4246
--data '{
4347
"llama_model_path": "/tmp/testmodel",
@@ -46,7 +50,7 @@ response1=$(curl -o /tmp/response1.log -s -w "%{http_code}" --location 'http://1
4650
"embedding": false
4751
}' 2>&1)
4852

49-
response2=$(curl -o /tmp/response2.log -s -w "%{http_code}" --location 'http://127.0.0.1:5000/inferences/llamacpp/chat_completion' \
53+
response2=$(curl -o /tmp/response2.log -s -w "%{http_code}" --location "http://127.0.0.1:$PORT/inferences/llamacpp/chat_completion" \
5054
--header 'Content-Type: application/json' \
5155
--header 'Accept: text/event-stream' \
5256
--header 'Access-Control-Allow-Origin: *' \

.github/scripts/e2e-test-windows.bat

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,15 @@ del %TEMP%\response1.log 2>nul
2020
del %TEMP%\response2.log 2>nul
2121
del %TEMP%\nitro.log 2>nul
2222

23+
set /a min=9999
24+
set /a max=11000
25+
set /a range=max-min+1
26+
set /a PORT=%min% + %RANDOM% %% %range%
27+
2328
rem Start the binary file
24-
start /B "" "%BINARY_PATH%" 1 "127.0.0.1" 5000 > %TEMP%\nitro.log 2>&1
29+
start /B "" "%BINARY_PATH%" 1 "127.0.0.1" %PORT% > %TEMP%\nitro.log 2>&1
2530

26-
ping -n 6 127.0.0.1 5000 > nul
31+
ping -n 6 127.0.0.1 %PORT% > nul
2732

2833
rem Capture the PID of the started process with "nitro" in its name
2934
for /f "tokens=2" %%a in ('tasklist /fi "imagename eq %BINARY_NAME%" /fo list ^| findstr /B "PID:"') do (
@@ -55,9 +60,9 @@ echo curl_data1=%curl_data1%
5560
echo curl_data2=%curl_data2%
5661

5762
rem Run the curl commands and capture the status code
58-
curl.exe -o %TEMP%\response1.log -s -w "%%{http_code}" --location "http://127.0.0.1:5000/inferences/llamacpp/loadModel" --header "Content-Type: application/json" --data "%curl_data1%" > %TEMP%\response1_code.log 2>&1
63+
curl.exe -o %TEMP%\response1.log -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/inferences/llamacpp/loadModel" --header "Content-Type: application/json" --data "%curl_data1%" > %TEMP%\response1_code.log 2>&1
5964

60-
curl.exe -o %TEMP%\response2.log -s -w "%%{http_code}" --location "http://127.0.0.1:5000/inferences/llamacpp/chat_completion" ^
65+
curl.exe -o %TEMP%\response2.log -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/inferences/llamacpp/chat_completion" ^
6166
--header "Content-Type: application/json" ^
6267
--header "Accept: text/event-stream" ^
6368
--header "Access-Control-Allow-Origin: *" ^

.github/workflows/build.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ jobs:
4444
prerelease: false
4545

4646
ubuntu-amd64-build:
47-
runs-on: linux-gpu
47+
runs-on: ubuntu-latest
4848
needs: create-draft-release
4949
if: always() && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped')
5050
permissions:

llama.cpp

0 commit comments

Comments
 (0)