2021-12-15 09:25:26 +08:00
|
|
|
from pymilvus import connections
|
2021-09-03 17:15:51 +08:00
|
|
|
from utils import *
|
|
|
|
|
|
|
|
|
2021-12-25 13:44:21 +08:00
|
|
|
def task_1(data_size):
|
2021-12-17 18:49:30 +08:00
|
|
|
"""
|
|
|
|
task_1:
|
2021-12-20 19:22:14 +08:00
|
|
|
before upgrade: create collection and insert data, load and search
|
2021-12-17 18:49:30 +08:00
|
|
|
after upgrade: get collection, load, search, create index, load, and search
|
|
|
|
"""
|
|
|
|
prefix = "task_1_"
|
|
|
|
connections.connect(host="127.0.0.1", port=19530, timeout=60)
|
|
|
|
get_collections(prefix)
|
|
|
|
load_and_search(prefix)
|
2021-12-25 13:44:21 +08:00
|
|
|
create_collections_and_insert_data(prefix, data_size)
|
2021-12-20 19:22:14 +08:00
|
|
|
create_index(prefix)
|
|
|
|
load_and_search(prefix)
|
2021-09-03 17:15:51 +08:00
|
|
|
|
|
|
|
|
2021-12-25 13:44:21 +08:00
|
|
|
def task_2(data_size):
|
2021-12-17 18:49:30 +08:00
|
|
|
"""
|
|
|
|
task_2:
|
2021-12-20 19:22:14 +08:00
|
|
|
before upgrade: create collection, insert data and create index, load and search
|
2021-12-17 18:49:30 +08:00
|
|
|
after upgrade: get collection, load, search, insert data, create index, load, and search
|
|
|
|
"""
|
|
|
|
prefix = "task_2_"
|
|
|
|
connections.connect(host="127.0.0.1", port=19530, timeout=60)
|
|
|
|
get_collections(prefix)
|
|
|
|
load_and_search(prefix)
|
2021-12-25 13:44:21 +08:00
|
|
|
create_collections_and_insert_data(prefix, data_size)
|
2021-12-17 18:49:30 +08:00
|
|
|
create_index(prefix)
|
|
|
|
load_and_search(prefix)
|
2021-09-03 17:15:51 +08:00
|
|
|
|
2021-12-17 18:49:30 +08:00
|
|
|
|
|
|
|
if __name__ == '__main__':
|
2021-12-25 13:44:21 +08:00
|
|
|
import argparse
|
|
|
|
parser = argparse.ArgumentParser(description='config for deploy test')
|
|
|
|
parser.add_argument('--data_size', type=int, default=3000, help='data size')
|
|
|
|
args = parser.parse_args()
|
|
|
|
data_size = args.data_size
|
|
|
|
print(f"data size: {data_size}")
|
|
|
|
task_1(data_size)
|
|
|
|
task_2(data_size)
|