Skip to content
This repository was archived by the owner on Jul 4, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 9 additions & 5 deletions .github/scripts/e2e-test-linux-and-mac.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ rm /tmp/response1.log /tmp/response2.log /tmp/nitro.log
BINARY_PATH=$1
DOWNLOAD_URL=$2

# Random port to ensure it's not used
min=10000
max=11000
range=$((max - min + 1))
PORT=$((RANDOM % range + min))

# Start the binary file
"$BINARY_PATH" 1 127.0.0.1 5000 > /tmp/nitro.log 2>&1 &
"$BINARY_PATH" 1 127.0.0.1 $PORT > /tmp/nitro.log 2>&1 &

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



# Check if /tmp/testmodel exists, if not, download it
if [[ ! -f "/tmp/testmodel" ]]; then
wget $DOWNLOAD_URL -O /tmp/testmodel
fi

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

response2=$(curl -o /tmp/response2.log -s -w "%{http_code}" --location 'http://127.0.0.1:5000/inferences/llamacpp/chat_completion' \
response2=$(curl -o /tmp/response2.log -s -w "%{http_code}" --location "http://127.0.0.1:$PORT/inferences/llamacpp/chat_completion" \
--header 'Content-Type: application/json' \
--header 'Accept: text/event-stream' \
--header 'Access-Control-Allow-Origin: *' \
Expand Down
13 changes: 9 additions & 4 deletions .github/scripts/e2e-test-windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,15 @@ del %TEMP%\response1.log 2>nul
del %TEMP%\response2.log 2>nul
del %TEMP%\nitro.log 2>nul

set /a min=9999
set /a max=11000
set /a range=max-min+1
set /a PORT=%min% + %RANDOM% %% %range%

rem Start the binary file
start /B "" "%BINARY_PATH%" 1 "127.0.0.1" 5000 > %TEMP%\nitro.log 2>&1
start /B "" "%BINARY_PATH%" 1 "127.0.0.1" %PORT% > %TEMP%\nitro.log 2>&1

ping -n 6 127.0.0.1 5000 > nul
ping -n 6 127.0.0.1 %PORT% > nul

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

rem Run the curl commands and capture the status code
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
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

curl.exe -o %TEMP%\response2.log -s -w "%%{http_code}" --location "http://127.0.0.1:5000/inferences/llamacpp/chat_completion" ^
curl.exe -o %TEMP%\response2.log -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/inferences/llamacpp/chat_completion" ^
--header "Content-Type: application/json" ^
--header "Accept: text/event-stream" ^
--header "Access-Control-Allow-Origin: *" ^
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ jobs:
prerelease: false

ubuntu-amd64-build:
runs-on: linux-gpu
runs-on: ubuntu-latest
needs: create-draft-release
if: always() && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped')
permissions:
Expand Down
2 changes: 1 addition & 1 deletion llama.cpp