-
Notifications
You must be signed in to change notification settings - Fork 33
179 lines (149 loc) · 5.84 KB
/
Copy pathInferenceSystem.yaml
File metadata and controls
179 lines (149 loc) · 5.84 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
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
---
name: InferenceSystem
on:
pull_request:
branches:
- main
push:
branches:
- main
workflow_dispatch:
concurrency:
group: build-${{ github.event.pull_request.number || github.sha }}
cancel-in-progress: true
permissions:
contents: read
jobs:
changes:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: read
outputs:
src: ${{ steps.filter.outputs.src }}
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Check for file changes
uses: dorny/paths-filter@7b450fff21473bca461d4b92ce414b9d0420d706 # v4.0.2
id: filter
with:
filters: |
src:
- InferenceSystem/**
- .github/workflows/InferenceSystem.yaml
inference-test-windows:
runs-on: windows-latest
needs: changes
if: ${{ needs.changes.outputs.src == 'true' }}
env:
HF_HUB_OFFLINE: "1"
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install FFmpeg
run: choco install ffmpeg -y
- name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Cache uv
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~\AppData\Local\uv\cache
key: ${{ runner.os }}-uv-${{ hashFiles('InferenceSystem/pyproject.toml', 'InferenceSystem/uv.lock') }}
restore-keys: |
${{ runner.os }}-uv-
- name: Install dependencies
working-directory: InferenceSystem
run: uv sync --group dev
- name: Download HuggingFace model to local cache
working-directory: InferenceSystem
env:
HF_HUB_OFFLINE: "0"
run: uv run python -c "from huggingface_hub import snapshot_download; snapshot_download('orcasound/orcahello-srkw-detector-v1')"
- name: Inference Orchestrator Positive detection tests
working-directory: InferenceSystem
run: uv run pytest tests/test_orchestrator.py -v -k "positive"
- name: Inference Orchestrator Negative detection test
working-directory: InferenceSystem
run: uv run pytest tests/test_orchestrator.py -v -k "negative"
- name: Inference Orchestrator Fail/edge-case tests
working-directory: InferenceSystem
run: uv run pytest tests/test_orchestrator.py -v -k "fail"
- name: Inference Orchestrator LiveHLS Smoke test
working-directory: InferenceSystem
run: uv run pytest tests/test_orchestrator.py -v -k "livehls"
inference-test-ubuntu:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.src == 'true' }}
env:
HF_HUB_OFFLINE: "1"
steps:
- name: Check out
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install FFmpeg
run: |
sudo apt-get update
sudo apt-get install -y ffmpeg
- name: Install uv
uses: astral-sh/setup-uv@c771a70e6277c0a99b617c7a806ffedaca235ff9 # v9.0.0
- name: Cache uv
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/uv
key: ${{ runner.os }}-uv-${{ hashFiles('InferenceSystem/pyproject.toml', 'InferenceSystem/uv.lock') }}
restore-keys: |
${{ runner.os }}-uv-
- name: Install dependencies
working-directory: InferenceSystem
run: uv sync --group dev
- name: Download HuggingFace model to local cache
working-directory: InferenceSystem
env:
HF_HUB_OFFLINE: "0"
run: uv run python -c "from huggingface_hub import snapshot_download; snapshot_download('orcasound/orcahello-srkw-detector-v1')"
- name: Inference Orchestrator Positive detection tests
working-directory: InferenceSystem
run: uv run pytest tests/test_orchestrator.py -v -k "positive"
- name: Inference Orchestrator Negative detection test
working-directory: InferenceSystem
run: uv run pytest tests/test_orchestrator.py -v -k "negative"
- name: Inference Orchestrator Fail/edge-case tests
working-directory: InferenceSystem
run: uv run pytest tests/test_orchestrator.py -v -k "fail"
- name: Inference Orchestrator LiveHLS Smoke test
working-directory: InferenceSystem
run: uv run pytest tests/test_orchestrator.py -v -k "livehls"
test-docker:
runs-on: ubuntu-latest
needs: changes
if: ${{ needs.changes.outputs.src == 'true' }}
permissions:
contents: read
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Free up disk space
run: |
echo "Disk space before cleanup:"
df -h
sudo apt-get clean
sudo apt-get autoremove -y
sudo rm -rf /usr/share/dotnet /opt/ghc /usr/local/share/boost "$AGENT_TOOLSDIRECTORY"
sudo rm -rf /usr/local/lib/android /opt/hostedtoolcache/CodeQL /usr/local/.ghcup /usr/share/swift
docker system prune -af
echo "Disk space after cleanup:"
df -h
- name: Build Dockerfile image
working-directory: InferenceSystem
run: |
docker build -f Dockerfile -t inference:ci .
- name: Smoke test container (LiveHLS)
working-directory: InferenceSystem
run: |
docker run --rm \
-v $PWD/tests/orch_configs/LiveHLS/LiveHLS_OrcasoundLab.yml:/config/config.yml \
inference:ci \
--max_live_iterations 2 2>&1 | tee output.log
grep -q "\[iter 1\]" output.log
grep -q "No HLS folders" output.log || grep -q "Failed to load M3U8" output.log || grep -q "global_prediction" output.log