Repository navigation
145 lines (129 loc) · 5.64 KB
/
Copy pathci.yml
File metadata and controls
145 lines (129 loc) · 5.64 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
workflow_dispatch:
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test-rdma-build:
name: build (libibverbs) + tests
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v4
- name: Install RDMA dev headers and build tools
run: |
sudo apt-get update
sudo apt-get install -y libibverbs-dev librdmacm-dev cmake ninja-build
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install (builds the C++ extension) + test deps
run: |
python -m pip install --upgrade pip
pip install ".[test]"
- name: Verify the extension built with RDMA support
run: |
python -c "from peercache import _peercache; assert _peercache.HAS_RDMA, 'expected RDMA build'; print('HAS_RDMA', _peercache.HAS_RDMA)"
- name: Run tests (TCP fallback; runners have no RDMA device)
run: pytest -q
test-no-rdma:
name: build (PEERCACHE_NO_RDMA) + tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install without RDMA (stub extension + TCP fallback)
run: |
python -m pip install --upgrade pip
pip install ".[test]" --config-settings=cmake.define.PEERCACHE_NO_RDMA=ON
- name: Verify stub build falls back to TCP
run: |
python -c "from peercache import _peercache; assert _peercache.HAS_RDMA is False; print('stub build OK')"
- name: Run tests
run: pytest -q
# ------------------------------------------------------------------ #
# SGLang integration: contract vs a real sglang install (no GPU).
# Verifies PeerCacheStore subclasses the real HiCacheStorage and the
# v1/v2 + sidecar-pool paths work against sglang's real interfaces.
# ------------------------------------------------------------------ #
sglang-contract:
name: sglang contract (no GPU)
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install PeerCache (no RDMA) + sglang
run: |
python -m pip install --upgrade pip
pip install ".[test]" --config-settings=cmake.define.PEERCACHE_NO_RDMA=ON
# Latest sglang: pulls torch (CPU wheel on hosted runners) which is
# large; a pinned sglang keeps the cache warm and the job fast.
pip install "sglang[all]==0.5.9" 2>/dev/null || pip install sglang
- name: Run sglang contract tests
run: pytest tests/sglang/test_sglang_contract.py -v
- name: Run sglang main-branch v2 contract tests
# Fetches the main-branch hicache_storage.py (PoolName/PoolTransfer/
# PoolHitPolicy + DeepSeek-V4/DRAFT pool names) from GitHub and drives
# PeerCache's v2 + sidecar paths against the real main-branch types.
run: pytest tests/sglang/test_main_v2_contract.py -v
- name: Run sglang official-registration tests
# Applies the PR patches (register_backend + _create_builtin_backend)
# to the main-branch backend_factory.py and verifies
# create_backend('peercache', ...) works like the builtin backends.
run: pytest tests/sglang/test_official_registration.py -v
# ------------------------------------------------------------------ #
# SGLang end-to-end: real sglang server + PeerCache backend on a GPU
# runner (self-hosted). TCP protocol validates the full control plane
# (discovery -> DHT directory -> published pool -> fetch) without RDMA.
# Triggered manually or by label; skipped when no GPU runner is online.
# ------------------------------------------------------------------ #
sglang-e2e-gpu:
name: sglang e2e (GPU, TCP protocol)
runs-on: [self-hosted, linux, x64, gpu]
if: >-
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'pull_request' &&
contains(github.event.pull_request.labels.*.name, 'run-sglang-e2e'))
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- name: Install PeerCache + sglang (CUDA)
run: |
python -m pip install --upgrade pip
pip install ".[test]" --config-settings=cmake.define.PEERCACHE_NO_RDMA=ON
pip install "sglang[srt]==0.5.9"
- name: Run sglang e2e (p2p directory mode)
env:
PEERCACHE_E2E_MODEL: Qwen/Qwen2.5-0.5B-Instruct
run: python tests/sglang/test_sglang_e2e.py --mode p2p
- name: Run sglang e2e (slotmap directory-free mode)
env:
PEERCACHE_E2E_MODEL: Qwen/Qwen2.5-0.5B-Instruct
run: python tests/sglang/test_sglang_e2e.py --mode slotmap
- name: Run 2-node slotmap cross-node read (live sglang server)
# Keep a slotmap sglang server up (--keep-server), drive shared-prefix
# requests into it, then have an independent PeerCache node read the
# published pages back from its slot region (one-shot bucket READ, no
# directory lookup).
env:
PEERCACHE_E2E_MODEL: Qwen/Qwen2.5-0.5B-Instruct
PEERCACHE_SGLANG_PY: python
run: |
python tests/sglang/test_sglang_e2e.py --mode slotmap --requests 2 --keep-server \
|| true
python tests/sglang/test_sglang_2node_slotmap_read.py
pkill -f "sglang.launch_server" 2>/dev/null || true