Skip to content

Commit

Permalink
Enabled Android arm64 GHA in precommit (openvinotoolkit#20094)
Browse files Browse the repository at this point in the history
  • Loading branch information
ilya-lavrenov authored Sep 27, 2023
1 parent 132bada commit ce7366b
Show file tree
Hide file tree
Showing 5 changed files with 150 additions and 177 deletions.
144 changes: 144 additions & 0 deletions .github/workflows/android_arm64.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,144 @@
name: Android ARM64 with vcpkg
on:
workflow_dispatch:
pull_request:
paths-ignore:
- '**/docs/**'
- 'docs/**'
- '**/**.md'
- '**.md'
- '**/layer_tests_summary/**'
- '**/conformance/**'
push:
paths-ignore:
- '**/docs/**'
- 'docs/**'
- '**/**.md'
- '**.md'
- '**/layer_tests_summary/**'
- '**/conformance/**'
branches:
- master

concurrency:
# github.ref is not unique in post-commit
group: ${{ github.event_name == 'push' && github.run_id || github.ref }}-android-arm64-vcpkg
cancel-in-progress: true

jobs:
Build:
defaults:
run:
shell: bash
runs-on: aks-linux-16-cores
container:
image: openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04
volumes:
- /mount/caches:/mount/caches
env:
DEBIAN_FRONTEND: noninteractive # to prevent apt-get from waiting user input
CMAKE_GENERATOR: 'Ninja'
CMAKE_CXX_COMPILER_LAUNCHER: ccache
CMAKE_C_COMPILER_LAUNCHER: ccache
OPENVINO_REPO: '/__w/openvino/openvino/openvino'
VCPKG_ROOT: '/__w/openvino/openvino/vcpkg'
BUILD_DIR: '/__w/openvino/openvino/build'
INSTALL_DIR: '/__w/openvino/openvino/install'
ANDROID_TOOLS: '/__w/openvino/openvino/android_tools'
ANDROID_NDK_HOME: '/__w/openvino/openvino/android_tools/ndk-bundle'
ANDROID_SDK_VERSION: 29
ANDROID_ABI_CONFIG: arm64-v8a
CCACHE_DIR: '/mount/caches/ccache/android_arm64'
CCACHE_TEMPDIR: '/__w/openvino/openvino/ccache_temp'
CCACHE_MAXSIZE: 50G
steps:
- name: Install git
run: apt-get update && apt-get install --assume-yes --no-install-recommends git ca-certificates

- name: Clone OpenVINO
uses: actions/checkout@v4
with:
path: 'openvino'

- name: Init submodules for non vcpkg dependencies
run: |
pushd ${OPENVINO_REPO}
git submodule update --init -- ${OPENVINO_REPO}/src/plugins
git submodule update --init -- ${OPENVINO_REPO}/thirdparty/gtest
git submodule update --init -- ${OPENVINO_REPO}/thirdparty/gflags
git submodule update --init -- ${OPENVINO_REPO}/thirdparty/open_model_zoo
popd
- name: Clone vcpkg
uses: actions/checkout@v4
with:
repository: 'microsoft/vcpkg'
path: 'vcpkg'
fetch-depth: '0'

#
# Dependencies
#

- name: Install dependencies
run: |
# generic dependencies
apt --assume-yes install ccache scons ninja-build build-essential python3-pip
# vcpkg requires cmake 3.19 or later
python3 -m pip install -U pip cmake
# vcpkg's tool dependencies
apt --assume-yes install curl zip unzip tar
# vcpkg 'python3' port dependencies
apt --assume-yes install autoconf libtool autoconf-archive
# vcpkg tree of dependencies require extra packages
apt --assume-yes install pkg-config linux-libc-dev
# Install Android SDK, NDK and Tools
apt -y --no-install-recommends install unzip wget default-jdk
wget https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip
unzip commandlinetools-linux-7583922_latest.zip
echo "yes" | ./cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_TOOLS} --install "ndk-bundle" "platform-tools" "platforms;android-${{ env.ANDROID_SDK_VERSION }}"
#
# Build
#

