Skip to content

Commit fd6500f

Browse files
authored
Remove always() condition in run github action jobs and remove e2e testing that hang the CI (#460)
Co-authored-by: Hien To <[email protected]>
1 parent 9e8293d commit fd6500f

File tree

5 files changed

+51
-129
lines changed

5 files changed

+51
-129
lines changed

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

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ range=$((max - min + 1))
2121
PORT=$((RANDOM % range + min))
2222

2323
# Start the binary file
24-
"$BINARY_PATH" 1 127.0.0.1 $PORT >/tmp/nitro.log 2>&1 &
24+
"$BINARY_PATH" 1 127.0.0.1 $PORT >/tmp/nitro.log &
2525

2626
# Get the process id of the binary file
2727
pid=$!
@@ -37,21 +37,27 @@ sleep 5
3737

3838
# Check if /tmp/testllm exists, if not, download it
3939
if [[ ! -f "/tmp/testllm" ]]; then
40-
wget $DOWNLOAD_URL -O /tmp/testllm
40+
curl --connect-timeout 300 $DOWNLOAD_URL --output /tmp/testllm
4141
fi
4242

4343
# Run the curl commands
44-
response1=$(curl -o /tmp/response1.log -s -w "%{http_code}" --location "http://127.0.0.1:$PORT/inferences/llamacpp/loadModel" \
44+
response1=$(curl --connect-timeout 60 -o /tmp/response1.log -s -w "%{http_code}" --location "http://127.0.0.1:$PORT/inferences/llamacpp/loadModel" \
4545
--header 'Content-Type: application/json' \
4646
--data '{
4747
"llama_model_path": "/tmp/testllm",
4848
"ctx_len": 50,
4949
"ngl": 32,
5050
"embedding": false
51-
}' 2>&1)
51+
}')
52+
53+
if ! ps -p $pid >/dev/null; then
54+
echo "nitro failed to load model. Logs:"
55+
cat /tmp/nitro.log
56+
exit 1
57+
fi
5258

5359
response2=$(
54-
curl -o /tmp/response2.log -s -w "%{http_code}" --location "http://127.0.0.1:$PORT/v1/chat/completions" \
60+
curl --connect-timeout 60 -o /tmp/response2.log -s -w "%{http_code}" --location "http://127.0.0.1:$PORT/v1/chat/completions" \
5561
--header 'Content-Type: application/json' \
5662
--header 'Accept: text/event-stream' \
5763
--header 'Access-Control-Allow-Origin: *' \
@@ -67,7 +73,7 @@ response2=$(
6773
"frequency_penalty": 0,
6874
"presence_penalty": 0,
6975
"temperature": 0.1
70-
}' 2>&1
76+
}'
7177
)
7278

7379
error_occurred=0

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ rem Wait for a few seconds to let the server start
4747

4848
rem Check if %TEMP%\testmodel exists, if not, download it
4949
if not exist "%MODEL_PATH%" (
50-
bitsadmin.exe /transfer "DownloadTestModel" %DOWNLOAD_URL% "%MODEL_PATH%"
50+
curl.exe --connect-timeout 300 %DOWNLOAD_URL% --output "%MODEL_PATH%"
5151
)
5252

5353
rem Define JSON strings for curl data

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

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ range=$((max - min + 1))
2121
PORT=$((RANDOM % range + min))
2222

2323
# Start the binary file
24-
"$BINARY_PATH" 1 127.0.0.1 $PORT >/tmp/nitro.log 2>&1 &
24+
"$BINARY_PATH" 1 127.0.0.1 $PORT >/tmp/nitro.log &
2525

2626
# Get the process id of the binary file
2727
pid=$!
@@ -37,25 +37,25 @@ sleep 5
3737

3838
# Check if /tmp/testwhisper exists, if not, download it
3939
if [[ ! -f "/tmp/testwhisper" ]]; then
40-
wget $DOWNLOAD_URL -O /tmp/testwhisper
40+
curl --connect-timeout 300 $DOWNLOAD_URL --output /tmp/testwhisper
4141
fi
4242

