-
Notifications
You must be signed in to change notification settings - Fork 174
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
109 changed files
with
2,310 additions
and
884 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: File Change Warning | ||
|
||
on: | ||
pull_request: | ||
branches: [main] | ||
types: [opened, reopened, ready_for_review, synchronize] | ||
|
||
# If there is a new commit, the previous jobs will be canceled | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
Dockerfile-path-change-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 for changed Dockerfile paths in yaml | ||
run: | | ||
set -xe | ||
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=DR ${{ github.event.pull_request.base.sha }} ${merged_commit} -- '**/Dockerfile**' | cut -f2)" | ||
if [ -n "$changed_files" ]; then | ||
for file in $changed_files; do | ||
if grep -q "$file" .github/workflows/docker/compose/*.yaml; then | ||
is_use="TRUE" | ||
used_files+="$file " | ||
fi | ||
done | ||
fi | ||
if [[ "$is_use" == "TRUE" ]]; then | ||
echo "Warning: Changed Dockerfile paths:" | ||
echo "$used_files" | ||
echo "Please modify the corresponding yaml in GenAIComps/.github/workflows/docker/compose and ask [email protected] for final confirmation." | ||
exit 1 | ||
fi | ||
- name: Check for changed Dockerfile paths in readme | ||
run: | | ||
set -xe | ||
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=DR ${{ github.event.pull_request.base.sha }} ${merged_commit} -- '**/Dockerfile**' | cut -f2)" | ||
if [ -n "$changed_files" ]; then | ||
for file in $changed_files; do | ||
if grep -q "$file" ./**/*.md; then | ||
is_use="TRUE" | ||
used_files+="$file " | ||
fi | ||
done | ||
fi | ||
if [[ "$is_use" == "TRUE" ]]; then | ||
echo "Warning: Changed Dockerfile paths:" | ||
echo "$used_files" | ||
echo "Please modify the corresponding README in GenAIComps and ask [email protected] for final confirmation." | ||
exit 1 | ||
fi | ||
Dockerfile-path-change-detection-in-GenAIExamples: | ||
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: Clone repo GenAIExamples | ||
run: | | ||
cd .. | ||
git clone https://github.com/opea-project/GenAIExamples | ||
- name: Check for changed Dockerfile paths | ||
run: | | ||
set -xe | ||
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=DR ${{ github.event.pull_request.base.sha }} ${merged_commit} -- '**/Dockerfile' | cut -f2)" | ||
if [ -n "$changed_files" ]; then | ||
for file in $changed_files; do | ||
if grep -q "$file" ../GenAIExamples/**/*.md; then | ||
is_use="TRUE" | ||
used_files+="$file " | ||
fi | ||
done | ||
fi | ||
if [[ "$is_use" == "TRUE" ]]; then | ||
echo "Warning: Changed Dockerfile paths:" | ||
echo "$used_files" | ||
echo "Please modify the corresponding README in GenAIExamples repo and ask [email protected] for final confirmation." | ||
exit 1 | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
# Copyright (C) 2024 Intel Corporation | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
name: Example-test | ||
|
||
on: | ||
pull_request_target: | ||
branches: [main] | ||
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped | ||
paths: | ||
- .github/workflows/pr-examples-test.yml | ||
- comps/cores/** | ||
- comps/embeddings/langchain/** | ||
- comps/retrievers/langchain/redis/** | ||
- comps/reranks/tei/** | ||
- comps/llms/text-generation/tgi/** | ||
- comps/dataprep/redis/langchain/** | ||
- requirements.txt | ||
|
||
# If there is a new commit, the previous jobs will be canceled | ||
concurrency: | ||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
example-test: | ||
runs-on: gaudi-01-3 | ||
steps: | ||
- name: Clean Up Working Directory | ||
run: | | ||
sudo rm -rf ${{github.workspace}}/* || true | ||
echo y | docker system prune | ||
docker rmi $(docker images --filter reference="*/*:comps" -q) || true | ||
- name: Checkout out Repo | ||
uses: actions/checkout@v4 | ||
with: | ||
ref: "refs/pull/${{ github.event.number }}/merge" | ||
|
||
- name: Run ChatQnA | ||
env: | ||
HUGGINGFACEHUB_API_TOKEN: ${{ secrets.HUGGINGFACEHUB_API_TOKEN }} | ||
run: | | ||
git clone https://github.com/opea-project/GenAIExamples.git | ||
cd ${{ github.workspace }}/GenAIExamples/ChatQnA/docker/gaudi | ||
sed -i "s#:latest#:comps#g" compose.yaml | ||
cat compose.yaml | ||
cd ${{ github.workspace }}/GenAIExamples/ChatQnA/tests | ||
GenAIComps_dir=${{github.workspace}} | ||
sed -i '/GenAIComps.git/d' test_chatqna_on_gaudi.sh | ||
sed -i "s#cd GenAIComps#cd ${GenAIComps_dir}#g" test_chatqna_on_gaudi.sh | ||
sed -i "s#docker build -t#docker build --no-cache -q -t#g" test_chatqna_on_gaudi.sh | ||
sed -i "s#:latest#:comps#g" test_chatqna_on_gaudi.sh | ||
cat test_chatqna_on_gaudi.sh | ||
echo "Run test..." | ||
timeout 50m bash test_chatqna_on_gaudi.sh | ||
- name: Clean up container | ||
if: cancelled() || failure() | ||
run: | | ||
cd ${{ github.workspace }}/GenAIExamples/ChatQnA/docker/gaudi | ||
docker compose stop && docker compose rm -f | ||
docker system prune -f | ||
- name: Publish pipeline artifact | ||
if: ${{ !cancelled() }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: "Examples-Test-Logs" | ||
path: ${{ github.workspace }}/GenAIExamples/ChatQnA/tests/*.log |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
File renamed without changes.
Oops, something went wrong.