From 029037184636f2ce0db1adffaa570c68684c1f84 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Thu, 3 Jul 2025 20:41:44 +0800 Subject: [PATCH 01/24] ci: add test-arealite --- .github/workflows/ci.yml | 18 ++++++++++++++++++ scripts/run_test_arealite.sh | 5 +++++ 2 files changed, 23 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 scripts/run_test_arealite.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000000..b783833304 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,18 @@ +name: CI + +on: + push: + paths: + - .github/workflows/ci.yml + - arealite/** + workflow_dispatch: + +jobs: + test-arealite: + runs-on: ubuntu-latest + steps: + - uses: appleboy/ssh-action@v1 + with: + host: ${{ secrets.CI_NODE_ADDR }} + key: ${{ secrets.REMOTE_SSH_KEY }} + script_path: scripts/run_test_arealite.sh diff --git a/scripts/run_test_arealite.sh b/scripts/run_test_arealite.sh new file mode 100644 index 0000000000..f8fb3095c3 --- /dev/null +++ b/scripts/run_test_arealite.sh @@ -0,0 +1,5 @@ +#!/usr/bin/env bash + +set -e + +echo "Hello World!" From becea9a265095c3f6b8422ca327f31f62ca750b8 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Thu, 3 Jul 2025 20:43:22 +0800 Subject: [PATCH 02/24] ci: add checkout before running test-arealite --- .github/workflows/ci.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index b783833304..92a547a9d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,10 @@ jobs: test-arealite: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v4 + with: + lfs: true + - uses: appleboy/ssh-action@v1 with: host: ${{ secrets.CI_NODE_ADDR }} From c13279a516a27a44037766c821294c08cb6d28ff Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Thu, 3 Jul 2025 20:45:36 +0800 Subject: [PATCH 03/24] ci: add USERNAME --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 92a547a9d3..ce3df363ea 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -18,5 +18,6 @@ jobs: - uses: appleboy/ssh-action@v1 with: host: ${{ secrets.CI_NODE_ADDR }} + username: ${{ secrets.CI_NODE_USER }} key: ${{ secrets.REMOTE_SSH_KEY }} script_path: scripts/run_test_arealite.sh From 5a0b8d3ddc6cf1da1cce4abec9e154732c50b4ff Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Thu, 3 Jul 2025 21:06:35 +0800 Subject: [PATCH 04/24] ci: add test script --- .github/workflows/ci.yml | 4 ++++ scripts/run_test_arealite.sh | 38 +++++++++++++++++++++++++++++++++++- 2 files changed, 41 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index ce3df363ea..e3db06c5d3 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -16,8 +16,12 @@ jobs: lfs: true - uses: appleboy/ssh-action@v1 + env: + GIT_REPO_URL: ${{ github.repositoryUrl }} + GIT_COMMIT_SHA: ${{ github.sha }} with: host: ${{ secrets.CI_NODE_ADDR }} username: ${{ secrets.CI_NODE_USER }} key: ${{ secrets.REMOTE_SSH_KEY }} + envs: GIT_REPO_URL,GIT_COMMIT_SHA script_path: scripts/run_test_arealite.sh diff --git a/scripts/run_test_arealite.sh b/scripts/run_test_arealite.sh index f8fb3095c3..3fce736c7a 100644 --- a/scripts/run_test_arealite.sh +++ b/scripts/run_test_arealite.sh @@ -2,4 +2,40 @@ set -e -echo "Hello World!" +GIT_REPO_URL=${GIT_REPO_URL:?"GIT_REPO_URL is not set"} +GIT_COMMIT_SHA=${GIT_COMMIT_SHA:?"GIT_COMMIT_SHA is not set"} +RUN_ID="areal-$(date +%s%N)" + +echo "GIT_REPO_URL: $GIT_REPO_URL" +echo "GIT_COMMIT_SHA: $GIT_COMMIT_SHA" + +mkdir -p /tmp/pip-cache + +mkdir -p "/tmp/$RUN_ID" +cd "/tmp/$RUN_ID" + +git clone "$GIT_REPO_URL" --depth 1 --branch "$GIT_COMMIT_SHA" --single-branch . + +if docker ps -a --format '{{.Names}}' | grep -q "$RUN_ID"; then + docker rm -f $RUN_ID +fi + +docker run -d \ + --name $RUN_ID \ + --gpus all \ + --shm-size=8g \ + -v $(pwd):/workspace \ + -v /tmp/pip-cache:/root/.cache/pip \ + -w /workspace \ + nvcr.io/nvidia/pytorch:25.01-py3 \ + sleep 3600 + +docker exec $RUN_ID bash -c " + python -m pip install --upgrade pip + pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple + pip config unset global.extra-index-url + bash examples/env/scripts/setup-pip-deps.sh + python -m pytest arealite/ +" + +docker rm -f $RUN_ID From 5fe18b1f021ce06c52897bc51702105a2aa5467b Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Thu, 3 Jul 2025 21:10:27 +0800 Subject: [PATCH 05/24] ci: add GitHub mirror --- .github/workflows/ci.yml | 2 +- scripts/run_test_arealite.sh | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e3db06c5d3..8d1450fdaa 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -17,7 +17,7 @@ jobs: - uses: appleboy/ssh-action@v1 env: - GIT_REPO_URL: ${{ github.repositoryUrl }} + GIT_REPO: ${{ github.repository }} GIT_COMMIT_SHA: ${{ github.sha }} with: host: ${{ secrets.CI_NODE_ADDR }} diff --git a/scripts/run_test_arealite.sh b/scripts/run_test_arealite.sh index 3fce736c7a..94c985eb16 100644 --- a/scripts/run_test_arealite.sh +++ b/scripts/run_test_arealite.sh @@ -2,11 +2,11 @@ set -e -GIT_REPO_URL=${GIT_REPO_URL:?"GIT_REPO_URL is not set"} +GIT_REPO=${GIT_REPO:?"GIT_REPO is not set"} GIT_COMMIT_SHA=${GIT_COMMIT_SHA:?"GIT_COMMIT_SHA is not set"} RUN_ID="areal-$(date +%s%N)" -echo "GIT_REPO_URL: $GIT_REPO_URL" +echo "GIT_REPO: $GIT_REPO" echo "GIT_COMMIT_SHA: $GIT_COMMIT_SHA" mkdir -p /tmp/pip-cache @@ -14,7 +14,7 @@ mkdir -p /tmp/pip-cache mkdir -p "/tmp/$RUN_ID" cd "/tmp/$RUN_ID" -git clone "$GIT_REPO_URL" --depth 1 --branch "$GIT_COMMIT_SHA" --single-branch . +git clone "https://github.bibk.top/$GIT_REPO" --depth 1 --branch "$GIT_COMMIT_SHA" --single-branch $(pwd) if docker ps -a --format '{{.Names}}' | grep -q "$RUN_ID"; then docker rm -f $RUN_ID From c274029fd76152110a8f3c9725d2872b7699acd1 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Thu, 3 Jul 2025 21:11:47 +0800 Subject: [PATCH 06/24] ci: fix typo --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8d1450fdaa..524ce0c23f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,5 +23,5 @@ jobs: 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,GIT_COMMIT_SHA script_path: scripts/run_test_arealite.sh From d9926ff092658020a5cdafe6786669c00b606a0c Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Thu, 3 Jul 2025 21:15:36 +0800 Subject: [PATCH 07/24] ci: clone one commit --- scripts/run_test_arealite.sh | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/scripts/run_test_arealite.sh b/scripts/run_test_arealite.sh index 94c985eb16..95058b1175 100644 --- a/scripts/run_test_arealite.sh +++ b/scripts/run_test_arealite.sh @@ -14,7 +14,10 @@ mkdir -p /tmp/pip-cache mkdir -p "/tmp/$RUN_ID" cd "/tmp/$RUN_ID" -git clone "https://github.bibk.top/$GIT_REPO" --depth 1 --branch "$GIT_COMMIT_SHA" --single-branch $(pwd) +git init +git remote add origin "https://github.bibk.top/$GIT_REPO" +git fetch --depth 1 origin "$GIT_COMMIT_SHA" +git checkout FETCH_HEAD if docker ps -a --format '{{.Names}}' | grep -q "$RUN_ID"; then docker rm -f $RUN_ID From 732f12e251259e26b809c2cd34f13b9c3d0582cd Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Thu, 3 Jul 2025 21:16:30 +0800 Subject: [PATCH 08/24] ci: fix condition --- .github/workflows/ci.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 524ce0c23f..f8d668f0d9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -5,6 +5,7 @@ on: paths: - .github/workflows/ci.yml - arealite/** + - scripts/run_test_arealite.sh workflow_dispatch: jobs: From 9efbfa529b0207359137980ba9cfe588eda2b2ca Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Thu, 3 Jul 2025 21:32:05 +0800 Subject: [PATCH 09/24] ci: set command timeout to 60m --- .github/workflows/ci.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f8d668f0d9..82522744f9 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -24,5 +24,6 @@ jobs: host: ${{ secrets.CI_NODE_ADDR }} username: ${{ secrets.CI_NODE_USER }} key: ${{ secrets.REMOTE_SSH_KEY }} - envs: GIT_REPO,GIT_COMMIT_SHA script_path: scripts/run_test_arealite.sh + envs: GIT_REPO,GIT_COMMIT_SHA + command_timeout: 60m From 95cfc73e9c97b4c01c187aea6b8126d070b17f3c Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Thu, 3 Jul 2025 21:51:35 +0800 Subject: [PATCH 10/24] ci: enable pip cache --- scripts/run_test_arealite.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/run_test_arealite.sh b/scripts/run_test_arealite.sh index 95058b1175..7d19a638df 100644 --- a/scripts/run_test_arealite.sh +++ b/scripts/run_test_arealite.sh @@ -37,6 +37,7 @@ docker exec $RUN_ID bash -c " python -m pip install --upgrade pip pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple pip config unset global.extra-index-url + pip config set global.no-cache-dir false bash examples/env/scripts/setup-pip-deps.sh python -m pytest arealite/ " From 0ee70d56d777be0b0ffecfeefa59705b56cba0c4 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Thu, 3 Jul 2025 22:02:26 +0800 Subject: [PATCH 11/24] ci: optimize container lifecycle --- scripts/run_test_arealite.sh | 29 ++++++++++++++++------------- 1 file changed, 16 insertions(+), 13 deletions(-) diff --git a/scripts/run_test_arealite.sh b/scripts/run_test_arealite.sh index 7d19a638df..9a7fe2cf02 100644 --- a/scripts/run_test_arealite.sh +++ b/scripts/run_test_arealite.sh @@ -9,8 +9,6 @@ RUN_ID="areal-$(date +%s%N)" echo "GIT_REPO: $GIT_REPO" echo "GIT_COMMIT_SHA: $GIT_COMMIT_SHA" -mkdir -p /tmp/pip-cache - mkdir -p "/tmp/$RUN_ID" cd "/tmp/$RUN_ID" @@ -19,11 +17,13 @@ git remote add origin "https://github.bibk.top/$GIT_REPO" git fetch --depth 1 origin "$GIT_COMMIT_SHA" git checkout FETCH_HEAD +mkdir -p /tmp/pip-cache + if docker ps -a --format '{{.Names}}' | grep -q "$RUN_ID"; then docker rm -f $RUN_ID fi -docker run -d \ +docker run \ --name $RUN_ID \ --gpus all \ --shm-size=8g \ @@ -31,15 +31,18 @@ docker run -d \ -v /tmp/pip-cache:/root/.cache/pip \ -w /workspace \ nvcr.io/nvidia/pytorch:25.01-py3 \ - sleep 3600 - -docker exec $RUN_ID bash -c " - python -m pip install --upgrade pip - pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple - pip config unset global.extra-index-url - pip config set global.no-cache-dir false - bash examples/env/scripts/setup-pip-deps.sh - python -m pytest arealite/ -" + bash -c " + python -m pip install --upgrade pip + pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple + pip config unset global.extra-index-url + pip config set global.no-cache-dir false + bash examples/env/scripts/setup-pip-deps.sh + python -m pytest arealite/ + " +status=$? docker rm -f $RUN_ID + +if [ $status -ne 0 ]; then + exit 1 +fi From 4ab4fc7d0dd2e6b53962c8bfd7a8ea3f7823a1f9 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 4 Jul 2025 16:55:35 +0800 Subject: [PATCH 12/24] ci: split into many stages --- .github/workflows/ci.yml | 29 ----------- .github/workflows/test-arealite.yml | 48 +++++++++++++++++++ .../build_env_image.sh | 29 +++++------ ci/clone_repo.sh | 18 +++++++ ci/test_arealite.sh | 38 +++++++++++++++ 5 files changed, 116 insertions(+), 46 deletions(-) delete mode 100644 .github/workflows/ci.yml create mode 100644 .github/workflows/test-arealite.yml rename scripts/run_test_arealite.sh => ci/build_env_image.sh (65%) create mode 100644 ci/clone_repo.sh create mode 100644 ci/test_arealite.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml deleted file mode 100644 index 82522744f9..0000000000 --- a/.github/workflows/ci.yml +++ /dev/null @@ -1,29 +0,0 @@ -name: CI - -on: - push: - paths: - - .github/workflows/ci.yml - - arealite/** - - scripts/run_test_arealite.sh - workflow_dispatch: - -jobs: - test-arealite: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - with: - lfs: true - - - uses: appleboy/ssh-action@v1 - env: - GIT_REPO: ${{ github.repository }} - GIT_COMMIT_SHA: ${{ github.sha }} - with: - host: ${{ secrets.CI_NODE_ADDR }} - username: ${{ secrets.CI_NODE_USER }} - key: ${{ secrets.REMOTE_SSH_KEY }} - script_path: scripts/run_test_arealite.sh - envs: GIT_REPO,GIT_COMMIT_SHA - command_timeout: 60m diff --git a/.github/workflows/test-arealite.yml b/.github/workflows/test-arealite.yml new file mode 100644 index 0000000000..f8d2c3704a --- /dev/null +++ b/.github/workflows/test-arealite.yml @@ -0,0 +1,48 @@ +name: Test AReaLite + +on: + push: + paths: + - .github/workflows/test-arealite.yml + - arealite/** + - ci/** + workflow_dispatch: + +jobs: + test-arealite: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: appleboy/ssh-action@v1 + env: + GIT_REPO_URL: https://github.bibk.top/${{ github.repository }} + GIT_COMMIT_SHA: ${{ github.sha }} + with: + host: ${{ secrets.CI_NODE_ADDR }} + username: ${{ secrets.CI_NODE_USER }} + key: ${{ secrets.REMOTE_SSH_KEY }} + envs: GIT_REPO_URL,GIT_COMMIT_SHA + script_path: scripts/clone_repo.sh + + - uses: appleboy/ssh-action@v1 + env: + GIT_COMMIT_SHA: ${{ github.sha }} + with: + host: ${{ secrets.CI_NODE_ADDR }} + username: ${{ secrets.CI_NODE_USER }} + key: ${{ secrets.REMOTE_SSH_KEY }} + command_timeout: 60m + envs: GIT_COMMIT_SHA + script_path: scripts/build_env_image.sh + + - uses: appleboy/ssh-action@v1 + env: + GIT_COMMIT_SHA: ${{ github.sha }} + with: + host: ${{ secrets.CI_NODE_ADDR }} + username: ${{ secrets.CI_NODE_USER }} + key: ${{ secrets.REMOTE_SSH_KEY }} + command_timeout: 60m + envs: GIT_COMMIT_SHA + script_path: scripts/test_arealite.sh diff --git a/scripts/run_test_arealite.sh b/ci/build_env_image.sh similarity index 65% rename from scripts/run_test_arealite.sh rename to ci/build_env_image.sh index 9a7fe2cf02..75fe3c25f0 100644 --- a/scripts/run_test_arealite.sh +++ b/ci/build_env_image.sh @@ -2,22 +2,18 @@ set -e -GIT_REPO=${GIT_REPO:?"GIT_REPO is not set"} GIT_COMMIT_SHA=${GIT_COMMIT_SHA:?"GIT_COMMIT_SHA is not set"} -RUN_ID="areal-$(date +%s%N)" -echo "GIT_REPO: $GIT_REPO" echo "GIT_COMMIT_SHA: $GIT_COMMIT_SHA" -mkdir -p "/tmp/$RUN_ID" -cd "/tmp/$RUN_ID" - -git init -git remote add origin "https://github.bibk.top/$GIT_REPO" -git fetch --depth 1 origin "$GIT_COMMIT_SHA" -git checkout FETCH_HEAD +# If there is already an image named areal-env, skip. +if docker images --format '{{.Repository}}:{{.Tag}}' | grep -q 'areal-env:latest'; then + echo "Image areal-env already exists, skipping build." + exit 0 +fi -mkdir -p /tmp/pip-cache +RUN_ID="areal-$GIT_COMMIT_SHA" +cd "/tmp/$RUN_ID" if docker ps -a --format '{{.Names}}' | grep -q "$RUN_ID"; then docker rm -f $RUN_ID @@ -28,7 +24,6 @@ docker run \ --gpus all \ --shm-size=8g \ -v $(pwd):/workspace \ - -v /tmp/pip-cache:/root/.cache/pip \ -w /workspace \ nvcr.io/nvidia/pytorch:25.01-py3 \ bash -c " @@ -37,12 +32,12 @@ docker run \ pip config unset global.extra-index-url pip config set global.no-cache-dir false bash examples/env/scripts/setup-pip-deps.sh - python -m pytest arealite/ " -status=$? -docker rm -f $RUN_ID - -if [ $status -ne 0 ]; then +if [ $? -ne 0 ]; then + docker rm -f $RUN_ID exit 1 fi + +docker commit $RUN_ID areal-env:latest +docker rm -f $RUN_ID diff --git a/ci/clone_repo.sh b/ci/clone_repo.sh new file mode 100644 index 0000000000..da31007309 --- /dev/null +++ b/ci/clone_repo.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +set -e + +GIT_REPO=${GIT_REPO:?"GIT_REPO is not set"} +GIT_COMMIT_SHA=${GIT_COMMIT_SHA:?"GIT_COMMIT_SHA is not set"} + +echo "GIT_REPO: $GIT_REPO" +echo "GIT_COMMIT_SHA: $GIT_COMMIT_SHA" + +RUN_ID="areal-$GIT_COMMIT_SHA" +mkdir -p "/tmp/$RUN_ID" +cd "/tmp/$RUN_ID" + +git init +git remote add origin "https://github.bibk.top/$GIT_REPO" +git fetch --depth 1 origin "$GIT_COMMIT_SHA" +git checkout FETCH_HEAD diff --git a/ci/test_arealite.sh b/ci/test_arealite.sh new file mode 100644 index 0000000000..603e53ed37 --- /dev/null +++ b/ci/test_arealite.sh @@ -0,0 +1,38 @@ +#!/usr/bin/env bash + +set -e + +GIT_COMMIT_SHA=${GIT_COMMIT_SHA:?"GIT_COMMIT_SHA is not set"} + +echo "GIT_COMMIT_SHA: $GIT_COMMIT_SHA" + +# If there is already an image named areal-env, skip. +if docker images --format '{{.Repository}}:{{.Tag}}' | grep -q 'areal-env:latest'; then + echo "Image areal-env already exists, skipping build." + exit 0 +fi + +RUN_ID="areal-$GIT_COMMIT_SHA" +cd "/tmp/$RUN_ID" + +if docker ps -a --format '{{.Names}}' | grep -q "$RUN_ID"; then + docker rm -f $RUN_ID +fi + +docker run \ + --name $RUN_ID \ + --gpus all \ + --shm-size=8g \ + -v $(pwd):/workspace \ + -w /workspace \ + areal-env:latest \ + bash -c " + python -m pytest arealite/ + " + +if [ $status -ne 0 ]; then + docker rm -f $RUN_ID + exit 1 +fi + +docker rm -f $RUN_ID From c75b570e60f3978777b2631a5f3766aa22ca6f32 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 4 Jul 2025 16:57:54 +0800 Subject: [PATCH 13/24] ci(test-arealite): fix typo --- .github/workflows/test-arealite.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-arealite.yml b/.github/workflows/test-arealite.yml index f8d2c3704a..91a9ab3ae5 100644 --- a/.github/workflows/test-arealite.yml +++ b/.github/workflows/test-arealite.yml @@ -23,7 +23,7 @@ jobs: username: ${{ secrets.CI_NODE_USER }} key: ${{ secrets.REMOTE_SSH_KEY }} envs: GIT_REPO_URL,GIT_COMMIT_SHA - script_path: scripts/clone_repo.sh + script_path: ci/clone_repo.sh - uses: appleboy/ssh-action@v1 env: @@ -34,7 +34,7 @@ jobs: key: ${{ secrets.REMOTE_SSH_KEY }} command_timeout: 60m envs: GIT_COMMIT_SHA - script_path: scripts/build_env_image.sh + script_path: ci/build_env_image.sh - uses: appleboy/ssh-action@v1 env: @@ -45,4 +45,4 @@ jobs: key: ${{ secrets.REMOTE_SSH_KEY }} command_timeout: 60m envs: GIT_COMMIT_SHA - script_path: scripts/test_arealite.sh + script_path: ci/test_arealite.sh From 59609c23b54b2c94ba967e4b8dcce8790bf22bf1 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 4 Jul 2025 17:05:29 +0800 Subject: [PATCH 14/24] ci: fix wrong env --- ci/clone_repo.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/ci/clone_repo.sh b/ci/clone_repo.sh index da31007309..71d6d7d203 100644 --- a/ci/clone_repo.sh +++ b/ci/clone_repo.sh @@ -2,10 +2,10 @@ set -e -GIT_REPO=${GIT_REPO:?"GIT_REPO is not set"} +GIT_REPO_URL=${GIT_REPO_URL:?"GIT_REPO_URL is not set"} GIT_COMMIT_SHA=${GIT_COMMIT_SHA:?"GIT_COMMIT_SHA is not set"} -echo "GIT_REPO: $GIT_REPO" +echo "GIT_REPO_URL: $GIT_REPO_URL" echo "GIT_COMMIT_SHA: $GIT_COMMIT_SHA" RUN_ID="areal-$GIT_COMMIT_SHA" @@ -13,6 +13,6 @@ mkdir -p "/tmp/$RUN_ID" cd "/tmp/$RUN_ID" git init -git remote add origin "https://github.bibk.top/$GIT_REPO" +git remote add origin "$GIT_REPO_URL" git fetch --depth 1 origin "$GIT_COMMIT_SHA" git checkout FETCH_HEAD From 07b574f4159e8d4b1ce24a1b0d5b4fc55b03e959 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 4 Jul 2025 18:14:59 +0800 Subject: [PATCH 15/24] ci: fix pytest --- ci/test_arealite.sh | 6 ------ 1 file changed, 6 deletions(-) diff --git a/ci/test_arealite.sh b/ci/test_arealite.sh index 603e53ed37..ac2652e983 100644 --- a/ci/test_arealite.sh +++ b/ci/test_arealite.sh @@ -6,12 +6,6 @@ GIT_COMMIT_SHA=${GIT_COMMIT_SHA:?"GIT_COMMIT_SHA is not set"} echo "GIT_COMMIT_SHA: $GIT_COMMIT_SHA" -# If there is already an image named areal-env, skip. -if docker images --format '{{.Repository}}:{{.Tag}}' | grep -q 'areal-env:latest'; then - echo "Image areal-env already exists, skipping build." - exit 0 -fi - RUN_ID="areal-$GIT_COMMIT_SHA" cd "/tmp/$RUN_ID" From 49c30b41986c334c5c65c4c0271c69024b6dccca Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 4 Jul 2025 18:38:30 +0800 Subject: [PATCH 16/24] ci: uninstall transformer-engine --- ci/test_arealite.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/test_arealite.sh b/ci/test_arealite.sh index ac2652e983..d846c4cbbb 100644 --- a/ci/test_arealite.sh +++ b/ci/test_arealite.sh @@ -21,6 +21,7 @@ docker run \ -w /workspace \ areal-env:latest \ bash -c " + pip uninstall transformer-engine python -m pytest arealite/ " From 5cd2d7341202df4fb2ba9ec8c22e5f1ef8a6fbdb Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 4 Jul 2025 18:44:23 +0800 Subject: [PATCH 17/24] ci: uninstall transformer-engine --- ci/test_arealite.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/test_arealite.sh b/ci/test_arealite.sh index d846c4cbbb..c3f923619d 100644 --- a/ci/test_arealite.sh +++ b/ci/test_arealite.sh @@ -21,7 +21,7 @@ docker run \ -w /workspace \ areal-env:latest \ bash -c " - pip uninstall transformer-engine + pip uninstall -y transformer-engine python -m pytest arealite/ " From 7f50c5dbbbc6a3baab42070f726b8762fd40566f Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 4 Jul 2025 19:22:30 +0800 Subject: [PATCH 18/24] ci: fix model paths --- arealite/tests/test_engine.py | 2 +- arealite/tests/test_grpo.py | 2 +- arealite/tests/test_rollout.py | 2 +- arealite/tests/test_rollout_controller.py | 2 +- arealite/tests/test_sft.py | 2 +- arealite/tests/test_sglang_client.py | 2 +- ci/test_arealite.sh | 1 + 7 files changed, 7 insertions(+), 6 deletions(-) diff --git a/arealite/tests/test_engine.py b/arealite/tests/test_engine.py index f7f53023be..03b1559b89 100644 --- a/arealite/tests/test_engine.py +++ b/arealite/tests/test_engine.py @@ -23,7 +23,7 @@ from realhf.impl.model.utils.padding import unpad_input VOCAB_SIZE = 100 -MODEL_PATH = "/storage/openpsi/models/Qwen__Qwen3-1.7B/" +MODEL_PATH = "Qwen/Qwen2-0.5B" @pytest.fixture(scope="module") diff --git a/arealite/tests/test_grpo.py b/arealite/tests/test_grpo.py index 5bf5c67545..24881a2a2d 100644 --- a/arealite/tests/test_grpo.py +++ b/arealite/tests/test_grpo.py @@ -22,7 +22,7 @@ EXPR_NAME = "test_grpo" TRIAL_NAME = "test_grpo" -MODEL_PATH = "/storage/openpsi/models/Qwen__Qwen3-1.7B/" +MODEL_PATH = "Qwen/Qwen2-0.5B" @pytest.fixture(scope="module") diff --git a/arealite/tests/test_rollout.py b/arealite/tests/test_rollout.py index 858f18f448..3f6bd43fb4 100644 --- a/arealite/tests/test_rollout.py +++ b/arealite/tests/test_rollout.py @@ -27,7 +27,7 @@ EXPR_NAME = "test_rollout" TRIAL_NAME = "test_rollout" -MODEL_PATH = "/storage/openpsi/models/Qwen__Qwen3-1.7B/" +MODEL_PATH = "Qwen/Qwen2-0.5B" @pytest.fixture(scope="module") diff --git a/arealite/tests/test_rollout_controller.py b/arealite/tests/test_rollout_controller.py index aadabdaf76..636f34933e 100644 --- a/arealite/tests/test_rollout_controller.py +++ b/arealite/tests/test_rollout_controller.py @@ -22,7 +22,7 @@ EXPR_NAME = "test_rollout_controller" TRIAL_NAME = "test_rollout_controller" -MODEL_PATH = "/storage/openpsi/models/Qwen__Qwen3-1.7B/" +MODEL_PATH = "Qwen/Qwen2-0.5B" @pytest.fixture(scope="module") diff --git a/arealite/tests/test_sft.py b/arealite/tests/test_sft.py index bf605e4bc6..eaa81cd52a 100644 --- a/arealite/tests/test_sft.py +++ b/arealite/tests/test_sft.py @@ -60,7 +60,7 @@ def test_sft(): ) engine_config = EngineConfig( - path="/storage/openpsi/models/Qwen__Qwen3-1.7B/", + path="Qwen/Qwen2-0.5B", gradient_checkpointing=False, optimizer=OptimizerConfig(), backend=EngineBackendConfig(type="hf"), diff --git a/arealite/tests/test_sglang_client.py b/arealite/tests/test_sglang_client.py index ab61caf296..db037c1d0e 100644 --- a/arealite/tests/test_sglang_client.py +++ b/arealite/tests/test_sglang_client.py @@ -23,7 +23,7 @@ EXPR_NAME = "test_sglang_client" TRIAL_NAME = "test_sglang_client" -MODEL_PATH = "/storage/openpsi/models/Qwen__Qwen3-1.7B/" +MODEL_PATH = "Qwen/Qwen2-0.5B" @pytest.fixture(scope="module") diff --git a/ci/test_arealite.sh b/ci/test_arealite.sh index c3f923619d..eb7cf3b817 100644 --- a/ci/test_arealite.sh +++ b/ci/test_arealite.sh @@ -22,6 +22,7 @@ docker run \ areal-env:latest \ bash -c " pip uninstall -y transformer-engine + export HF_ENDPOINT=https://hf-mirror.com python -m pytest arealite/ " From 1d6363240f79ee87ad2b21d9c88bf8e6d78a24ba Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 4 Jul 2025 21:35:58 +0800 Subject: [PATCH 19/24] ci: show stdout/stderr --- ci/test_arealite.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ci/test_arealite.sh b/ci/test_arealite.sh index eb7cf3b817..870b6358f1 100644 --- a/ci/test_arealite.sh +++ b/ci/test_arealite.sh @@ -23,7 +23,7 @@ docker run \ bash -c " pip uninstall -y transformer-engine export HF_ENDPOINT=https://hf-mirror.com - python -m pytest arealite/ + python -m pytest -s arealite/ " if [ $status -ne 0 ]; then From 96745bed79e71b0539110589b3e22bfbc2a86218 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 4 Jul 2025 22:53:56 +0800 Subject: [PATCH 20/24] ci: fix not clean up --- ci/build_env_image.sh | 7 +------ ci/test_arealite.sh | 7 +------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/ci/build_env_image.sh b/ci/build_env_image.sh index 75fe3c25f0..9e3d724a49 100644 --- a/ci/build_env_image.sh +++ b/ci/build_env_image.sh @@ -32,12 +32,7 @@ docker run \ pip config unset global.extra-index-url pip config set global.no-cache-dir false bash examples/env/scripts/setup-pip-deps.sh - " - -if [ $? -ne 0 ]; then - docker rm -f $RUN_ID - exit 1 -fi + " || docker rm -f $RUN_ID && exit 1 docker commit $RUN_ID areal-env:latest docker rm -f $RUN_ID diff --git a/ci/test_arealite.sh b/ci/test_arealite.sh index 870b6358f1..70be190c6a 100644 --- a/ci/test_arealite.sh +++ b/ci/test_arealite.sh @@ -24,11 +24,6 @@ docker run \ pip uninstall -y transformer-engine export HF_ENDPOINT=https://hf-mirror.com python -m pytest -s arealite/ - " - -if [ $status -ne 0 ]; then - docker rm -f $RUN_ID - exit 1 -fi + " || docker rm -f $RUN_ID && exit 1 docker rm -f $RUN_ID From 27aac79e254ec9d56f1a16d31fdd88e65eb6f0db Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Sat, 5 Jul 2025 21:07:09 +0800 Subject: [PATCH 21/24] ci: backup sglang --- ci/build_env_image.sh | 3 ++- ci/test_arealite.sh | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/ci/build_env_image.sh b/ci/build_env_image.sh index 9e3d724a49..5937723b5a 100644 --- a/ci/build_env_image.sh +++ b/ci/build_env_image.sh @@ -30,8 +30,9 @@ docker run \ python -m pip install --upgrade pip pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple pip config unset global.extra-index-url - pip config set global.no-cache-dir false bash examples/env/scripts/setup-pip-deps.sh + pip uninstall -y transformer-engine + mv ./sglang /sglang " || docker rm -f $RUN_ID && exit 1 docker commit $RUN_ID areal-env:latest diff --git a/ci/test_arealite.sh b/ci/test_arealite.sh index 70be190c6a..689776b407 100644 --- a/ci/test_arealite.sh +++ b/ci/test_arealite.sh @@ -21,9 +21,8 @@ docker run \ -w /workspace \ areal-env:latest \ bash -c " - pip uninstall -y transformer-engine - export HF_ENDPOINT=https://hf-mirror.com - python -m pytest -s arealite/ + mv /sglang ./sglang + HF_ENDPOINT=https://hf-mirror.com python -m pytest -s arealite/ " || docker rm -f $RUN_ID && exit 1 docker rm -f $RUN_ID From 18e9d2faea1a1e8346275c08329efb0849d279e0 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Sat, 5 Jul 2025 22:19:56 +0800 Subject: [PATCH 22/24] ci: remove tmp repo dir when run --- ci/clone_repo.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/clone_repo.sh b/ci/clone_repo.sh index 71d6d7d203..c4448822e5 100644 --- a/ci/clone_repo.sh +++ b/ci/clone_repo.sh @@ -9,6 +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" mkdir -p "/tmp/$RUN_ID" cd "/tmp/$RUN_ID" From c60a39fec26fc2bdd8f6da5367336de9b8ffe7cb Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Sun, 6 Jul 2025 08:35:35 +0800 Subject: [PATCH 23/24] ci: fix docker run exit 1 condition --- ci/build_env_image.sh | 2 +- ci/test_arealite.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ci/build_env_image.sh b/ci/build_env_image.sh index 5937723b5a..3839845928 100644 --- a/ci/build_env_image.sh +++ b/ci/build_env_image.sh @@ -33,7 +33,7 @@ docker run \ bash examples/env/scripts/setup-pip-deps.sh pip uninstall -y transformer-engine mv ./sglang /sglang - " || docker rm -f $RUN_ID && exit 1 + " || { docker rm -f $RUN_ID; exit 1; } docker commit $RUN_ID areal-env:latest docker rm -f $RUN_ID diff --git a/ci/test_arealite.sh b/ci/test_arealite.sh index 689776b407..79734eade5 100644 --- a/ci/test_arealite.sh +++ b/ci/test_arealite.sh @@ -23,6 +23,6 @@ docker run \ bash -c " mv /sglang ./sglang HF_ENDPOINT=https://hf-mirror.com python -m pytest -s arealite/ - " || docker rm -f $RUN_ID && exit 1 + " || { docker rm -f $RUN_ID; exit 1; } docker rm -f $RUN_ID From 08d7b68fade57c38131a730a328d23adba433eb7 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Sun, 6 Jul 2025 08:44:26 +0800 Subject: [PATCH 24/24] ci(test-arealite): limit the concurrency and extend command timeout --- .github/workflows/test-arealite.yml | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-arealite.yml b/.github/workflows/test-arealite.yml index 91a9ab3ae5..41ae60b8fa 100644 --- a/.github/workflows/test-arealite.yml +++ b/.github/workflows/test-arealite.yml @@ -11,6 +11,8 @@ on: jobs: test-arealite: runs-on: ubuntu-latest + concurrency: + group: test-arealite steps: - uses: actions/checkout@v4 @@ -32,7 +34,7 @@ jobs: host: ${{ secrets.CI_NODE_ADDR }} username: ${{ secrets.CI_NODE_USER }} key: ${{ secrets.REMOTE_SSH_KEY }} - command_timeout: 60m + command_timeout: 2h envs: GIT_COMMIT_SHA script_path: ci/build_env_image.sh @@ -43,6 +45,6 @@ jobs: host: ${{ secrets.CI_NODE_ADDR }} username: ${{ secrets.CI_NODE_USER }} key: ${{ secrets.REMOTE_SSH_KEY }} - command_timeout: 60m + command_timeout: 1h envs: GIT_COMMIT_SHA script_path: ci/test_arealite.sh