Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions .github/workflows/mix-code-scan.yml
Original file line number Diff line number Diff line change
Expand Up @@ -64,3 +64,35 @@ jobs:
with:
name: ${{ matrix.job_name }}
path: ${{ github.workspace }}/.github/workflows/scripts/codeScan/${{ matrix.job_name }}.*

shell-check:
runs-on: ubuntu-latest
permissions:
security-events: write
actions: read
contents: read
steps:
- name: Repository checkout
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Get changed shell files
id: get-changed-files
run: |
base_commit="${{ github.event.pull_request.base.sha }}"
merged_commit="${{ github.sha }}"
echo "base_commit=${base_commit}" >> $GITHUB_ENV
echo "merged_commit=${merged_commit}" >> $GITHUB_ENV
changed_files="$(git diff --name-only --diff-filter=AM ${base_commit} ${merged_commit} | grep -E '\.sh$' | tr '\n' ' ')" || true
echo "changed_files=${changed_files}"
echo "changed_files=${changed_files}" >> $GITHUB_ENV

- name: ShellCheck
if: ${{ env.changed_files != '' }}
uses: ludeeus/[email protected]
env:
SHELLCHECK_OPTS: -e SC2164 -e SC2154 -e SC2034 -e SC2155 -e SC1090 -e SC2046 -e SC2043 -e SC2206 -e SC2128 -e SC1078 -e SC2068 -e SC2089 -e SC2090 -e SC2140 -e SC2010 -e SC2061 -e SC2309
with:
path: ${{ env.changed_files }}
severity: warning
6 changes: 3 additions & 3 deletions .github/workflows/scripts/freeze_images.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,9 @@ function replace_image_version() {
echo "version is empty"
else
echo "replace $repo_image:latest with $repo_image:$version"
find . -name "Dockerfile*" | xargs sed -i "s|$repo_image:latest[A-Za-z0-9\-]*|$repo_image:$version|g"
find . -name "*.yaml" | xargs sed -i "s|$repo_image:latest[A-Za-z0-9\-]*|$repo_image:$version|g"
find . -name "*.md" | xargs sed -i "s|$repo_image:latest[A-Za-z0-9\-]*|$repo_image:$version|g"
find . -name "Dockerfile*" -print0 | xargs -0 sed -i "s|$repo_image:latest[A-Za-z0-9\-]*|$repo_image:$version|g"
find . -name "*.yaml" -print0 | xargs -0 sed -i "s|$repo_image:latest[A-Za-z0-9\-]*|$repo_image:$version|g"
find . -name "*.md" -print0 | xargs -0 sed -i "s|$repo_image:latest[A-Za-z0-9\-]*|$repo_image:$version|g"
fi
}

Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/scripts/freeze_requirements.sh
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ function main() {
check_branch_name
echo "::group::pip install --no-cache-dir pip-tools" && pip install --no-cache-dir pip-tools --upgrade && echo "::endgroup::"
export -f freeze
find . -name "requirements.txt" | xargs -n 1 -I {} bash -c 'freeze "$@"' _ {}
find . -name "requirements-runtime.txt" | xargs -n 1 -I {} bash -c 'freeze "$@"' _ {}
find . -name "requirements.txt" -print0 | xargs -0 -n 1 -I {} bash -c 'freeze "$@"' _ {}
find . -name "requirements-runtime.txt" -print0 | xargs -0 -n 1 -I {} bash -c 'freeze "$@"' _ {}
}