4343
# Run the curl commands
44-
response1=$(curl -o /tmp/response1.log -s -w "%{http_code}" --location "http://127.0.0.1:$PORT/v1/audio/load_model" \
44+
response1=$(curl --connect-timeout 60 -o /tmp/response1.log -s -w "%{http_code}" --location "http://127.0.0.1:$PORT/v1/audio/load_model" \
4545
--header 'Content-Type: application/json' \
4646
--data '{
4747
"model_path": "/tmp/testwhisper",
4848
"model_id": "whisper.cpp"
49-
}' 2>&1)
49+
}')
5050

5151
response2=$(
52-
curl -o /tmp/response2.log -s -w "%{http_code}" --location "http://127.0.0.1:$PORT/v1/audio/transcriptions" \
52+
curl --connect-timeout 60 -o /tmp/response2.log -s -w "%{http_code}" --location "http://127.0.0.1:$PORT/v1/audio/transcriptions" \
5353
--header 'Access-Control-Allow-Origin: *' \
5454
--form 'file=@"../whisper.cpp/samples/jfk.wav"' \
5555
--form 'model_id="whisper.cpp"' \
5656
--form 'temperature="0.0"' \
5757
--form 'prompt="The transcript is about OpenAI which makes technology like DALL·E, GPT-3, and ChatGPT with the hope of one day building an AGI system that benefits all of humanity. The president is trying to raly people to support the cause."' \
58-
2>&1
58+
5959
)
6060

6161
error_occurred=0

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

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,17 +47,17 @@ rem Wait for a few seconds to let the server start
4747

4848
rem Check if %TEMP%\testwhisper exists, if not, download it
4949
if not exist "%MODEL_PATH%" (
50-
bitsadmin.exe /transfer "DownloadTestModel" %DOWNLOAD_URL% "%MODEL_PATH%"
50+
curl.exe --connect-timeout 300 %DOWNLOAD_URL% --output "%MODEL_PATH%"
5151
)
5252

5353
rem Define JSON strings for curl data
5454
call set "MODEL_PATH_STRING=%%MODEL_PATH:\=\\%%"
5555
set "curl_data1={\"model_path\":\"%MODEL_PATH_STRING%\",\"model_id\":\"whisper\"}"
5656

5757
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:%PORT%/v1/audio/load_model" --header "Content-Type: application/json" --data "%curl_data1%" > %TEMP%\response1_code.log 2>&1
58+
curl.exe --connect-timeout 60 -o %TEMP%\response1.log -s -w "%%{http_code}" --location "http://127.0.0.1:%PORT%/v1/audio/load_model" --header "Content-Type: application/json" --data "%curl_data1%" > %TEMP%\response1_code.log 2>&1
5959

60-
curl -o %TEMP%\response2.log -s -w "%%{http_code}" --location "http://localhost:%PORT%/v1/audio/transcriptions" ^
60+
curl --connect-timeout 60 -o %TEMP%\response2.log -s -w "%%{http_code}" --location "http://localhost:%PORT%/v1/audio/transcriptions" ^
6161
--form "file=@../..//whisper.cpp/samples/jfk.wav" ^
6262
--form "model_id=whisper" > %TEMP%\response2_code.log 2>&1
6363

.github/workflows/build.yml

Lines changed: 29 additions & 113 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ on:
4949

5050
env:
5151
BRANCH_NAME: ${{ github.head_ref || github.ref_name }}
52-
LLM_MODEL_URL: https://huggingface.co/TheBloke/TinyLlama-1.1B-Chat-v0.3-GGUF/resolve/main/tinyllama-1.1b-chat-v0.3.Q2_K.gguf
53-
WHISPER_MODEL_URL: https://huggingface.co/ggerganov/whisper.cpp/resolve/main/ggml-tiny-q5_1.bin
52+
LLM_MODEL_URL: https://delta.jan.ai/tinyllama-1.1b-chat-v0.3.Q2_K.gguf
53+
WHISPER_MODEL_URL: https://delta.jan.ai/ggml-tiny-q5_1.bin
5454

