-
Notifications
You must be signed in to change notification settings - Fork 2.3k
306 lines (264 loc) · 12.1 KB
/
job_build_windows.yml
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
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
on:
workflow_call:
inputs:
runner:
description: 'Machine on which the tests would run'
type: string
required: true
affected-components:
description: 'Components that are affected by changes in the commit defined by the Smart CI Action'
type: string
required: true
build-type:
description: 'OpenVINO build type, e.g., "Release"'
type: string
required: true
target-branch:
description: 'Target branch for the build'
type: string
required: true
cmake-options:
description: 'A string of options passed to CMake'
type: string
required: true
build-additional-python-wheels:
description: 'Whether to build additional, i.e., non-system Python wheels. Should have Python 3.9-3.12 installed'
type: boolean
required: false
default: false
permissions: read-all
env:
PIP_CACHE_PATH: "C:\\mount\\caches\\pip\\win"
PYTHON_VERSION: '3.11'
jobs:
Build:
timeout-minutes: 180
defaults:
run:
shell: pwsh
runs-on: ${{ inputs.runner }}
env:
CMAKE_BUILD_TYPE: ${{ inputs.build-type }}
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CMAKE_C_COMPILER_LAUNCHER: ccache
CCACHE_REMOTE_DIR: C:\\mount\\caches\\ccache\\windows2022_x86_64_${{ inputs.build-type }}\\${{ inputs.target-branch }}
CCACHE_DIR: ${{ github.workspace }}\\ccache
CCACHE_MAXSIZE: 3G
OPENVINO_REPO: "${{ github.workspace }}\\openvino"
OPENVINO_CONTRIB_REPO: "${{ github.workspace }}\\openvino_contrib"
INSTALL_DIR: "${{ github.workspace }}\\openvino_install"
INSTALL_DIR_JS: "${{ github.workspace }}\\openvino_install\\js"
INSTALL_TEST_DIR: "${{ github.workspace }}\\tests_install"
INSTALL_WHEELS_DIR: "${{ github.workspace }}\\install\\wheels"
BUILD_DIR: "${{ github.workspace }}\\openvino_build"
ARTIFACTS_SHARE: "C:\\mount\\build-artifacts"
MANIFEST_PATH: "${{ github.workspace }}\\manifest.yml"
PRODUCT_TYPE: 'public_windows_vs2019_${{ inputs.build-type }}'
steps:
- name: Clone OpenVINO
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
path: 'openvino'
submodules: 'true'
- name: Clone OpenVINO Contrib
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
with:
repository: 'openvinotoolkit/openvino_contrib'
path: 'openvino_contrib'
ref: ${{ inputs.target-branch }}
- name: Setup Python ${{ env.PYTHON_VERSION }}
uses: ./openvino/.github/actions/setup_python
with:
version: ${{ env.PYTHON_VERSION }}
pip-cache-path: ${{ env.PIP_CACHE_PATH }}
should-setup-pip-paths: 'true'
self-hosted-runner: 'true'
show-cache-info: 'true'
- name: Generate product manifest and set CI_BUILD_NUMBER & CI_BUILD_DEV_TAG
id: create_manifest
uses: ./openvino/.github/actions/create_manifest
with:
repos: |
${{ env.OPENVINO_REPO }}
${{ env.OPENVINO_CONTRIB_REPO }}
product_type: ${{ env.PRODUCT_TYPE }}
target_arch: 'x86_64'
build_type: ${{ inputs.build-type }}
save_to: ${{ env.MANIFEST_PATH }}
#
# Print system info
#
- name: System info
uses: ./openvino/.github/actions/system_info
#
# Dependencies
#
- name: Install python dependencies
run: |
# For Python API: build and wheel packaging
python3 -m pip install -r ${{ env.OPENVINO_REPO }}/src/bindings/python/wheel/requirements-dev.txt
# For running ONNX frontend unit tests
python3 -m pip install --force-reinstall -r ${{ env.OPENVINO_REPO }}/src/frontends/onnx/tests/requirements.txt
# For running TensorFlow frontend unit tests
python3 -m pip install -r ${{ env.OPENVINO_REPO }}/src/frontends/tensorflow/tests/requirements.txt
# For running TensorFlow Lite frontend unit tests
python3 -m pip install -r ${{ env.OPENVINO_REPO }}/src/frontends/tensorflow_lite/tests/requirements.txt
# Disabled because of CVS-95904
# For running Paddle frontend unit tests
# python3 -m pip install -r ${{ env.OPENVINO_REPO }}/src/frontends/paddle/tests/requirements.txt
# For getting rid of SSL issues during model downloading for unit tests
python3 -m pip install certifi
- name: Download and install ccache
run: |
Invoke-WebRequest -Uri 'https://github.com/ccache/ccache/releases/download/v4.9.1/ccache-4.9.1-windows-x86_64.zip' -OutFile 'ccache.zip'
Expand-Archive -Path 'ccache.zip' -DestinationPath 'C:\temp\ccache'
Move-Item -Path 'C:\temp\ccache\*' -Destination 'C:\ccache'
Add-Content -Path $env:GITHUB_PATH -Value "C:\ccache"
- name: Install build dependencies
run: |
Invoke-WebRequest https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-win.zip -OutFile ninja-win.zip -MaximumRetryCount 10
Expand-Archive -Force ninja-win.zip
# Add it to the GitHub Path so it would be available in the subsequent steps
Add-Content -Path $env:GITHUB_PATH -Value "${{ github.workspace }}/ninja-win"
#
# Build
#
- name: Setup ccache
uses: ./openvino/.github/actions/cache
with:
save-always: ${{ github.event_name == 'push' && 'true' || 'false' }}
cleanup-always: ${{ github.event_name == 'push' && 'true' || 'false' }}
cache-path: ${{ env.CCACHE_REMOTE_DIR }}
path: ${{ env.CCACHE_DIR }}
key: ${{ runner.os }}-${{ runner.arch }}-ccache-${{ github.sha }}
restore-keys: |
${{ runner.os }}-${{ runner.arch }}-ccache
- name: Configure Developer Command Prompt for Microsoft Visual C++ (2019)
uses: ilammy/msvc-dev-cmd@0b201ec74fa43914dc39ae48a89fd1d8cb592756 # v1.13.0
with:
toolset: 14.29
- name: Set SSL_CERT_FILE for model downloading for unit tests
run: echo SSL_CERT_FILE=$(python3 -m certifi) >> $env:GITHUB_ENV
- name: CMake configure
run: cmake -S ${{ env.OPENVINO_REPO }} -B ${{ env.BUILD_DIR }} ${{ inputs.cmake-options }}
- name: Clean ccache stats
run: '& ccache --zero-stats'
- name: Cmake build - OpenVINO
run: cmake --build ${{ env.BUILD_DIR }} --config ${{ env.CMAKE_BUILD_TYPE }} --parallel $ENV:NUMBER_OF_PROCESSORS --verbose
- name: Show ccache stats
run: '& ccache --show-stats'
- name: Cmake install - OpenVINO
run: |
cmake --install . --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_DIR }}
cmake --install . --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_WHEELS_DIR }} --component python_wheels
cmake --install . --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_TEST_DIR }} --component tests
working-directory: ${{ env.BUILD_DIR }}
# Setup additional Python versions for wheels building
- name: Setup Python 3.9
if: ${{ inputs.build-additional-python-wheels }}
uses: ./openvino/.github/actions/setup_python
with:
version: '3.9'
pip-cache-path: ${{ env.PIP_CACHE_PATH }}
should-setup-pip-paths: 'true'
self-hosted-runner: 'true'
# Setup additional Python versions for wheels building
- name: Setup Python 3.10
if: ${{ inputs.build-additional-python-wheels }}
uses: ./openvino/.github/actions/setup_python
with:
version: '3.10'
pip-cache-path: ${{ env.PIP_CACHE_PATH }}
should-setup-pip-paths: 'true'
self-hosted-runner: 'true'
# Setup additional Python versions for wheels building
- name: Setup Python 3.12
if: ${{ inputs.build-additional-python-wheels }}
uses: ./openvino/.github/actions/setup_python
with:
version: '3.12'
pip-cache-path: ${{ env.PIP_CACHE_PATH }}
should-setup-pip-paths: 'true'
self-hosted-runner: 'true'
- name: Build additional Python wheels
if: ${{ inputs.build-additional-python-wheels }}
run: |
$pyVersions = '3.9', '3.10', '3.12'
foreach ($pyVersion in $pyVersions) {
$pyBuildDir = "${{ github.workspace }}/py$pyVersion"
New-Item -ItemType Directory -Path "$pyBuildDir" -Force
$pythonCommand = "py -$pyVersion -c `"import sys; print(f'{sys.executable}')`""
$pythonExecutablePath = & cmd /c $pythonCommand
& $pythonExecutablePath -m pip install -r ${{ env.OPENVINO_REPO }}/src/bindings/python/wheel/requirements-dev.txt
cmake -DPython3_EXECUTABLE="$pythonExecutablePath" -DOpenVINODeveloperPackage_DIR=${{ env.BUILD_DIR }} -S ${{ env.OPENVINO_REPO }}/src/bindings/python -B "$pyBuildDir"
cmake --build "$pyBuildDir" --parallel --config ${{ env.CMAKE_BUILD_TYPE }}
cmake --install "$pyBuildDir" --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_WHEELS_DIR }} --component python_wheels
}
- name: Pack Artifacts
run: |
$file = Get-ChildItem -Path "${{ env.INSTALL_DIR }}"
$compress = @{
Path = $file
CompressionLevel = "Optimal"
DestinationPath = "${{ env.BUILD_DIR }}/openvino_package.zip"
}
Compress-Archive @compress
$file=Get-ChildItem -Path "${{ env.INSTALL_TEST_DIR }}"
$compress = @{
Path = $file
CompressionLevel = "Optimal"
DestinationPath = "${{ env.BUILD_DIR }}/openvino_tests.zip"
}
Compress-Archive @compress
- name: CMake configure, build and install - OpenVINO JS API
if: ${{ fromJSON(inputs.affected-components).JS_API }}
run: |
cmake -UTBB* -S ${{ env.OPENVINO_REPO }} -B ${{ env.BUILD_DIR }} `
-DCPACK_GENERATOR=NPM `
-DENABLE_SYSTEM_TBB=OFF `
-DENABLE_WHEEL=OFF
cmake --build ${{ env.BUILD_DIR }} --parallel $ENV:NUMBER_OF_PROCESSORS
cmake --install ${{ env.BUILD_DIR }} --config ${{ env.CMAKE_BUILD_TYPE }} --prefix ${{ env.INSTALL_DIR_JS }}
#
# Upload build artifacts and logs
#
- name: Upload openvino package
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: openvino_package
path: ${{ env.BUILD_DIR }}/openvino_package.zip
if-no-files-found: 'error'
- name: Upload openvino wheels
if: ${{ inputs.build-type != 'Debug' }}
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: openvino_wheels
path: ${{ env.INSTALL_WHEELS_DIR }}/wheels/*.whl
if-no-files-found: 'error'
- name: Upload openvino tests package
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: openvino_tests
path: ${{ env.BUILD_DIR }}/openvino_tests.zip
if-no-files-found: 'error'
- name: Upload openvino js package
if: ${{ fromJSON(inputs.affected-components).JS_API }}
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: openvino_js_package
path: ${{ env.INSTALL_DIR_JS }}
if-no-files-found: 'error'
- name: Store artifacts to a shared drive
id: store_artifacts
if: ${{ always() }}
uses: ./openvino/.github/actions/store_artifacts
with:
artifacts: |
${{ env.BUILD_DIR }}/openvino_package.zip
${{ env.BUILD_DIR }}/openvino_tests.zip
${{ env.MANIFEST_PATH }}
${{ env.STORE_WHEELS == 'true' && format('{0}/wheels', env.INSTALL_WHEELS_DIR) || '' }}
storage_dir: ${{ env.PRODUCT_TYPE }}
storage_root: ${{ env.ARTIFACTS_SHARE }}
env:
STORE_WHEELS: ${{ inputs.build-type != 'Debug' }}