Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 2 additions & 36 deletions .github/workflows/test-arealite.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,42 +13,8 @@ jobs:
test-arealite:
environment:
name: AReaLite-unittests
runs-on: ubuntu-latest
concurrency:
group: test-arealite
runs-on: gpu
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 }}
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
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
- run: bash ./ci/test_arealite.sh
40 changes: 0 additions & 40 deletions ci/build_env_image.sh

This file was deleted.

19 changes: 0 additions & 19 deletions ci/clone_repo.sh

This file was deleted.

44 changes: 31 additions & 13 deletions ci/test_arealite.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,28 +2,46 @@

set -e

GIT_COMMIT_SHA=${GIT_COMMIT_SHA:?"GIT_COMMIT_SHA is not set"}
RUN_ID="test-arealite-$(openssl rand -hex 6)"
Comment thread
futrime marked this conversation as resolved.

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..."

RUN_ID="areal-$GIT_COMMIT_SHA"
cd "/tmp/$RUN_ID"
# Build the environment image
docker run \
--name $RUN_ID \
Comment thread
futrime marked this conversation as resolved.
-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
Comment thread
futrime marked this conversation as resolved.
" || { docker rm -f $RUN_ID; exit 1; }

if docker ps -a --format '{{.Names}}' | grep -q "$RUN_ID"; then
# Commit the container as the environment image
docker commit $RUN_ID areal-env:$ENV_SHA
docker rm -f $RUN_ID
else
echo "Image areal-env:$ENV_SHA already exists, skipping build."
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 \
-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 "
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
areal-env:$ENV_SHA \
python -m pytest -s arealite/tests/
Comment thread
futrime marked this conversation as resolved.