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

Signed-off-by: wangting0128 <ting.wang@zilliz.com>
This commit is contained in:
wt 2021-11-01 17:17:56 +08:00 committed by GitHub
parent 5e077fd261
commit 056c636dad
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -21,6 +21,26 @@ def get_token(url):
return token
def get_tags(url, token):
headers = {'Content-type': "application/json",
"charset": "UTF-8",
"Accept": "application/vnd.docker.distribution.manifest.v2+json",
"Authorization": "Bearer %s" % token}
try:
rep = requests.get(url, headers=headers)
data = json.loads(rep.text)
tags = []
if 'tags' in data:
tags = data["tags"]
else:
print("Can not get the tag list")
return tags
except:
print("Can not get the tag list")
return []
def parse_server_tag(server_tag):
""" paser server tag from server config"""
# tag format: "8c"/"8c16m"/"8c16m1g"