Skip to content

Commit

Permalink
Merge branch 'main' into base-image
Browse files Browse the repository at this point in the history
  • Loading branch information
lvliang-intel authored Jan 28, 2025
2 parents 15bac5c + 63c66a0 commit f605b4f
Show file tree
Hide file tree
Showing 766 changed files with 17,763 additions and 20,612 deletions.
2 changes: 0 additions & 2 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@
/comps/guardrails/ [email protected] [email protected]
/comps/image2image/ [email protected] [email protected]
/comps/image2video/ [email protected] [email protected]
/comps/intent_detection/ [email protected] [email protected]
/comps/llms/ [email protected] [email protected]
/comps/lvms/ [email protected] [email protected]
/comps/prompt_registry/ [email protected] [email protected]
Expand All @@ -26,5 +25,4 @@
/comps/text2image/ [email protected] [email protected]
/comps/text2sql/ [email protected] [email protected]
/comps/tts/ [email protected] [email protected]
/comps/vectorstores/ [email protected] [email protected]
/comps/web_retrievers/ [email protected] [email protected]
8 changes: 5 additions & 3 deletions .github/ISSUE_TEMPLATE/1_bug_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ body:
options:
- label: Pull docker images from hub.docker.com
- label: Build docker images from source
- label: Other
validations:
required: true

Expand All @@ -74,10 +75,10 @@ body:
attributes:
label: Deploy method
options:
- label: Docker compose
- label: Docker
- label: Kubernetes
- label: Helm
- label: Docker Compose
- label: Kubernetes Helm Charts
- label: Other
validations:
required: true

Expand All @@ -88,6 +89,7 @@ body:
options:
- Single Node
- Multiple Nodes
- Other
default: 0
validations:
required: true
Expand Down
1 change: 1 addition & 0 deletions .github/ISSUE_TEMPLATE/2_feature_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@ body:
options:
- Single Node
- Multiple Nodes
- Other
default: 0
validations:
required: true
Expand Down
26 changes: 22 additions & 4 deletions .github/workflows/_comps-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,16 @@ on:
default: true
required: false
type: boolean
test:
test_compose:
default: true
description: "Test comps with docker compose"
required: false
type: boolean
test_helmchart:
default: true
description: "Test comps with helm chart"
required: false
type: boolean
mode:
default: "CD"
description: "Whether the test range is CI, CD or CICD"
Expand All @@ -33,6 +38,7 @@ jobs:
# Image Build
####################################################################################################
build-images:
if: ${{ !(fromJSON(inputs.test_helmchart)) }}
runs-on: "docker-build-gaudi"
continue-on-error: true
outputs:
Expand Down Expand Up @@ -64,8 +70,8 @@ jobs:
cd ./vllm-openvino && git checkout v0.6.1 && git rev-parse HEAD && cd ../
fi
if [[ $(grep -c "vllm-gaudi:" ${docker_compose_yml}) != 0 ]]; then
git clone https://github.com/HabanaAI/vllm-fork.git vllm-fork
cd vllm-fork && git checkout 3c39626 && cd ../
git clone --depth 1 --branch v0.6.4.post2+Gaudi-1.19.0 https://github.com/HabanaAI/vllm-fork.git
sed -i 's/triton/triton==3.1.0/g' vllm-fork/requirements-hpu.txt
fi
- name: Get build list
id: get-build-list
Expand Down Expand Up @@ -98,9 +104,21 @@ jobs:
####################################################################################################
test-service-compose:
needs: [build-images]
if: ${{ fromJSON(inputs.test) }}
if: ${{ fromJSON(inputs.test_compose) }}
uses: ./.github/workflows/_run-docker-compose.yml
with:
tag: ${{ inputs.tag }}
service: ${{ inputs.service }}
secrets: inherit

