Signed-off-by: Wang, Xigui <xigui.wang@intel.com> Co-authored-by: chen, suyue <suyue.chen@intel.com>
140 lines
4.8 KiB
YAML
140 lines
4.8 KiB
YAML
# Copyright (C) 2024 Intel Corporation
|
|
# SPDX-License-Identifier: Apache-2.0
|
|
|
|
name: Example jobs
|
|
permissions: read-all
|
|
on:
|
|
workflow_call:
|
|
inputs:
|
|
node:
|
|
required: true
|
|
type: string
|
|
example:
|
|
required: true
|
|
type: string
|
|
services:
|
|
default: ""
|
|
required: false
|
|
type: string
|
|
tag:
|
|
default: "latest"
|
|
required: false
|
|
type: string
|
|
build:
|
|
default: true
|
|
required: false
|
|
type: boolean
|
|
test_compose:
|
|
default: false
|
|
required: false
|
|
type: boolean
|
|
test_helmchart:
|
|
default: false
|
|
required: false
|
|
type: boolean
|
|
test_gmc:
|
|
default: false
|
|
required: false
|
|
type: boolean
|
|
opea_branch:
|
|
default: "main"
|
|
required: false
|
|
type: string
|
|
inject_commit:
|
|
default: false
|
|
required: false
|
|
type: string
|
|
|
|
jobs:
|
|
####################################################################################################
|
|
# Image Build
|
|
####################################################################################################
|
|
build-images:
|
|
runs-on: "docker-build-${{ inputs.node }}"
|
|
steps:
|
|
- name: Clean Up Working Directory
|
|
run: sudo rm -rf ${{github.workspace}}/*
|
|
|
|
- name: Get Checkout Ref
|
|
run: |
|
|
if [ "${{ github.event_name }}" == "pull_request" ] || [ "${{ github.event_name }}" == "pull_request_target" ]; then
|
|
echo "CHECKOUT_REF=refs/pull/${{ github.event.number }}/merge" >> $GITHUB_ENV
|
|
else
|
|
echo "CHECKOUT_REF=${{ github.ref }}" >> $GITHUB_ENV
|
|
fi
|
|
|
|
- name: Checkout out GenAIExamples
|
|
uses: actions/checkout@v4
|
|
with:
|
|
ref: ${{ env.CHECKOUT_REF }}
|
|
fetch-depth: 0
|
|
|
|
- name: Clone Required Repo
|
|
run: |
|
|
cd ${{ github.workspace }}/${{ inputs.example }}/docker_image_build
|
|
docker_compose_path=${{ github.workspace }}/${{ inputs.example }}/docker_image_build/build.yaml
|
|
if [[ $(grep -c "vllm:" ${docker_compose_path}) != 0 ]]; then
|
|
git clone https://github.com/vllm-project/vllm.git && cd vllm
|
|
# Get the latest tag
|
|
VLLM_VER="$(git describe --tags "$(git rev-list --tags --max-count=1)" )"
|
|
echo "Check out vLLM tag ${VLLM_VER}"
|
|
git checkout ${VLLM_VER} &> /dev/null
|
|
# make sure do not change the pwd
|
|
git rev-parse HEAD && cd ../
|
|
fi
|
|
if [[ $(grep -c "vllm-gaudi:" ${docker_compose_path}) != 0 ]]; then
|
|
git clone --depth 1 --branch v0.6.4.post2+Gaudi-1.19.0 https://github.com/HabanaAI/vllm-fork.git
|
|
fi
|
|
git clone --depth 1 --branch ${{ inputs.opea_branch }} https://github.com/opea-project/GenAIComps.git
|
|
cd GenAIComps && git rev-parse HEAD && cd ../
|
|
|
|
- name: Build Image
|
|
if: ${{ fromJSON(inputs.build) }}
|
|
uses: opea-project/validation/actions/image-build@main
|
|
with:
|
|
work_dir: ${{ github.workspace }}/${{ inputs.example }}/docker_image_build
|
|
docker_compose_path: ${{ github.workspace }}/${{ inputs.example }}/docker_image_build/build.yaml
|
|
service_list: ${{ inputs.services }}
|
|
registry: ${OPEA_IMAGE_REPO}opea
|
|
inject_commit: ${{ inputs.inject_commit }}
|
|
tag: ${{ inputs.tag }}
|
|
|
|
####################################################################################################
|
|
# Docker Compose Test
|
|
####################################################################################################
|
|
test-example-compose:
|
|
needs: [build-images]
|
|
if: ${{ fromJSON(inputs.test_compose) }}
|
|
uses: ./.github/workflows/_run-docker-compose.yml
|
|
with:
|
|
tag: ${{ inputs.tag }}
|
|
example: ${{ inputs.example }}
|
|
hardware: ${{ inputs.node }}
|
|
secrets: inherit
|
|
|
|
|
|
####################################################################################################
|
|
# helmchart Test
|
|
####################################################################################################
|
|
test-helmchart:
|
|
if: ${{ fromJSON(inputs.test_helmchart) }}
|
|
uses: ./.github/workflows/_helm-e2e.yml
|
|
with:
|
|
example: ${{ inputs.example }}
|
|
hardware: ${{ inputs.node }}
|
|
tag: ${{ inputs.tag }}
|
|
mode: "CD"
|
|
secrets: inherit
|
|
|
|
####################################################################################################
|
|
# GMC Test
|
|
####################################################################################################
|
|
test-gmc-pipeline:
|
|
needs: [build-images]
|
|
if: ${{ fromJSON(inputs.test_gmc) }}
|
|
uses: ./.github/workflows/_gmc-e2e.yml
|
|
with:
|
|
example: ${{ inputs.example }}
|
|
hardware: ${{ inputs.node }}
|
|
secrets: inherit
|