diff --git a/.github/workflows/test-arealite.yml b/.github/workflows/test-arealite.yml index 41ae60b..486e8e0 100644 --- a/.github/workflows/test-arealite.yml +++ b/.github/workflows/test-arealite.yml @@ -1,7 +1,8 @@ name: Test AReaLite on: - push: + pull_request: + branches: [ lite ] paths: - .github/workflows/test-arealite.yml - arealite/** @@ -20,11 +21,12 @@ jobs: env: GIT_REPO_URL: https://github.bibk.top/${{ github.repository }} GIT_COMMIT_SHA: ${{ github.sha }} + CI_NODE_SUDO_PW: ${{ secrets.CI_NODE_SUDO_PW }} with: host: ${{ secrets.CI_NODE_ADDR }} username: ${{ secrets.CI_NODE_USER }} key: ${{ secrets.REMOTE_SSH_KEY }} - envs: GIT_REPO_URL,GIT_COMMIT_SHA + envs: GIT_REPO_URL,GIT_COMMIT_SHA,CI_NODE_SUDO_PW script_path: ci/clone_repo.sh - uses: appleboy/ssh-action@v1 diff --git a/arealite/tests/test_sglang_engine.py b/arealite/tests/test_sglang_engine.py index a4c2043..42f648c 100644 --- a/arealite/tests/test_sglang_engine.py +++ b/arealite/tests/test_sglang_engine.py @@ -26,6 +26,8 @@ if not os.path.exists(MODEL_PATH): PORT = 13887 DIST_PORT = 15887 HOST = network.gethostip() +# set a large timeout since we may need to download the model from hub +RUN_SERVER_TIMEOUT = 180 def check_server_health(base_url): @@ -65,11 +67,11 @@ def sglang_server(): ) base_url = f"http://{HOST}:{PORT}" tik = time.time() - while time.time() - tik < 90: + while time.time() - tik < RUN_SERVER_TIMEOUT: if check_server_health(base_url): break time.sleep(1) - if time.time() - tik > 90: + if time.time() - tik > RUN_SERVER_TIMEOUT: raise RuntimeError("server launch failed") yield process.terminate() diff --git a/ci/clone_repo.sh b/ci/clone_repo.sh index c444882..ec75a61 100644 --- a/ci/clone_repo.sh +++ b/ci/clone_repo.sh @@ -9,7 +9,7 @@ echo "GIT_REPO_URL: $GIT_REPO_URL" echo "GIT_COMMIT_SHA: $GIT_COMMIT_SHA" RUN_ID="areal-$GIT_COMMIT_SHA" -rm -rf "/tmp/$RUN_ID" +echo ${CI_NODE_SUDO_PW} | sudo -S rm -rf "/tmp/$RUN_ID" mkdir -p "/tmp/$RUN_ID" cd "/tmp/$RUN_ID"