From 343f23b0ba599587c615b7b973a32eb2027deabd Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Thu, 24 Jul 2025 21:26:35 +0800 Subject: [PATCH 01/23] ci: add testsz for self hosted runner --- .github/workflows/test-self-hosted-runner.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 .github/workflows/test-self-hosted-runner.yml diff --git a/.github/workflows/test-self-hosted-runner.yml b/.github/workflows/test-self-hosted-runner.yml new file mode 100644 index 0000000000..780305f9c3 --- /dev/null +++ b/.github/workflows/test-self-hosted-runner.yml @@ -0,0 +1,15 @@ +name: Test Self-Hosted Runners + +on: + push: + pull_request: + workflow_dispatch: + +jobs: + test-self-hosted-runner: + runs-on: self-hosted + steps: + - uses: actions/checkout@v4 + + - run: | + nvidia-smi From 477e2aa4722d5c95800c76c0b125616ffcc9904c Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Thu, 24 Jul 2025 21:33:12 +0800 Subject: [PATCH 02/23] ci: use self-hosted runner --- .github/workflows/test-arealite.yml | 36 ++----------------- .github/workflows/test-self-hosted-runner.yml | 15 -------- ci/clone_repo.sh | 19 ---------- 3 files changed, 3 insertions(+), 67 deletions(-) delete mode 100644 .github/workflows/test-self-hosted-runner.yml delete mode 100644 ci/clone_repo.sh diff --git a/.github/workflows/test-arealite.yml b/.github/workflows/test-arealite.yml index 50b776c432..8d87db7b90 100644 --- a/.github/workflows/test-arealite.yml +++ b/.github/workflows/test-arealite.yml @@ -11,44 +11,14 @@ on: jobs: test-arealite: - environment: - name: AReaLite-unittests - runs-on: ubuntu-latest - concurrency: - group: test-arealite + runs-on: a800 steps: - uses: actions/checkout@v4 - - uses: appleboy/ssh-action@v1 + - run: ./ci/build_env_image.sh 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,CI_NODE_SUDO_PW - script_path: ci/clone_repo.sh - - uses: appleboy/ssh-action@v1 + - run: ./ci/test_arealite.sh env: GIT_COMMIT_SHA: ${{ github.sha }} - with: - host: ${{ secrets.CI_NODE_ADDR }} - username: ${{ secrets.CI_NODE_USER }} - key: ${{ secrets.REMOTE_SSH_KEY }} - command_timeout: 2h - envs: GIT_COMMIT_SHA - script_path: ci/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: 1h - envs: GIT_COMMIT_SHA - script_path: ci/test_arealite.sh diff --git a/.github/workflows/test-self-hosted-runner.yml b/.github/workflows/test-self-hosted-runner.yml deleted file mode 100644 index 780305f9c3..0000000000 --- a/.github/workflows/test-self-hosted-runner.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: Test Self-Hosted Runners - -on: - push: - pull_request: - workflow_dispatch: - -jobs: - test-self-hosted-runner: - runs-on: self-hosted - steps: - - uses: actions/checkout@v4 - - - run: | - nvidia-smi diff --git a/ci/clone_repo.sh b/ci/clone_repo.sh deleted file mode 100644 index ec75a6142b..0000000000 --- a/ci/clone_repo.sh +++ /dev/null @@ -1,19 +0,0 @@ -#!/usr/bin/env bash - -set -e - -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_URL: $GIT_REPO_URL" -echo "GIT_COMMIT_SHA: $GIT_COMMIT_SHA" - -RUN_ID="areal-$GIT_COMMIT_SHA" -echo ${CI_NODE_SUDO_PW} | sudo -S rm -rf "/tmp/$RUN_ID" -mkdir -p "/tmp/$RUN_ID" -cd "/tmp/$RUN_ID" - -git init -git remote add origin "$GIT_REPO_URL" -git fetch --depth 1 origin "$GIT_COMMIT_SHA" -git checkout FETCH_HEAD From 8d0145a53207c86dbe3125ccd94944e29aed7b4c Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Thu, 24 Jul 2025 21:34:54 +0800 Subject: [PATCH 03/23] ci: run ci on push --- .github/workflows/test-arealite.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/test-arealite.yml b/.github/workflows/test-arealite.yml index 8d87db7b90..d22b2ba944 100644 --- a/.github/workflows/test-arealite.yml +++ b/.github/workflows/test-arealite.yml @@ -7,6 +7,7 @@ on: - .github/workflows/test-arealite.yml - arealite/** - ci/** + push: workflow_dispatch: jobs: From b5d6b436c4c9cfac87ba67df3f3ea075a5c7d511 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Thu, 24 Jul 2025 21:39:08 +0800 Subject: [PATCH 04/23] ci: remove cd to tmp dir --- ci/build_env_image.sh | 1 - ci/test_arealite.sh | 1 - 2 files changed, 2 deletions(-) diff --git a/ci/build_env_image.sh b/ci/build_env_image.sh index 45fdf8784e..cc4e800613 100644 --- a/ci/build_env_image.sh +++ b/ci/build_env_image.sh @@ -7,7 +7,6 @@ GIT_COMMIT_SHA=${GIT_COMMIT_SHA:?"GIT_COMMIT_SHA is not set"} echo "GIT_COMMIT_SHA: $GIT_COMMIT_SHA" RUN_ID="areal-$GIT_COMMIT_SHA" -cd "/tmp/$RUN_ID" # If there is already an image for the current environment, skip the build. ENV_SHA=$(sha256sum pyproject.toml | awk '{print $1}') diff --git a/ci/test_arealite.sh b/ci/test_arealite.sh index 8f281b168f..d497e37550 100644 --- a/ci/test_arealite.sh +++ b/ci/test_arealite.sh @@ -7,7 +7,6 @@ GIT_COMMIT_SHA=${GIT_COMMIT_SHA:?"GIT_COMMIT_SHA is not set"} echo "GIT_COMMIT_SHA: $GIT_COMMIT_SHA" 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 From 982a5499697e261f2fe4ce6ac16ffbf38e6994de Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Thu, 24 Jul 2025 21:49:14 +0800 Subject: [PATCH 05/23] ci: fix --- .github/workflows/test-arealite.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test-arealite.yml b/.github/workflows/test-arealite.yml index d22b2ba944..61aecec8a1 100644 --- a/.github/workflows/test-arealite.yml +++ b/.github/workflows/test-arealite.yml @@ -16,10 +16,10 @@ jobs: steps: - uses: actions/checkout@v4 - - run: ./ci/build_env_image.sh + - run: bash ./ci/build_env_image.sh env: GIT_COMMIT_SHA: ${{ github.sha }} - - run: ./ci/test_arealite.sh + - run: bash ./ci/test_arealite.sh env: GIT_COMMIT_SHA: ${{ github.sha }} From ad99b1e098875fd98060c042167a63b10a0b331e Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Thu, 24 Jul 2025 21:56:11 +0800 Subject: [PATCH 06/23] ci: add environment back --- .github/workflows/test-arealite.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-arealite.yml b/.github/workflows/test-arealite.yml index 61aecec8a1..5df72d55da 100644 --- a/.github/workflows/test-arealite.yml +++ b/.github/workflows/test-arealite.yml @@ -12,6 +12,8 @@ on: jobs: test-arealite: + environment: + name: AReaLite-unittests runs-on: a800 steps: - uses: actions/checkout@v4 From 691f9c52525f695bd7634e98724b42d3f57bb142 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Thu, 24 Jul 2025 21:58:40 +0800 Subject: [PATCH 07/23] ci: set concurrency --- .github/workflows/test-arealite.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-arealite.yml b/.github/workflows/test-arealite.yml index 5df72d55da..727f528abe 100644 --- a/.github/workflows/test-arealite.yml +++ b/.github/workflows/test-arealite.yml @@ -12,6 +12,8 @@ on: jobs: test-arealite: + concurrency: + group: a800 environment: name: AReaLite-unittests runs-on: a800 From 6e529ce4cf50306c9f3b6f319474a379292418a3 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Thu, 24 Jul 2025 22:20:48 +0800 Subject: [PATCH 08/23] ci: fix build env image --- ci/build_env_image.sh | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/ci/build_env_image.sh b/ci/build_env_image.sh index cc4e800613..8f7c3ca4ee 100644 --- a/ci/build_env_image.sh +++ b/ci/build_env_image.sh @@ -27,12 +27,10 @@ docker run \ -w /workspace \ nvcr.io/nvidia/pytorch:25.01-py3 \ 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 uninstall -y transformer-engine torch-tensorrt nvidia-dali-cuda120 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:$ENV_SHA" From 2d743b16331cdd84186d3bdb612198752f4ddc6d Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 25 Jul 2025 08:11:54 +0800 Subject: [PATCH 09/23] Update .github/workflows/test-arealite.yml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- .github/workflows/test-arealite.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-arealite.yml b/.github/workflows/test-arealite.yml index 727f528abe..148bac5d09 100644 --- a/.github/workflows/test-arealite.yml +++ b/.github/workflows/test-arealite.yml @@ -13,7 +13,7 @@ on: jobs: test-arealite: concurrency: - group: a800 + group: test-arealite-a800 environment: name: AReaLite-unittests runs-on: a800 From f408d3113ed066a87a598120428dc075c313789a Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 25 Jul 2025 08:13:09 +0800 Subject: [PATCH 10/23] Update ci/build_env_image.sh Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- ci/build_env_image.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ci/build_env_image.sh b/ci/build_env_image.sh index 8f7c3ca4ee..189de55045 100644 --- a/ci/build_env_image.sh +++ b/ci/build_env_image.sh @@ -29,7 +29,9 @@ docker run \ bash -c " pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple pip config unset global.extra-index-url - pip uninstall -y transformer-engine torch-tensorrt nvidia-dali-cuda120 + pip uninstall -y --ignore-installed transformer-engine + pip uninstall -y --ignore-installed torch-tensorrt + pip uninstall -y --ignore-installed nvidia-dali-cuda120 bash examples/env/scripts/setup-pip-deps.sh " || { docker rm -f $RUN_ID; exit 1; } From 73e6adb51e8423278e034357bf06cf17cc1b3c4b Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 25 Jul 2025 08:15:08 +0800 Subject: [PATCH 11/23] ci: add some test code --- .github/workflows/test-arealite.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/test-arealite.yml b/.github/workflows/test-arealite.yml index 148bac5d09..68ff1c1af1 100644 --- a/.github/workflows/test-arealite.yml +++ b/.github/workflows/test-arealite.yml @@ -20,6 +20,8 @@ jobs: steps: - uses: actions/checkout@v4 + - run: ls /data1 + - run: bash ./ci/build_env_image.sh env: GIT_COMMIT_SHA: ${{ github.sha }} From b9d30711ac71dbe90b21be542282a654a69faabb Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 25 Jul 2025 10:18:45 +0800 Subject: [PATCH 12/23] ci: simplify --- .github/workflows/test-arealite.yml | 12 +-------- ci/build_env_image.sh | 39 ----------------------------- ci/test_arealite.sh | 37 ++++++++++++++++++++++++--- 3 files changed, 34 insertions(+), 54 deletions(-) delete mode 100644 ci/build_env_image.sh diff --git a/.github/workflows/test-arealite.yml b/.github/workflows/test-arealite.yml index 68ff1c1af1..4065702306 100644 --- a/.github/workflows/test-arealite.yml +++ b/.github/workflows/test-arealite.yml @@ -12,20 +12,10 @@ on: jobs: test-arealite: - concurrency: - group: test-arealite-a800 environment: name: AReaLite-unittests - runs-on: a800 + runs-on: gpu steps: - uses: actions/checkout@v4 - - run: ls /data1 - - - run: bash ./ci/build_env_image.sh - env: - GIT_COMMIT_SHA: ${{ github.sha }} - - run: bash ./ci/test_arealite.sh - env: - GIT_COMMIT_SHA: ${{ github.sha }} diff --git a/ci/build_env_image.sh b/ci/build_env_image.sh deleted file mode 100644 index 189de55045..0000000000 --- a/ci/build_env_image.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/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" - -RUN_ID="areal-$GIT_COMMIT_SHA" - -# If there is already an image for the current environment, skip the build. -ENV_SHA=$(sha256sum pyproject.toml | awk '{print $1}') -if docker images --format '{{.Repository}}:{{.Tag}}' | grep -q "areal-env:$ENV_SHA"; then - echo "Image areal-env already exists, skipping build." - exit 0 -fi - -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 \ - nvcr.io/nvidia/pytorch:25.01-py3 \ - bash -c " - pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple - pip config unset global.extra-index-url - pip uninstall -y --ignore-installed transformer-engine - pip uninstall -y --ignore-installed torch-tensorrt - pip uninstall -y --ignore-installed nvidia-dali-cuda120 - bash examples/env/scripts/setup-pip-deps.sh - " || { docker rm -f $RUN_ID; exit 1; } - -docker commit $RUN_ID "areal-env:$ENV_SHA" -docker rm -f $RUN_ID diff --git a/ci/test_arealite.sh b/ci/test_arealite.sh index d497e37550..4286fd2d1e 100644 --- a/ci/test_arealite.sh +++ b/ci/test_arealite.sh @@ -2,17 +2,46 @@ set -e -GIT_COMMIT_SHA=${GIT_COMMIT_SHA:?"GIT_COMMIT_SHA is not set"} +RUN_ID="test-arealite-$(cat /dev/urandom | tr -dc 'a-z0-9' | head -c 16)" -echo "GIT_COMMIT_SHA: $GIT_COMMIT_SHA" +# Calculate environment hash from pyproject.toml +ENV_SHA=$(sha256sum pyproject.toml | awk '{print $1}') + +# Build environment image if it doesn't exist +if ! docker images --format '{{.Repository}}:{{.Tag}}' | grep -q "areal-env:$ENV_SHA"; then + echo "Building image areal-env:$ENV_SHA..." + + # Build the environment image + docker run \ + --name $RUN_ID \ + -v $(pwd):/workspace \ + -w /workspace \ + nvcr.io/nvidia/pytorch:25.01-py3 \ + bash -c " + pip config set global.index-url https://mirrors.tuna.tsinghua.edu.cn/pypi/web/simple + pip config unset global.extra-index-url + pip uninstall -y --ignore-installed transformer-engine + pip uninstall -y --ignore-installed torch-tensorrt + pip uninstall -y --ignore-installed nvidia-dali-cuda120 + bash examples/env/scripts/setup-pip-deps.sh + " || { docker rm -f $RUN_ID; exit 1; } -RUN_ID="areal-$GIT_COMMIT_SHA" + # Commit the container as the environment image + docker commit $RUN_ID "areal-env:$ENV_SHA" + docker rm -f $RUN_ID + + echo "Image areal-env:$ENV_SHA built successfully." +else + echo "Image areal-env:$ENV_SHA already exists, skipping build." +fi +# Clean up any existing test container if docker ps -a --format '{{.Names}}' | grep -q "$RUN_ID"; then docker rm -f $RUN_ID fi -ENV_SHA=$(sha256sum pyproject.toml | awk '{print $1}') +# Run tests using the environment image +echo "Running tests on image areal-env:$ENV_SHA..." docker run \ --name $RUN_ID \ --gpus all \ From 78ca75e806fb5a8b70cc80f33d2c26e7449329be Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 25 Jul 2025 10:24:12 +0800 Subject: [PATCH 13/23] ci: try to fix --- ci/test_arealite.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/ci/test_arealite.sh b/ci/test_arealite.sh index 4286fd2d1e..603ef911ae 100644 --- a/ci/test_arealite.sh +++ b/ci/test_arealite.sh @@ -2,7 +2,7 @@ set -e -RUN_ID="test-arealite-$(cat /dev/urandom | tr -dc 'a-z0-9' | head -c 16)" +RUN_ID="test-arealite-$RANDOM" # Calculate environment hash from pyproject.toml ENV_SHA=$(sha256sum pyproject.toml | awk '{print $1}') @@ -50,7 +50,6 @@ docker run \ -w /workspace \ "areal-env:$ENV_SHA" \ bash -c " - mv /sglang ./sglang HF_ENDPOINT=https://hf-mirror.com python -m pytest -s arealite/ " || { docker rm -f $RUN_ID; exit 1; } From 76731c9fa897936bf4225c15e7b0b5b6f496112e Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 25 Jul 2025 10:27:12 +0800 Subject: [PATCH 14/23] ci: test --- ci/test_arealite.sh | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/ci/test_arealite.sh b/ci/test_arealite.sh index 603ef911ae..13ae45a469 100644 --- a/ci/test_arealite.sh +++ b/ci/test_arealite.sh @@ -2,6 +2,8 @@ set -e +ls + RUN_ID="test-arealite-$RANDOM" # Calculate environment hash from pyproject.toml @@ -35,11 +37,6 @@ else echo "Image areal-env:$ENV_SHA already exists, skipping build." fi -# Clean up any existing test container -if docker ps -a --format '{{.Names}}' | grep -q "$RUN_ID"; then - docker rm -f $RUN_ID -fi - # Run tests using the environment image echo "Running tests on image areal-env:$ENV_SHA..." docker run \ From 04a36fae57af3d43c0980b841e1702413e9feb14 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 25 Jul 2025 10:28:58 +0800 Subject: [PATCH 15/23] ci: test2 --- ci/test_arealite.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/test_arealite.sh b/ci/test_arealite.sh index 13ae45a469..c38196d687 100644 --- a/ci/test_arealite.sh +++ b/ci/test_arealite.sh @@ -47,6 +47,7 @@ docker run \ -w /workspace \ "areal-env:$ENV_SHA" \ bash -c " + ls HF_ENDPOINT=https://hf-mirror.com python -m pytest -s arealite/ " || { docker rm -f $RUN_ID; exit 1; } From b18853c21cd179198314a96a2037fb199b098a67 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 25 Jul 2025 10:30:51 +0800 Subject: [PATCH 16/23] ci: test3 --- ci/test_arealite.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/ci/test_arealite.sh b/ci/test_arealite.sh index c38196d687..7a6c8391ce 100644 --- a/ci/test_arealite.sh +++ b/ci/test_arealite.sh @@ -47,6 +47,7 @@ docker run \ -w /workspace \ "areal-env:$ENV_SHA" \ bash -c " + pwd ls HF_ENDPOINT=https://hf-mirror.com python -m pytest -s arealite/ " || { docker rm -f $RUN_ID; exit 1; } From ba5488f9723f71700295a2ae1413d6542562d696 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 25 Jul 2025 10:35:29 +0800 Subject: [PATCH 17/23] ci: test3 --- ci/test_arealite.sh | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/ci/test_arealite.sh b/ci/test_arealite.sh index 7a6c8391ce..d0519ebc90 100644 --- a/ci/test_arealite.sh +++ b/ci/test_arealite.sh @@ -2,8 +2,6 @@ set -e -ls - RUN_ID="test-arealite-$RANDOM" # Calculate environment hash from pyproject.toml @@ -37,6 +35,9 @@ else echo "Image areal-env:$ENV_SHA already exists, skipping build." fi +pwd +ls + # Run tests using the environment image echo "Running tests on image areal-env:$ENV_SHA..." docker run \ From ce97e0fe227edec0f061065402107a3c8e6b7e7f Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 25 Jul 2025 17:13:54 +0800 Subject: [PATCH 18/23] ci: tidy up --- ci/test_arealite.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/ci/test_arealite.sh b/ci/test_arealite.sh index d0519ebc90..9463d9bbae 100644 --- a/ci/test_arealite.sh +++ b/ci/test_arealite.sh @@ -29,15 +29,10 @@ if ! docker images --format '{{.Repository}}:{{.Tag}}' | grep -q "areal-env:$ENV # Commit the container as the environment image docker commit $RUN_ID "areal-env:$ENV_SHA" docker rm -f $RUN_ID - - echo "Image areal-env:$ENV_SHA built successfully." else echo "Image areal-env:$ENV_SHA already exists, skipping build." fi -pwd -ls - # Run tests using the environment image echo "Running tests on image areal-env:$ENV_SHA..." docker run \ @@ -48,8 +43,6 @@ docker run \ -w /workspace \ "areal-env:$ENV_SHA" \ bash -c " - pwd - ls HF_ENDPOINT=https://hf-mirror.com python -m pytest -s arealite/ " || { docker rm -f $RUN_ID; exit 1; } From a7670f622a19693af00971ac4af3b068182eb439 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 25 Jul 2025 22:01:07 +0800 Subject: [PATCH 19/23] ci: simplify --- ci/test_arealite.sh | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/ci/test_arealite.sh b/ci/test_arealite.sh index 9463d9bbae..59b5492bdb 100644 --- a/ci/test_arealite.sh +++ b/ci/test_arealite.sh @@ -27,7 +27,7 @@ if ! docker images --format '{{.Repository}}:{{.Tag}}' | grep -q "areal-env:$ENV " || { docker rm -f $RUN_ID; exit 1; } # Commit the container as the environment image - docker commit $RUN_ID "areal-env:$ENV_SHA" + docker commit $RUN_ID areal-env:$ENV_SHA docker rm -f $RUN_ID else echo "Image areal-env:$ENV_SHA already exists, skipping build." @@ -36,14 +36,12 @@ fi # Run tests using the environment image echo "Running tests on image areal-env:$ENV_SHA..." docker run \ + -e HF_ENDPOINT=https://hf-mirror.com \ --name $RUN_ID \ --gpus all \ --shm-size=8g \ + --rm \ -v $(pwd):/workspace \ -w /workspace \ - "areal-env:$ENV_SHA" \ - bash -c " - HF_ENDPOINT=https://hf-mirror.com python -m pytest -s arealite/ - " || { docker rm -f $RUN_ID; exit 1; } - -docker rm -f $RUN_ID + areal-env:$ENV_SHA \ + python -m pytest -s arealite/ From bf9f4d1703a3fc5ef9ed0db5cf05b58180c45ba5 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Fri, 25 Jul 2025 22:19:53 +0800 Subject: [PATCH 20/23] ci: do not trigger on push --- .github/workflows/test-arealite.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-arealite.yml b/.github/workflows/test-arealite.yml index 4065702306..6ed86b43f6 100644 --- a/.github/workflows/test-arealite.yml +++ b/.github/workflows/test-arealite.yml @@ -7,7 +7,6 @@ on: - .github/workflows/test-arealite.yml - arealite/** - ci/** - push: workflow_dispatch: jobs: From 71690b00aad588a5130ca2878538bd168b8d2101 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Sat, 26 Jul 2025 14:50:29 +0800 Subject: [PATCH 21/23] ci: test arealite/tests/ --- 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 59b5492bdb..a619895cea 100644 --- a/ci/test_arealite.sh +++ b/ci/test_arealite.sh @@ -44,4 +44,4 @@ docker run \ -v $(pwd):/workspace \ -w /workspace \ areal-env:$ENV_SHA \ - python -m pytest -s arealite/ + python -m pytest -s arealite/tests/ From 08b050f3a6a2e4bc2d2b65948e27699ed805cfa6 Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Sat, 26 Jul 2025 15:06:31 +0800 Subject: [PATCH 22/23] ci: use UUID as run id --- 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 a619895cea..dcf1cb1428 100644 --- a/ci/test_arealite.sh +++ b/ci/test_arealite.sh @@ -2,7 +2,7 @@ set -e -RUN_ID="test-arealite-$RANDOM" +RUN_ID="test-arealite-$(uuidgen)" # Calculate environment hash from pyproject.toml ENV_SHA=$(sha256sum pyproject.toml | awk '{print $1}') From fe682aec043e8e3723d1b72fea1a2f452cd7f62e Mon Sep 17 00:00:00 2001 From: Zijian Zhang Date: Sat, 26 Jul 2025 15:10:06 +0800 Subject: [PATCH 23/23] ci: use openssl rand to genreate run id --- 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 dcf1cb1428..74ac39c34c 100644 --- a/ci/test_arealite.sh +++ b/ci/test_arealite.sh @@ -2,7 +2,7 @@ set -e -RUN_ID="test-arealite-$(uuidgen)" +RUN_ID="test-arealite-$(openssl rand -hex 6)" # Calculate environment hash from pyproject.toml ENV_SHA=$(sha256sum pyproject.toml | awk '{print $1}')