####################################################################################################
# Helm Chart Test
####################################################################################################
test-service-helmchart:
if: ${{ fromJSON(inputs.test_helmchart) }}
uses: ./.github/workflows/_run-helm-chart.yml
with:
tag: ${{ inputs.tag }}
mode: ${{ inputs.mode }}
service: ${{ inputs.service }}
secrets: inherit
242 changes: 242 additions & 0 deletions .github/workflows/_run-helm-chart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,242 @@
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

name: Helm Chart Test on GenAIComps For Call
permissions: read-all
on:
workflow_call:
inputs:
service:
default: "chatqna"
required: true
type: string
description: "service to test, e.g. asr"
dockerhub:
default: false
required: false
type: boolean
description: "Set to true if you want to use released docker images at dockerhub. By default using internal docker registry."
tag:
default: "latest"
required: false
type: string
mode:
default: "CD"
description: "Whether the test range is CI, CD or CICD"
required: false
type: string
version:
default: "0-latest"
required: false
type: string

jobs:
get-test-case:
runs-on: ubuntu-latest
outputs:
run_matrix: ${{ steps.get-test-files.outputs.run_matrix }}
CHECKOUT_REF: ${{ steps.get-checkout-ref.outputs.CHECKOUT_REF }}
steps:
- name: Get checkout ref
id: get-checkout-ref
run: |
if [ "${{ github.event_name }}" == "pull_request" ] || [ "${{ github.event_name }}" == "pull_request_target" ]; then
CHECKOUT_REF=refs/pull/${{ github.event.number }}/merge
else
CHECKOUT_REF=${{ github.ref }}
fi
echo "CHECKOUT_REF=${CHECKOUT_REF}" >> $GITHUB_OUTPUT
echo "checkout ref ${CHECKOUT_REF}"
- name: Checkout Repo
uses: actions/checkout@v4
with:
ref: ${{ steps.get-checkout-ref.outputs.CHECKOUT_REF }}
fetch-depth: 0

