Skip to content

Run performance test on a Kubernetes cluster #14

Run performance test on a Kubernetes cluster

Run performance test on a Kubernetes cluster #14

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
name: Run performance test on a Kubernetes cluster
on:
workflow_dispatch:
inputs:
registry:
default: ""
description: "Registry to store images,e.g., docker.io, default is empty"
required: false
type: string
tag:
default: "v0.9rc"
description: "Tag to apply to images"
required: true
type: string
opea_branch:
default: "v0.9rc"
description: "Branch to build images"
required: true
type: string
runner:
description: "Runner label"
required: true
type: string
jobs:
setup-stress:
runs-on: "${{ inputs.runner }}"
steps:
- name: Clean Up Working Directory
run: sudo rm -rf ${{github.workspace}}/*
- name: Checkout out GenAIEval
uses: actions/checkout@v4
with:
path: Validation
- name: Checkout out GenAIEval
uses: actions/checkout@v4
with:
repository: opea-project/GenAIEval
path: GenAIEval
- name: Set up stress tool
run: |
cd GenAIEval
python3 -m venv stress_venv
source stress_venv/bin/activate
pip install -r requirements.txt
- name: Checkout out GenAIExamples
uses: actions/checkout@v4
with:
repository: opea-project/GenAIExamples
ref: ${{ inputs.opea_branch }}
path: GenAIExamples
run-benchmark:
needs: [setup-stress]
runs-on: "${{ inputs.runner }}"
strategy:
matrix:
node_num: ["1"]
steps:
- name: Prepare benchmark configuration
working-directory: ./Validation
env:
TEST_OUTPUT_DIR: /home/sdp/benchmark_output/node_${{ matrix.node_num }}
run: |
# export TEST_OUTPUT_DIR=/home/sdp/benchmark_output/node_${{ matrix.node_num }}
rm -rf $TEST_OUTPUT_DIR
.github/scripts/perf_test.sh --generate_config ${{ matrix.node_num }}
echo "uncordon=false" >> $GITHUB_ENV
echo "uninstall=false" >> $GITHUB_ENV
echo "TEST_OUTPUT_DIR=$TEST_OUTPUT_DIR" >> $GITHUB_ENV
- name: K8s Label Nodes
working-directory: ./Validation
run: |
echo "uncordon=true" >> $GITHUB_ENV
.github/scripts/perf_test.sh --label ${{ matrix.node_num }}
- name: Install Workload
working-directory: ./Validation
env:
IMAGE_REPO: ${{ inputs.registry }}
IMAGE_TAG: ${{ inputs.tag }}
HF_TOKEN: ${{ secrets.HUGGINGFACEHUB_API_TOKEN }}
LLM_MODEL_ID: "Intel/neural-chat-7b-v3-3"
EMBEDDING_MODEL_ID: "BAAI/bge-base-en-v1.5"
RERANK_MODEL_ID: "BAAI/bge-reranker-base"
run: |
echo "uninstall=true" >> $GITHUB_ENV
.github/scripts/perf_test.sh --installChatQnA ${{ matrix.node_num }} ../GenAIExamples
- name: Stress Test
working-directory: ./GenAIEval
run: |
source stress_venv/bin/activate
cd evals/benchmark
python benchmark.py
tar -cvf ${{ github.workspace }}/node_${{ matrix.node_num }}.tar $TEST_OUTPUT_DIR
- uses: actions/[email protected]
with:
name: benchmark_result_${{ matrix.node_num }}node
path: node_${{ matrix.node_num }}.tar
overwrite: true
- name: Uninstall Workload
if: always()
working-directory: ./Validation
run: |
if $uninstall; then
.github/scripts/perf_test.sh --uninstallChatQnA ${{ matrix.node_num }} ../GenAIExamples
fi
- name: K8s Unlabel Nodes
if: always()
working-directory: ./Validation
run: |
if $uncordon; then
.github/scripts/perf_test.sh --unlabel
fi