未验证 提交 8fb3048c 编写于 作者: S Shenghang Tsai 提交者: GitHub

fix oss list file 100 limit (#3935)

* fix oss list file 100 limit

* fix cu100_xla
上级 790d41f3
......@@ -60,6 +60,7 @@ jobs:
cuda_version="11.1"
elif [ "$matrix_release_version" == "cu100_xla" ]; then
cuda_version="10.0"
extra_flags="--xla"
elif [ "$matrix_release_version" == "cu101_xla" ]; then
cuda_version="10.1"
extra_flags="--xla"
......
......@@ -44,15 +44,21 @@ def generate_index_file(endpoint, bucket, dir_key, file_path, index_keys=None):
ks = os.getenv("OSS_ACCESS_KEY_SECRET")
auth = oss2.Auth(ki, ks)
bucket_obj = oss2.Bucket(auth, endpoint, bucket)
files = bucket_obj.list_objects(dir_key + "/")
should_continue = True
count = 0
for f in files.object_list:
key = f.key
print(key)
link = url4key(endpoint, bucket, key)
append_link(soup, link)
count += 1
next_marker = ""
while should_continue:
files = bucket_obj.list_objects(dir_key + "/", marker=next_marker)
for f in files.object_list:
key = f.key
if key.endswith(".whl"):
print(key)
link = url4key(endpoint, bucket, key)
append_link(soup, link)
count += 1
next_marker = files.next_marker
should_continue = next_marker != ""
print("count", count)
assert count
html = soup.prettify()
with open(file_path, "w+") as f:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册