to publish stable wheel to ort channel (#8873)

Co-authored-by: liqun <liqun@OrtTrainingDev4.af05slrtruoetgaxwwjv5nsq5e.px.internal.cloudapp.net>
This commit is contained in:
liqun Fu 2021-08-30 09:33:01 -07:00 committed by GitHub
parent 36fa0de8b7
commit c8dd0bf37e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -7,15 +7,17 @@ import argparse
from azure.storage.blob import BlockBlobService, ContentSettings
def parse_local_version_from_whl_name(blob_name):
def parse_nightly_and_local_version_from_whl_name(blob_name):
night_build = 'nightly' if blob_name.find(".dev") > 0 else 'stable'
start = blob_name.find("+")
if start == -1:
return None
return night_build, None
start = start + 1
end = blob_name.find("-", start)
if end == -1:
return None
return blob_name[start:end]
return night_build, None
return night_build, blob_name[start:end]
def upload_whl(python_wheel_path, account_name, account_key, container_name):
@ -27,13 +29,14 @@ def upload_whl(python_wheel_path, account_name, account_key, container_name):
blob_name = os.path.basename(python_wheel_path)
block_blob_service.create_blob_from_path(container_name, blob_name, python_wheel_path)
local_version = parse_local_version_from_whl_name(blob_name)
nightly_build, local_version = parse_nightly_and_local_version_from_whl_name(blob_name)
if local_version:
html_blob_name = 'onnxruntime_nightly_{}.html'.format(local_version)
html_blob_name = 'onnxruntime_{}_{}.html'.format(nightly_build, local_version)
else:
html_blob_name = 'onnxruntime_nightly.html'
html_blob_name = 'onnxruntime_{}.html'.format(nightly_build)
download_path_to_html = "./onnxruntime_{}.html".format(nightly_build)
download_path_to_html = "./onnxruntime_nightly.html"
block_blob_service.get_blob_to_path(container_name, html_blob_name, download_path_to_html)
blob_name_plus_replaced = blob_name.replace('+', '%2B')