- name: Build vcpkg
run: |
${VCPKG_ROOT}/bootstrap-vcpkg.sh
# patch vcpkg default toolchain to build only Release configuration
echo "set(VCPKG_BUILD_TYPE release)" >> ${VCPKG_ROOT}/triplets/arm64-android.cmake
- name: CMake - configure
run: |
cmake \
-G '${{ env.CMAKE_GENERATOR }}' \
-DENABLE_INTEL_GPU=ON \
-DENABLE_TESTS=ON \
-DENABLE_SYSTEM_OPENCL=ON \
-DENABLE_SYSTEM_PROTOBUF=ON \
-DENABLE_SYSTEM_PUGIXML=ON \
-DENABLE_SYSTEM_SNAPPY=ON \
-DENABLE_SYSTEM_TBB=ON \
-DENABLE_SYSTEM_FLATBUFFERS=ON \
-DANDROID_ABI=${{ env.ANDROID_ABI_CONFIG }} \
-DANDROID_PLATFORM=${{ env.ANDROID_SDK_VERSION }} \
-DVCPKG_TARGET_TRIPLET=arm64-android \
-DVCPKG_HOST_TRIPLET=x64-linux-release \
-DCMAKE_TOOLCHAIN_FILE=${VCPKG_ROOT}/scripts/buildsystems/vcpkg.cmake \
-DVCPKG_CHAINLOAD_TOOLCHAIN_FILE=${ANDROID_NDK_HOME}/build/cmake/android.toolchain.cmake \
-DCMAKE_COMPILE_WARNING_AS_ERROR=ON \
-DCMAKE_CXX_COMPILER_LAUNCHER=${{ env.CMAKE_CXX_COMPILER_LAUNCHER }} \
-DCMAKE_C_COMPILER_LAUNCHER=${{ env.CMAKE_C_COMPILER_LAUNCHER }} \
-S ${OPENVINO_REPO} \
-B ${BUILD_DIR}
- name: Clean ccache stats
run: ccache --zero-stats --show-config

- name: Cmake - build
run: cmake --build ${BUILD_DIR} --parallel

- name: Show ccache stats
run: ccache --show-stats
2 changes: 1 addition & 1 deletion .github/workflows/code_style.yml
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ jobs:
run: |
sudo apt update
sudo apt --assume-yes remove clang-7 clang-8 clang-9 clang-10 clang-11 clang-12 clang-13
sudo apt --assume-yes install libclang-14-dev
sudo apt --assume-yes install clang-14 libclang-14-dev
- name: Install Python-based dependencies
run: python3 -m pip install -r cmake/developer_package/ncc_naming_style/requirements_dev.txt
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ jobs:
- name: Install build dependencies
run: |
bash ${OPENVINO_REPO}/install_build_dependencies.sh
# openjdk-11-jdk - Java API
# default-jdk - Java API
# libssl1.1 - 'python3 -m pip' in self-hosted runner
# unzip - to download ninja
apt install --assume-yes --no-install-recommends openjdk-11-jdk libssl1.1 unzip
apt install --assume-yes --no-install-recommends default-jdk libssl1.1 unzip
wget https://github.com/ninja-build/ninja/releases/download/v1.11.1/ninja-linux.zip
unzip ninja-linux.zip
Expand Down
173 changes: 0 additions & 173 deletions .github/workflows/linux_android_arm64.yml

This file was deleted.

4 changes: 3 additions & 1 deletion vcpkg.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,11 @@
"homepage": "https://github.com/openvinotoolkit/openvino",
"documentation": "https://docs.openvino.ai/latest/index.html",
"license": "Apache-2.0",
"builtin-baseline": "962e5e39f8a25f42522f51fffc574e05a3efd26b",
"builtin-baseline": "db0473513e5dc73ec6b6f431ff05d2f398eea042",
"dependencies": [
"ade",
"gflags",
"nlohmann-json",
{
"name": "pkgconf",
"host": true
Expand Down

0 comments on commit ce7366b

Please sign in to comment.