5555
jobs:
5656
create-draft-release:
@@ -125,6 +125,7 @@ jobs:
125125
runs-on: ubuntu-18-04-cuda-11-7
126126
needs: [create-draft-release, set-nitro-version]
127127
if: always() && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.set-nitro-version.result == 'success'
128+
timeout-minutes: 20
128129
permissions:
129130
contents: write
130131
steps:
@@ -188,6 +189,7 @@ jobs:
188189
runs-on: ubuntu-18-04-cuda-11-7
189190
needs: [create-draft-release, set-nitro-version]
190191
if: always() && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.set-nitro-version.result == 'success'
192+
timeout-minutes: 20
191193
permissions:
192194
contents: write
193195
steps:
@@ -231,22 +233,6 @@ jobs:
231233
name: nitro-linux-amd64-vulkan
232234
path: ./nitro
233235

234-
# - name: Run e2e testing - LLama.CPP
235-
# shell: bash
236-
# run: |
237-
# # run e2e testing
238-
# cd nitro
239-
# chmod +x ../.github/scripts/e2e-test-llama-linux-and-mac.sh && ../.github/scripts/e2e-test-llama-linux-and-mac.sh ./nitro ${{ env.LLM_MODEL_URL }}
240-
# rm -rf uploads/
241-
242-
# - name: Run e2e testing - Whisper.CPP
243-
# shell: bash
244-
# run: |
245-
# # run e2e testing
246-
# cd nitro
247-
# chmod +x ../.github/scripts/e2e-test-whisper-linux-and-mac.sh && ../.github/scripts/e2e-test-whisper-linux-and-mac.sh ./nitro ${{ env.WHISPER_MODEL_URL }}
248-
# rm -rf uploads/
249-
250236
- uses: actions/[email protected]
251237
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
252238
env:
@@ -261,6 +247,7 @@ jobs:
261247
runs-on: ubuntu-18-04-cuda-${{ matrix.cuda }}
262248
needs: [create-draft-release, set-nitro-version]
263249
if: always() && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.set-nitro-version.result == 'success'
250+
timeout-minutes: 20
264251
permissions:
265252
contents: write
266253
strategy:
@@ -297,21 +284,21 @@ jobs:
297284
name: nitro-linux-amd64-cuda-${{ matrix.cuda }}
298285
path: ./nitro
299286

300-
- name: Run e2e testing - LLama.CPP
301-
shell: bash
302-
run: |
303-
# run e2e testing
304-
cd nitro
305-
chmod +x ../.github/scripts/e2e-test-llama-linux-and-mac.sh && ../.github/scripts/e2e-test-llama-linux-and-mac.sh ./nitro ${{ env.LLM_MODEL_URL }}
306-
rm -rf uploads/
287+
# - name: Run e2e testing - LLama.CPP
288+
# shell: bash
289+
# run: |
290+
# # run e2e testing
291+
# cd nitro
292+
# chmod +x ../.github/scripts/e2e-test-llama-linux-and-mac.sh && ../.github/scripts/e2e-test-llama-linux-and-mac.sh ./nitro ${{ env.LLM_MODEL_URL }}
293+
# rm -rf uploads/
307294

308-
- name: Run e2e testing - Whisper.CPP
309-
shell: bash
310-
run: |
311-
# run e2e testing
312-
cd nitro
313-
chmod +x ../.github/scripts/e2e-test-whisper-linux-and-mac.sh && ../.github/scripts/e2e-test-whisper-linux-and-mac.sh ./nitro ${{ env.WHISPER_MODEL_URL }}
314-
rm -rf uploads/
295+
# - name: Run e2e testing - Whisper.CPP
296+
# shell: bash
297+
# run: |
298+
# # run e2e testing
299+
# cd nitro
300+
# chmod +x ../.github/scripts/e2e-test-whisper-linux-and-mac.sh && ../.github/scripts/e2e-test-whisper-linux-and-mac.sh ./nitro ${{ env.WHISPER_MODEL_URL }}
301+
# rm -rf uploads/
315302

