Update package_release_tasks.py (#20835)

1. Move azcopy environment variables out of script and into an Azure DevOps variable group. Move towards consolidating the managed identity client ID definition in one place.
2. Disable azcopy overwrite. We don't want to accidentally change the files for a released package.
This commit is contained in:
Edward Chen 2024-05-28 17:50:25 -07:00 committed by GitHub
parent 362a623905
commit 535e9d7114
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -6,7 +6,6 @@ from __future__ import annotations
import argparse
import glob
import os
import shlex
import subprocess
from enum import Enum
@ -25,22 +24,13 @@ def _run(command: list[str], **kwargs):
def upload_pod_archive(pod_archive_path: Path):
env = os.environ.copy()
env.update(
{
# configure azcopy to use managed identity
"AZCOPY_AUTO_LOGIN_TYPE": "MSI",
"AZCOPY_MSI_CLIENT_ID": "63b63039-6328-442f-954b-5a64d124e5b4",
}
)
storage_account_name = "onnxruntimepackages"
storage_account_container_name = "$web"
dest_url = f"https://{storage_account_name}.blob.core.windows.net/{storage_account_container_name}/"
upload_command = ["azcopy", "cp", str(pod_archive_path), dest_url]
upload_command = ["azcopy", "cp", str(pod_archive_path), dest_url, "--overwrite", "false"]
_run(upload_command, env=env)
_run(upload_command)
def update_podspec(pod_archive_path: Path, podspec_path: Path):