main
10 changes: 5 additions & 5 deletions .github/workflows/scripts/get_test_matrix.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ function find_test_1() {
# Accurate matching test scripts
# find_test=$(find ./tests -type f \( -name test_${service_name}_${integrations}.sh -o -name test_${service_name}_${integrations}_on_*.sh \)) || true
# Fuzzy matching test scripts, for example, llms/src/text-generation/integrations/opea.py match several tests.
find_test=$(find ./tests -type f -name test_${service_name}_${integration}*.sh) || true
find_test=$(find ./tests -type f -name "test_${service_name}_${integration}*.sh") || true
if [ "$find_test" ]; then
fill_in_matrix "$find_test"
else
Expand All @@ -54,15 +54,15 @@ function find_test_1() {
done
fi
if [ "$run_all_interation" = "true" ]; then
find_test=$(find ./tests -type f -name test_${service_name}*.sh) || true
find_test=$(find ./tests -type f -name "test_${service_name}*.sh") || true
if [ "$find_test" ]; then
fill_in_matrix "$find_test"
fi
fi
elif [[ $(echo ${service_path} | grep "third_parties") ]]; then
# new org with `src` and `third_parties` folder
service_name=$(echo $service_path | sed 's:/src::' | tr '/' '_' | cut -c7-) # comps/third_parties/vllm/src -> third_parties_vllm
find_test=$(find ./tests -type f -name test_${service_name}*.sh) || true
find_test=$(find ./tests -type f -name "test_${service_name}*.sh") || true
if [ "$find_test" ]; then
fill_in_matrix "$find_test"
fi
Expand All @@ -77,7 +77,7 @@ function find_test_1() {
else
# old org without 'src' folder
service_name=$(echo $service_path | tr '/' '_' | cut -c7-) # comps/retrievers/redis/langchain -> retrievers_redis_langchain
find_test=$(find ./tests -type f -name test_${service_name}*.sh) || true
find_test=$(find ./tests -type f -name "test_${service_name}*.sh") || true
if [ "$find_test" ]; then
fill_in_matrix "$find_test"
fi
Expand Down Expand Up @@ -140,7 +140,7 @@ function find_test_3() {
_domain=${_domain#compose_}
_service=${_service}_${_domain}
fi
find_test=$(find ./tests -type f -name test_${_service}*.sh) || true
find_test=$(find ./tests -type f -name "test_${_service}*.sh") || true
if [ "$find_test" ]; then
fill_in_matrix "$find_test"
fi
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts/test_ut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ cd /GenAIComps/tests
if [ $test_name = 'mega' ]; then
echo "run mega test"
cd cores
find . -name "*.yaml" -exec sh -c 'x="{}"; cp $x ./' \;
find . -name "*.yaml" -exec sh -c 'cp "$1" ./ ' _ {} \;
comps_path=$(python -c 'import comps; print(comps.__path__[0])')
find . -name "test*.py" | sed "s,\.\/,python -m pytest --cov=\"${comps_path}\" --cov-report term --cov-report xml:coverage.xml --cov-append -vs --disable-warnings ,g" > run.sh
bash run.sh 2>&1 | tee ${ut_log_name}
Expand Down
1 change: 0 additions & 1 deletion comps/animation/src/docker_run.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand Down
2 changes: 1 addition & 1 deletion comps/finetuning/src/integrations/xtune/prepare_xtune.sh
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,6 @@ else
ps aux | grep "llamafactory-cli webui" | head -n 1 | awk '{print $2}' |xargs kill
echo "kill webui service done"
fi
echo 0 >> done
echo 0 >> "done"
echo "Please follow README.md to install driver or update torch lib"
fi
1 change: 0 additions & 1 deletion comps/finetuning/src/launch.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

# Copyright (C) 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

# Copyright (C) 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand Down
1 change: 0 additions & 1 deletion comps/struct2graph/src/environment_setup.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

# Copyright (C) 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand Down
1 change: 0 additions & 1 deletion comps/text2graph/src/setup_service_env.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

# Copyright (C) 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand Down
4 changes: 2 additions & 2 deletions comps/text2kg/src/environment_setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -28,8 +28,8 @@ export NEO4J_USERNAME=${NEO4J_USERNAME:-"neo4j"}
export NEO4J_PASSWORD=${NEO4J_PASSWORD:-"neo4j_password"}
export NEO4J_URL=${NEO4J_URL:-"neo4j://localhost:7687"}
export NEO4J_URI=${NEO4J_URI:-"neo4j://localhost:7687"}
export NEO4J_PORT1={$NEO4J_PORT1:-7474}:7474
export NEO4J_PORT2={$NEO4J_PORT2:-7687}:7687
export NEO4J_PORT1=${NEO4J_PORT1:-7474}:7474
export NEO4J_PORT2=${NEO4J_PORT2:-7687}:7687
export NEO4J_AUTH=neo4j/password
export NEO4J_PLUGINS=\[\"apoc\"\]
export NEO4J_HEALTH_URL="http://localhost:7474"
Expand Down
1 change: 0 additions & 1 deletion comps/third_parties/video-llama/src/start.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
# Download models
Expand Down
1 change: 0 additions & 1 deletion comps/third_parties/wav2lip/src/download_ckpts.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand Down
1 change: 0 additions & 1 deletion tests/agent/build_vllm_gaudi.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

# Copyright (C) 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand Down
1 change: 0 additions & 1 deletion tests/agent/launch_vllm_gaudi.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

# Copyright (C) 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand Down
1 change: 0 additions & 1 deletion tests/agent/sql_agent_test/run_data_split.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
#!/bin/bash

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand Down
2 changes: 1 addition & 1 deletion tests/agent/test_agent_langchain_on_intel_hpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ function main() {

stop_docker

echo y | docker system prune 2>&1 > /dev/null
echo y | docker system prune > /dev/null 2>&1
}

main
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function main() {

stop_docker
echo "cleanup container images and volumes"
echo y | docker system prune 2>&1 > /dev/null
echo y | docker system prune > /dev/null 2>&1

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function start_service() {
function validate_microservice() {
echo "Validate microservice started"
echo "test 1 - violated policies"
result=$(http_proxy= curl http://localhost:11303/v1/guardrails -X POST -d '{"text":"How do you buy a tiger in the US?","parameters":{"max_new_tokens":32}}' -H 'Content-Type: application/json')
result=$(http_proxy="" curl http://localhost:11303/v1/guardrails -X POST -d '{"text":"How do you buy a tiger in the US?","parameters":{"max_new_tokens":32}}' -H 'Content-Type: application/json')
if [[ $result == *"Violated"* ]]; then
echo "Result correct."
else
Expand All @@ -51,7 +51,7 @@ function validate_microservice() {
exit 1
fi
echo "test 2 - safe"
result=$(http_proxy= curl http://localhost:11303/v1/guardrails -X POST -d '{"text":"How do you buy a car in the US?","parameters":{"max_new_tokens":32}}' -H 'Content-Type: application/json')
result=$(http_proxy="" curl http://localhost:11303/v1/guardrails -X POST -d '{"text":"How do you buy a car in the US?","parameters":{"max_new_tokens":32}}' -H 'Content-Type: application/json')
if [[ $result == *"car"* ]]; then
echo "Result correct."
else
Expand Down Expand Up @@ -80,7 +80,7 @@ function main() {

stop_docker
echo "cleanup container images and volumes"
echo y | docker system prune 2>&1 > /dev/null
echo y | docker system prune > /dev/null 2>&1

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ function start_service() {
function validate_microservice() {
echo "Validate microservice started"
echo "test 1 - violated policies"
result=$(http_proxy= curl http://localhost:11304/v1/guardrails -X POST -d '{"text":"How do you buy a tiger in the US?","parameters":{"max_new_tokens":32}}' -H 'Content-Type: application/json')
result=$(http_proxy="" curl http://localhost:11304/v1/guardrails -X POST -d '{"text":"How do you buy a tiger in the US?","parameters":{"max_new_tokens":32}}' -H 'Content-Type: application/json')
if [[ $result == *"Violated"* ]]; then
echo "Result correct."
else
Expand All @@ -51,7 +51,7 @@ function validate_microservice() {
exit 1
fi
echo "test 2 - safe"
result=$(http_proxy= curl http://localhost:11304/v1/guardrails -X POST -d '{"text":"How do you buy a car in the US?","parameters":{"max_new_tokens":32}}' -H 'Content-Type: application/json')
result=$(http_proxy="" curl http://localhost:11304/v1/guardrails -X POST -d '{"text":"How do you buy a car in the US?","parameters":{"max_new_tokens":32}}' -H 'Content-Type: application/json')
if [[ $result == *"car"* ]]; then
echo "Result correct."
else
Expand Down Expand Up @@ -79,7 +79,7 @@ function main() {

stop_docker
echo "cleanup container images and volumes"
echo y | docker system prune 2>&1 > /dev/null
echo y | docker system prune > /dev/null 2>&1

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,7 @@ function main() {

stop_docker
echo "cleanup container images and volumes"
echo y | docker system prune 2>&1 > /dev/null
echo y | docker system prune > /dev/null 2>&1

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ function main() {
stop_docker

echo "cleanup container images and volumes"
echo y | docker system prune 2>&1 > /dev/null
echo y | docker system prune > /dev/null 2>&1

}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ function main() {

stop_docker
echo "cleanup container images and volumes"
echo y | docker system prune 2>&1 > /dev/null
echo y | docker system prune > /dev/null 2>&1

}

Expand Down
1 change: 1 addition & 0 deletions tests/llms/llm_utils.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
#!/bin/bash
# Copyright (C) 2025 Intel Corporation
# SPDX-License-Identifier: Apache-2.0

Expand Down
2 changes: 1 addition & 1 deletion tests/third_parties/_test_third_parties_sglang.sh
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ function main() {

stop_docker
echo "cleanup container images and volumes"
echo y | docker system prune 2>&1 > /dev/null
echo y | docker system prune > /dev/null 2>&1

}

Expand Down
2 changes: 1 addition & 1 deletion tests/third_parties/test_third_parties_ipex.sh
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ function main() {

stop_docker
echo "cleanup container images and volumes"
echo y | docker system prune 2>&1 > /dev/null
echo y | docker system prune > /dev/null 2>&1

}

Expand Down
2 changes: 1 addition & 1 deletion tests/utils/wait-for-it.sh
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ wait_for_wrapper()
timeout $WAITFORIT_BUSYTIMEFLAG $WAITFORIT_TIMEOUT $0 --child --host=$WAITFORIT_HOST --port=$WAITFORIT_PORT --timeout=$WAITFORIT_TIMEOUT &
fi
WAITFORIT_PID=$!
trap "kill -INT -$WAITFORIT_PID" INT
trap 'kill -INT -$WAITFORIT_PID' INT
wait $WAITFORIT_PID
WAITFORIT_RESULT=$?
if [[ $WAITFORIT_RESULT -ne 0 ]]; then
Expand Down
Loading