Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support for pulling down ARM and MacOS artifacts #1307

Merged
merged 3 commits into from
Oct 11, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion utils/artifacts.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

import argparse
import os
import platform
import sys
import tarfile
from io import BytesIO
Expand Down Expand Up @@ -47,6 +48,22 @@ def parse_args():
return parser.parse_args()


def get_platform_string():
machine = platform.machine()
system = platform.system()

if system == "Linux":
if machine == "x86_64":
return "manylinux_x86_64"
elif machine == "aarch64":
return "manylinux_aarch64"
elif system == "Darwin":
if machine == "arm64":
return "macosx_13_0_arm64"

raise ValueError(f"Unsupported or unrecognized platform: {machine}, {system}")


def get_release_and_version(package_path: str) -> Tuple[bool, bool, str, str, str, str]:
"""
Load version and release info from deepsparse package
Expand Down Expand Up @@ -99,6 +116,7 @@ def download_wand_binaries(package_path: str, full_version: str, is_release: boo
and extract them to the right location
"""
release_string = "release" if is_release else "nightly"
platform_string = get_platform_string()

print(
f"Unable to find wand binaries locally in {package_path}.\n"
Expand All @@ -111,7 +129,7 @@ def download_wand_binaries(package_path: str, full_version: str, is_release: boo
f"-cp{sys.version_info[0]}{sys.version_info[1]}"
f"-cp{sys.version_info[0]}{sys.version_info[1]}"
f"{'' if sys.version_info[1] > 7 else 'm'}" # 3.6 and 3.7 have a 'm'
"-manylinux_x86_64.tar.gz"
f"-{platform_string}.tar.gz"
)

print("Requesting", artifact_url)
Expand Down
Loading