Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
milvus
milvus
提交
e7d5196f
M
milvus
项目概览
milvus
/
milvus
大约 1 年 前同步成功
通知
261
Star
22476
Fork
2472
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
M
milvus
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
e7d5196f
编写于
8月 17, 2023
作者:
Z
zhuwenxing
提交者:
GitHub
8月 17, 2023
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
[test]Wait index building complete before rolling update (#26377)
Signed-off-by:
N
zhuwenxing
<
wenxing.zhu@zilliz.com
>
上级
3c62acde
变更
2
显示空白变更内容
内联
并排
Showing
2 changed file
with
52 addition
and
2 deletion
+52
-2
tests/python_client/chaos/testcases/test_single_request_operation_for_rolling_update.py
...cases/test_single_request_operation_for_rolling_update.py
+25
-2
tests/python_client/deploy/monitor_rolling_update.py
tests/python_client/deploy/monitor_rolling_update.py
+27
-0
未找到文件。
tests/python_client/chaos/testcases/test_single_request_operation_for_rolling_update.py
浏览文件 @
e7d5196f
import
time
from
pathlib
import
Path
import
subprocess
import
pytest
from
time
import
sleep
from
pymilvus
import
connections
from
pymilvus
import
connections
,
utility
from
chaos.checker
import
(
CreateChecker
,
InsertChecker
,
FlushChecker
,
...
...
@@ -87,10 +90,20 @@ class TestOperations(TestBase):
log
.
info
(
f
"do bulk insert failed:
{
result
}
"
)
retry_times
+=
1
sleep
(
5
)
# how to make sure the bulk insert done before rolling update?
# wait for index building complete
utility
.
wait_for_index_building_complete
(
v
.
c_name
,
timeout
=
120
)
res
=
utility
.
index_building_progress
(
v
.
c_name
)
index_completed
=
res
[
"pending_index_rows"
]
==
0
while
not
index_completed
:
time
.
sleep
(
10
)
res
=
utility
.
index_building_progress
(
v
.
c_name
)
log
.
info
(
f
"index building progress:
{
res
}
"
)
index_completed
=
res
[
"pending_index_rows"
]
==
0
log
.
info
(
f
"index building progress:
{
res
}
"
)
log
.
info
(
"*********************Load Start**********************"
)
cc
.
start_monitor_threads
(
self
.
health_checkers
)
# wait request_duration
request_duration
=
request_duration
.
replace
(
"h"
,
"*3600+"
).
replace
(
"m"
,
"*60+"
).
replace
(
"s"
,
""
)
if
request_duration
[
-
1
]
==
"+"
:
...
...
@@ -98,6 +111,16 @@ class TestOperations(TestBase):
request_duration
=
eval
(
request_duration
)
for
i
in
range
(
10
):
sleep
(
request_duration
//
10
)
if
i
==
3
:
# apply rolling update after 30% time of request_duration
log
.
info
(
"*********************Apply Rolling Update**********************"
)
file_path
=
f
"
{
str
(
Path
(
__file__
).
parent
.
parent
.
parent
)
}
/deploy/milvus_crd.yaml"
cmd
=
f
"kubectl apply -f
{
file_path
}
"
log
.
info
(
f
"cmd:
{
cmd
}
"
)
res
=
subprocess
.
Popen
(
cmd
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
stdout
,
stderr
=
res
.
communicate
()
log
.
info
(
f
"
{
cmd
}
, stdout:
{
stdout
}
, stderr:
{
stderr
}
"
)
for
k
,
v
in
self
.
health_checkers
.
items
():
v
.
check_result
()
for
k
,
v
in
self
.
health_checkers
.
items
():
...
...
tests/python_client/deploy/monitor_rolling_update.py
0 → 100644
浏览文件 @
e7d5196f
import
argparse
import
subprocess
import
time
from
loguru
import
logger
as
log
def
run_kubectl_get_pod
(
duration
,
interval
,
release_name
):
end_time
=
time
.
time
()
+
duration
while
time
.
time
()
<
end_time
:
cmd
=
f
"kubectl get pod |grep
{
release_name
}
"
res
=
subprocess
.
Popen
(
cmd
,
shell
=
True
,
stdout
=
subprocess
.
PIPE
,
stderr
=
subprocess
.
PIPE
)
stdout
,
stderr
=
res
.
communicate
()
output
=
stdout
.
decode
(
"utf-8"
)
log
.
info
(
f
"
{
cmd
}
\n
{
output
}
\n
"
)
time
.
sleep
(
interval
)
if
__name__
==
'__main__'
:
parser
=
argparse
.
ArgumentParser
(
description
=
'Script to run "kubectl get pod" command at regular intervals'
)
parser
.
add_argument
(
'-d'
,
'--duration'
,
type
=
int
,
default
=
600
,
help
=
'Duration in seconds (default: 600)'
)
parser
.
add_argument
(
'-i'
,
'--interval'
,
type
=
int
,
default
=
5
,
help
=
'Interval in seconds (default: 30)'
)
parser
.
add_argument
(
'-n'
,
'--release_name'
,
type
=
str
,
default
=
""
,
help
=
'release name (default: "None")'
)
args
=
parser
.
parse_args
()
run_kubectl_get_pod
(
args
.
duration
,
args
.
interval
,
args
.
release_name
)
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录