You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@mxnet.apache.org by je...@apache.org on 2021/12/19 15:51:14 UTC
[incubator-mxnet] branch v1.9.x updated: [v1.9.x] Fix aarch64 cd pipeline (#20783)
This is an automated email from the ASF dual-hosted git repository.
jevans pushed a commit to branch v1.9.x
in repository https://gitbox.apache.org/repos/asf/incubator-mxnet.git
The following commit(s) were added to refs/heads/v1.9.x by this push:
new cb788af [v1.9.x] Fix aarch64 cd pipeline (#20783)
cb788af is described below
commit cb788afe75ed11c3b8a961f730f0effc9bf8d366
Author: Joe Evans <jo...@gmail.com>
AuthorDate: Sun Dec 19 07:49:34 2021 -0800
[v1.9.x] Fix aarch64 cd pipeline (#20783)
* Add wheel to installed pip packages on aarch64, so we can build the wheel in the CD pipeline.
* Better support for aarch64 docker container cache.
* Only import machine() function from platform module, as platform variable is already widely used.
* Only build containers with aarch64 in name on aarch64.
* Make all arch defaults to local machine type.
---
ci/build.py | 13 +++++++------
ci/docker/install/requirements_aarch64 | 1 +
ci/docker_cache.py | 3 ++-
3 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/ci/build.py b/ci/build.py
index b7236dc..1998f58 100755
--- a/ci/build.py
+++ b/ci/build.py
@@ -34,6 +34,7 @@ import re
import shutil
import signal
import subprocess
+from platform import machine
from itertools import chain
from subprocess import check_call, check_output
from typing import *
@@ -46,7 +47,7 @@ from util import *
DOCKER_COMPOSE_FILES = set(['docker/build.centos7'])
# keywords to identify arm-based dockerfiles
-AARCH_FILE_KEYWORDS = ['armv', 'aarch64']
+AARCH_FILE_KEYWORDS = ['aarch64']
def get_dockerfiles_path():
return "docker"
@@ -60,7 +61,7 @@ def get_docker_compose_platforms(path: str = get_dockerfiles_path()):
return platforms
-def get_platforms(path: str = get_dockerfiles_path(), arch='x86') -> List[str]:
+def get_platforms(path: str = get_dockerfiles_path(), arch=machine()) -> List[str]:
"""Get a list of platforms given our dockerfiles"""
dockerfiles = glob.glob(os.path.join(path, "Dockerfile.*"))
dockerfiles = set(filter(lambda x: x[-1] != '~', dockerfiles))
@@ -68,7 +69,7 @@ def get_platforms(path: str = get_dockerfiles_path(), arch='x86') -> List[str]:
files = files - DOCKER_COMPOSE_FILES
files.update(["build."+x for x in get_docker_compose_platforms()])
arm_files = set(filter(lambda x: any(y in x for y in AARCH_FILE_KEYWORDS), files))
- if arch == 'x86':
+ if arch == 'x86_64':
files = files - arm_files
elif arch == 'aarch64':
files = arm_files
@@ -300,7 +301,7 @@ def container_run(platform: str,
return 0
-def list_platforms(arch='x86') -> str:
+def list_platforms(arch=machine()) -> str:
return "\nSupported platforms:\n{}".format('\n'.join(get_platforms(arch=arch)))
@@ -357,8 +358,8 @@ def main() -> int:
type=str)
parser.add_argument("-A", "--architecture",
- help="Architecture of images to build (x86 or aarch64). Default is x86.",
- default='x86',
+ help="Architecture of images to build (x86_64 or aarch64). Default is current machine type.",
+ default=machine(),
dest='architecture')
parser.add_argument("-b", "--build-only",
diff --git a/ci/docker/install/requirements_aarch64 b/ci/docker/install/requirements_aarch64
index 327a78f..1cfead0 100644
--- a/ci/docker/install/requirements_aarch64
+++ b/ci/docker/install/requirements_aarch64
@@ -30,3 +30,4 @@ astroid==2.3.3 # pylint and astroid need to be aligned
requests<2.19.0,>=2.18.4
setuptools
coverage
+wheel
diff --git a/ci/docker_cache.py b/ci/docker_cache.py
index f9d5b81..a512034 100755
--- a/ci/docker_cache.py
+++ b/ci/docker_cache.py
@@ -30,6 +30,7 @@ import os
import subprocess
import re
import sys
+from platform import machine
from typing import *
import build as build_util
@@ -225,7 +226,7 @@ def main() -> int:
args = parser.parse_args()
- platforms = build_util.get_platforms()
+ platforms = build_util.get_platforms(arch=machine())
if "dkr.ecr" in args.docker_registry:
_ecr_login(args.docker_registry)