Skip to content

Commit

Permalink
debug
Browse files Browse the repository at this point in the history
Signed-off-by: Abirdcfly <fp544037857@gmail.com>
  • Loading branch information
Abirdcfly committed Mar 22, 2024
1 parent f934aa0 commit 4f88e78
Showing 1 changed file with 42 additions and 10 deletions.
52 changes: 42 additions & 10 deletions tests/example-test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -350,15 +350,6 @@ function fileUploadSummarise() {

info "1. create kind cluster"
make kind
df -h
rerank_image="kubeagi/core-library-cli:v0.0.1-20240308-18ea8aa"
docker pull $rerank_image
kind load docker-image $rerank_image --name=$KindName
if [[ $GITHUB_ACTIONS == "true" ]]; then
# github action has less disk space
docker rmi $rerank_image
fi
df -h

info "2. load arcadia image to kind"
docker tag controller:latest controller:example-e2e
Expand Down Expand Up @@ -536,8 +527,49 @@ kubectl apply -f config/samples/app_llmchain_englishteacher.yaml
waitCRDStatusReady "Application" "arcadia" "base-chat-english-teacher"
EnableAPIServerPortForward
sleep 3
getRespInAppChat "base-chat-english-teacher" "arcadia" "hi how are you?" "" "true"
kubectl apply -f config/samples/app_retrievalqachain_knowledgebase.yaml
waitCRDStatusReady "Application" "arcadia" "base-chat-with-knowledgebase"
sleep 3
kubectl patch applications -n arcadia base-chat-with-knowledgebase -p '{"spec":{"docNullReturn":""}}' --type='merge'
kubectl apply -f config/samples/app_retrievalqachain_knowledgebase_pgvector.yaml
waitCRDStatusReady "Application" "arcadia" "base-chat-with-knowledgebase-pgvector"
kubectl apply -f config/samples/app_llmchain_chat_with_bot.yaml
waitCRDStatusReady "Application" "arcadia" "base-chat-with-bot"
sleep 3
info "8.4.5 get app prompt starters"
attempt=0
while true; do
info "sleep 3 seconds"
sleep 3
info "get app prompt starters without knowledgebase"
resp=$(curl --max-time $TimeoutSeconds -s --show-error -XPOST http://127.0.0.1:8081/chat/prompt-starter --data '{"app_name": "base-chat-with-bot"}' -H 'namespace: arcadia')
echo $resp | jq .
if [[ $resp == *"error"* ]]; then
attempt=$((attempt + 1))
if [ $attempt -gt $RETRY_COUNT ]; then
echo "❌: Failed. Retry count exceeded."
exit 1
fi
echo "🔄: Failed. Attempt $attempt/$RETRY_COUNT"
kill $portal_pid >/dev/null 2>&1
EnableAPIServerPortForward
if [[ $resp == *"googleapi: Error"* ]]; then
echo "google api error, will retry after 60s"
sleep 60
fi
continue
fi
info "get app prompt starters with knowledgebase"
resp=$(curl --max-time $TimeoutSeconds -s --show-error -XPOST http://127.0.0.1:8081/chat/prompt-starter --data '{"app_name": "base-chat-with-knowledgebase-pgvector"}' -H 'namespace: arcadia')
echo $resp | jq .
if [[ $resp == *"error"* ]]; then
echo "failed"
exit 1
fi
break
done

exit 0
info "8.2 QA app using knowledgebase base"
info "8.2.1.1 QA app using knowledgebase base on chroma"
kubectl apply -f config/samples/app_retrievalqachain_knowledgebase.yaml
Expand Down

0 comments on commit 4f88e78

Please sign in to comment.