Skip to content

Commit

Permalink
Bug fix (opea-project#591)
Browse files Browse the repository at this point in the history
* 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]>
  • Loading branch information
ZePan110 authored Sep 3, 2024
1 parent d609071 commit 12fd97a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 6 deletions.
23 changes: 19 additions & 4 deletions .github/workflows/_comps-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ jobs:
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}}/*
Expand All @@ -51,10 +53,23 @@ jobs:
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
if [ -f "${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose-cd.yaml" ]; then
docker_compose_yml=${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose-cd.yaml
echo "file_exists=true" >> $GITHUB_OUTPUT
else
echo "There is no CD part of ${{ inputs.service }} that needs to be executed."
echo "file_exists=false" >> $GITHUB_OUTPUT
fi
else
docker_compose_yml=${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose.yaml
if [ -f "${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose.yaml" ]; then
docker_compose_yml=${{ github.workspace }}/.github/workflows/docker/compose/${{ inputs.service }}-compose.yaml
echo "file_exists=true" >> $GITHUB_OUTPUT
else
echo "There is no CI part of ${{ inputs.service }} that needs to be executed."
echo "file_exists=false" >> $GITHUB_OUTPUT
fi
fi
echo "docker_compose_path=${docker_compose_yml}" >> $GITHUB_OUTPUT
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
Expand All @@ -64,7 +79,7 @@ jobs:
fi
- name: Build Image
if: ${{ fromJSON(inputs.build) }}
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 }}
Expand All @@ -77,7 +92,7 @@ jobs:
####################################################################################################
test-service-compose:
needs: [build-images]
if: ${{ fromJSON(inputs.test) }}
if: ${{ fromJSON(inputs.test) && needs.build-images.outputs.file_exists == 'true' }}
uses: ./.github/workflows/_run-docker-compose.yml
with:
tag: ${{ inputs.tag }}
Expand Down
4 changes: 2 additions & 2 deletions comps/nginx/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ In GenAIComps, we utilize nginx to streamline our network services. We provide a
## 🚀1. Build Docker Image

```bash
cd docker
docker build -t opea/nginx:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f ./Dockerfile .
cd ../..
docker build -t opea/nginx:latest --build-arg https_proxy=$https_proxy --build-arg http_proxy=$http_proxy -f comps/nginx/docker/Dockerfile .
```

## 🚀2. Environment Settings
Expand Down

0 comments on commit 12fd97a

Please sign in to comment.