316303
- uses: actions/[email protected]
317304
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
@@ -327,6 +314,7 @@ jobs:
327314
runs-on: mac-silicon
328315
needs: [create-draft-release, set-nitro-version]
329316
if: always() && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.set-nitro-version.result == 'success'
317+
timeout-minutes: 20
330318
permissions:
331319
contents: write
332320
steps:
@@ -405,6 +393,7 @@ jobs:
405393
runs-on: macos-latest
406394
needs: [create-draft-release, set-nitro-version]
407395
if: always() && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.set-nitro-version.result == 'success'
396+
timeout-minutes: 20
408397
permissions:
409398
contents: write
410399
steps:
@@ -470,86 +459,11 @@ jobs:
470459
asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-mac-amd64.tar.gz
471460
asset_content_type: application/gzip
472461

473-
# macOS-amd64-vulkan-build:
474-
# runs-on: macos-latest
475-
# needs: [create-draft-release, set-nitro-version]
476-
# if: always() && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.set-nitro-version.result == 'success'
477-
# permissions:
478-
# contents: write
479-
# steps:
480-
# - name: Clone
481-
# id: checkout
482-
# uses: actions/checkout@v3
483-
# with:
484-
# submodules: recursive
485-
486-
# - name: Dependencies
487-
# id: depends
488-
# continue-on-error: true
489-
# run: |
490-
# brew update
491-
# brew install sdl2
492-
493-
# - name: Prepare Vulkan SDK
494-
# uses: humbletim/[email protected]
495-
# with:
496-
# vulkan-query-version: 1.3.204.0
497-
# vulkan-components: Vulkan-Headers, Vulkan-Loader
498-
# vulkan-use-cache: true
499-
500-
# - name: Build
501-
# id: cmake_build
502-
# run: |
503-
# ./install_deps.sh
504-
# mkdir build && cd build
505-
# cmake -DNITRO_VERSION=${{ needs.set-nitro-version.outputs.version }} -DLLAMA_VULKAN=ON -DLLAMA_METAL=OFF ..
506-
# CC=gcc-8 make -j $(sysctl -n hw.ncp)
507-
# ls -la
508-
509-
# - name: Package
510-
# shell: bash
511-
# run: |
512-
# mkdir -p nitro
513-
# cp build/nitro nitro/
514-
# tar -czvf nitro.tar.gz nitro
515-
516-
# - name: Upload Artifact
517-
# uses: actions/upload-artifact@v2
518-
# if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' || github.event_name == 'pull_request'
519-
# with:
520-
# name: nitro-mac-amd64
521-
# path: ./nitro
522-
523-
# - name: Run e2e testing - LLama.CPP
524-
# shell: bash
525-
# run: |
526-
# # run e2e testing
527-
# cd nitro
528-
# chmod +x ../.github/scripts/e2e-test-llama-linux-and-mac.sh && ../.github/scripts/e2e-test-llama-linux-and-mac.sh ./nitro ${{ env.LLM_MODEL_URL }}
529-
# rm -rf uploads/
530-
531-
# - name: Run e2e testing - Whisper.CPP
532-
# shell: bash
533-
# run: |
534-
# # run e2e testing
535-
# cd nitro
536-
# chmod +x ../.github/scripts/e2e-test-whisper-linux-and-mac.sh && ../.github/scripts/e2e-test-whisper-linux-and-mac.sh ./nitro ${{ env.WHISPER_MODEL_URL }}
537-
# rm -rf uploads/
538-
539-
# - uses: actions/[email protected]
540-
# if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
541-
# env:
542-
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
543-
# with:
544-
# upload_url: ${{ needs.create-draft-release.outputs.upload_url }}
545-
# asset_path: ./nitro.tar.gz
546-
# asset_name: nitro-${{ needs.create-draft-release.outputs.version }}-mac-amd64-vulkan.tar.gz
547-
# asset_content_type: application/gzip
548-
549462
windows-amd64-build:
550463
runs-on: windows-latest
551464
needs: [create-draft-release, set-nitro-version]
552465
if: always() && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.set-nitro-version.result == 'success'
466+
timeout-minutes: 20
553467
permissions:
554468
contents: write
555469

