Skip to content

Commit aa967b0

Browse files
psiddhGithub Executorch
andauthored
Add aarch64 Docker image variants for Android and ARM SDK builds (pytorch#17547)
Adds two new Docker build targets for aarch64 host systems: - executorch-ubuntu-22.04-gcc11-aarch64-android (Android NDK r28c) - executorch-ubuntu-22.04-gcc11-aarch64-arm-sdk (ARM SDK) These enable CI builds on ARM64 runners, supporting development on Apple Silicon and ARM-based Linux hosts. Previously only x86_64 variants existed for these image flavors. Co-authored-by: Github Executorch <github_executorch@arm.com>
1 parent 505c5c9 commit aa967b0

3 files changed

Lines changed: 25 additions & 3 deletions

File tree

‎.ci/docker/build.sh‎

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,15 @@ case "${IMAGE_NAME}" in
4040
LINTRUNNER=""
4141
GCC_VERSION=11
4242
;;
43+
executorch-ubuntu-22.04-gcc11-aarch64-android)
44+
LINTRUNNER=""
45+
GCC_VERSION=11
46+
ANDROID_NDK_VERSION=r28c
47+
;;
48+
executorch-ubuntu-22.04-gcc11-aarch64-arm-sdk)
49+
ARM_SDK=yes
50+
GCC_VERSION=11
51+
;;
4352
executorch-ubuntu-22.04-linter)
4453
LINTRUNNER=yes
4554
CLANG_VERSION=12

‎.ci/docker/common/install_android.sh‎

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,8 +40,14 @@ install_ndk() {
4040
rm -rf "${NDK_INSTALLATION_DIR}" && mkdir -p "${NDK_INSTALLATION_DIR}"
4141

4242
pushd /tmp
43-
# The NDK installation is cached on ossci-android S3 bucket
44-
curl -Os --retry 3 "https://ossci-android.s3.amazonaws.com/android-ndk-${ANDROID_NDK_VERSION}-linux.zip"
43+
ARCH=$(uname -m)
44+
if [ "${ARCH}" = "aarch64" ]; then
45+
# aarch64 NDK is not cached on S3, download from Google directly
46+
curl -Os --retry 3 "https://dl.google.com/android/repository/android-ndk-${ANDROID_NDK_VERSION}-linux.zip"
47+
else
48+
# The NDK installation is cached on ossci-android S3 bucket
49+
curl -Os --retry 3 "https://ossci-android.s3.amazonaws.com/android-ndk-${ANDROID_NDK_VERSION}-linux.zip"
50+
fi
4551
unzip -qo "android-ndk-${ANDROID_NDK_VERSION}-linux.zip"
4652

4753
# Print the content for manual verification
@@ -73,7 +79,10 @@ install_sdk() {
7379
yes | /opt/cmdline-tools/bin/sdkmanager --sdk_root="${SDK_INSTALLATION_DIR}" --install "build-tools;35.0.0"
7480
# And some more tools for future emulator tests
7581
yes | /opt/cmdline-tools/bin/sdkmanager --sdk_root="${SDK_INSTALLATION_DIR}" --install "platform-tools"
76-
yes | /opt/cmdline-tools/bin/sdkmanager --sdk_root="${SDK_INSTALLATION_DIR}" --install "tools"
82+
# The 'tools' package (emulator) is not available on aarch64
83+
if [ "$(uname -m)" != "aarch64" ]; then
84+
yes | /opt/cmdline-tools/bin/sdkmanager --sdk_root="${SDK_INSTALLATION_DIR}" --install "tools"
85+
fi
7786
}
7887

7988
install_prerequiresites

‎.github/workflows/docker-builds.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,10 @@ jobs:
4646
include:
4747
- docker-image-name: executorch-ubuntu-22.04-gcc11-aarch64
4848
runner: linux.arm64.2xlarge
49+
- docker-image-name: executorch-ubuntu-22.04-gcc11-aarch64-android
50+
runner: linux.arm64.2xlarge
51+
- docker-image-name: executorch-ubuntu-22.04-gcc11-aarch64-arm-sdk
52+
runner: linux.arm64.2xlarge
4953
- docker-image-name: executorch-ubuntu-22.04-cuda-windows
5054
runner: linux.g5.4xlarge.nvidia.gpu
5155

0 commit comments

Comments
 (0)