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

Commit a0130e0

Browse files
committed
Add bash script test for linux
1 parent 6298888 commit a0130e0

File tree

2 files changed

+91
-2
lines changed

2 files changed

+91
-2
lines changed

.github/scripts/linux.sh

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
#!/bin/bash
2+
3+
# Check for required arguments
4+
if [[ $# -ne 2 ]]; then
5+
echo "Usage: $0 <path_to_binary> <url_to_download>"
6+
exit 1
7+
fi
8+
9+
rm /tmp/response1.log /tmp/response2.log /tmp/nitro.log
10+
11+
BINARY_PATH=$1
12+
DOWNLOAD_URL=$2
13+
14+
# Start the binary file
15+
$BINARY_PATH > /tmp/nitro.log 2>&1 &
16+
17+
# Get the process id of the binary file
18+
pid=$!
19+
20+
if ! ps -p $pid > /dev/null; then
21+
echo "nitro failed to start. Logs:"
22+
cat /tmp/nitro.log
23+
exit 1
24+
fi
25+
26+
# Wait for a few seconds to let the server start
27+
sleep 5
28+
29+
30+
31+
# Check if /tmp/testmodel exists, if not, download it
32+
if [[ ! -f "/tmp/testmodel" ]]; then
33+
wget $DOWNLOAD_URL -O /tmp/testmodel
34+
fi
35+
36+
# Run the curl commands
37+
response1=$(curl -o /tmp/response1.log -s -w "%{http_code}" --location 'http://localhost:3928/inferences/llamacpp/loadModel' \
38+
--header 'Content-Type: application/json' \
39+
--data '{
40+
"llama_model_path": "/tmp/testmodel",
41+
"ctx_len": 2048,
42+
"ngl": 32,
43+
"embedding": false
44+
}' 2>&1)
45+
46+
response2=$(curl -o /tmp/response2.log -s -w "%{http_code}" --location 'http://localhost:3928/inferences/llamacpp/chat_completion' \
47+
--header 'Content-Type: application/json' \
48+
--header 'Accept: text/event-stream' \
49+
--header 'Access-Control-Allow-Origin: *' \
50+
--data '{
51+
"messages": [
52+
{"content": "Hello there", "role": "assistant"},
53+
{"content": "Write a long and sad story for me", "role": "user"}
54+
],
55+
"stream": true,
56+
"model": "gpt-3.5-turbo",
57+
"max_tokens": 2048,
58+
"stop": ["hello"],
59+
"frequency_penalty": 0,
60+
"presence_penalty": 0,
61+
"temperature": 0.7
62+
}' 2>&1
63+
)
64+
65+
error_occurred=0
66+
if [[ "$response1" -ne 200 ]]; then
67+
echo "The first curl command failed with status code: $response1"
68+
cat /tmp/response1.log
69+
error_occurred=1
70+
fi
71+
72+
if [[ "$response2" -ne 200 ]]; then
73+
echo "The second curl command failed with status code: $response2"
74+
cat /tmp/response2.log
75+
error_occurred=1
76+
fi
77+
78+
if [[ "$error_occurred" -eq 1 ]]; then
79+
echo "Nitro test run failed!!!!!!!!!!!!!!!!!!!!!!"
80+
echo "Nitro Error Logs:"
81+
cat /tmp/nitro.log
82+
kill $pid
83+
exit 1
84+
fi
85+
86+
echo "Nitro test run successfully!"
87+
88+
# Kill the server process
89+
kill $pid

.github/workflows/build.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -287,7 +287,7 @@ jobs:
287287
with:
288288
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
289289
asset_path: ./nitro.zip
290-
asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-win-amd64-${{ matrix.build }}.zip
290+
asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-win-amd64.zip
291291
asset_content_type: application/zip
292292

293293
windows-amd64-cuda-build:
@@ -347,7 +347,7 @@ jobs:
347347
with:
348348
upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
349349
asset_path: ./nitro.zip
350-
asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-win-amd64-${{ matrix.build }}-cu${{ matrix.cuda }}.zip
350+
asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-win-amd64-cuda.zip
351351
asset_content_type: application/zip
352352

353353
update_release_draft:

0 commit comments

Comments
 (0)