Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Android meets Docker
Search
Jing Li
October 17, 2017
Programming
0
140
Android meets Docker
Presented at DockerCon EU 2017
Jing Li
October 17, 2017
Tweet
Share
More Decks by Jing Li
See All by Jing Li
Android meets Docker
thyrlian
0
220
Android meets Docker
thyrlian
1
67
Android meets Docker
thyrlian
1
150
Android meets Docker
thyrlian
0
51
Android meets Docker
thyrlian
0
53
Other Decks in Programming
See All in Programming
Scala におけるコンパイラエラーとの付き合い方
chencmd
2
430
事業フェーズの変化に対応する 開発生産性向上のゼロイチ
masaygggg
0
200
Go1.23で入った errorsパッケージの小さなアプデ
kuro_kurorrr
2
390
Swiftコードバトル必勝法
toshi0383
0
170
『ドメイン駆動設計をはじめよう』中核の業務領域
masuda220
PRO
5
990
私のEbitengineの第一歩
qt_luigi
0
450
A New Era of Testing
mannodermaus
2
510
Some more adventure of Happy Eyeballs
coe401_
2
190
オートマトン学習しろ / Do automata learning
makenowjust
3
130
Scala アプリケーションのビルドを改善してデプロイ時間を 1/4 にした話 | How I improved the build of my Scala application and reduced deployment time by 4x
nomadblacky
1
180
Our Websites Need a Lifestyle Change, Not a Diet
ryantownsend
0
150
o1モデルのプロンプトエンジニアリングって?
ktc_wada
0
260
Featured
See All Featured
A Modern Web Designer's Workflow
chriscoyier
691
190k
Templates, Plugins, & Blocks: Oh My! Creating the theme that thinks of everything
marktimemedia
26
2k
Become a Pro
speakerdeck
PRO
22
4.9k
Art, The Web, and Tiny UX
lynnandtonic
294
20k
Practical Orchestrator
shlominoach
185
10k
Fireside Chat
paigeccino
31
2.9k
Happy Clients
brianwarren
96
6.6k
The MySQL Ecosystem @ GitHub 2015
samlambert
250
12k
Design by the Numbers
sachag
277
19k
Side Projects
sachag
451
42k
YesSQL, Process and Tooling at Scale
rocio
167
14k
BBQ
matthewcrist
83
9.2k
Transcript
Android Meets Docker Jing Li
Developer Story
Pain in the provision ∞ machines ( e.g. mobile CI
) Admin
Containerization vs Virtualization
Why Docker? Docker Vagrant Resource Isolation Low Extreme Supported OS
Linux * Boot / Stop Time Seconds Minutes Size MB GB
Docker for Android? Infer - A tool to detect bugs
in Java and ... code. Run Android SDK update in Docker container AUFS doesn't support hardlink move operations.
Solution for SDK update Mount SDK volume in container •
Minimal • Flexible • Persist • Share
NFS ✓ In one place ? Performance ⾠ No concurrent
writing
Benchmark
Performance Comparison 2 build types, 107 unit tests ( x2
= 214 ), 2 UI tests ./gradlew clean check :demo:connectedAndroidTest On-premises Docker (w/ cached AndroidSDK) 6 mins 48.0 secs Other online CI solutions (w/o optimization) > 10 mins
Android Devices • ARM emulator • x86 emulator (requires KVM)
• USB (needs privileged mode, ⛔ for macOS) • Wifi • Genymotion Cloud
Performance of 2 UI tests ARM emulator @ 2 mins
4.615 secs x86 emulator @ (on Linux Host) 23.497 secs Genymotion 25.335 secs
Out Of Memory
Memory Matters JVM is not container aware _JAVA_OPTIONS -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap
Exit Code 137 = 128 + 9 = SIGKILL = Killed 1 = SIGHUP = Hangup Comment killed by the kernel OOM killer JVM terminates the program and exits
Can we get any better? Gradle distributions
Gradle distributions mirror server • From: gradle/wrapper/gradle-wrapper.properties • To: ~/.gradle/wrapper/dists
• SSL certificate - needs to be trusted by Java keystore • /etc/hosts
And better? Gradle caches • Don’t waste time downloading dependencies
• ~/.gradle/caches/
Reveal • Encoding problem expected:<Hall[]chen> but was:<Hall[ö]chen> • Hard coded
Timezone in test expected: 2099-12-31T00:00:00.0000+0200 but was : 2099-12-31T00:00:00.0000+0000 • File & Path File#listFiles() -> File[] (sort order depends on OS) Machine-dependent Problem
What Else for Mobile • Integration Test • Prod /
Test server • unreliable network • complex setup • Docker • out of the box for mobile dev • Something else • Serverless ( Kotlin, Swift ) - reuse code
Thank you! ! thyrlian " thyrlian Docker Image: https://github.com/thyrlian/AndroidSDK