From 364a70e6335a33e5a75167fc7aa4443d235b4c37 Mon Sep 17 00:00:00 2001 From: ZePan110 Date: Wed, 4 Sep 2024 18:29:50 +0800 Subject: [PATCH 1/7] test Signed-off-by: ZePan110 --- Dockerfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 Dockerfile diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..e69de29bb2 From 36e4687b66c53356d3ef1c824a51328288e8e1cb Mon Sep 17 00:00:00 2001 From: ZePan110 Date: Wed, 4 Sep 2024 18:38:32 +0800 Subject: [PATCH 2/7] test2 Signed-off-by: ZePan110 --- comps/Dockerfile | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 comps/Dockerfile diff --git a/comps/Dockerfile b/comps/Dockerfile new file mode 100644 index 0000000000..e69de29bb2 From dc9958fdf1018652bfaf84948d701d080635a557 Mon Sep 17 00:00:00 2001 From: ZePan110 Date: Wed, 4 Sep 2024 19:05:13 +0800 Subject: [PATCH 3/7] ADD Dockerfile addition detection in GenAIComps Signed-off-by: ZePan110 --- .../workflows/pr-dockerfile-path-scan.yaml | 32 +++++++++++++++++++ comps/XXCCSS/Dockerfile | 0 comps/llms/Dockerfile | 0 3 files changed, 32 insertions(+) create mode 100644 comps/XXCCSS/Dockerfile create mode 100644 comps/llms/Dockerfile diff --git a/.github/workflows/pr-dockerfile-path-scan.yaml b/.github/workflows/pr-dockerfile-path-scan.yaml index b5e1ce753f..674e7ed597 100644 --- a/.github/workflows/pr-dockerfile-path-scan.yaml +++ b/.github/workflows/pr-dockerfile-path-scan.yaml @@ -118,3 +118,35 @@ jobs: echo "Please modify the corresponding README in GenAIExamples repo and ask suyue.chen@intel.com for final confirmation." exit 1 fi + + Dockerfile-addition-detection-in-GenAIComps: + runs-on: ubuntu-latest + steps: + - name: Clean Up Working Directory + run: sudo rm -rf ${{github.workspace}}/* + + - name: Checkout code + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check if the Dockerfile has been added + run: | + set -e + shopt -s globstar + cd ${{github.workspace}} + is_use="FALSE" + used_files="" + merged_commit=$(git log -1 --format='%H') + changed_files="$(git diff --name-status --diff-filter=A ${{ github.event.pull_request.base.sha }} ${merged_commit} -- '**/Dockerfile**' | cut -f2)" + if [ -n "$changed_files" ]; then + for file in $changed_files; do + echo '$(echo "$file" | awk -F '/' '{print $2}')' + if grep -rl '$(echo "$file" | awk -F '/' '{print $2}')' ".github/workflows/docker/compose/"; then + echo "Please check if the added $file is included in the yaml under path ${{github.workspace}}.github/workflows/docker/compose/." + else + echo "Please create a new compose file named service_name-compose-cd.yaml in ${{github.workspace}}.github/workflows/docker/compose/ and fill it in." + fi + done + exit 1 + fi diff --git a/comps/XXCCSS/Dockerfile b/comps/XXCCSS/Dockerfile new file mode 100644 index 0000000000..e69de29bb2 diff --git a/comps/llms/Dockerfile b/comps/llms/Dockerfile new file mode 100644 index 0000000000..e69de29bb2 From f7266b532472b1ca4ef47843934f78de2539b183 Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Wed, 4 Sep 2024 03:11:15 +0000 Subject: [PATCH 4/7] [pre-commit.ci] auto fixes from pre-commit.com hooks for more information, see https://pre-commit.ci --- Dockerfile | 3 +++ comps/Dockerfile | 3 +++ comps/XXCCSS/Dockerfile | 3 +++ comps/llms/Dockerfile | 3 +++ 4 files changed, 12 insertions(+) diff --git a/Dockerfile b/Dockerfile index e69de29bb2..dc52a20f99 100644 --- a/Dockerfile +++ b/Dockerfile @@ -0,0 +1,3 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + diff --git a/comps/Dockerfile b/comps/Dockerfile index e69de29bb2..dc52a20f99 100644 --- a/comps/Dockerfile +++ b/comps/Dockerfile @@ -0,0 +1,3 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + diff --git a/comps/XXCCSS/Dockerfile b/comps/XXCCSS/Dockerfile index e69de29bb2..dc52a20f99 100644 --- a/comps/XXCCSS/Dockerfile +++ b/comps/XXCCSS/Dockerfile @@ -0,0 +1,3 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + diff --git a/comps/llms/Dockerfile b/comps/llms/Dockerfile index e69de29bb2..dc52a20f99 100644 --- a/comps/llms/Dockerfile +++ b/comps/llms/Dockerfile @@ -0,0 +1,3 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + From aa91282fffe7ec34ee3f265621917dc6d38afa5a Mon Sep 17 00:00:00 2001 From: ZePan110 Date: Wed, 4 Sep 2024 19:11:08 +0800 Subject: [PATCH 5/7] Fix issue. Signed-off-by: ZePan110 --- .github/workflows/pr-dockerfile-path-scan.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-dockerfile-path-scan.yaml b/.github/workflows/pr-dockerfile-path-scan.yaml index 674e7ed597..694807ce08 100644 --- a/.github/workflows/pr-dockerfile-path-scan.yaml +++ b/.github/workflows/pr-dockerfile-path-scan.yaml @@ -141,11 +141,12 @@ jobs: changed_files="$(git diff --name-status --diff-filter=A ${{ github.event.pull_request.base.sha }} ${merged_commit} -- '**/Dockerfile**' | cut -f2)" if [ -n "$changed_files" ]; then for file in $changed_files; do - echo '$(echo "$file" | awk -F '/' '{print $2}')' - if grep -rl '$(echo "$file" | awk -F '/' '{print $2}')' ".github/workflows/docker/compose/"; then + echo "$file" + echo "$(echo "$file" | awk -F '/' '{print $2}')" + if grep -rl "$(echo "$file" | awk -F '/' '{print $2}')" ".github/workflows/docker/compose/"; then echo "Please check if the added $file is included in the yaml under path ${{github.workspace}}.github/workflows/docker/compose/." else - echo "Please create a new compose file named service_name-compose-cd.yaml in ${{github.workspace}}.github/workflows/docker/compose/ and fill it in." + echo "Please create a new compose file named service_name-compose-cd.yaml in ${{github.workspace}}.github/workflows/docker/compose/ for $file and fill it in." fi done exit 1 From bc8eb45f91c9bc800e383c54ce88fed1bf8a9f0d Mon Sep 17 00:00:00 2001 From: ZePan110 Date: Wed, 4 Sep 2024 21:21:28 +0800 Subject: [PATCH 6/7] Fix issus. Signed-off-by: ZePan110 --- .github/workflows/pr-dockerfile-path-scan.yaml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/pr-dockerfile-path-scan.yaml b/.github/workflows/pr-dockerfile-path-scan.yaml index 694807ce08..c655dc9e5e 100644 --- a/.github/workflows/pr-dockerfile-path-scan.yaml +++ b/.github/workflows/pr-dockerfile-path-scan.yaml @@ -143,10 +143,11 @@ jobs: for file in $changed_files; do echo "$file" echo "$(echo "$file" | awk -F '/' '{print $2}')" - if grep -rl "$(echo "$file" | awk -F '/' '{print $2}')" ".github/workflows/docker/compose/"; then - echo "Please check if the added $file is included in the yaml under path ${{github.workspace}}.github/workflows/docker/compose/." + # if grep -rl "$(echo "$file" | awk -F '/' '{print $2}')" "${{github.workspace}}/.github/workflows/docker/compose/"; then + if find "${{github.workspace}}/.github/workflows/docker/compose/" -name "*$(echo "$file" | awk -F '/' '{print $2}')*" |grep -q .; then + echo "Please check if the added $file is included in the yaml under path ${{github.workspace}}/.github/workflows/docker/compose/." else - echo "Please create a new compose file named service_name-compose-cd.yaml in ${{github.workspace}}.github/workflows/docker/compose/ for $file and fill it in." + echo "Please create a new compose file named service_name-compose-cd.yaml in ${{github.workspace}}/.github/workflows/docker/compose/ for $file and fill it in." fi done exit 1 From a3caf4b3b180e7dfbbfd33de1b9285d84bc18319 Mon Sep 17 00:00:00 2001 From: ZePan110 Date: Wed, 4 Sep 2024 21:35:54 +0800 Subject: [PATCH 7/7] Remove test file. Signed-off-by: ZePan110 --- .github/workflows/pr-dockerfile-path-scan.yaml | 3 --- Dockerfile | 3 --- comps/Dockerfile | 3 --- comps/XXCCSS/Dockerfile | 3 --- comps/llms/Dockerfile | 3 --- 5 files changed, 15 deletions(-) delete mode 100644 Dockerfile delete mode 100644 comps/Dockerfile delete mode 100644 comps/XXCCSS/Dockerfile delete mode 100644 comps/llms/Dockerfile diff --git a/.github/workflows/pr-dockerfile-path-scan.yaml b/.github/workflows/pr-dockerfile-path-scan.yaml index c655dc9e5e..6fa00a3973 100644 --- a/.github/workflows/pr-dockerfile-path-scan.yaml +++ b/.github/workflows/pr-dockerfile-path-scan.yaml @@ -141,9 +141,6 @@ jobs: changed_files="$(git diff --name-status --diff-filter=A ${{ github.event.pull_request.base.sha }} ${merged_commit} -- '**/Dockerfile**' | cut -f2)" if [ -n "$changed_files" ]; then for file in $changed_files; do - echo "$file" - echo "$(echo "$file" | awk -F '/' '{print $2}')" - # if grep -rl "$(echo "$file" | awk -F '/' '{print $2}')" "${{github.workspace}}/.github/workflows/docker/compose/"; then if find "${{github.workspace}}/.github/workflows/docker/compose/" -name "*$(echo "$file" | awk -F '/' '{print $2}')*" |grep -q .; then echo "Please check if the added $file is included in the yaml under path ${{github.workspace}}/.github/workflows/docker/compose/." else diff --git a/Dockerfile b/Dockerfile deleted file mode 100644 index dc52a20f99..0000000000 --- a/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - diff --git a/comps/Dockerfile b/comps/Dockerfile deleted file mode 100644 index dc52a20f99..0000000000 --- a/comps/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - diff --git a/comps/XXCCSS/Dockerfile b/comps/XXCCSS/Dockerfile deleted file mode 100644 index dc52a20f99..0000000000 --- a/comps/XXCCSS/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 - diff --git a/comps/llms/Dockerfile b/comps/llms/Dockerfile deleted file mode 100644 index dc52a20f99..0000000000 --- a/comps/llms/Dockerfile +++ /dev/null @@ -1,3 +0,0 @@ -# Copyright (C) 2024 Intel Corporation -# SPDX-License-Identifier: Apache-2.0 -