diff --git a/.github/scripts/e2e-test-linux-and-mac.sh b/.github/scripts/e2e-test-linux-and-mac.sh index 0d850ea48..1c5fdf7f4 100644 --- a/.github/scripts/e2e-test-linux-and-mac.sh +++ b/.github/scripts/e2e-test-linux-and-mac.sh @@ -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=$! @@ -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", @@ -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: *' \ diff --git a/.github/scripts/e2e-test-windows.bat b/.github/scripts/e2e-test-windows.bat index 4389531c1..96a5385de 100644 --- a/.github/scripts/e2e-test-windows.bat +++ b/.github/scripts/e2e-test-windows.bat @@ -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 ( @@ -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: *" ^ diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 9cd93ab96..2e9a5b98d 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -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: diff --git a/llama.cpp b/llama.cpp index 1f5cd8327..1d144112c 160000 --- a/llama.cpp +++ b/llama.cpp @@ -1 +1 @@ -Subproject commit 1f5cd83275fabb43f2ae92c30033b384a3eb37b4 +Subproject commit 1d144112c0fbbb4ecc07dbcf4f05a380148bd6de