Skip to content

Commit 0fe3d0a

Browse files
akashchimryzhovCopilot
authored
[CI] [GHA] Add manylinux build (#538)
* add manylinux build * fix var name * add wheel build * build wheel via one python * Update .github/workflows/manylinux_2_28.yml Co-authored-by: Copilot <[email protected]> * Update .github/workflows/manylinux_2_28.yml --------- Co-authored-by: Mikhail Ryzhov <[email protected]> Co-authored-by: Copilot <[email protected]>
1 parent 8d3c79d commit 0fe3d0a

File tree

1 file changed

+296
-0
lines changed

1 file changed

+296
-0
lines changed
Lines changed: 296 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,296 @@
1+
name: Manylinux 2_28
2+
on:
3+
workflow_dispatch:
4+
pull_request:
5+
merge_group:
6+
push:
7+
branches:
8+
- master
9+
- 'releases/**'
10+
11+
permissions: read-all # Required by https://github.com/ossf/scorecard/blob/e23b8ad91fd6a64a0a971ca4fc0a4d1650725615/docs/checks.md#token-permissions
12+
13+
concurrency:
14+
# github.ref is not unique in post-commit
15+
group: ${{ github.event_name == 'push' && github.run_id || github.ref }}-manylinux-2-28
16+
cancel-in-progress: true
17+
18+
env:
19+
PYTHON_VERSION: '3.11'
20+
OV_BRANCH: ${{ github.base_ref || github.event.merge_group.base_ref || github.ref }}
21+
CMAKE_CXX_COMPILER_LAUNCHER: sccache
22+
CMAKE_C_COMPILER_LAUNCHER: sccache
23+
SCCACHE_IGNORE_SERVER_IO_ERROR: 1
24+
SCCACHE_SERVER_PORT: 35555
25+
SCCACHE_CACHE_SIZE: 30G
26+
SCCACHE_AZURE_KEY_PREFIX: tokenizers/manylinux_2_28
27+
ARTIFACTS_SHARE: '/mount/build-artifacts'
28+
BASE_PRODUCT_TYPE: public_manylinux_2_28_x86_64
29+
30+
jobs:
31+
openvino_download:
32+
name: Download prebuilt OpenVINO
33+
outputs:
34+
status: ${{ steps.openvino_download.outcome }}
35+
ov_wheel_source: ${{ steps.openvino_download.outputs.ov_wheel_source }}
36+
ov_version: ${{ steps.openvino_download.outputs.ov_version }}
37+
docker_tag: ${{ steps.get_docker_tag.outputs.docker_tag }}
38+
timeout-minutes: 10
39+
defaults:
40+
run:
41+
shell: bash
42+
runs-on: aks-linux-medium
43+
container:
44+
image: 'openvinogithubactions.azurecr.io/openvino_provider:0.1.0'
45+
volumes:
46+
- /mount:/mount
47+
- ${{ github.workspace }}:${{ github.workspace }}
48+
49+
steps:
50+
- uses: openvinotoolkit/openvino/.github/actions/openvino_provider@master
51+
id: openvino_download
52+
with:
53+
platform: 'almalinux8'
54+
commit_packages_to_provide: 'wheels,developer_package.tar.gz'
55+
revision: latest_available_commit
56+
57+
- name: Clone docker tag from OpenVINO repo
58+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
59+
with:
60+
repository: 'openvinotoolkit/openvino'
61+
path: 'openvino'
62+
ref: ${{ env.OV_BRANCH }}
63+
sparse-checkout: |
64+
.github/dockerfiles/docker_tag
65+
66+
- name: Save docker tag to output
67+
id: get_docker_tag
68+
run: |
69+
docker_tag=$(cat openvino/.github/dockerfiles/docker_tag)
70+
echo "docker_tag=$docker_tag" >> $GITHUB_OUTPUT
71+
72+
openvino_tokenizers_cpack:
73+
name: OpenVINO tokenizers cpack, BUILD_TYPE=${{ matrix.build_type }}
74+
strategy:
75+
matrix:
76+
build_type: [Release]
77+
needs: [ openvino_download ]
78+
if: |
79+
always() &&
80+
(needs.openvino_download.outputs.status == 'success')
81+
timeout-minutes: 45
82+
defaults:
83+
run:
84+
shell: bash
85+
runs-on: aks-linux-8-cores-16gb
86+
container:
87+
image: openvinogithubactions.azurecr.io/ov_build/manylinux_2_28:${{ needs.openvino_download.outputs.docker_tag }}
88+
volumes:
89+
- /mount:/mount
90+
- ${{ github.workspace }}:${{ github.workspace }}
91+
options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING
92+
env:
93+
CMAKE_GENERATOR: 'Ninja'
94+
OPENVINO_REPO: ${{ github.workspace }}/openvino
95+
INSTALL_DIR: ${{ github.workspace }}/openvino/install
96+
OV_TOKENIZERS_INSTALL_DIR: ${{ github.workspace }}/openvino_tokenizers/install
97+
OPENVINO_TOKENIZERS_REPO: ${{ github.workspace }}/openvino_tokenizers
98+
BUILD_DIR: ${{ github.workspace }}/openvino_tokenizers/build
99+
MANIFEST_PATH: ${{ github.workspace }}/manifest.yml
100+
steps:
101+
- name: Clone Openvino tokenizers
102+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
103+
with:
104+
path: ${{ env.OPENVINO_TOKENIZERS_REPO }}
105+
106+
- name: Generate product manifest
107+
id: create_manifest
108+
uses: openvinotoolkit/openvino/.github/actions/create_manifest@master
109+
with:
110+
repos: ${{ env.OPENVINO_TOKENIZERS_REPO }}
111+
product_type: ${{ env.BASE_PRODUCT_TYPE }}_${{ matrix.build_type }}
112+
target_arch: 'x86_64'
113+
build_type: ${{ matrix.build_type }}
114+
save_to: ${{ env.MANIFEST_PATH }}
115+
116+
- name: Download OpenVINO package
117+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
118+
with:
119+
name: ${{ needs.openvino_download.outputs.ov_artifact_name }}
120+
path: ${{ env.INSTALL_DIR }}
121+
merge-multiple: true
122+
123+
- name: CMake configure - tokenizers
124+
run: |
125+
source ${INSTALL_DIR}/setupvars.sh
126+
/usr/bin/cmake -DOpenVINODeveloperPackage_DIR=${{ env.INSTALL_DIR }}/developer_package/cmake \
127+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
128+
-S ${{ env.OPENVINO_TOKENIZERS_REPO }} \
129+
-B ${{ env.BUILD_DIR }}
130+
131+
- name: Cmake build - tokenizers
132+
run: /usr/bin/cmake --build ${{ env.BUILD_DIR }} --parallel --config ${{ matrix.build_type }} --verbose
133+
134+
- name: Cmake install - tokenizers
135+
run: /usr/bin/cmake --install ${{ env.BUILD_DIR }} --config=${{ matrix.build_type }} --prefix=${{ env.OV_TOKENIZERS_INSTALL_DIR }}/ov_tokenizers
136+
137+
- name: Pack Artifacts
138+
run: |
139+
pushd ${OV_TOKENIZERS_INSTALL_DIR}
140+
tar -czvf ${BUILD_DIR}/ov_tokenizers.tar.gz *
141+
popd
142+
143+
#
144+
# Upload build artifacts
145+
#
146+
147+
- name: Upload openvino tokenizers package
148+
if: ${{ always() }}
149+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
150+
with:
151+
name: openvino_tokenizers_cpack_${{ matrix.build_type }}
152+
path: ${{ env.BUILD_DIR }}/*.tar.gz
153+
if-no-files-found: 'error'
154+
155+
- name: Upload manifest
156+
if: ${{ always() }}
157+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
158+
with:
159+
name: manifest_${{ matrix.build_type }}
160+
path: ${{ env.MANIFEST_PATH }}
161+
if-no-files-found: 'error'
162+
163+
openvino_tokenizers_wheel:
164+
name: OpenVINO tokenizers extension wheel
165+
needs: [ openvino_download ]
166+
if: |
167+
always() &&
168+
(needs.openvino_download.outputs.status == 'success')
169+
timeout-minutes: 25
170+
defaults:
171+
run:
172+
shell: bash
173+
runs-on: aks-linux-4-cores-16gb
174+
container:
175+
image: openvinogithubactions.azurecr.io/ov_build/manylinux_2_28:${{ needs.openvino_download.outputs.docker_tag }}
176+
volumes:
177+
- /mount:/mount
178+
- ${{ github.workspace }}:${{ github.workspace }}
179+
options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING
180+
env:
181+
OPENVINO_REPO: ${{ github.workspace }}/openvino
182+
INSTALL_DIR: ${{ github.workspace }}/openvino/install
183+
OPENVINO_TOKENIZERS_REPO: ${{ github.workspace }}/openvino_tokenizers
184+
BUILD_DIR: ${{ github.workspace }}/openvino_tokenizers/build
185+
186+
steps:
187+
- name: Clone Openvino tokenizers
188+
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
189+
with:
190+
path: ${{ env.OPENVINO_TOKENIZERS_REPO }}
191+
192+
- name: Set CI environment
193+
id: create_manifest
194+
uses: openvinotoolkit/openvino/.github/actions/create_manifest@master
195+
with:
196+
repos: ${{ env.OPENVINO_TOKENIZERS_REPO }}
197+
product_type: ${{ env.BASE_PRODUCT_TYPE }}_Release
198+
target_arch: 'x86_64'
199+
build_type: Release
200+
save_to: ${{ github.workspace }}
201+
202+
- name: Download OpenVINO package
203+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
204+
with:
205+
name: ${{ needs.openvino_download.outputs.ov_artifact_name }}
206+
path: ${{ env.INSTALL_DIR }}
207+
merge-multiple: true
208+
209+
#
210+
# Build
211+
#
212+
213+
- name: Build tokenizers Wheel
214+
run: |
215+
python${{ env.PYTHON_VERSION }} -m pip wheel -v --no-deps --wheel-dir ${BUILD_DIR} \
216+
--config-settings='override=wheel.build_tag="${{ github.run_number }}"' \
217+
${{ needs.openvino_download.outputs.ov_wheel_source }} \
218+
${OPENVINO_TOKENIZERS_REPO}
219+
working-directory: ${{ env.INSTALL_DIR }}
220+
env:
221+
CMAKE_GENERATOR: 'Unix Makefiles'
222+
OpenVINODeveloperPackage_DIR: ${{ env.INSTALL_DIR }}/developer_package/cmake
223+
224+
#
225+
# Upload build artifacts
226+
#
227+
228+
- name: Upload openvino tokenizers wheel
229+
if: ${{ always() }}
230+
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2
231+
with:
232+
name: openvino_tokenizers_wheel
233+
path: ${{ env.BUILD_DIR }}/*.whl
234+
if-no-files-found: 'error'
235+
236+
store_artifacts:
237+
name: Store build artifacts
238+
strategy:
239+
matrix:
240+
build_type: [Release]
241+
needs: [openvino_download, openvino_tokenizers_wheel, openvino_tokenizers_cpack]
242+
timeout-minutes: 10
243+
defaults:
244+
run:
245+
shell: bash
246+
runs-on: aks-linux-medium
247+
container:
248+
image: openvinogithubactions.azurecr.io/library/python:3.12-slim
249+
volumes:
250+
- /mount:/mount
251+
- ${{ github.workspace }}:${{ github.workspace }}
252+
env:
253+
CPACK_PACKAGE: ${{ github.workspace }}/ov_tokenizers.tar.gz
254+
WHEEL_PACKAGE: ${{ github.workspace }}/wheels
255+
MANIFEST_PATH: ${{ github.workspace }}/manifest.yml
256+
257+
steps:
258+
- name: Download tokenizers package & manifest
259+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
260+
with:
261+
pattern: "{openvino_tokenizers_cpack_${{ matrix.build_type }},manifest_${{ matrix.build_type }}}"
262+
path: ${{ github.workspace }}
263+
merge-multiple: true
264+
265+
- name: Download tokenizers wheels
266+
uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0
267+
with:
268+
name: openvino_tokenizers_wheel
269+
path: ${{ env.WHEEL_PACKAGE }}
270+
271+
- name: Store ${{ matrix.build_type }} artifacts to a shared drive
272+
id: store_artifacts
273+
if: ${{ always() }}
274+
uses: openvinotoolkit/openvino/.github/actions/store_artifacts@master
275+
with:
276+
artifacts: |
277+
${{ env.CPACK_PACKAGE }}
278+
${{ env.WHEEL_PACKAGE }}
279+
${{ env.MANIFEST_PATH }}
280+
storage_dir: ${{ env.BASE_PRODUCT_TYPE }}_${{ matrix.build_type }}
281+
storage_root: ${{ env.ARTIFACTS_SHARE }}
282+
product_name: ${{ github.event.repository.name }}
283+
284+
Overall_Status:
285+
name: ci/gha_overall_status_manylinux_2_28
286+
needs: [openvino_download, openvino_tokenizers_cpack, store_artifacts, openvino_tokenizers_wheel]
287+
if: ${{ always() }}
288+
runs-on: ubuntu-latest
289+
steps:
290+
- name: Check status of all jobs
291+
if: >-
292+
${{
293+
contains(needs.*.result, 'failure') ||
294+
contains(needs.*.result, 'cancelled')
295+
}}
296+
run: exit 1

0 commit comments

Comments
 (0)