@@ -2,7 +2,8 @@ name: 'OpenVINO provider'
2
2
description : ' Provides OpenVINO build artifacts from a requested source'
3
3
inputs :
4
4
revision :
5
- description : ' Version of OpenVINO to provide - latest_available | HEAD | specific commit hash'
5
+ description : ' Version of OpenVINO to provide - latest_available_commit | HEAD | specific commit hash |
6
+ latest_nightly | specific package version (e.g. 2024.4.0rc2)'
6
7
required : true
7
8
branch_name :
8
9
description : ' Branch of OpenVINO to take the revision from if no specific hash was provided.
@@ -11,21 +12,25 @@ inputs:
11
12
ov_artifact_name :
12
13
description : " Name under which to upload provided OpenVINO build artifacts, set automatically by default"
13
14
required : false
15
+ platform :
16
+ description : " Platform for which to get artifacts: centos7 | debian10 | rhel8 | ubuntu20 |
17
+ ubuntu20 | ubuntu22 | ubuntu24 | macos | macos_12_6 | windows"
18
+ required : false
19
+ arch :
20
+ description : " Architecture for which to get artifacts: x86_64 | armhf | arm64"
21
+ default : " x86_64"
22
+ required : false
23
+ install_dir :
24
+ description : ' Local path to install OpenVINO package to. If not specified, package is installed to GitHub workspace
25
+ and uploaded to GitHub'
26
+ required : false
14
27
commit_packages_to_provide :
15
28
description : " Comma-separated list of OpenVINO packages from post-commit to provide ('all' to get everything)"
16
29
required : false
17
- commit_build_key :
18
- description : ' public_linux_ubuntu_20_04_release | public_linux_ubuntu_22_04_release |
19
- public_linux_ubuntu_24_04_release | public_windows_vs2019_release'
20
- required : false
21
30
commit_share_path :
22
31
description : ' Path to share holding OpenVINO post-commit artifacts'
23
32
required : false
24
33
default : ' /mount/build-artifacts'
25
- nightly_build_key :
26
- description : ' centos7_x86_64 | debian9_armhf | rhel8_x86_64 | ubuntu20_arm64 | ubuntu20_x86_64 | ubuntu22_x86_64 |
27
- ubuntu24_x86_64 | macos_12_6_arm64 | macos_12_6_x86_64 | windows_x86_64'
28
- required : false
29
34
nightly_package_source :
30
35
description : ' Source URL hosting OpenVINO nightly archives'
31
36
required : false
@@ -34,40 +39,44 @@ inputs:
34
39
description : ' Source URL hosting OpenVINO wheels, for passing to pip as --extra-index-url'
35
40
required : false
36
41
default : ' https://storage.openvinotoolkit.org/simple/wheels'
37
- package_url :
38
- description : ' Direct URL to OpenVINO archive to use, if neither post-commit nor nightly archives are required'
39
- required : false
42
+
40
43
outputs :
41
44
ov_artifact_name :
42
45
description : " Name of the artifact to upload OpenVINO build artifacts under"
43
- value : ${{ steps.openvino_download.outputs.ov_artifact_name || steps.openvino_commit_output.outputs.ov_artifact_name }}
44
- ov_package_path :
45
- description : " Path to OpenVINO core package relative to the root of uploaded artifacts"
46
- value : ${{ steps.openvino_download.outputs.ov_package_path || steps.openvino_commit_output.outputs.ov_package_path }}
47
- ov_wheel_input :
48
- description : " Input for pip to install OpenVINO python wheel"
49
- value : ${{ steps.openvino_wheel.outputs.ov_wheel_input || steps.openvino_commit_wheel.outputs.ov_wheel_input }}
46
+ value : ${{ steps.openvino_s3_download.outputs.ov_artifact_name || steps.openvino_commit_output.outputs.ov_artifact_name }}
50
47
ov_wheel_source :
51
48
description : " Pip option for custom OV wheel location (--find-links or --extra-index-url)"
52
- value : ${{ steps.openvino_wheel.outputs.ov_wheel_source || steps.openvino_commit_wheel.outputs.ov_wheel_source }}
49
+ value : ${{ steps.openvino_s3_wheel.outputs.ov_wheel_source || steps.openvino_commit_wheel.outputs.ov_wheel_source }}
50
+ ov_version :
51
+ description : " OpenVINO product version"
52
+ value : ${{ steps.openvino_s3_wheel.outputs.ov_version || steps.openvino_commit_wheel.outputs.ov_version }}
53
53
54
54
runs :
55
55
using : " composite"
56
56
steps :
57
- - name : Verify parameters
58
- if : ${{ !inputs.package_url && !inputs.nightly_build_key && !inputs.commit_build_key }}
57
+ - name : Identify artifacts source
58
+ id : get_source
59
59
shell : bash
60
60
run : |
61
- echo "Please, set one parameter for action - nightly_build_key, commit_build_key or package_url"
62
- exit 1
61
+ artifacts_source="postcommit"
62
+ if [[ "${{ inputs.revision }}" == "latest_nightly" || "${{ inputs.revision }}" =~ ^[0-9]{4}\.[0-9]+\.*[0-9]* ]]; then
63
+ artifacts_source="s3"
64
+ fi
65
+ echo "artifacts_source=$artifacts_source" >> $GITHUB_OUTPUT
66
+
67
+ - name : Get action revision
68
+ id : get_action_revision
69
+ run : echo "action_ref=${{ env.ACTION_REF }}" >> $GITHUB_OUTPUT
70
+ shell : bash
71
+ env :
72
+ ACTION_REF : ${{ github.action_ref || github.base_ref || github.event.merge_group.base_ref || github.ref }}
63
73
64
74
- uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
65
75
with :
66
76
repository : ' openvinotoolkit/openvino'
67
- ref : ${{ inputs.branch_name || github.base_ref || github.event.merge_group.base_ref || github.ref }}
77
+ ref : ${{ steps.get_action_revision.outputs.action_ref }}
68
78
sparse-checkout : .github/actions
69
79
70
- # --- Post-commit case ---
71
80
- name : Clone OpenVINO to get HEAD commit
72
81
if : inputs.revision == 'HEAD'
73
82
uses : actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
@@ -84,18 +93,25 @@ runs:
84
93
head=$(git -C openvino rev-parse HEAD)
85
94
echo "head=$head" >> $GITHUB_OUTPUT
86
95
96
+ - name : Create install dir
97
+ if : inputs.install_dir
98
+ shell : bash
99
+ run : |
100
+ mkdir -p ${{ inputs.install_dir }}
101
+
102
+ # --- Post-commit case ---
87
103
- name : Download post-commit OpenVINO archives
88
104
id : openvino_commit_download
89
- if : inputs.commit_build_key
105
+ if : steps.get_source.outputs.artifacts_source == 'postcommit'
90
106
uses : ./.github/actions/restore_artifacts
91
107
with :
92
- storage_dir : ${{ inputs.commit_build_key }}
108
+ platform : ${{ inputs.platform }}_${{ inputs.arch }}
93
109
storage_root : ${{ inputs.commit_share_path }}
94
110
event_name : " commit"
95
111
trigger_repo_sha : ${{ env.OV_REVISION }}
96
112
branch_name : ${{ inputs.branch_name }}
97
- artifacts_key : ${{ inputs.ov_artifact_name || inputs.commit_build_key }}
98
113
to_restore : ${{ inputs.commit_packages_to_provide }}
114
+ target_dir : ${{ inputs.install_dir }}
99
115
env :
100
116
OV_REVISION : ${{ inputs.revision == 'HEAD' && steps.get_openvino_head_commit.outputs.head || inputs.revision }}
101
117
@@ -104,79 +120,98 @@ runs:
104
120
if : steps.openvino_commit_download.outcome == 'success'
105
121
shell : bash
106
122
run : |
107
- ov_artifact_name=${{ inputs.ov_artifact_name || steps.openvino_commit_download.outputs.restored_artifacts_key }}
108
- cd ${{ steps.openvino_commit_download.outputs.artifacts_workspace_path }}
123
+ ov_artifact_name=${{ inputs.ov_artifact_name || inputs.platform }}
124
+ workspace_path=${{ steps.openvino_commit_download.outputs.artifacts_path }}
125
+ cd $workspace_path
109
126
ov_package_path=$(find . -name 'openvino_package*' -printf "%P\n" -quit)
110
127
[ -z "$ov_package_path" ] && echo "No openvino_package found in restored artifacts" && exit 1
128
+ mv $ov_package_path/* . && rm -rf $ov_package_path
111
129
echo "ov_artifact_name=$ov_artifact_name" >> $GITHUB_OUTPUT
112
- echo "ov_package_path=$ov_package_path " >> $GITHUB_OUTPUT
130
+ echo "ov_package_path=$workspace_path " >> $GITHUB_OUTPUT
113
131
114
132
- name : Get commit wheel
115
133
id : openvino_commit_wheel
116
134
if : steps.openvino_commit_download.outcome == 'success'
117
135
shell : bash
118
136
run : |
119
- cd ${{ steps.openvino_commit_download.outputs.artifacts_workspace_path }}
137
+ artifacts_path=${{ steps.openvino_commit_download.outputs.artifacts_path }}
138
+ cd $artifacts_path
120
139
version=$(yq eval '.components.dldt.custom_params.wheel_product_version' manifest.yml)
121
- wheel_path=${{ steps.openvino_commit_output.outputs.ov_package_path }}/tools
122
- default_find_links_cmd="--find-links=./ $wheel_path"
140
+ wheel_path=${{ inputs.install_dir && '$artifacts_path/tools' || './tools' }}
141
+ default_find_links_cmd="--find-links=$wheel_path"
123
142
find_links_cmd=$([[ -n "$PIP_FIND_LINKS" ]] && echo "" || echo "$default_find_links_cmd")
124
- wheel_input="$find_links_cmd openvino==$version"
125
- echo "ov_wheel_input=$wheel_input" >> $GITHUB_OUTPUT
143
+ echo "ov_version=$version" >> $GITHUB_OUTPUT
126
144
echo "ov_wheel_source=$default_find_links_cmd" >> $GITHUB_OUTPUT
127
145
146
+ - name : Upload commit OpenVINO archives
147
+ if : steps.openvino_commit_download.outcome == 'success' && !inputs.install_dir
148
+ uses : actions/upload-artifact@v4
149
+ with :
150
+ name : ${{ steps.openvino_commit_output.outputs.ov_artifact_name }}
151
+ path : ${{ steps.openvino_commit_output.outputs.ov_package_path }}
152
+ if-no-files-found : ' error'
128
153
129
- # --- S3 case (nightly or direct URL) ---
130
- - name : Verify parameters
131
- if : (inputs.nightly_build_key || inputs.package_url) && inputs.revision != 'latest_available'
154
+ # --- S3 case ---
155
+ - name : Get a specific S3 package URL
156
+ id : get_s3_package
157
+ if : steps.get_source.outputs.artifacts_source == 's3' && inputs.revision != 'latest_nightly'
132
158
shell : bash
133
- run : |
134
- echo "Nightly and package_url build sources provide only 'latest' artifacts, specific revision not supported"
135
- exit 1
159
+ run : >-
160
+ python3 -m venv venv && . venv/bin/activate &&
161
+ pip install -r $GITHUB_ACTION_PATH/requirements.txt &&
162
+ python $GITHUB_ACTION_PATH/get_s3_package.py --product openvino --platform ${{ inputs.platform }} --arch ${{ inputs.arch }}
163
+ --version ${{ inputs.revision }}
136
164
137
- - name : Download OpenVINO archives
138
- id : openvino_download
139
- if : inputs.nightly_build_key || inputs.package_url
165
+ - name : Download nightly OpenVINO archives
166
+ id : openvino_s3_download
167
+ if : steps.get_source.outputs.artifacts_source == 's3'
140
168
shell : bash
141
169
run : |
142
- if [ ${{ inputs.package_url }} ]; then
143
- ov_package_url=${{ inputs .package_url }}
170
+ if [ ${{ steps.get_s3_package.outcome }} != 'skipped' ]; then
171
+ ov_package_url=${{ steps.get_s3_package.outputs .package_url }}
144
172
else
145
- ov_package_url=$(curl -s ${{ inputs.nightly_package_source }} | jq -r '.${{ inputs.nightly_build_key }}')
173
+ ov_package_url=$(curl -s ${{ inputs.nightly_package_source }} | jq -r '.${{ inputs.platform }}_${{ inputs.arch }}')
146
174
fi
175
+ cd ${{ inputs.install_dir || env.GITHUB_WORKSPACE }}
147
176
package_basename=$(basename $ov_package_url)
148
177
wget $ov_package_url --progress=bar:force:noscroll -O $package_basename
149
- package_folder=${package_basename%.*} && mkdir $package_folder
150
- [[ "$package_basename" == *.zip ]] && unzip "$package_basename" -d $package_folder || tar -xvf "$package_basename" -C $package_folder
178
+ package_folder=${package_basename%.*}
179
+ [[ "$package_basename" == *.zip ]] && unzip "$package_basename" || tar -xvf "$package_basename"
180
+ rm $package_basename
181
+ if [ ${{ inputs.install_dir }} ]; then
182
+ mv $package_folder/* . && rm -rf $package_folder
183
+ fi
151
184
ov_artifact_name=$([ ${{ inputs.ov_artifact_name }} ] && echo ${{ inputs.ov_artifact_name }} || echo $package_folder)
185
+ echo "ov_package_url=$ov_package_url" >> $GITHUB_OUTPUT
152
186
echo "ov_artifact_name=$ov_artifact_name" >> $GITHUB_OUTPUT
153
187
echo "ov_package_path=$package_folder" >> $GITHUB_OUTPUT
154
188
155
189
- name : Upload OpenVINO archives
156
- if : steps.openvino_download .outcome == 'success'
190
+ if : steps.openvino_s3_download .outcome == 'success' && !inputs.install_dir
157
191
uses : actions/upload-artifact@v4
158
192
with :
159
- name : ${{ steps.openvino_download .outputs.ov_artifact_name }}
160
- path : ${{ steps.openvino_download .outputs.ov_package_path }}
193
+ name : ${{ steps.openvino_s3_download .outputs.ov_artifact_name }}
194
+ path : ${{ steps.openvino_s3_download .outputs.ov_package_path }}
161
195
if-no-files-found : ' error'
162
196
163
197
- name : Get wheel
164
- id : openvino_wheel
165
- if : steps.openvino_download .outcome == 'success'
198
+ id : openvino_s3_wheel
199
+ if : steps.openvino_s3_download .outcome == 'success'
166
200
shell : bash
167
201
run : |
168
- rc_version=$(echo ${{ inputs.package_url }} |
202
+ rc_version=$(echo ${{ steps.openvino_s3_download.outputs.ov_package_url }} |
169
203
grep -oP '(?<=pre-release\/)\d{4}\.\d+\.\d+rc\d+' || true)
170
204
171
- release_version=$(echo ${{ steps.openvino_download .outputs.ov_package_path }} |
205
+ release_version=$(echo ${{ steps.openvino_s3_download .outputs.ov_package_path }} |
172
206
grep -oP '_\K\d{4}\.\d+\.\d+')
173
207
174
- dev_version=$(echo ${{ steps.openvino_download .outputs.ov_package_path }} |
208
+ dev_version=$(echo ${{ steps.openvino_s3_download .outputs.ov_package_path }} |
175
209
grep -oP "${release_version//./\\.}\.dev\d{8}" || true)
176
210
177
211
version=${rc_version:-${dev_version:-$release_version}}
212
+
178
213
extra_index="--pre --extra-index-url ${{ inputs.pip_extra_url }}/nightly \
179
214
--extra-index-url ${{ inputs.pip_extra_url }}/pre-release"
180
- wheel_input="$extra_index openvino==$version"
181
- echo "ov_wheel_input=$wheel_input " >> $GITHUB_OUTPUT
215
+
216
+ echo "ov_version=$version " >> $GITHUB_OUTPUT
182
217
echo "ov_wheel_source=$extra_index" >> $GITHUB_OUTPUT
0 commit comments