Repository navigation
116 lines (109 loc) · 4.7 KB
/
Copy pathci.yml
File metadata and controls
116 lines (109 loc) · 4.7 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
name: ci
on:
push:
branches: [main]
pull_request:
workflow_call:
permissions:
contents: read
# Cancel superseded runs on the same ref instead of queueing them.
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
# Bound CPU kernel dispatch to AVX2, the dev-host golden baseline.
env:
ATEN_CPU_CAPABILITY: avx2
MKL_CBWR: AVX2
ONEDNN_MAX_CPU_ISA: AVX2
jobs:
# Format, lint and types only. Fast, high signal, no test execution.
lint:
runs-on: ubuntu-24.04
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
version: "0.12.17"
python-version: "3.12"
enable-cache: true
cache-dependency-glob: "uv.lock"
- run: uv sync --locked --all-extras --group dev
- name: Format, lint, types
run: |
set -euo pipefail
uv run --frozen ruff format --check
uv run --frozen ruff check
MYPYPATH=src:scripts:. uv run --frozen mypy --explicit-package-bases \
--package hypertrain --module experiments.gpu_network_v2.orchestrate \
--module scripts.network_service_proof --module scripts.network_gpu_operation
# Whole non-sim/non-e2e suite, sharded round-robin over test files so wall-clock
# is a fraction of the serial run. The native-systemd-only cases are excluded here
# and run in the nightly heavy workflow (heavy.yml).
test:
runs-on: ubuntu-24.04
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
shard: [0, 1, 2, 3, 4, 5, 6, 7]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
version: "0.12.17"
python-version: "3.12"
enable-cache: true
cache-dependency-glob: "uv.lock"
- run: uv sync --locked --all-extras --group dev
- name: Sharded suite
env:
SHARD: ${{ matrix.shard }}
SHARDS: "8"
shell: bash
run: |
set -euo pipefail
mapfile -t ALL < <(git ls-files 'tests/**/test_*.py' \
| grep -v '^tests/sim/' | grep -v '^tests/e2e/' | sort)
SEL=()
for i in "${!ALL[@]}"; do
if (( i % SHARDS == SHARD )); then SEL+=("${ALL[$i]}"); fi
done
printf 'shard %s/%s -> %s files\n' "$SHARD" "$SHARDS" "${#SEL[@]}"
if [ "${#SEL[@]}" -eq 0 ]; then echo "no files in shard"; exit 0; fi
uv run --frozen pytest -q --durations=25 -m "not od" \
--deselect=tests/challenge/test_capacity_outer_v2.py::test_actual_bounded_outer_child_matches_original_signed_replay \
--deselect=tests/challenge/test_service_capacity_v2.py::test_real_capacity_launch_failure_keeps_debit_and_prevents_restart_rerun \
"--deselect=tests/miner/test_capacity_runtime_v2.py::test_actual_small_kernel_attempt_and_cleanup[success]" \
"--deselect=tests/miner/test_capacity_runtime_v2.py::test_actual_small_kernel_attempt_and_cleanup[oom]" \
"--deselect=tests/miner/test_capacity_runtime_v2.py::test_actual_small_kernel_attempt_and_cleanup[cancel]" \
"--deselect=tests/miner/test_capacity_runtime_v2.py::test_actual_small_kernel_attempt_and_cleanup[deadline]" \
--deselect=tests/miner/test_capacity_runtime_v2.py::test_real_runner_parent_death_retains_absolute_manager_timer \
--deselect=tests/miner/test_island_launch_v2.py::test_capacity_branch_uses_real_bounded_failure_before_publication \
--deselect=tests/challenge/test_capacity_outer_v2.py::test_actual_bounded_genesis_preparation_and_duplicate_debit \
--deselect=tests/relay/test_transport_v2.py::test_launch_safety_independent_systemd_units \
"${SEL[@]}"
# The slow subprocess suites, in parallel with test.
test-slow:
runs-on: ubuntu-24.04
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
suite: [sim, e2e]
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@c18668ad3cf93ea998bef934396af7bb5c839dc7 # v10.2.0
with:
version: "0.12.17"
python-version: "3.12"
enable-cache: true
cache-dependency-glob: "uv.lock"
- run: uv sync --locked --all-extras --group dev
- run: uv run --frozen pytest -q --durations=25 -m "not od" tests/${{ matrix.suite }}