diff --git a/.github/workflows/_comps-workflow.yml b/.github/workflows/_comps-workflow.yml index c2a68b0ca..3a7591de0 100644 --- a/.github/workflows/_comps-workflow.yml +++ b/.github/workflows/_comps-workflow.yml @@ -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}}/* @@ -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 @@ -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 }} @@ -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 }} diff --git a/comps/nginx/README.md b/comps/nginx/README.md index 416b9b2e1..cae340331 100644 --- a/comps/nginx/README.md +++ b/comps/nginx/README.md @@ -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