Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Sign up for free
Menu
Search
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Features
All features
Private URLs
Password Protection
Custom URLS
Scheduled publishing
Remove Branding
Restrict embedding
Deck Collections
Notes
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Explore
Featured decks
Featured speakers
Programming
Technology
Storyboards
Pricing
Search
Sign in
Sign up for free
Android meets Docker
Search
Jing Li
October 17, 2017
Programming
170
0
Share
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
Android meets Docker
Presented at DockerCon EU 2017
Jing Li
October 17, 2017
Transcript
20 slides
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
More Decks by Jing Li
See All by Jing Li
Android meets Docker
thyrlian
0
270
Android meets Docker
thyrlian
1
81
Android meets Docker
thyrlian
1
210
Android meets Docker
thyrlian
0
62
Android meets Docker
thyrlian
0
63
Other Decks in Programming
See All in Programming
Materialが消えた日 〜真っ白なFlutterキャンバスにRenderObjectで絵を描く〜
umigishiaoi
0
170
小さなアプリを作って公開するまで
onozaty
0
190
protojson における文字化けの扱い
kazuki1023
0
440
あなたはMCPの機能を、まだ知らない。
4geru
1
430
[DroidKnights 2026] Workflow AX: From Auto-Documented Policies to E2E Testing
raeminkang
0
580
느린 네트워크와 저사양 디바이스 사용자를 위한 웹뷰 로딩 시간 개선기
kmkim
1
240
Goコンパイラを作ってGoをもっと理解する / Build a Go compiler to better understand Go
ikura_hamu
0
130
GraphQL の onError と Nullability のこれから
quramy
0
220
クラウドエージェントは、 何がそんなに便利なのか / what makes cloud agents so useful
rkaga
5
900
AI駆動開発4年目の現在地(『あなたはFDEになるべきか?』イベント資料)
kumaiu
0
640
Growing PicoRuby's Ecosystem on ESP32
yuuu
2
140
TS 7.0 で baseUrl が使えなくなった今、パスエイリアスをどうするか
bicstone
2
680
Featured
See All Featured
Building a Modern Day E-commerce SEO Strategy
aleyda
45
9.3k
Dealing with People You Can't Stand - Big Design 2015
cassininazir
367
27k
How to optimise 3,500 product descriptions for ecommerce in one day using ChatGPT
katarinadahlin
PRO
3
3.9k
Discover your Explorer Soul
emna__ayadi
2
1.3k
Optimising Largest Contentful Paint
csswizardry
37
4k
Music & Morning Musume
bryan
48
7.5k
The SEO Collaboration Effect
kristinabergwall1
1
620
Self-Hosted WebAssembly Runtime for Runtime-Neutral Checkpoint/Restore in Edge–Cloud Continuum
chikuwait
0
950
The Illustrated Children's Guide to Kubernetes
chrisshort
51
53k
A better future with KSS
kneath
240
18k
Visual Storytelling: How to be a Superhuman Communicator
reverentgeek
2
750
Lightning Talk: Beautiful Slides for Beginners
inesmontani
PRO
2
840