forked from opea-project/GenAIInfra
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathtest-pod.yaml
31 lines (30 loc) · 1.05 KB
/
test-pod.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
apiVersion: v1
kind: Pod
metadata:
name: {{ include "data-prep.fullname" . }}-testpod
labels:
{{- include "data-prep.labels" . | nindent 4 }}
annotations:
"helm.sh/hook": test
#"helm.sh/hook-delete-policy": "hook-succeeded, hook-failure"
spec:
containers:
- name: curl
image: python:3.10.14
command: ['bash', '-c']
args:
- |
echo "test file" > /tmp/file1.txt;
max_retry=20;
for ((i=1; i<=max_retry; i++)); do
curl http://{{ include "data-prep.fullname" . }}:{{ .Values.service.port }}/v1/dataprep -sS --fail-with-body \
-X POST \
-H "Content-Type: multipart/form-data" \
-F "files=@/tmp/file1.txt" && break;
curlcode=$?
if [[ $curlcode -eq 7 ]]; then sleep 10; else echo "curl failed with code $curlcode"; exit 1; fi;
done;
if [ $i -gt $max_retry ]; then echo "test failed with maximum retry"; exit 1; fi
restartPolicy: Never