forked from opea-project/GenAIComps
-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (88 loc) · 3.42 KB
/
_comps-workflow.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
name: Comps jobs
permissions: read-all
on:
workflow_call:
inputs:
node:
required: true
type: string
service:
required: true
type: string
tag:
default: "comps"
required: false
type: string
build:
default: true
required: false
type: boolean
test:
default: true
description: "Test comps with docker compose"
required: false
type: boolean
mode:
default: "CD"
description: "Whether the test range is CI or CD"
required: false
type: string
jobs:
####################################################################################################
# Image Build
####################################################################################################
build-images:
runs-on: "docker-build-${{ inputs.node }}"
continue-on-error: true
outputs:
file_exists: ${{ steps.get-yaml-path.outputs.file_exists }}
steps:
- name: Clean Up Working Directory
run: sudo rm -rf ${{github.workspace}}/*
- name: Checkout out Repo
uses: actions/checkout@v4
- name: Clone required Repo
id: get-yaml-path
run: |
cd ${{ github.workspace }}/.github/workflows/docker/compose
# service=$(echo ${{ inputs.service }} | cut -d'_' -f1)
if [[ "${{ inputs.mode }}" == "CD" ]]; then
docker_compose_yml=${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose-cd.yaml
else
docker_compose_yml=${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose.yaml
fi
echo "docker_compose_path=${docker_compose_yml}" >> $GITHUB_OUTPUT
if [ -f "$docker_compose_yml" ]; then
echo "file_exists=true" >> $GITHUB_OUTPUT
else
echo "There is no ${{ inputs.mode }} part of ${{ inputs.service }} that needs to be executed."
echo "file_exists=false" >> $GITHUB_OUTPUT
fi
if [[ $(grep -c "llava-tgi:" ${docker_compose_yml}) != 0 ]]; then
git clone https://github.com/yuanwu2017/tgi-gaudi.git && cd tgi-gaudi && git checkout v2.0.4
fi
if [[ $(grep -c "vllm-openvino:" ${docker_compose_yml}) != 0 ]]; then
git clone https://github.com/vllm-project/vllm.git vllm-openvino
fi
- name: Build Image
if: ${{ fromJSON(inputs.build) && steps.get-yaml-path.outputs.file_exists == 'true' }}
uses: opea-project/validation/actions/image-build@main
with:
work_dir: ${{ github.workspace }}
docker_compose_path: ${{ steps.get-yaml-path.outputs.docker_compose_path }}
registry: ${OPEA_IMAGE_REPO}opea
tag: ${{ inputs.tag }}
####################################################################################################
# Docker Compose Test
####################################################################################################
test-service-compose:
needs: [build-images]
if: ${{ fromJSON(inputs.test) && needs.build-images.outputs.file_exists == 'true' }}
uses: ./.github/workflows/_run-docker-compose.yml
with:
tag: ${{ inputs.tag }}
service: ${{ inputs.service }}
hardware: ${{ inputs.node }}
secrets: inherit