-
Notifications
You must be signed in to change notification settings - Fork 2.4k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add job_tensorflow_hub_performance_models_tests.yml
- Loading branch information
Showing
2 changed files
with
133 additions
and
1 deletion.
There are no files selected for viewing
116 changes: 116 additions & 0 deletions
116
.github/workflows/job_tensorflow_hub_performance_models_tests.yml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,116 @@ | ||
name: TensorFlow Hub Performance Models tests | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
runner: | ||
description: 'Machine on which the tests would run' | ||
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}' | ||
event: | ||
description: 'Event that triggered the workflow. E.g., "schedule" for nightly runs' | ||
type: string | ||
required: true | ||
|
||
jobs: | ||
TensorFlow_Hub_Performance_Models_Tests: | ||
name: TensorFlow Hub Performance Models tests | ||
timeout-minutes: ${{ inputs.event == 'schedule' && 400 || 25 }} | ||
runs-on: ${{ inputs.runner }} | ||
container: ${{ fromJSON(inputs.container) }} | ||
defaults: | ||
run: | ||
shell: bash | ||
env: | ||
DEBIAN_FRONTEND: noninteractive # to prevent apt-get from waiting user input | ||
OPENVINO_REPO: ${{ github.workspace }}/openvino | ||
INSTALL_DIR: ${{ github.workspace }}/install | ||
INSTALL_TEST_DIR: ${{ github.workspace }}/install/tests | ||
MODEL_HUB_TESTS_INSTALL_DIR: ${{ github.workspace }}/install/tests/model_hub_tests | ||
steps: | ||
|
||
- name: Check sudo | ||
if: ${{ runner.os == 'Linux' }} | ||
run: if [ "$(id -u)" -eq 0 ]; then apt update && apt --assume-yes install sudo; fi | ||
|
||
- name: Download OpenVINO package | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: openvino_package | ||
path: ${{ env.INSTALL_DIR }} | ||
|
||
- name: Download OpenVINO tests package | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: openvino_tests | ||
path: ${{ env.INSTALL_TEST_DIR }} | ||
|
||
# Needed as ${{ github.workspace }} is not working correctly when using Docker | ||
- name: Setup Variables | ||
run: | | ||
echo "OPENVINO_REPO=$GITHUB_WORKSPACE/openvino" >> "$GITHUB_ENV" | ||
echo "INSTALL_DIR=$GITHUB_WORKSPACE/install" >> "$GITHUB_ENV" | ||
echo "INSTALL_TEST_DIR=$GITHUB_WORKSPACE/install/tests" >> "$GITHUB_ENV" | ||
echo "MODEL_HUB_TESTS_INSTALL_DIR=$GITHUB_WORKSPACE/install/tests/model_hub_tests" >> "$GITHUB_ENV" | ||
- name: Extract OpenVINO packages | ||
run: | | ||
pushd ${INSTALL_DIR} | ||
tar -xzf openvino_package.tar.gz -C ${INSTALL_DIR} | ||
popd | ||
pushd ${INSTALL_TEST_DIR} | ||
tar -xzf openvino_tests.tar.gz -C ${INSTALL_DIR} | ||
popd | ||
- name: Fetch setup_python action | ||
uses: actions/checkout@v4 | ||
with: | ||
sparse-checkout: | | ||
.github/actions/setup_python/action.yml | ||
sparse-checkout-cone-mode: false | ||
path: 'openvino' | ||
|
||
- name: Install dependencies | ||
if: ${{ runner.os == 'Linux' }} | ||
run: | | ||
# install git (required to build pip deps from the sources) | ||
sudo apt-get install --assume-yes --no-install-recommends g++ git ca-certificates | ||
- name: Setup Python 3.11 | ||
uses: ./openvino/.github/actions/setup_python | ||
with: | ||
version: '3.11' | ||
should-setup-pip-paths: 'false' | ||
self-hosted-runner: ${{ contains(inputs.runner, 'aks') }} | ||
|
||
- name: Install OpenVINO Python wheels | ||
run: python3 -m pip install ${INSTALL_DIR}/tools/openvino-* | ||
|
||
- name: Install TF Hub tests requirements | ||
run: python3 -m pip install -r ${MODEL_HUB_TESTS_INSTALL_DIR}/tf_hub_tests/requirements.txt | ||
|
||
- name: Install Hub Performance tests requirements | ||
run: python3 -m pip install -r ${MODEL_HUB_TESTS_INSTALL_DIR}/performance_tests/requirements.txt | ||
|
||
- name: Performance Hub Tests | ||
run: | | ||
export PYTHONPATH=${MODEL_HUB_TESTS_INSTALL_DIR}:$PYTHONPATH | ||
python3 -m pytest ${MODEL_HUB_TESTS_INSTALL_DIR}/performance_tests/ -m ${TYPE} --html=${INSTALL_TEST_DIR}/TEST-tf_hub_performance.html --self-contained-html -v | ||
env: | ||
TYPE: ${{ inputs.event == 'schedule' && 'nightly' || 'precommit'}} | ||
TEST_DEVICE: CPU | ||
|
||
- name: Upload Test Results | ||
uses: actions/upload-artifact@v3 | ||
if: ${{ !cancelled() }} | ||
with: | ||
name: test-results-tensorflow-hub-performance-models | ||
path: | | ||
${{ env.INSTALL_TEST_DIR }}/TEST*.html | ||
if-no-files-found: 'error' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters