forked from openvinotoolkit/openvino
-
Notifications
You must be signed in to change notification settings - Fork 0
137 lines (120 loc) · 4.78 KB
/
job_tokenizers.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
name: OpenVINO tokenizers extension
on:
workflow_call:
inputs:
runner:
description: 'Machine on which the tests would run'
type: string
required: true
shell:
description: "shell to override the default shell settings in the runner's operating system."
type: string
required: true
container:
description: 'JSON to be converted to the value of the "container" configuration for the job'
type: string
required: false
default: '{"image": null}'
affected-components:
description: 'Components that are affected by changes in the commit defined by the Smart CI Action'
type: string
required: true
python-version:
description: 'Python version to setup. E.g., "3.11"'
type: string
required: true
permissions: read-all
env:
PIP_CACHE_PATH_LINUX: /mount/caches/pip/linux
PIP_CACHE_PATH_WIN: "C:\\mount\\caches\\pip\\win"
TARGET_BRANCH: ${{ github.base_ref || github.event.merge_group.base_ref || github.ref }}
jobs:
Openvino_tokenizers:
name: OpenVINO tokenizers extension
timeout-minutes: 25
defaults:
run:
shell: ${{ inputs.shell }}
runs-on: ${{ inputs.runner }}
container: ${{ fromJSON(inputs.container) }}
env:
INSTALL_DIR: ${{ github.workspace }}/install
INSTALL_WHEELS_DIR: ${{ github.workspace }}/install/wheels
OPENVINO_TOKENIZERS_REPO: ${{ github.workspace }}/openvino_tokenizers
EXTENSION_BUILD_DIR: ${{ github.workspace }}/build
steps:
# Needed as ${{ github.workspace }} is not working correctly when using Docker
- name: Setup Variables
run: |
echo "INSTALL_DIR=$GITHUB_WORKSPACE/install" >> "$GITHUB_ENV"
echo "OPENVINO_TOKENIZERS_REPO=$GITHUB_WORKSPACE/openvino_tokenizers" >> "$GITHUB_ENV"
echo "EXTENSION_BUILD_DIR=$GITHUB_WORKSPACE/build" >> "$GITHUB_ENV"
echo "INSTALL_WHEELS_DIR=$GITHUB_WORKSPACE/install/wheels" >> "$GITHUB_ENV"
- name: checkout actions
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
timeout-minutes: 15
with:
sparse-checkout: |
.github/actions/setup_python
.github/actions/cache
.github/actions/install_ov_wheels/action.yml
install_build_dependencies.sh
- name: Install OpenVINO dependencies (mac)
if: runner.os == 'macOS'
run: brew install pigz
- name: Setup Python ${{ inputs.python-version }}
uses: ./.github/actions/setup_python
with:
version: ${{ inputs.python-version }}
pip-cache-path: ${{ runner.os == 'Linux' && env.PIP_CACHE_PATH_LINUX || env.PIP_CACHE_PATH_WIN }}
should-setup-pip-paths: ${{ runner.os != 'macOS' }}
self-hosted-runner: ${{ runner.os != 'macOS' }}
- name: Clone OpenVINO Tokenizers
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
timeout-minutes: 15
with:
repository: 'openvinotoolkit/openvino_tokenizers'
path: ${{ env.OPENVINO_TOKENIZERS_REPO }}
ref: ${{ env.TARGET_BRANCH }}
- name: Download OpenVINO artifacts (wheels)
uses: actions/download-artifact@fa0a91b85d4f404e444e00e005971372dc801d16 # v4.1.8
with:
pattern: openvino_[wheels]*
path: ${{ env.INSTALL_WHEELS_DIR }}
merge-multiple: true
#
# Dependencies
#
- name: Install OpenVINO Python wheels
uses: ./.github/actions/install_ov_wheels
with:
wheels-dir-path: ${{ env.INSTALL_WHEELS_DIR }}
wheels-to-install: 'openvino'
#
# Build
#
- name: Build tokenizers wheel (Linux and macOS)
if: runner.os != 'Windows'
working-directory: ${{ env.OPENVINO_TOKENIZERS_REPO }}
run: |
# use OpenVINO wheel package only to build the extension
python -m pip wheel -v --no-deps --wheel-dir ${EXTENSION_BUILD_DIR} --find-links ${INSTALL_WHEELS_DIR} .
env:
CMAKE_BUILD_PARALLEL_LEVEL: '4'
- name: Build tokenizers wheel (Windows)
if: runner.os == 'Windows'
working-directory: ${{ env.OPENVINO_TOKENIZERS_REPO }}
run: |
python3 -m pip wheel -v --no-deps --wheel-dir ${env:EXTENSION_BUILD_DIR} --find-links ${env:INSTALL_WHEELS_DIR} .
env:
CMAKE_BUILD_PARALLEL_LEVEL: '4'
#
# Upload build artifacts
#
- name: Upload openvino tokenizers wheel
if: ${{ always() }}
uses: actions/upload-artifact@b4b15b8c7c6ac21ea08fcf65892d2ee8f75cf882 # v4.4.3
with:
name: openvino_tokenizers_wheel
path: ${{ env.EXTENSION_BUILD_DIR }}/*.whl
if-no-files-found: 'error'