Skip to content

Commit e4de76d

Browse files
authored
Use model cache for docker compose test (opea-project#1582)
Signed-off-by: ZePan110 <[email protected]>
1 parent ce38a84 commit e4de76d

File tree

28 files changed

+61
-31
lines changed

28 files changed

+61
-31
lines changed

.github/workflows/_example-workflow.yml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,11 @@ on:
4343
inject_commit:
4444
default: false
4545
required: false
46-
type: string
46+
type: boolean
47+
use_model_cache:
48+
default: false
49+
required: false
50+
type: boolean
4751

4852
jobs:
4953
####################################################################################################
@@ -110,6 +114,7 @@ jobs:
110114
tag: ${{ inputs.tag }}
111115
example: ${{ inputs.example }}
112116
hardware: ${{ inputs.node }}
117+
use_model_cache: ${{ inputs.use_model_cache }}
113118
secrets: inherit
114119

115120

@@ -131,7 +136,7 @@ jobs:
131136
####################################################################################################
132137
test-gmc-pipeline:
133138
needs: [build-images]
134-
if: ${{ fromJSON(inputs.test_gmc) }}
139+
if: false # ${{ fromJSON(inputs.test_gmc) }}
135140
uses: ./.github/workflows/_gmc-e2e.yml
136141
with:
137142
example: ${{ inputs.example }}

.github/workflows/_run-docker-compose.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ on:
2828
required: false
2929
type: string
3030
default: ""
31+
use_model_cache:
32+
required: false
33+
type: boolean
34+
default: false
3135
jobs:
3236
get-test-case:
3337
runs-on: ubuntu-latest
@@ -144,9 +148,11 @@ jobs:
144148
example: ${{ inputs.example }}
145149
hardware: ${{ inputs.hardware }}
146150
test_case: ${{ matrix.test_case }}
151+
use_model_cache: ${{ inputs.use_model_cache }}
147152
run: |
148153
cd ${{ github.workspace }}/$example/tests
149154
if [[ "$IMAGE_REPO" == "" ]]; then export IMAGE_REPO="${OPEA_IMAGE_REPO}opea"; fi
155+
if [[ "$use_model_cache" == "true" ]]; then export model_cache="/data2/hf_model"; fi
150156
if [ -f ${test_case} ]; then timeout 30m bash ${test_case}; else echo "Test script {${test_case}} not found, skip test!"; fi
151157
152158
- name: Clean up container after test

.github/workflows/manual-example-workflow.yml

Lines changed: 21 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ on:
2020
description: "Tag to apply to images"
2121
required: true
2222
type: string
23-
deploy_gmc:
24-
default: false
25-
description: 'Whether to deploy gmc'
26-
required: true
27-
type: boolean
23+
# deploy_gmc:
24+
# default: false
25+
# description: 'Whether to deploy gmc'
26+
# required: true
27+
# type: boolean
2828
build:
2929
default: true
3030
description: 'Build test required images for Examples'
@@ -40,11 +40,11 @@ on:
4040
description: 'Test examples with helm charts'
4141
required: false
4242
type: boolean
43-
test_gmc:
44-
default: false
45-
description: 'Test examples with gmc'
46-
required: false
47-
type: boolean
43+
# test_gmc:
44+
# default: false
45+
# description: 'Test examples with gmc'
46+
# required: false
47+
# type: boolean
4848
opea_branch:
4949
default: "main"
5050
description: 'OPEA branch for image build'
@@ -54,7 +54,12 @@ on:
5454
default: false
5555
description: "inject commit to docker images true or false"
5656
required: false
57-
type: string
57+
type: boolean
58+
use_model_cache:
59+
default: false
60+
description: "use model cache true or false"
61+
required: false
62+
type: boolean
5863

5964
permissions: read-all
6065
jobs:
@@ -76,7 +81,8 @@ jobs:
7681
7782
build-deploy-gmc:
7883
needs: [get-test-matrix]
79-
if: ${{ fromJSON(inputs.deploy_gmc) }}
84+
if: false
85+
#${{ fromJSON(inputs.deploy_gmc) }}
8086
strategy:
8187
matrix:
8288
node: ${{ fromJson(needs.get-test-matrix.outputs.nodes) }}
@@ -89,7 +95,7 @@ jobs:
8995
secrets: inherit
9096

9197
run-examples:
92-
needs: [get-test-matrix, build-deploy-gmc]
98+
needs: [get-test-matrix] #[get-test-matrix, build-deploy-gmc]
9399
if: always()
94100
strategy:
95101
matrix:
@@ -104,7 +110,8 @@ jobs:
104110
build: ${{ fromJSON(inputs.build) }}
105111
test_compose: ${{ fromJSON(inputs.test_compose) }}
106112
test_helmchart: ${{ fromJSON(inputs.test_helmchart) }}
107-
test_gmc: ${{ fromJSON(inputs.test_gmc) }}
113+
# test_gmc: ${{ fromJSON(inputs.test_gmc) }}
108114
opea_branch: ${{ inputs.opea_branch }}
109115
inject_commit: ${{ inputs.inject_commit }}
116+
use_model_cache: ${{ inputs.use_model_cache }}
110117
secrets: inherit

.github/workflows/pr-docker-compose-e2e.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,5 +42,6 @@ jobs:
4242
tag: "ci"
4343
example: ${{ matrix.example }}
4444
hardware: ${{ matrix.hardware }}
45+
use_model_cache: true
4546
diff_excluded_files: '\.github|\.md|\.txt|kubernetes|gmc|assets|benchmark'
4647
secrets: inherit

AudioQnA/docker_compose/intel/cpu/xeon/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ services:
3030
ports:
3131
- "3006:80"
3232
volumes:
33-
- "./data:/data"
33+
- "${MODEL_CACHE}:/data"
3434
shm_size: 1g
3535
environment:
3636
no_proxy: ${no_proxy}

AudioQnA/docker_compose/intel/cpu/xeon/compose_multilang.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ services:
3131
ports:
3232
- "3006:80"
3333
volumes:
34-
- "./data:/data"
34+
- "${MODEL_CACHE}:/data"
3535
shm_size: 1g
3636
environment:
3737
no_proxy: ${no_proxy}

AudioQnA/docker_compose/intel/hpu/gaudi/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ services:
4040
ports:
4141
- "3006:80"
4242
volumes:
43-
- "./data:/data"
43+
- "${MODEL_CACHE}:/data"
4444
environment:
4545
no_proxy: ${no_proxy}
4646
http_proxy: ${http_proxy}

AudioQnA/tests/test_compose_on_gaudi.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
99
echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
1010
export REGISTRY=${IMAGE_REPO}
1111
export TAG=${IMAGE_TAG}
12+
export MODEL_CACHE=${model_cache:-"./data"}
1213

1314
WORKPATH=$(dirname "$PWD")
1415
LOG_PATH="$WORKPATH/tests"

AudioQnA/tests/test_compose_on_xeon.sh

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ echo "REGISTRY=IMAGE_REPO=${IMAGE_REPO}"
99
echo "TAG=IMAGE_TAG=${IMAGE_TAG}"
1010
export REGISTRY=${IMAGE_REPO}
1111
export TAG=${IMAGE_TAG}
12+
export MODEL_CACHE=${model_cache:-"./data"}
1213

1314
WORKPATH=$(dirname "$PWD")
1415
LOG_PATH="$WORKPATH/tests"

DBQnA/docker_compose/intel/cpu/xeon/compose.yaml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ services:
88
ports:
99
- "8008:80"
1010
volumes:
11-
- "./data:/data"
11+
- "${MODEL_CACHE}:/data"
1212
environment:
1313
no_proxy: ${no_proxy}
1414
http_proxy: ${http_proxy}

0 commit comments

Comments
 (0)