@@ -340,79 +340,6 @@ jobs:
340340 # python -m unittest mooncake-wheel.tests.test_mooncake_backend_p2p_cpu
341341 shell : bash
342342
343- test-sglang-integration :
344- needs : build-flags
345- runs-on : ubuntu-latest
346- env :
347- tone_user_name : ${{ secrets.TONE_USER_NAME }}
348- steps :
349- - name : trigger T-one test
350- if : ${{ env.tone_user_name != '' }}
351- run : |
352- max_attempts=5
353- attempt=1
354- while [ $attempt -le $max_attempts ]; do
355- echo "Attempt $attempt: Fetching artifact..."
356- if curl -L -H "Accept: application/vnd.github+json" -H "X-GitHub-Api-Version: 2022-11-28" https://api.github.com/repos/${{ github.repository }}/actions/runs/${{ github.run_id }}/artifacts > artifact.json; then
357- echo "Successfully fetched artifact"
358- break
359- else
360- echo "Failed to fetch artifact. Retrying..."
361- sleep 60
362- fi
363- attempt=$((attempt + 1))
364- done
365- if [ $attempt -gt $max_attempts ]; then
366- echo "Failed to fetch artifacts after $max_attempts attempts"
367- exit 1
368- fi
369-
370- cat artifact.json
371- artifact_id=$(jq -r ".artifacts[] | select(.name | contains(\"py312\") ) | .id" artifact.json)
372- signature="${{ secrets.TONE_USER_NAME }}|${{ secrets.TONE_USER_TOKEN }}|$(python3 -c "import time;print(time.time())")"
373- signature="$(python3 -c "import base64;print(base64.b64encode(\"$signature\".encode('utf-8')).decode('utf-8'))")"
374- curl -s -H 'Content-Type: application/json' -X POST -d "{\"workspace\":\"mooncake_test\",\"project\":\"mooncake-ci\",\"template\":\"mooncake-ci-test\",\"name\":\"mooncake-ci-${{ github.sha }}\",\"username\":\"${{ secrets.TONE_USER_NAME }}\",\"env_ifs\":\" \",\"env_info\":\"ARTIFACT_ID=${artifact_id} GIT_REPO=${{ github.repository }}\",\"signature\":\"$signature\"}" https://tone.openanolis.cn/api/job/create/ > job.json
375- if [ "$(jq .code job.json)" == 200 ]; then
376- echo "job created"
377- else
378- echo "job create failed"
379- exit 1
380- fi
381- job_id=$(jq .data.id job.json)
382- echo "check job status here and remember to cancel it before restart the job !"
383- echo "job_url: https://tone.openanolis.cn/ws/gclfnh19/test_result/${job_id}?tab=4"
384- echo "job_id=${job_id}" >> $GITHUB_ENV
385- shell : bash
386-
387- - name : qurey job results
388- if : ${{ env.tone_user_name != '' }}
389- run : |
390- time=0
391- while true; do
392- if [ $time -gt 720 ]; then
393- echo "timeout"
394- exit 1
395- fi
396- signature="${{ secrets.TONE_USER_NAME }}|${{ secrets.TONE_USER_TOKEN }}|$(python3 -c "import time;print(time.time())")"
397- signature="$(python3 -c "import base64;print(base64.b64encode(\"$signature\".encode('utf-8')).decode('utf-8'))")"
398- curl -s -H 'Content-Type: application/json' -X POST -d "{\"username\":\"${{ secrets.TONE_USER_NAME }}\", \"signature\":\"$signature\", \"job_id\": \"${job_id}\"}" https://tone.openanolis.cn/api/job/query/ > job_status.json
399- if ! [ "$(jq .code job_status.json)" == 200 ]; then
400- echo "job query failed"
401- exit 1
402- fi
403- job_status=$(jq .data.job_second_state job_status.json)
404- if [[ $job_status =~ "pass" ]]; then
405- echo "job successful !"
406- exit 0
407- elif [[ $job_status =~ "fail" ]] ; then
408- echo "job failed or stopped !"
409- exit 1
410- fi
411- time=$(( time + 1))
412- sleep 10
413- done
414- shell : bash
415-
416343 build-flags :
417344 if : >-
418345 github.event_name == 'push' ||
0 commit comments