[skip ci] Add new func of benchmark (#11314)

Signed-off-by: wangting0128 <ting.wang@zilliz.com>
pull/11343/head
wt 2021-11-05 19:48:30 +08:00 committed by GitHub
parent 1aaf7ad298
commit 479e83bf45
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 27 additions and 0 deletions

View File

@ -75,6 +75,33 @@ def get_config_digest(url, token):
return ""
def get_latest_tag(limit=200):
auth_url = ""
tags_url = ""
tag_url = ""
master_latest_digest = get_config_digest(tag_url + "master-latest", get_token(auth_url))
tags = get_tags(tags_url, get_token(auth_url))
tag_list = get_master_tags(tags)
latest_tag = ""
for i in range(1, len(tag_list) + 1):
tag_name = str(tag_list[-i])
tag_digest = get_config_digest(tag_url + tag_name, get_token(auth_url))
if tag_digest == master_latest_digest:
latest_tag = tag_name
break
if i > limit:
break
if latest_tag == "":
# latest_tag = "master-latest"
raise print("Can't find the latest image name")
print("The image name used is %s" % str(latest_tag))
return latest_tag
def parse_server_tag(server_tag):
""" paser server tag from server config"""
# tag format: "8c"/"8c16m"/"8c16m1g"