wasi-nn: update openvino crate, use external CI action (#4383)
* ci: replace OpenVINO installer action To test wasi-nn, we currently use an OpenVINO backend. The Wasmtime CI must install OpenVINO using a custom GitHub action. This CI action has not been updated in some time and in the meantime OpenVINO (and the OpenVINO crates) have released several new versions. https://github.com/abrown/install-openvino-action is an external action that we plan to keep up to date with the latest releases. This change replaces the current CI action with that one. * wasi-nn: upgrade openvino dependency to v0.4.1 This eliminates a `lazy_static` dependency and changes a few parameters to pass by reference. Importantly, it enables support for the latest versions of OpenVINO (v2022.*) in wasi-nn. * ci: update wasi-nn script to source correct env script * ci: really use the correct path for the env script Also, clarify which directory OpenVINO is installed in (the symlink may not be present).
This commit is contained in:
2
.github/actions/install-openvino/.gitignore
vendored
2
.github/actions/install-openvino/.gitignore
vendored
@@ -1,2 +0,0 @@
|
||||
CHECKSUM
|
||||
GPG-PUB-KEY*
|
||||
8
.github/actions/install-openvino/README.md
vendored
8
.github/actions/install-openvino/README.md
vendored
@@ -1,8 +0,0 @@
|
||||
# install-openvino
|
||||
|
||||
A GitHub action to install OpenVINO from a package repository. This is only necessary for `wasi-nn` support but there
|
||||
are enough steps here to package the functionality separately and avoid cluttering the CI.
|
||||
|
||||
Future improvements:
|
||||
- make this installer work for different OS/distributions (e.g. https://docs.openvinotoolkit.org/latest/openvino_docs_install_guides_installing_openvino_windows.html)
|
||||
- it would be nice to output the install directory (i.e. `/opt/intel/openvino`)
|
||||
13
.github/actions/install-openvino/action.yml
vendored
13
.github/actions/install-openvino/action.yml
vendored
@@ -1,13 +0,0 @@
|
||||
name: 'Install OpenVINO'
|
||||
description: 'Install OpenVINO binaries from a package repository; this is significantly faster than building from source'
|
||||
|
||||
inputs:
|
||||
version:
|
||||
description: 'The release version of OpenVINO to install'
|
||||
required: false
|
||||
|
||||
runs:
|
||||
using: composite
|
||||
steps:
|
||||
- run: ${{ github.action_path }}/install.sh ${{ inputs.version }}
|
||||
shell: bash
|
||||
40
.github/actions/install-openvino/install.sh
vendored
40
.github/actions/install-openvino/install.sh
vendored
@@ -1,40 +0,0 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Determine the OpenVINO version to install from the first parameter. Also, split out the parts of
|
||||
# this version; `${version_parts[0]}` should contain the year. E.g.:
|
||||
# version=2021.4.752
|
||||
# version_year=2021
|
||||
if [ "$#" -ne 1 ]; then
|
||||
version="2021.4.752"
|
||||
else
|
||||
version="$1"
|
||||
fi
|
||||
IFS='.' read -ra version_parts <<< "$version"
|
||||
version_year="${version_parts[0]}"
|
||||
|
||||
# Determine the OS name and version (Linux-specific for now). E.g.:
|
||||
# os_name=ubuntu
|
||||
# os_version=20.04
|
||||
# os_version_year=20
|
||||
eval $(source /etc/os-release; echo os_name="$ID"; echo os_version="$VERSION_ID";)
|
||||
IFS='.' read -ra os_version_parts <<< "$os_version"
|
||||
os_version_year="${os_version_parts[0]}"
|
||||
|
||||
# Determine the directory of this script. E.g.:
|
||||
# script_dir=/some/directory
|
||||
scriptdir="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
|
||||
|
||||
# Retrieve the OpenVINO checksum.
|
||||
curl -sSL https://apt.repos.intel.com/openvino/$version_year/GPG-PUB-KEY-INTEL-OPENVINO-$version_year > $scriptdir/GPG-PUB-KEY-INTEL-OPENVINO-$version_year
|
||||
echo "5f5cff8a2d26ba7de91942bd0540fa4d $scriptdir/GPG-PUB-KEY-INTEL-OPENVINO-$version_year" > $scriptdir/CHECKSUM
|
||||
md5sum --check $scriptdir/CHECKSUM
|
||||
|
||||
# Add the OpenVINO repository (DEB-specific for now).
|
||||
sudo apt-key add $scriptdir/GPG-PUB-KEY-INTEL-OPENVINO-$version_year
|
||||
echo "deb https://apt.repos.intel.com/openvino/$version_year all main" | sudo tee /etc/apt/sources.list.d/intel-openvino-$version_year.list
|
||||
sudo apt update
|
||||
|
||||
# Install the OpenVINO package.
|
||||
sudo apt install -y intel-openvino-runtime-$os_name$os_version_year-$version
|
||||
Reference in New Issue
Block a user