Skip to content

Commit

Permalink
Add support for pulling down ARM and MacOS artifacts (#1307)
Browse files Browse the repository at this point in the history
* Add support for ARM and MacOS artifacts

* Update artifacts.py

* Add the x in osx
  • Loading branch information
mgoin committed Oct 11, 2023
1 parent 428d4b5 commit 6afc0ec
Showing 1 changed file with 19 additions and 1 deletion.
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

0 comments on commit 6afc0ec

Please sign in to comment.