Fix TCP PeerAgent advertised host #136
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # .github/workflows/ci.yml | |
| name: CI | |
| on: | |
| pull_request: | |
| push: | |
| branches: [main, master] | |
| workflow_dispatch: | |
| inputs: | |
| run_rdma_tests: | |
| description: Run RDMA/CUDA tests on the self-hosted runner | |
| required: true | |
| default: "false" | |
| type: choice | |
| options: | |
| - "false" | |
| - "true" | |
| permissions: | |
| contents: read | |
| jobs: | |
| lint: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.11" | |
| cache: pip | |
| - name: Install pre-commit | |
| run: python -m pip install pre-commit | |
| - name: Run pre-commit | |
| run: pre-commit run --all-files | |
| build-wheel: | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: actions/setup-python@v6 | |
| with: | |
| python-version: "3.10" | |
| cache: pip | |
| - name: Install system dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y \ | |
| build-essential \ | |
| cmake \ | |
| ninja-build \ | |
| libnuma-dev \ | |
| libibverbs-dev \ | |
| libasio-dev | |
| - name: Install build dependencies | |
| run: | | |
| python -m pip install -U pip build wheel | |
| python -m pip install scikit-build-core pybind11 ninja | |
| - name: Build wheel | |
| env: | |
| CMAKE_ARGS: >- | |
| -DBUILD_RDMA=ON | |
| -DBUILD_TCP=ON | |
| -DBUILD_PYTHON=ON | |
| -DBUILD_NVLINK=OFF | |
| -DBUILD_TORCH_PLUGIN=OFF | |
| -DBUILD_ASCEND_DIRECT=OFF | |
| -DBUILD_TEST=OFF | |
| -DUSE_CUDA=OFF | |
| # The native wheel lives under dlslime/ (dlslime-ctrl/ is a separate Rust crate). | |
| run: python -m build --wheel --outdir dist dlslime | |
| - name: Install wheel smoke test | |
| run: | | |
| python -m pip install dist/dlslime-*.whl --no-deps | |
| cd /tmp | |
| python - <<'PY' | |
| import dlslime | |
| print("dlslime import ok") | |
| PY | |
| rdma-tests: | |
| name: RDMA tests | |
| if: > | |
| (github.event_name == 'workflow_dispatch' && | |
| inputs.run_rdma_tests == 'true') || | |
| (github.event_name == 'pull_request' && | |
| github.event.pull_request.head.repo.full_name == github.repository) | |
| runs-on: [self-hosted, linux, rdma] | |
| environment: self-hosted-rdma | |
| timeout-minutes: 60 | |
| steps: | |
| - uses: actions/checkout@v6 | |
| with: | |
| clean: false | |
| - name: Run RDMA Python tests in Docker | |
| run: | | |
| set -euxo pipefail | |
| container_name="dlslime-ci-${GITHUB_RUN_ID}-${GITHUB_RUN_ATTEMPT}" | |
| cleanup() { | |
| docker rm -f "${container_name}" >/dev/null 2>&1 || true | |
| } | |
| trap cleanup EXIT | |
| # Mount the runner-checked-out workspace into the container so the | |
| # tests always run against the exact commit being CI'd, not whatever | |
| # stale tree happens to live on the host. | |
| docker run -d \ | |
| --gpus all \ | |
| --network host \ | |
| --ipc host \ | |
| --privileged \ | |
| --cap-add SYS_ADMIN \ | |
| --cap-add SYS_PTRACE \ | |
| --name "${container_name}" \ | |
| -v "${GITHUB_WORKSPACE}:/workspace" \ | |
| -v /mnt/nvme1n1/ml_research/models:/models \ | |
| -w /workspace \ | |
| majinming_lmdeploy:v1 \ | |
| sleep infinity | |
| docker exec "${container_name}" bash -lc ' | |
| set -euxo pipefail | |
| apt install -y libasio-dev | |
| cd /workspace | |
| export PIP_CONFIG_FILE=/dev/null | |
| export PIP_INDEX_URL=https://mirrors.aliyun.com/pypi/simple/ | |
| export PIP_TRUSTED_HOST=mirrors.aliyun.com | |
| export http_proxy=http://127.0.0.1:7897 | |
| export https_proxy=http://127.0.0.1:7897 | |
| export HTTP_PROXY=http://127.0.0.1:7897 | |
| export HTTPS_PROXY=http://127.0.0.1:7897 | |
| export SLIME_VISIBLE_DEVICES=mlx5_0,mlx5_1,mlx5_2,mlx5_3,mlx5_4,mlx5_5,mlx5_6,mlx5_7 | |
| unset PIP_EXTRA_INDEX_URL | |
| export DLSLIME_TCP_TEST_CUDA=ON | |
| python -m pip install -U pip pytest | |
| python -m pip show dlslime || true | |
| python -m pip uninstall -y dlslime || true | |
| python -m pip install -e dlslime | |
| python -m pip show dlslime | |
| python -c "import dlslime; print(\"dlslime:\", dlslime.__file__); print(\"available_nic:\", dlslime.available_nic())" | |
| pytest dlslime/tests/python -v | |
| ' |