Skip to content

Redirect versionless models auth and metadata to new model registry when USE_INFERENCE_MODELS=True #3802

Redirect versionless models auth and metadata to new model registry when USE_INFERENCE_MODELS=True

Redirect versionless models auth and metadata to new model registry when USE_INFERENCE_MODELS=True #3802

name: INTEGRATION TESTS - inference_models (CPU)
permissions:
contents: read
on:
pull_request:
branches: [main]
push:
branches: [main]
workflow_dispatch:
inputs:
extras:
description: 'Extras to test. Available options: onnx_extras. Leave empty to run all.'
required: false
default: ''
type: choice
options:
- ''
- onnx_extras
- torch_models
python_version:
description: 'Python version to test. Available options: 3.10, 3.11, 3.12. Leave empty to run all.'
required: false
default: ''
type: choice
options:
- ''
- '3.10'
- '3.11'
- '3.12'
jobs:
integration-tests-inference-models-cpu:
name: ${{ matrix.extras.marker }}:${{ matrix.python-version }}
runs-on:
labels: depot-ubuntu-22.04-4
group: public-depot
timeout-minutes: 20
strategy:
matrix:
python-version: ["3.10", "3.11", "3.12"]
extras:
- { install: "onnx-cpu,mediapipe", marker: "onnx_extras", workers: "auto" }
- { install: "torch-cpu,mediapipe", marker: "torch_models", workers: "2" }
steps:
- name: 🛎️ Checkout
if: ${{ (github.event.inputs.extras == '' || github.event.inputs.extras == matrix.extras.marker) && (github.event.inputs.python_version == '' || github.event.inputs.python_version == matrix.python-version) }}
uses: actions/checkout@v4
- name: 📦 Cache Python packages
if: ${{ (github.event.inputs.extras == '' || github.event.inputs.extras == matrix.extras.marker) && (github.event.inputs.python_version == '' || github.event.inputs.python_version == matrix.python-version) }}
uses: actions/cache@v3
with:
path: ~/.cache/uv
key: ${{ runner.os }}-uv-${{ matrix.python-version }}-${{ hashFiles('inference_models/pyproject.toml') }}
restore-keys: |
${{ runner.os }}-uv-${{ matrix.python-version }}-
- name: 🐍 Set up Python ${{ matrix.python-version }}
if: ${{ (github.event.inputs.extras == '' || github.event.inputs.extras == matrix.extras.marker) && (github.event.inputs.python_version == '' || github.event.inputs.python_version == matrix.python-version) }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
check-latest: true
- name: 📦 Install base dependencies as well as `${{ matrix.extras.install }}` dependencies
if: ${{ (github.event.inputs.extras == '' || github.event.inputs.extras == matrix.extras.marker) && (github.event.inputs.python_version == '' || github.event.inputs.python_version == matrix.python-version) }}
working-directory: inference_models
run: |
python -m pip install --upgrade pip
python -m pip install uv
python -m uv venv
python -m uv pip install -e .[test,${{ matrix.extras.install }}] --python .venv
- name: 🧪 Run tests marked `${{ matrix.extras.marker }}`
if: ${{ (github.event.inputs.extras == '' || github.event.inputs.extras == matrix.extras.marker) && (github.event.inputs.python_version == '' || github.event.inputs.python_version == matrix.python-version) }}
working-directory: inference_models
timeout-minutes: 15
run: |
source .venv/bin/activate
python -m pytest -n ${{ matrix.extras.workers }} -m "${{ matrix.extras.marker }} and not gpu_only" tests/integration_tests