[Test] Made Android docker to have NDK & CMake installed (#33449)

It is not uncommon for Android tests to fail due to an NDK download
failure. To address this issue, the Android Docker image has been
updated to include NDK and CMake. This will help to avoid download
problem.

I verified this works as intended to see the invocation log not having
installation log for NDK and CMake such as

```
Checking the license for package NDK (Side by side) 25.1.8937393 in /opt/android-sdk/licenses
License for package NDK (Side by side) 25.1.8937393 accepted.
Preparing "Install NDK (Side by side) 25.1.8937393 (revision: 25.1.8937393)".
"Install NDK (Side by side) 25.1.8937393 (revision: 25.1.8937393)" ready.
Installing NDK (Side by side) 25.1.8937393 in /opt/android-sdk/ndk/25.1.8937393
"Install NDK (Side by side) 25.1.8937393 (revision: 25.1.8937393)" complete.
"Install NDK (Side by side) 25.1.8937393 (revision: 25.1.8937393)" finished.
Checking the license for package CMake 3.10.2.4988404 in /opt/android-sdk/licenses
License for package CMake 3.10.2.4988404 accepted.
Preparing "Install CMake 3.10.2.4988404 (revision: 3.10.2)".
"Install CMake 3.10.2.4988404 (revision: 3.10.2)" ready.
Installing CMake 3.10.2.4988404 in /opt/android-sdk/cmake/3.10.2.4988404
"Install CMake 3.10.2.4988404 (revision: 3.10.2)" complete.
"Install CMake 3.10.2.4988404 (revision: 3.10.2)" finished.
```
This commit is contained in:
Esun Kim 2023-06-15 11:04:53 -07:00 committed by GitHub
parent ac3b42499e
commit cd74cfe49a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 11 additions and 1 deletions

View File

@ -38,6 +38,11 @@
ENV ANDROID_HOME /opt/android-sdk
RUN yes | $ANDROID_SDK_PATH/tools/bin/sdkmanager --licenses # accept all licenses
# Install Android NDK & CMake
# This is not required but desirable to reduce the time to download and the chance of download failure.
RUN mkdir -p ~/.android && touch ~/.android/repositories.cfg
RUN $ANDROID_SDK_PATH/tools/bin/sdkmanager 'ndk;25.1.8937393' 'cmake;3.10.2.4988404'
# Install gcloud
RUN curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-407.0.0-linux-x86_64.tar.gz && ${'\\'}
tar -xf google-cloud-cli-407.0.0-linux-x86_64.tar.gz && ${'\\'}

View File

@ -1 +1 @@
us-docker.pkg.dev/grpc-testing/testing-images-public/android_ndk:47e2befd3ceab97fa3e8ad5b8499b684380d624d@sha256:256ff2bb8fd6c6921cd7653f79fa495669c6466f78df96f71867f89f6d487ff3
us-docker.pkg.dev/grpc-testing/testing-images-public/android_ndk:b21742719ae22d6ac607d98b4a8d794cebe68542@sha256:2bddf36ae504968b35f97e4a6c9b74864473689e84049675c30afb70f868d897

View File

@ -105,6 +105,11 @@ ENV ANDROID_SDK_PATH /opt/android-sdk
ENV ANDROID_HOME /opt/android-sdk
RUN yes | $ANDROID_SDK_PATH/tools/bin/sdkmanager --licenses # accept all licenses
# Install Android NDK & CMake
# This is not required but desirable to reduce the time to download and the chance of download failure.
RUN mkdir -p ~/.android && touch ~/.android/repositories.cfg
RUN $ANDROID_SDK_PATH/tools/bin/sdkmanager 'ndk;25.1.8937393' 'cmake;3.10.2.4988404'
# Install gcloud
RUN curl -O https://dl.google.com/dl/cloudsdk/channels/rapid/downloads/google-cloud-cli-407.0.0-linux-x86_64.tar.gz && \
tar -xf google-cloud-cli-407.0.0-linux-x86_64.tar.gz && \