Skip to content

Commit 0629696

Browse files
lianhaoyongfengdu
authored andcommitted
K8S manifest: Update ChatQnA/CodeGen/CodeTrans/DocSum
- Update ChatQnA/CodeGen/CodeTrans/DocSum k8s manifest to avoid requiring creating directory for cache model. - Add chatqna-guardrails manifest files. - Fix bug #752 introduced by PR #669 Signed-off-by: Lianhao Lu <lianhao.lu@intel.com>
1 parent 4bd7841 commit 0629696

File tree

14 files changed

+3574
-297
lines changed

14 files changed

+3574
-297
lines changed

.github/workflows/_manifest-e2e.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ jobs:
8080
echo "skip_validate=false" >> $GITHUB_ENV
8181
else
8282
echo "Timeout waiting for pods in namespace $NAMESPACE to be ready!"
83+
.github/workflows/scripts/k8s-utils.sh dump_pods_status $NAMESPACE
8384
exit 1
8485
fi
8586
sleep 60
@@ -91,7 +92,12 @@ jobs:
9192
if $skip_validate; then
9293
echo "Skip validate"
9394
else
94-
${{ github.workspace }}/${{ inputs.example }}/tests/test_manifest_on_${{ inputs.hardware }}.sh validate_${{ inputs.example }} $NAMESPACE
95+
if ${{ github.workspace }}/${{ inputs.example }}/tests/test_manifest_on_${{ inputs.hardware }}.sh validate_${{ inputs.example }} $NAMESPACE ; then
96+
echo "Validate ${{ inputs.example }} successful!"
97+
else
98+
echo "Validate ${{ inputs.example }} failure!!!"
99+
.github/workflows/scripts/k8s-utils.sh dump_all_pod_logs $NAMESPACE
100+
fi
95101
fi
96102
97103
- name: Kubectl uninstall
Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
#!/bin/bash
2+
# Copyright (C) 2024 Intel Corporation
3+
# SPDX-License-Identifier: Apache-2.0
4+
5+
#set -xe
6+
7+
function dump_pod_log() {
8+
pod_name=$1
9+
namespace=$2
10+
echo "-----------Pod: $pod_name---------"
11+
echo "#kubectl describe pod $pod_name -n $namespace"
12+
kubectl describe pod $pod_name -n $namespace
13+
echo "-----------------------------------"
14+
echo "#kubectl logs $pod_name -n $namespace"
15+
kubectl logs $pod_name -n $namespace
16+
echo "-----------------------------------"
17+
}
18+
19+
function dump_pods_status() {
20+
namespace=$1
21+
echo "-----DUMP POD STATUS in NS $namespace------"
22+
kubectl get pods -n $namespace -o wide
23+
echo "-----------------------------------"
24+
25+
# Get all pods in the namespace and their statuses
26+
pods=$(kubectl get pods -n $namespace --no-headers)
27+
28+
# Loop through each pod
29+
echo "$pods" | while read -r line; do
30+
pod_name=$(echo $line | awk '{print $1}')
31+
ready=$(echo $line | awk '{print $2}')
32+
status=$(echo $line | awk '{print $3}')
33+
34+
# Extract the READY count
35+
ready_count=$(echo $ready | cut -d'/' -f1)
36+
required_count=$(echo $ready | cut -d'/' -f2)
37+
38+
# Check if the pod is not in "Running" status or READY count is less than required
39+
if [[ "$status" != "Running" || "$ready_count" -lt "$required_count" ]]; then
40+
dump_pod_log $pod_name $namespace
41+
fi
42+
done
43+
}
44+
45+
function dump_all_pod_logs() {
46+
namespace=$1
47+
echo "-----DUMP POD STATUS AND LOG in NS $namespace------"
48+
49+
pods=$(kubectl get pods -n $namespace -o jsonpath='{.items[*].metadata.name}')
50+
for pod_name in $pods
51+
do
52+
dump_pod_log $pod_name $namespace
53+
done
54+
}
55+
56+
if [ $# -eq 0 ]; then
57+
echo "Usage: $0 <function_name>"
58+
exit 1
59+
fi
60+
61+
case "$1" in
62+
dump_pods_status)
63+
dump_pods_status $2
64+
;;
65+
dump_all_pod_logs)
66+
dump_all_pod_logs $2
67+
;;
68+
*)
69+
echo "Unknown function: $1"
70+
;;
71+
esac

0 commit comments

Comments
 (0)