@@ -643,6 +557,7 @@ jobs:
643557
runs-on: windows-latest
644558
needs: [create-draft-release, set-nitro-version]
645559
if: always() && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.set-nitro-version.result == 'success'
560+
timeout-minutes: 20
646561
permissions:
647562
contents: write
648563

@@ -729,6 +644,7 @@ jobs:
729644
runs-on: windows-cuda-${{ matrix.cuda }}
730645
needs: [create-draft-release, set-nitro-version]
731646
if: always() && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.set-nitro-version.result == 'success'
647+
timeout-minutes: 20
732648
permissions:
733649
contents: write
734650

@@ -822,6 +738,7 @@ jobs:
822738

823739
update_release_draft:
824740
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags/')
741+
timeout-minutes: 20
825742
needs:
826743
[
827744
ubuntu-amd64-build,
@@ -830,7 +747,6 @@ jobs:
830747
macOS-amd64-build,
831748
windows-amd64-build,
832749
windows-amd64-cuda-build,
833-
# macOS-amd64-vulkan-build,
834750
ubuntu-amd64-vulkan-build,
835751
windows-amd64-vulkan-build,
836752
]
@@ -844,7 +760,8 @@ jobs:
844760
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
845761

846762
noti-discord-nightly:
847-
if: always() && github.event_name == 'schedule' && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.ubuntu-amd64-build.result == 'success' && needs.ubuntu-amd64-cuda-build.result == 'success' && needs.macOS-silicon-build.result == 'success' && needs.macOS-amd64-build.result == 'success' && needs.windows-amd64-build.result == 'success' && needs.windows-amd64-cuda-build.result == 'success'
763+
timeout-minutes: 20
764+
if: github.event_name == 'schedule' && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.ubuntu-amd64-build.result == 'success' && needs.ubuntu-amd64-cuda-build.result == 'success' && needs.macOS-silicon-build.result == 'success' && needs.macOS-amd64-build.result == 'success' && needs.windows-amd64-build.result == 'success' && needs.windows-amd64-cuda-build.result == 'success'
848765
needs:
849766
[
850767
create-draft-release,
@@ -854,7 +771,6 @@ jobs:
854771
macOS-amd64-build,
855772
windows-amd64-build,
856773
windows-amd64-cuda-build,
857-
# macOS-amd64-vulkan-build,
858774
ubuntu-amd64-vulkan-build,
859775
windows-amd64-vulkan-build,
860776
]
@@ -883,7 +799,8 @@ jobs:
883799
GITHUB_RUN_ID: ${{ github.run_id }}
884800

885801
noti-discord-manual:
886-
if: always() && github.event_name == 'workflow_dispatch' && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.ubuntu-amd64-build.result == 'success' && needs.ubuntu-amd64-cuda-build.result == 'success' && needs.macOS-silicon-build.result == 'success' && needs.macOS-amd64-build.result == 'success' && needs.windows-amd64-build.result == 'success' && needs.windows-amd64-cuda-build.result == 'success'
802+
timeout-minutes: 20
803+
if: github.event_name == 'workflow_dispatch' && (needs.create-draft-release.result == 'success' || needs.create-draft-release.result == 'skipped') && needs.ubuntu-amd64-build.result == 'success' && needs.ubuntu-amd64-cuda-build.result == 'success' && needs.macOS-silicon-build.result == 'success' && needs.macOS-amd64-build.result == 'success' && needs.windows-amd64-build.result == 'success' && needs.windows-amd64-cuda-build.result == 'success'
887804
needs:
888805
[
889806
create-draft-release,
@@ -893,7 +810,6 @@ jobs:
893810
macOS-amd64-build,
894811
windows-amd64-build,
895812
windows-amd64-cuda-build,
896-
# macOS-amd64-vulkan-build,
897813
ubuntu-amd64-vulkan-build,
898814
windows-amd64-vulkan-build,
899815
]

0 commit comments

Comments
 (0)