-
Notifications
You must be signed in to change notification settings - Fork 278
Add CI for testing AReaLite #150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
0290371
becea9a
c13279a
5a0b8d3
5fe18b1
c274029
d9926ff
732f12e
9efbfa5
95cfc73
0ee70d5
4ab4fc7
c75b570
4d11e16
59609c2
07b574f
49c30b4
5cd2d73
7f50c5d
1d63632
96745be
27aac79
18e9d2f
c60a39f
08d7b68
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,50 @@ | ||
| name: Test AReaLite | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - .github/workflows/test-arealite.yml | ||
| - arealite/** | ||
| - ci/** | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| test-arealite: | ||
| runs-on: ubuntu-latest | ||
| concurrency: | ||
| group: test-arealite | ||
| 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: 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 |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,39 @@ | ||||||
| #!/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 \ | ||||||
|
||||||
| -v $(pwd):/workspace \ | |
| -v "$(pwd)":/workspace \ |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,19 @@ | ||
| #!/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" | ||
| 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 |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,28 @@ | ||||||
| #!/usr/bin/env bash | ||||||
|
|
||||||
| set -e | ||||||
|
||||||
| set -e | |
| set -eu |
Copilot
AI
Jul 6, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quote the volume path to handle directories with spaces, e.g., -v "$(pwd)":/workspace.
| -v $(pwd):/workspace \ | |
| -v "$(pwd)":/workspace \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[nitpick] This
MODEL_PATHis duplicated across multiple tests; consider extracting it into a shared fixture or constant to reduce duplication and ease future updates.