Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[docker:android-ndk-r22-jdk17-ubuntu24] android-ndk-r22-jdk17 running on Ubuntu 24.04 #93

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tomaszrybakiewicz
Copy link
Contributor

@tomaszrybakiewicz tomaszrybakiewicz commented Oct 4, 2024

[docker:android-ndk-r22-jdk17-ubuntu24]

  • android-ndk-r22-jdk17 image running on Ubuntu 24.04 (amd64)


# Install awscli
RUN set -eu \
&& pip3 install awscli --break-system-packages
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In Ubuntu 24.04, the system-managed Python enforces the usage of the virtual environment to install packages.
Given that the container using this image gets re-created for each CI job, we can confidently suppress that check by passing --break-system-packages.


# Install libffi for sdk-cicd
RUN set -eu \
apt-get update -y && apt-get -y install libffi-dev
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

sdk-cicd requires FFI library - on Ubuntu 24.04 that's https://packages.debian.org/buster/libffi-dev

Comment on lines +91 to +122
# Install Android NDK
# Use desired version from https://developer.android.com/ndk/downloads/index.html
# and update the checksum.
RUN set -eu \
&& curl -L --retry 3 https://dl.google.com/android/repository/android-ndk-r22-linux-x86_64.zip -o ndk.zip \
&& (echo "82274313aba10da6177fd41868f56a0f9651dd81 ndk.zip" | sha1sum -c) \
&& unzip -q ndk.zip && rm ndk.zip && mv android-ndk-r* ndk-bundle

# Install dependencies and build tools

RUN set -eu \
&& mkdir -p "${ANDROID_HOME}/licenses" \
&& echo "24333f8a63b6825ea9c5514f83c2829b004d1fee" > "${ANDROID_HOME}/licenses/android-sdk-license" \
&& tools/bin/sdkmanager --include_obsolete \
"--sdk_root=${ANDROID_HOME}" \
"platform-tools" \
"build-tools;28.0.3" \
"build-tools;29.0.2" \
"build-tools;29.0.3" \
"build-tools;30.0.2" \
"build-tools;30.0.3" \
"build-tools;33.0.2" \
"platforms;android-34" \
"platforms;android-33" \
"platforms;android-32" \
"platforms;android-31" \
"platforms;android-30" \
"platforms;android-29" \
"platforms;android-28" \
"extras;android;m2repository" \
"extras;google;m2repository" \
"cmake;3.10.2.4988404" \
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Recently we dropped pre-installing pretty much everything (NDKs, android version, build-tools...) in favour of downloading it every time (image we use in monorepo Common SDK).

It turned out to be faster to download every time instead of CI downloading the big image

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That seems like a step backward and very wasteful. Instead, we should create one base image - without Android packages and one image for each mono repo. Is there a limit to how many docker images we can publish?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure I understand what is wasteful? Do you mean dropping the android packages or having many images?

Copy link
Contributor Author

@tomaszrybakiewicz tomaszrybakiewicz Oct 9, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Download Android packages for each CI job. AFAIK, Circle CI bills us for storage space and network usage. So, if we can decrease network usage by preloading packages onto an image, I think we should do so.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're anyway download the image so there's not that much difference. Actually, IIRC downloading the original package is smaller than the additional size added to the image.

Moreover, not every android build uses all the version you're adding here. Therefore, every build is now "paying the price" of an image with all those that it doesn't need.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The best would be for you to measure it in CI and see what is the impact for yourself.

@tomaszrybakiewicz
Copy link
Contributor Author

tomaszrybakiewicz commented Oct 8, 2024

We need to fix our CI setup in this repo. We build a Docker image and publish it to the Docker hub before PR changes are approved. We should update it so that the publish job executes only after the PR is merged.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants