forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
247 lines (213 loc) · 9.54 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
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
permissions: read-all
env:
PIP_CACHE_PATH: /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_GENERATOR: 'Ninja Multi-Config'
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"
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@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
with:
path: 'openvino'
submodules: 'true'
- name: Clone OpenVINO Contrib
uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0
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 -G "${{ env.CMAKE_GENERATOR }}" `
-DENABLE_CPPLINT=OFF `
-DBUILD_SHARED_LIBS=ON `
-DENABLE_TESTS=ON `
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON `
-DENABLE_STRICT_DEPENDENCIES=OFF `
-DENABLE_PYTHON=ON `
-DCMAKE_DISABLE_FIND_PACKAGE_PkgConfig=ON `
-DCMAKE_BUILD_TYPE=${{ env.CMAKE_BUILD_TYPE }} `
-DCUSTOM_OPERATIONS="calculate_grid;complex_mul;fft;grid_sample;sparse_conv;sparse_conv_transpose" `
-DOPENVINO_EXTRA_MODULES="${{ env.OPENVINO_CONTRIB_REPO }}/modules/custom_operations;${{ env.OPENVINO_CONTRIB_REPO }}/modules/java_api" `
-S ${{ env.OPENVINO_REPO }} `
-B ${{ env.BUILD_DIR }}
- name: Clean ccache stats
run: '& ccache --zero-stats'
- name: Cmake build - OpenVINO
run: cmake --build ${{ env.BUILD_DIR }} --parallel --verbose
- name: Show ccache stats
run: '& ccache --show-stats'
- name: Cmake install - OpenVINO
run: |
cmake -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -P ${{ env.BUILD_DIR }}/cmake_install.cmake
cmake -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_TEST_DIR }} -DCOMPONENT=tests -P ${{ env.BUILD_DIR }}/cmake_install.cmake
cmake -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR }} -DCOMPONENT=python_wheels -P ${{ env.BUILD_DIR }}/cmake_install.cmake
- 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 -DCPACK_GENERATOR=NPM -DENABLE_SYSTEM_TBB=OFF -UTBB* -S ${{ env.OPENVINO_REPO }} -B ${{ env.BUILD_DIR }}
cmake --build ${{ env.BUILD_DIR }} --parallel
cmake -DCMAKE_INSTALL_PREFIX=${{ env.INSTALL_DIR_JS }} -P ${{ env.BUILD_DIR }}/cmake_install.cmake
#
# Upload build artifacts and logs
#
- name: Upload openvino package
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
with:
name: openvino_package
path: ${{ env.BUILD_DIR }}/openvino_package.zip
if-no-files-found: 'error'
- name: Upload openvino tests package
uses: actions/upload-artifact@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
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@50769540e7f4bd5e21e526ee35c689e35e0d6874 # v4.4.0
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 }}
storage_dir: ${{ env.PRODUCT_TYPE }}
storage_root: ${{ env.ARTIFACTS_SHARE }}