Repository navigation
112 lines (102 loc) · 3.41 KB
/
Copy pathinference.yml
File metadata and controls
112 lines (102 loc) · 3.41 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
name: Inference Tests
on:
pull_request_review:
types: [submitted]
workflow_dispatch:
permissions:
contents: read
actions: read
concurrency:
group: inference-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
gate:
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
approved: ${{ steps.check.outputs.approved }}
steps:
- id: check
run: |
if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then
echo "approved=true" >> $GITHUB_OUTPUT
elif [ "${{ github.event.review.state }}" = "approved" ]; then
echo "approved=true" >> $GITHUB_OUTPUT
else
echo "approved=false" >> $GITHUB_OUTPUT
fi
runner-check:
needs: gate
if: needs.gate.outputs.approved == 'true'
runs-on: ubuntu-latest
timeout-minutes: 5
outputs:
available: ${{ steps.check.outputs.available }}
steps:
- id: check
env:
GH_TOKEN: ${{ github.token }}
REPO: ${{ github.repository }}
run: |
set -euo pipefail
status=$(curl -sS -L -w "%{http_code}" -o runners.json \
-H "Authorization: Bearer ${GH_TOKEN}" \
-H "Accept: application/vnd.github+json" \
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/${REPO}/actions/runners?per_page=100" || true)
if [ "$status" != "200" ]; then
echo "available=false" >> "$GITHUB_OUTPUT"
echo "::notice::Could not inspect self-hosted runners (HTTP $status); skipping inference tests instead of queueing."
exit 0
fi
count=$(jq '[.runners[] | select(.status == "online" and .busy == false) | select(([.labels[].name] | contains(["self-hosted", "linux", "arm64"])))] | length' runners.json)
if [ "$count" -gt 0 ]; then
echo "available=true" >> "$GITHUB_OUTPUT"
else
echo "available=false" >> "$GITHUB_OUTPUT"
echo "::notice::No idle self-hosted linux arm64 runner is available; skipping inference tests."
fi
build:
needs: [gate, runner-check]
if: needs.gate.outputs.approved == 'true' && needs.runner-check.outputs.available == 'true'
runs-on: [self-hosted, linux, arm64]
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
with:
clean: false
- name: Setup Python environment
run: |
if [ ! -f venv/bin/activate ]; then
source ./setup
fi
- name: Build libcactus + engine tests
run: |
bash cactus-engine/build.sh
cd cactus-engine/tests
rm -rf build && mkdir -p build && cd build
cmake .. -DCMAKE_BUILD_TYPE=Release
make -j$(nproc)
model-tests:
needs: build
runs-on: [self-hosted, linux, arm64]
timeout-minutes: 60
env:
CACTUS_NO_CLOUD_TELE: "1"
strategy:
fail-fast: false
matrix:
model:
- LiquidAI/LFM2-VL-450M
- openai/whisper-small
steps:
- uses: actions/checkout@v4
with:
clean: false
- name: Run tests for ${{ matrix.model }}
env:
HF_TOKEN: ${{ secrets.HF_TOKEN }}
run: |
source venv/bin/activate
MODEL="${{ github.event.inputs.model || matrix.model }}"
python3 -m cactus test --component engine --model "$MODEL"