- name: Get test Services
id: get-test-files
run: |
set -x
if [ "${{ inputs.mode }}" = "CI" ]; then
base_commit=${{ github.event.pull_request.base.sha }}
merged_commit=$(git log -1 --format='%H')
values_files=$(git diff --name-only ${base_commit} ${merged_commit} | \
grep "values.yaml" | \
grep "${{ inputs.service }}" | \
sort -u )
echo $values_files
elif [ "${{ inputs.mode }}" = "CD" ]; then
values_files=$(ls ${{ github.workspace }}/comps/${{ inputs.service }}/deployment/kubernetes/*values.yaml)
fi
run_matrix="["
run_matrix="{\"include\":["
for file in ${values_files}; do
if [ -f "$file" ]; then
filename=$(basename "$file")
if [[ "$filename" == *"gaudi"* ]]; then
hardware="gaudi"
value_file="$filename"
elif [[ "$filename" == *"nv"* ]]; then
continue
else
hardware="xeon"
value_file="$filename"
fi
echo "service=${{ inputs.service }}, hardware=${hardware}, value_file=${value_file}"
if [[ $(echo ${run_matrix} | grep -c "{\"value_file\":\"${value_file}\",\"hardware\":\"${hardware}\"},") == 0 ]]; then
run_matrix="${run_matrix}{\"value_file\":\"${value_file}\",\"hardware\":\"${hardware}\"},"
echo "------------------ add one values file ------------------"
fi
fi
done
run_matrix="${run_matrix%,}]}"
echo "run_matrix=${run_matrix}"
echo "run_matrix=${run_matrix}" >> $GITHUB_OUTPUT
helm-test:
needs: [get-test-case]
strategy:
matrix: ${{ fromJSON(needs.get-test-case.outputs.run_matrix) }}
if: ${{ needs.get-test-case.outputs.run_matrix != '[]' }}
runs-on: k8s-${{ matrix.hardware }}
continue-on-error: true
steps:
- name: Clean Up Working Directory
run: |
echo "service=${{ inputs.service }} hardware=${{ matrix.hardware }} value_file=${{ matrix.value_file }}"
echo "value_file=${{ matrix.value_file }}"
sudo rm -rf ${{github.workspace}}/*
- name: Get checkout ref
id: get-checkout-ref
run: |
if [ "${{ github.event_name }}" == "pull_request" ] || [ "${{ github.event_name }}" == "pull_request_target" ]; then
CHECKOUT_REF=refs/pull/${{ github.event.number }}/merge
else
CHECKOUT_REF=${{ github.ref }}
fi
echo "CHECKOUT_REF=${CHECKOUT_REF}" >> $GITHUB_OUTPUT
echo "checkout ref ${CHECKOUT_REF}"
- name: Checkout Repo
uses: actions/checkout@v4
with:
ref: ${{ steps.get-checkout-ref.outputs.CHECKOUT_REF }}
fetch-depth: 0

- name: Set variables
env:
service: ${{ inputs.service }}
run: |
service_name="${service,,}" # third_parties/bridgetower
if [[ "${service,,}" == *"third_parties"* ]]; then
CHART_NAME="$(echo "${service,,}"|cut -d'/' -f2)" # bridgetower
else
CHART_NAME="${service_name}" # agent
fi
echo "service_name=$service_name" >> $GITHUB_ENV
echo "CHART_NAME=$CHART_NAME" >> $GITHUB_ENV
echo "RELEASE_NAME=${CHART_NAME}$(date +%d%H%M%S)" >> $GITHUB_ENV
echo "NAMESPACE=comp-${CHART_NAME}-$(date +%d%H%M%S)" >> $GITHUB_ENV
echo "ROLLOUT_TIMEOUT_SECONDS=600s" >> $GITHUB_ENV
echo "TEST_TIMEOUT_SECONDS=600s" >> $GITHUB_ENV
echo "KUBECTL_TIMEOUT_SECONDS=60s" >> $GITHUB_ENV
echo "should_cleanup=false" >> $GITHUB_ENV
echo "skip_validate=false" >> $GITHUB_ENV
echo "CHART_FOLDER=comps/${service}/deployment/kubernetes" >> $GITHUB_ENV
- name: get template name
run: |
echo "template_link=$(grep 'helm install' comps/${service_name}/deployment/kubernetes/README.md | awk -F' ' '{print $4}' | head -n 1)"
echo "template_link=$(grep 'helm install' comps/${service_name}/deployment/kubernetes/README.md | awk -F' ' '{print $4}' | head -n 1)" >> $GITHUB_ENV
- name: Helm install
id: install
env:
GOOGLE_CSE_ID: ${{ secrets.GOOGLE_CSE_ID }}
GOOGLE_API_KEY: ${{ secrets.GOOGLE_API_KEY }}
HUGGINGFACEHUB_API_TOKEN: ${{ secrets.HUGGINGFACEHUB_API_TOKEN }}
HFTOKEN: ${{ secrets.HUGGINGFACEHUB_API_TOKEN }}
value_file: ${{ matrix.value_file }}
run: |
set -xe
echo "should_cleanup=true" >> $GITHUB_ENV
if [[ ! -f ${{ github.workspace }}/${{ env.CHART_FOLDER }}/${value_file} ]]; then
echo "No value file found, exiting test!"
echo "skip_validate=true" >> $GITHUB_ENV
echo "should_cleanup=false" >> $GITHUB_ENV
exit 0
fi
for img in `helm template -n $NAMESPACE $RELEASE_NAME ${template_link} -f comps/${{ inputs.service }}/deployment/kubernetes/${value_file} --version ${{ inputs.version }} | grep 'image:' | grep 'opea/' | awk '{print $2}' | xargs`;
do
# increase helm install wait for for vllm-gaudi case
if [[ $img == *"vllm-gaudi"* ]]; then
ROLLOUT_TIMEOUT_SECONDS=900s
fi
done
# oci://ghcr.io/opea-project/charts/${CHART_NAME} \
if ! helm install --create-namespace --namespace $NAMESPACE $RELEASE_NAME \
${template_link} \
--set global.HUGGINGFACEHUB_API_TOKEN=${HFTOKEN} \
--set global.modelUseHostPath=/home/sdp/.cache/huggingface/hub \
--set GOOGLE_API_KEY=${{ env.GOOGLE_API_KEY}} \
--set GOOGLE_CSE_ID=${{ env.GOOGLE_CSE_ID}} \
-f comps/${{ inputs.service }}/deployment/kubernetes/${value_file} \
--version ${{ inputs.version }} \
--wait --timeout "$ROLLOUT_TIMEOUT_SECONDS"; then
echo "Failed to install chart ${{ inputs.service }}"
echo "skip_validate=true" >> $GITHUB_ENV
.github/workflows/scripts/k8s-utils.sh dump_pods_status $NAMESPACE
exit 1
fi
helm list -A
kubectl get pods -n $NAMESPACE
- name: Validate e2e test
if: always()
run: |
set -xe
if $skip_validate; then
echo "Skip validate"
else
LOG_PATH=/home/$(whoami)/helm-logs
chart=${{ env.CHART_NAME }}
helm test -n $NAMESPACE $RELEASE_NAME --logs --timeout "$TEST_TIMEOUT_SECONDS" | tee ${LOG_PATH}/charts-${chart}.log
exit_code=$?
if [ $exit_code -ne 0 ]; then
echo "Chart ${chart} test failed, please check the logs in ${LOG_PATH}!"
exit 1
fi
echo "Checking response results, make sure the output is reasonable. "
teststatus=false
if [[ -f $LOG_PATH/charts-${chart}.log ]] && \
[[ $(grep -c "^Phase:.*Failed" $LOG_PATH/charts-${chart}.log) != 0 ]]; then
teststatus=false
${{ github.workspace }}/.github/workflows/scripts/k8s-utils.sh dump_all_pod_logs $NAMESPACE
else
teststatus=true
fi
if [ $teststatus == false ]; then
echo "Response check failed, please check the logs in artifacts!"
exit 1
else
echo "Response check succeeded!"
exit 0
fi
fi
- name: Helm uninstall
if: always()
run: |
if $should_cleanup ; then
helm uninstall $RELEASE_NAME --namespace $NAMESPACE
if ! kubectl delete ns $NAMESPACE --timeout=$KUBECTL_TIMEOUT_SECONDS; then
kubectl delete pods --namespace $NAMESPACE --force --grace-period=0 --all
kubectl delete ns $NAMESPACE --force --grace-period=0 --timeout=$KUBECTL_TIMEOUT_SECONDS
fi
fi
2 changes: 1 addition & 1 deletion .github/workflows/check-online-doc-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
build:
runs-on: ubuntu-latest
runs-on: ubuntu-22.04
steps:

- name: Checkout
Expand Down
8 changes: 0 additions & 8 deletions .github/workflows/docker/compose/animation-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,3 @@ services:
build:
dockerfile: comps/animation/src/Dockerfile
image: ${REGISTRY:-opea}/animation:${TAG:-latest}
wav2lip:
build:
dockerfile: comps/third_parties/wav2lip/src/Dockerfile
image: ${REGISTRY:-opea}/wav2lip:${TAG:-latest}
wav2lip-gaudi:
build:
dockerfile: comps/third_parties/wav2lip/src/Dockerfile.intel_hpu
image: ${REGISTRY:-opea}/wav2lip-gaudi:${TAG:-latest}
2 changes: 1 addition & 1 deletion .github/workflows/docker/compose/chathistory-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,5 +5,5 @@
services:
chathistory-mongo-server:
build:
dockerfile: comps/chathistory/mongo/Dockerfile
dockerfile: comps/chathistory/src/Dockerfile
image: ${REGISTRY:-opea}/chathistory-mongo-server:${TAG:-latest}
Loading

0 comments on commit f605b4f

Please sign in to comment.