Skip to content

Commit 12fd97a

Browse files
authored
Bug fix (#591)
* Check if the document exists. Signed-off-by: zepan <[email protected]> * Add flag output. Signed-off-by: zepan <[email protected]> * Modify nginx readme. Signed-off-by: zepan <[email protected]> * Modify document detection logic Signed-off-by: zepan <[email protected]> --------- Signed-off-by: zepan <[email protected]>
1 parent d609071 commit 12fd97a

File tree

2 files changed

+21
-6
lines changed

2 files changed

+21
-6
lines changed

.github/workflows/_comps-workflow.yml

Lines changed: 19 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ jobs:
3838
build-images:
3939
runs-on: "docker-build-${{ inputs.node }}"
4040
continue-on-error: true
41+
outputs:
42+
file_exists: ${{ steps.get-yaml-path.outputs.file_exists }}
4143
steps:
4244
- name: Clean Up Working Directory
4345
run: sudo rm -rf ${{github.workspace}}/*
@@ -51,10 +53,23 @@ jobs:
5153
cd ${{ github.workspace }}/.github/workflows/docker/compose
5254
# service=$(echo ${{ inputs.service }} | cut -d'_' -f1)
5355
if [[ "${{ inputs.mode }}" == "CD" ]]; then
54-
docker_compose_yml=${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose-cd.yaml
56+
if [ -f "${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose-cd.yaml" ]; then
57+
docker_compose_yml=${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose-cd.yaml
58+
echo "file_exists=true" >> $GITHUB_OUTPUT
59+
else
60+
echo "There is no CD part of ${{ inputs.service }} that needs to be executed."
61+
echo "file_exists=false" >> $GITHUB_OUTPUT
62+
fi
5563
else
56-
docker_compose_yml=${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose.yaml
64+
if [ -f "${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose.yaml" ]; then
65+
docker_compose_yml=${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose.yaml
66+
echo "file_exists=true" >> $GITHUB_OUTPUT
67+
else
68+
echo "There is no CI part of ${{ inputs.service }} that needs to be executed."
69+
echo "file_exists=false" >> $GITHUB_OUTPUT
70+
fi
5771
fi
72+
5873
echo "docker_compose_path=${docker_compose_yml}" >> $GITHUB_OUTPUT
5974
if [[ $(grep -c "llava-tgi:" ${docker_compose_yml}) != 0 ]]; then
6075
git clone https://github.com/yuanwu2017/tgi-gaudi.git && cd tgi-gaudi && git checkout v2.0.4
@@ -64,7 +79,7 @@ jobs:
6479
fi
6580
6681
- name: Build Image
67-
if: ${{ fromJSON(inputs.build) }}
82+
if: ${{ fromJSON(inputs.build) && steps.get-yaml-path.outputs.file_exists == 'true' }}
6883
uses: opea-project/validation/actions/image-build@main
6984
with:
7085
work_dir: ${{ github.workspace }}
@@ -77,7 +92,7 @@ jobs:
7792
####################################################################################################
7893
test-service-compose:
7994
needs: [build-images]
80-
if: ${{ fromJSON(inputs.test) }}
95+
if: ${{ fromJSON(inputs.test) && needs.build-images.outputs.file_exists == 'true' }}
8196
uses: ./.github/workflows/_run-docker-compose.yml
8297
with:
8398
tag: ${{ inputs.tag }}

comps/nginx/README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ In GenAIComps, we utilize nginx to streamline our network services. We provide a
77
## 🚀1. Build Docker Image
88

99
```bash
10-
cd docker
11-
docker build -t opea/nginx:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f ./Dockerfile .
10+
cd ../..
11+
docker build -t opea/nginx:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/nginx/docker/Dockerfile .
1212
```
1313

1414
## 🚀2. Environment Settings

0 commit comments

Comments
 (0)