Skip to content

Commit

Permalink
[CI] [GHA] Add Dockerfile for Android ARM64, use it in workflow (open…
Browse files Browse the repository at this point in the history
…vinotoolkit#25130)

### Tickets:
 - *144477*
  • Loading branch information
akashchi authored and allnes committed Jun 26, 2024
1 parent 4220bec commit d14aacc
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 37 deletions.
2 changes: 1 addition & 1 deletion .github/dockerfiles/docker_tag
Original file line number Diff line number Diff line change
@@ -1 +1 @@
pr-25107
pr-25130
55 changes: 55 additions & 0 deletions .github/dockerfiles/ov_build/ubuntu_22_04_android_arm64/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
FROM openvinogithubactions.azurecr.io/dockerhub/ubuntu:22.04

USER root

# APT configuration
RUN echo 'Acquire::Retries "10";' > /etc/apt/apt.conf && \
echo 'APT::Get::Assume-Yes "true";' >> /etc/apt/apt.conf && \
echo 'APT::Get::Fix-Broken "true";' >> /etc/apt/apt.conf && \
echo 'APT::Get::no-install-recommends "true";' >> /etc/apt/apt.conf

ENV DEBIAN_FRONTEND="noninteractive" \
TZ="Europe/London"

RUN apt update && \
apt install software-properties-common git ca-certificates && \
add-apt-repository --yes --no-update ppa:git-core/ppa && \
apt update && \
apt install \
scons \
wget \
ninja-build \
build-essential \
python3-pip && \
# vcpkg requires cmake 3.19 or later
python3 -m pip install -U pip cmake~=3.28.0 && \
# vcpkg's tool dependencies
apt install curl zip unzip tar && \
# vcpkg 'python3' port dependencies
apt install autoconf libtool autoconf-archive && \
# vcpkg tree of dependencies require extra packages
apt install pkgconf linux-libc-dev && \
apt --no-install-recommends install default-jdk && \
rm -rf /var/lib/apt/lists/*

# Install sscache
ARG SCCACHE_VERSION="v0.7.5"
ENV SCCACHE_HOME="/opt/sccache" \
SCCACHE_PATH="/opt/sccache/sccache"

RUN mkdir ${SCCACHE_HOME} && cd ${SCCACHE_HOME} && \
SCCACHE_ARCHIVE="sccache-${SCCACHE_VERSION}-x86_64-unknown-linux-musl.tar.gz" && \
curl -SLO https://github.com/mozilla/sccache/releases/download/${SCCACHE_VERSION}/${SCCACHE_ARCHIVE} && \
tar -xzf ${SCCACHE_ARCHIVE} --strip-components=1 && rm ${SCCACHE_ARCHIVE}

ENV PATH="$SCCACHE_HOME:$PATH"

# Install Android SDK, NDK and Tools
ENV ANDROID_TOOLS /deps/android_tools
ENV ANDROID_NDK_HOME /deps/android_tools/ndk-bundle
RUN mkdir -p ${ANDROID_NDK_HOME}
ENV ANDROID_SDK_VERSION 29

RUN wget https://dl.google.com/android/repository/commandlinetools-linux-7583922_latest.zip && \
unzip commandlinetools-linux-7583922_latest.zip
RUN echo "yes" | ./cmdline-tools/bin/sdkmanager --sdk_root=${ANDROID_TOOLS} --install "ndk-bundle" "platform-tools" "platforms;android-${ANDROID_SDK_VERSION}"
63 changes: 27 additions & 36 deletions .github/workflows/android_arm64.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ jobs:
runs-on: ubuntu-latest
outputs:
affected_components: "${{ steps.smart_ci.outputs.affected_components }}"
changed_components: "${{ steps.smart_ci.outputs.changed_components }}"
skip_workflow: "${{ steps.smart_ci.outputs.skip_workflow }}"
steps:
- name: checkout action
Expand All @@ -40,15 +41,37 @@ jobs:
skip_when_only_listed_labels_set: 'docs'
skip_when_only_listed_files_changed: '*.md,*.rst,*.png,*.jpg,*.svg,*/layer_tests_summary/*,*/conformance/*'

Build:
Docker:
needs: Smart_CI
runs-on: aks-linux-4-cores-16gb-docker-build
container:
image: openvinogithubactions.azurecr.io/docker_build:0.2
volumes:
- /mount:/mount
outputs:
images: "${{ steps.handle_docker.outputs.images }}"
steps:
- name: Checkout
uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7

- uses: ./.github/actions/handle_docker
id: handle_docker
with:
images: |
ov_build/ubuntu_22_04_android_arm64
registry: 'openvinogithubactions.azurecr.io'
dockerfiles_root_dir: '.github/dockerfiles'
changed_components: ${{ needs.smart_ci.outputs.changed_components }}

Build:
needs: [Smart_CI, Docker]
timeout-minutes: 150
defaults:
run:
shell: bash
runs-on: aks-linux-16-cores-32gb
container:
image: openvinogithubactions.azurecr.io/dockerhub/ubuntu:20.04
image: ${{ fromJSON(needs.docker.outputs.images).ov_build.ubuntu_22_04_android_arm64 }}
volumes:
- /mount:/mount
options: -e SCCACHE_AZURE_BLOB_CONTAINER -e SCCACHE_AZURE_CONNECTION_STRING
Expand All @@ -64,18 +87,15 @@ jobs:
OPENVINO_REPO: '/__w/openvino/openvino/openvino'
VCPKG_ROOT: '/__w/openvino/openvino/vcpkg'
BUILD_DIR: '/__w/openvino/openvino/build'
ANDROID_TOOLS: '/__w/openvino/openvino/android_tools'
ANDROID_NDK_HOME: '/__w/openvino/openvino/android_tools/ndk-bundle'
ANDROID_TOOLS: '/deps/android_tools'
ANDROID_NDK_HOME: '/deps/android_tools/ndk-bundle'
ANDROID_SDK_VERSION: 29
ANDROID_ABI_CONFIG: arm64-v8a
VCPKG_DEFAULT_BINARY_CACHE: '/mount/caches/ccache/android_arm64/vcpkg_cache'
VCPKG_FORCE_SYSTEM_BINARIES: '1'
SCCACHE_AZURE_KEY_PREFIX: android_arm64
if: "!needs.smart_ci.outputs.skip_workflow"
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@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
with:
Expand Down Expand Up @@ -107,35 +127,6 @@ jobs:
- name: System info
uses: ./openvino/.github/actions/system_info

#
# 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~=3.28.0
# 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 pkgconf 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 }}"
- name: Install sccache
uses: mozilla-actions/sccache-action@89e9040de88b577a072e3760aaf59f585da083af # v0.0.5
with:
version: "v0.7.5"

#
# Build
#
Expand Down

0 comments on commit d14aacc

Please sign in to comment.