Skip to content

Commit

Permalink
Fix dockerfile check logical (#671)
Browse files Browse the repository at this point in the history
Signed-off-by: chensuyue <[email protected]>
Signed-off-by: ZePan110 <[email protected]>
  • Loading branch information
ZePan110 authored Sep 11, 2024
1 parent 1b69897 commit 887ca75
Show file tree
Hide file tree
Showing 12 changed files with 78 additions and 94 deletions.
4 changes: 0 additions & 4 deletions .github/workflows/docker/compose/dataprep-compose-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -23,10 +23,6 @@ services:
build:
dockerfile: comps/dataprep/multimodal/redis/langchain/Dockerfile
image: ${REGISTRY:-opea}/dataprep-redis:${TAG:-latest}
dataprep-vdms:
build:
dockerfile: comps/dataprep/vdms/multimodal_langchain/Dockerfile
image: ${REGISTRY:-opea}/dataprep-vdms:${TAG:-latest}
dataprep-vdmsxx: #need to rename
build:
dockerfile: comps/dataprep/vdms/langchain/Dockerfile
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/docker/compose/dataprep-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,7 @@ services:
build:
dockerfile: comps/dataprep/redis/langchain_ray/Dockerfile
image: ${REGISTRY:-opea}/dataprep-on-ray-redis:${TAG:-latest}
dataprep-vdms:
build:
dockerfile: comps/dataprep/vdms/multimodal_langchain/Dockerfile
image: ${REGISTRY:-opea}/dataprep-vdms:${TAG:-latest}
4 changes: 0 additions & 4 deletions .github/workflows/docker/compose/embeddings-compose-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,6 @@ services:
build:
dockerfile: comps/embeddings/tei/llama_index/Dockerfile
image: ${REGISTRY:-opea}/embedding-tei-llama-index:${TAG:-latest}
embedding-multimodal:
build:
dockerfile: comps/embeddings/multimodal_clip/Dockerfile
image: ${REGISTRY:-opea}/embedding-multimodal:${TAG:-latest}
bridgetower-embedder:
build:
dockerfile: comps/embeddings/multimodal/bridgetower/Dockerfile
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/docker/compose/embeddings-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ services:
build:
dockerfile: comps/embeddings/tei/langchain/Dockerfile
image: ${REGISTRY:-opea}/embedding-tei:${TAG:-latest}
embedding-multimodal:
build:
dockerfile: comps/embeddings/multimodal_clip/Dockerfile
image: ${REGISTRY:-opea}/embedding-multimodal:${TAG:-latest}
8 changes: 0 additions & 8 deletions .github/workflows/docker/compose/lvms-compose-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,3 @@ services:
build:
dockerfile: comps/lvms/llava/dependency/Dockerfile.intel_hpu
image: ${REGISTRY:-opea}/llava-hpu:${TAG:-latest}
lvm-video-llama:
build:
dockerfile: comps/lvms/video-llama/Dockerfile
image: ${REGISTRY:-opea}/lvm-video-llama:${TAG:-latest}
video-llama-lvm-server:
build:
dockerfile: comps/lvms/video-llama/dependency/Dockerfile
image: ${REGISTRY:-opea}/video-llama-lvm-server:${TAG:-latest}
8 changes: 8 additions & 0 deletions .github/workflows/docker/compose/lvms-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,11 @@ services:
build:
dockerfile: comps/lvms/tgi-llava/Dockerfile
image: ${REGISTRY:-opea}/lvm-tgi:${TAG:-latest}
lvm-video-llama:
build:
dockerfile: comps/lvms/video-llama/Dockerfile
image: ${REGISTRY:-opea}/lvm-video-llama:${TAG:-latest}
video-llama-lvm-server:
build:
dockerfile: comps/lvms/video-llama/dependency/Dockerfile
image: ${REGISTRY:-opea}/video-llama-lvm-server:${TAG:-latest}
4 changes: 0 additions & 4 deletions .github/workflows/docker/compose/reranks-compose-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,3 @@ services:
build:
dockerfile: comps/reranks/mosec/langchain/Dockerfile
image: ${REGISTRY:-opea}/reranking-langchain-mosec:${TAG:-latest}
reranking-videoragqna:
build:
dockerfile: comps/reranks/video-rag-qna/Dockerfile
image: ${REGISTRY:-opea}/reranking-videoragqna:${TAG:-latest}
4 changes: 4 additions & 0 deletions .github/workflows/docker/compose/reranks-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,7 @@ services:
build:
dockerfile: comps/reranks/tei/Dockerfile
image: ${REGISTRY:-opea}/reranking-tei:${TAG:-latest}
reranking-videoragqna:
build:
dockerfile: comps/reranks/video-rag-qna/Dockerfile
image: ${REGISTRY:-opea}/reranking-videoragqna:${TAG:-latest}
4 changes: 0 additions & 4 deletions .github/workflows/docker/compose/retrievers-compose-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,3 @@ services:
build:
dockerfile: comps/retrievers/multimodal/redis/langchain/Dockerfile
image: ${REGISTRY:-opea}/multimodal-retriever-redis:${TAG:-latest}
retriever-vdms:
build:
dockerfile: comps/retrievers/vdms/langchain/Dockerfile
image: ${REGISTRY:-opea}/retriever-vdms:${TAG:-latest}
4 changes: 4 additions & 0 deletions .github/workflows/docker/compose/retrievers-compose.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,7 @@ services:
build:
dockerfile: comps/retrievers/qdrant/haystack/Dockerfile
image: ${REGISTRY:-opea}/retriever-qdrant:${TAG:-latest}
retriever-vdms:
build:
dockerfile: comps/retrievers/vdms/langchain/Dockerfile
image: ${REGISTRY:-opea}/retriever-vdms:${TAG:-latest}
10 changes: 0 additions & 10 deletions .github/workflows/docker/compose/tts-compose-cd.yaml

This file was deleted.

114 changes: 54 additions & 60 deletions .github/workflows/pr-dockerfile-path-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -56,66 +56,60 @@ jobs:
exit 1
fi
# - name: Check all Dockerfile mode and if it exists in yaml
# if: always()
# run: |
# set -e
# shopt -s globstar
# no_add="FALSE"
# cd ${{github.workspace}}
# Dockerfiles=$(find ./comps -name '*Dockerfile*'|sed 's/^\.\///')
# if [ -n "$Dockerfiles" ]; then
# for Dockerfile in $Dockerfiles; do
# service=$(echo "$Dockerfile" | awk -F '/' '{print $2}')
# if grep -q "$Dockerfile" ../GenAIExamples/**/*build.yaml*; then
# mode="" #CI
# else
# mode="-cd" #CD
# fi
#
# yaml_file=${{github.workspace}}/.github/workflows/docker/compose/$service'-compose'$mode'.yaml'
# if [ -e "$yaml_file" ]; then
# # check service yaml if exist
# if ! grep -q "$Dockerfile" "$yaml_file"; then
# echo "AR: Update $Dockerfile to .github/workflows/docker/compose/"$service"-compose"$mode".yaml."
# no_add="TRUE"
# fi
# else
# echo "AR: Create a new compose file .github/workflows/docker/compose/"$service"-compose"$mode".yaml for $Dockerfile and fill it in."
# no_add="TRUE"
# fi
# done
# fi
#
# if [[ "$no_add" == "TRUE" ]]; then
# exit 1
# fi
#
# - name: Check for the exist of Dockerfile in all yamls.
# if: always()
# run: |
# shopt -s globstar
# no_exist="FALSE"
# cd ${{github.workspace}}
# yamls=$(find .github/workflows/docker/compose/ -name '*.yaml')
# if [ -n "$yamls" ]; then
# for yaml in $yamls; do
# dockerfiles=$(grep 'dockerfile:' "$yaml"|sed 's/dockerfile: //')
# for dockerfile in $dockerfiles; do
# if [[ "$dockerfile" == *"comps/"* ]]; then
# if ! [ -e "$dockerfile" ]; then
# # cat "$yaml"
# echo "AR: The dockerfile path "$dockerfile" in "$yaml" does not exist, remove or update it."
# no_exist="TRUE"
# fi
# fi
# done
# done
# fi
#
# if [[ "$no_exist" == "TRUE" ]]; then
# exit 1
# fi
- name: Check Dockerfile path included in image build yaml
if: always()
run: |
set -e
shopt -s globstar
no_add="FALSE"
cd ${{github.workspace}}
Dockerfiles=$(find ./comps -name '*Dockerfile*'|sed 's/^\.\///')
if [ -n "$Dockerfiles" ]; then
for Dockerfile in $Dockerfiles; do
service=$(echo "$Dockerfile" | awk -F '/' '{print $2}')
if grep -q "$Dockerfile" ../GenAIExamples/**/*build.yaml*; then
mode="" #CI
else
mode="-cd" #CD
fi
yaml_file=${{github.workspace}}/.github/workflows/docker/compose/"$service"-compose
if ! grep -q "$Dockerfile" "$yaml_file"*yaml; then
echo "AR: Update $Dockerfile to .github/workflows/docker/compose/"$service"-compose"$mode".yaml."
no_add="TRUE"
fi
done
fi
if [[ "$no_add" == "TRUE" ]]; then
exit 1
fi
- name: Check Dockerfile inside image build yaml exist in code
if: always()
run: |
shopt -s globstar
no_exist="FALSE"
cd ${{github.workspace}}
yamls=$(find .github/workflows/docker/compose/ -name '*.yaml')
if [ -n "$yamls" ]; then
for yaml in $yamls; do
dockerfiles=$(grep 'dockerfile:' "$yaml"|sed 's/dockerfile: //')
for dockerfile in $dockerfiles; do
if [[ "$dockerfile" == *"comps/"* ]]; then
if ! [ -e "$dockerfile" ]; then
# cat "$yaml"
echo "AR: The dockerfile path "$dockerfile" in "$yaml" does not exist, remove or update it."
no_exist="TRUE"
fi
fi
done
done
fi
if [[ "$no_exist" == "TRUE" ]]; then
exit 1
fi
Dockerfile-path-change-detection-in-GenAIExamples:
runs-on: ubuntu-latest
Expand Down

0 comments on commit 887ca75

Please sign in to comment.