Skip to content

Integration Tests - Konflux #243

Integration Tests - Konflux

Integration Tests - Konflux #243

name: Integration Tests - Konflux
on:
# Trigger when a PR build status event is posted by Konflux
status:
# Allow manual trigger with custom image tag
workflow_dispatch:
inputs:
image_tag:
description: 'Image tag to test (e.g., odh-pr-123)'
required: true
type: string
source_ref:
description: 'Git ref to checkout for tests (branch, tag, or commit SHA)'
required: true
type: string
permissions:
contents: read
statuses: write
jobs:
# Extract image information from the trigger event
setup:
name: Determine Image Tag
runs-on: ubuntu-latest
# Only run for workflow_dispatch or relevant status events
if: |
github.event_name == 'workflow_dispatch' ||
(github.event_name == 'status' &&
github.event.state == 'success' &&
github.event.context == 'Red Hat Konflux / openvino-model-server-on-pull-request')
outputs:
image_tag: ${{ steps.set_image_tag.outputs.image_tag }}
source_ref: ${{ steps.set_source_ref.outputs.source_ref }}
steps:
- name: Set image tag
id: set_image_tag
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
TAG="${{ github.event.inputs.image_tag }}"
else
TAG="odh-pr-${{ github.event.sha }}"
fi
echo "image_tag=${TAG}" >> $GITHUB_OUTPUT
echo "Image tag: ${TAG}"
- name: Set source ref
id: set_source_ref
run: |
if [[ "${{ github.event_name }}" == "workflow_dispatch" ]]; then
REF="${{ github.event.inputs.source_ref }}"
else
REF="${{ github.event.sha }}"
fi
echo "source_ref=${REF}" >> $GITHUB_OUTPUT
echo "Source ref: ${REF}"
# Pull the image
pull-image:
name: Pull Image from Quay.io
runs-on: ubuntu-latest
needs: setup
steps:
- name: Pull image
run: |
FULL_IMAGE="quay.io/opendatahub/openvino_model_server:${{ needs.setup.outputs.image_tag }}"
echo "Pulling image: ${FULL_IMAGE}"
docker pull ${FULL_IMAGE}
docker tag ${FULL_IMAGE} openvino/model_server:latest
- name: Save Docker image
run: |
docker save openvino/model_server:latest | gzip > model-server-image.tar.gz
- name: Upload image artifact
uses: actions/upload-artifact@v4
with:
name: model-server-image
path: model-server-image.tar.gz
retention-days: 1
# File integrity test
file-integrity:
name: File Integrity Test
runs-on: ubuntu-latest
needs: [setup, pull-image]
if: always() && needs.setup.result == 'success'
steps:
- name: Post pending status to commit
if: github.event_name == 'status'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api repos/${{ github.repository }}/statuses/${{ needs.setup.outputs.source_ref }} \
-f state=pending \
-f context="File Integrity Test" \
-f description="Running file integrity tests..." \
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ needs.setup.outputs.source_ref }}
- name: Download Docker image
uses: actions/download-artifact@v4
with:
name: model-server-image
- name: Load Docker image
run: |
docker load < model-server-image.tar.gz
- name: Run file integrity test
run: |
make run_lib_files_test
- name: Post success status to commit
if: github.event_name == 'status' && success()
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api repos/${{ github.repository }}/statuses/${{ needs.setup.outputs.source_ref }} \
-f state=success \
-f context="File Integrity Test" \
-f description="File integrity tests passed" \
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- name: Post failure status to commit
if: github.event_name == 'status' && failure()
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api repos/${{ github.repository }}/statuses/${{ needs.setup.outputs.source_ref }} \
-f state=failure \
-f context="File Integrity Test" \
-f description="File integrity tests failed" \
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
# Python clients test
clients-test:
name: Python Clients Test
runs-on: ubuntu-latest
needs: [setup, pull-image]
if: always() && needs.setup.result == 'success'
steps:
- name: Post pending status to commit
if: github.event_name == 'status'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api repos/${{ github.repository }}/statuses/${{ needs.setup.outputs.source_ref }} \
-f state=pending \
-f context="Python Clients Test" \
-f description="Running Python client tests..." \
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ needs.setup.outputs.source_ref }}
- name: Download Docker image
uses: actions/download-artifact@v4
with:
name: model-server-image
- name: Load Docker image
run: |
docker load < model-server-image.tar.gz
- name: Run Python clients test
run: |
make test_python_clients
- name: Post success status to commit
if: github.event_name == 'status' && success()
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api repos/${{ github.repository }}/statuses/${{ needs.setup.outputs.source_ref }} \
-f state=success \
-f context="Python Clients Test" \
-f description="Python client tests passed" \
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- name: Post failure status to commit
if: github.event_name == 'status' && failure()
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api repos/${{ github.repository }}/statuses/${{ needs.setup.outputs.source_ref }} \
-f state=failure \
-f context="Python Clients Test" \
-f description="Python client tests failed" \
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
# Latency performance test
latency-test:
name: Latency Performance Test
runs-on: ubuntu-latest
needs: [setup, pull-image]
if: always() && needs.setup.result == 'success'
steps:
- name: Post pending status to commit
if: github.event_name == 'status'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api repos/${{ github.repository }}/statuses/${{ needs.setup.outputs.source_ref }} \
-f state=pending \
-f context="Latency Performance Test" \
-f description="Running latency tests..." \
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ needs.setup.outputs.source_ref }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Download Docker image
uses: actions/download-artifact@v4
with:
name: model-server-image
- name: Load Docker image
run: |
docker load < model-server-image.tar.gz
- name: Run latency test
run: |
make test_perf
- name: Post success status to commit
if: github.event_name == 'status' && success()
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api repos/${{ github.repository }}/statuses/${{ needs.setup.outputs.source_ref }} \
-f state=success \
-f context="Latency Performance Test" \
-f description="Latency tests passed" \
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- name: Post failure status to commit
if: github.event_name == 'status' && failure()
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api repos/${{ github.repository }}/statuses/${{ needs.setup.outputs.source_ref }} \
-f state=failure \
-f context="Latency Performance Test" \
-f description="Latency tests failed" \
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
# Throughput performance test
throughput-test:
name: Throughput Performance Test
runs-on: ubuntu-latest
needs: [setup, pull-image]
if: always() && needs.setup.result == 'success'
steps:
- name: Post pending status to commit
if: github.event_name == 'status'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api repos/${{ github.repository }}/statuses/${{ needs.setup.outputs.source_ref }} \
-f state=pending \
-f context="Throughput Performance Test" \
-f description="Running throughput tests..." \
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ needs.setup.outputs.source_ref }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Download Docker image
uses: actions/download-artifact@v4
with:
name: model-server-image
- name: Load Docker image
run: |
docker load < model-server-image.tar.gz
- name: Run throughput test
run: |
make test_throughput
- name: Post success status to commit
if: github.event_name == 'status' && success()
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api repos/${{ github.repository }}/statuses/${{ needs.setup.outputs.source_ref }} \
-f state=success \
-f context="Throughput Performance Test" \
-f description="Throughput tests passed" \
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- name: Post failure status to commit
if: github.event_name == 'status' && failure()
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api repos/${{ github.repository }}/statuses/${{ needs.setup.outputs.source_ref }} \
-f state=failure \
-f context="Throughput Performance Test" \
-f description="Throughput tests failed" \
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
# Functional tests
functional-tests:
name: Functional Tests
runs-on: ubuntu-latest
needs: [setup, pull-image]
if: always() && needs.setup.result == 'success'
steps:
- name: Post pending status to commit
if: github.event_name == 'status'
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api repos/${{ github.repository }}/statuses/${{ needs.setup.outputs.source_ref }} \
-f state=pending \
-f context="Functional Tests" \
-f description="Running functional tests..." \
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ needs.setup.outputs.source_ref }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Download Docker image
uses: actions/download-artifact@v4
with:
name: model-server-image
- name: Load Docker image
run: |
docker load < model-server-image.tar.gz
- name: Run functional tests
env:
IMAGE: openvino/model_server:latest
run: |
make test_functional
- name: Post success status to commit
if: github.event_name == 'status' && success()
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api repos/${{ github.repository }}/statuses/${{ needs.setup.outputs.source_ref }} \
-f state=success \
-f context="Functional Tests" \
-f description="Functional tests passed" \
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"
- name: Post failure status to commit
if: github.event_name == 'status' && failure()
env:
GH_TOKEN: ${{ github.token }}
run: |
gh api repos/${{ github.repository }}/statuses/${{ needs.setup.outputs.source_ref }} \
-f state=failure \
-f context="Functional Tests" \
-f description="Functional tests failed" \
-f target_url="${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}"