Android meets Docker. Jing Li

Similar documents
Android Studio Setup Procedure

Docker & why we should use it

Installation Instructions

Installation Instructions

Travis Cardwell Technical Meeting

docker & HEP: containerization of applications for development, distribution and preservation

Automating the Build Pipeline for Docker Container

Docker A FRAMEWORK FOR DATA INTENSIVE COMPUTING

Containers. Pablo F. Ordóñez. October 18, 2018

Docker und IBM Digital Experience in Docker Container

GitLab-CI and Docker Registry

DOCKER 101 FOR JS AFFICIONADOS. Christian Ulbrich, Zalari UG

Docker at Lyft Speeding up development Matthew #dockercon

Best Practices for Developing & Deploying Java Applications with Docker

Cloud Computing with APL. Morten Kromberg, CXO, Dyalog

DEPLOYMENT MADE EASY!

HOW TO DEVELOP FOR GLASS ENTERPRISE

Note that if you have a Branding Addon purchased, the WHM Feature Manager will show App Name you chose during the installation, instead of CrossBox.

Getting Started with Hadoop

An introduction to Docker

#jenkinsconf. Managing jenkins with multiple components project. Jenkins User Conference Israel. Presenter Name Ohad Basan

Portable, lightweight, & interoperable Docker containers across Red Hat solutions

Android SDK under Linux

Optimizing Docker Images

LENS Server Maintenance Guide JZ 2017/07/28

By: Jeeva S. Chelladhurai

Developing and Testing Java Microservices on Docker. Todd Fasullo Dir. Engineering

Linux Essentials Objectives Topics:

Dell EMC ME4 Series vsphere Client Plug-in

Introduction to containers

DevOps in the Cloud A pipeline to heaven?! Robert Cowham BCS CMSG Vice Chair

Engineering Robust Server Software

Chap2: Operating-System Structures

Getting Started With Cpsc (Advanced) Hosted by Jarrett Spiker

Important DevOps Technologies (3+2+3days) for Deployment

Cross platform enablement for the yocto project with containers. ELC 2017 Randy Witt Intel Open Source Technology Center

WES 237A Project Part 1 Guide

IBM z Systems Development and Test Environment Tools User's Guide IBM

Parallelizing CI using Docker Swarm-Mode

Docker task in HPC Pack

Dockerfile & docker CLI Cheat Sheet

DEVELOPMENT GUIDE VAB-630. Android BSP v

How To Install Java Manually Linux Ubuntu Bit

Creating pipelines that build, test and deploy containerized artifacts Slides: Tom Adams

CONTINUOUS INTEGRATION CONTINUOUS DELIVERY

AMM Feb/2018. Frederic Marec Embedded Engineer

Introduction to Containers

IBM Cloud Developer Tools (IDT) and App Service Console Overview

APEX Installation Guide. Sven van der Meer, Liam Fallon, John Keeney. Version SNAPSHOT, T16:01:13Z

Tool installation for PMC-MC-X2/X4 with P2020 series processor

USING NGC WITH GOOGLE CLOUD PLATFORM

Fosdem Feb/2018. Frederic Marec Embedded Engineer

Midterm Presentation Schedule

Deployment Patterns using Docker and Chef

Container-based virtualization: Docker

Investigating Containers for Future Services and User Application Support

Lab 8: Building Microservices on Oracle Autonomous Transaction Processing Service

Network softwarization Lab session 2: OS Virtualization Networking

Advanced Continuous Delivery Strategies for Containerized Applications Using DC/OS

Follow me!

Dockerfile Best Practices

Harbor Registry. VMware VMware Inc. All rights reserved.

Project 1 Setup. Some relevant details are the output of: 1. uname -a 2. cat /etc/*release 3. whereis java 4. java -version 5.

Getting Started With Containers

DevOps Workflow. From 0 to kube in 60 min. Christian Kniep, v Technical Account Manager, Docker Inc.

SQL Server Containers for Developers. Julie Lerman

CS370 Operating Systems

Android System Development Training 4-day session

Linux for Beginners. Windows users should download putty or bitvise:

Red Hat Containers Cheat Sheet

Build, test and release your python packages

Oracle Endeca Server. Installation Guide. Version January 2016

Docker Cheat Sheet. Introduction

How to Implement a Web-based Terminal with Docker

Introduction To Linux. Rob Thomas - ACRC

OpenEMR Insights Configuration Instructions

containerization: more than the new virtualization

Linux Systems Administration Getting Started with Linux

swiftenv Documentation

USING DOCKER FOR MXCUBE DEVELOPMENT AT MAX IV

Challenges in Cutting Edge CI. #jenkinsconf. Real-life story. Jenkins User Conference Israel #jenkinsconf. Gil

Who is Docker and how he can help us? Heino Talvik

Tutorial on Basic Android Setup

Accelerate at DevOps Speed With Openshift v3. Alessandro Vozza & Samuel Terburg Red Hat

Docker 101 Workshop. Eric Smalling - Solution Architect, Docker

UP! TO DOCKER PAAS. Ming

TECHNICAL BRIEF. Scheduling and Orchestration of Heterogeneous Docker-Based IT Landscapes. January 2017 Version 2.0 For Public Use

Dr. Roland Huß, Red

Initial setting up of VPN Java version.

~Deep dive into Windows Containers and Docker~

AZURE CONTAINER INSTANCES

How Docker Compose Changed My Life

Continuous Integration and Deployment (CI/CD)

The Galaxy Docker Project. our hands-on tutorial

SQL Server Administration on Linux 2017

SD Card with Eclipse/Emulator

/ Cloud Computing. Recitation 5 September 26 th, 2017

Ios Sdk Documentation For Windows 7 32 Bit. Latest Version >>>CLICK HERE<<<

X(cross) Development System make AGL application development easier. December 2017 Sébastien Douheret

Running Blockchain in Docker Containers Prerequisites Sign up for a LinuxONE Community Cloud trial account Deploy a virtual server instance

Transcription:

Android meets Docker Jing Li 1

2

> 50 cities in Europe 3

Developer Story 4

Pain in the Admin provision machines ( e.g. mobile CI ) 5

Containerization vs Virtualization 6

Why Docker? Docker Vagrant Resource Isolation Low Extreme Supported OS Linux * Boot / Stop Time Seconds Minutes Size MB GB 7

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. 8

Docker ABC image vs container build vs pull Let s go! 9

Dockerfile reference FROM - base image RUN - execute commands in a new layer ENV - set the environment variable ADD - copy files to image EXPOSE - listen on the specified network port CMD - provide defaults for an executing container 10

Dockerfile FROM ubuntu:16.04 # support multiarch: i386 architecture # install Java # install essential tools # install Qt RUN dpkg --add-architecture i386 && \ apt-get update -y && \ apt-get install -y libncurses5:i386 libc6:i386 libstdc++6:i386 lib32gcc1 lib32ncurses5 lib32z1 zlib1g:i386 && \ apt-get install -y --no-install-recommends openjdk-8-jdk && \ apt-get install -y git wget zip && \ apt-get install -y qt5-default 11

Dockerfile # download and install Gradle ENV GRADLE_VERSION 4.2.1 RUN cd /opt && \ wget -q https://services.gradle.org/distributions/gradle-${gradle_version}-bin.zip && \ unzip gradle*.zip && \ ls -d */ sed 's/\/*$//g' xargs -I{} mv {} gradle && \ rm gradle*.zip # download and install Kotlin compiler ENV KOTLIN_VERSION 1.1.51 RUN cd /opt && \ wget -q https://github.com/jetbrains/kotlin/releases/download/v${kotlin_version}/kotlincompiler-${kotlin_version}.zip && \ unzip *kotlin*.zip && \ rm *kotlin*.zip 12

Dockerfile # download and install Android SDK ENV ANDROID_SDK_VERSION 3859397 RUN mkdir -p /opt/android-sdk && cd /opt/android-sdk && \ wget -q https://dl.google.com/android/repository/sdk-tools-linux-${android_sdk_version}.zip && \ unzip *tools*linux*.zip && \ rm *tools*linux*.zip # set the environment variables ENV JAVA_HOME /usr/lib/jvm/java-8-openjdk-amd64 ENV GRADLE_HOME /opt/gradle ENV KOTLIN_HOME /opt/kotlinc ENV ANDROID_HOME /opt/android-sdk ENV PATH ${PATH}:${GRADLE_HOME}/bin:${KOTLIN_HOME}/bin:${ANDROID_HOME}/tools:${ANDROID_HOME}/platform-tools:$ {ANDROID_HOME}/tools/bin:${ANDROID_HOME}/emulator ENV _JAVA_OPTIONS -XX:+UnlockExperimentalVMOptions -XX:+UseCGroupMemoryLimitForHeap # WORKAROUND: for issue https://issuetracker.google.com/issues/37137213 ENV LD_LIBRARY_PATH ${ANDROID_HOME}/emulator/lib64:${ANDROID_HOME}/emulator/lib64/qt/lib 13

Dockerfile # accept the license agreements of the SDK components ADD license_accepter.sh /opt/ RUN /opt/license_accepter.sh $ANDROID_HOME # install and configure SSH server ADD banner.net /etc/ ADD authorized_keys /tmp/ EXPOSE 22 RUN apt-get update -y && \ apt-get install -y openssh-server supervisor locales && \... ADD supervisord.conf /etc/supervisor/conf.d/ CMD ["/usr/bin/supervisord"] 14

Dockerfile Best Practices Single responsibility use compose for orchestration Minimize the number of layers layer = intermediate image, supports caching Size matters, use what you have Install & un- by separated steps will image size Readability 15

Solution for SDK update Mount SDK volume in container Minimal Flexible Persist Share 16

Different Approaches Mount SDK volume BTRFS storage driver One image per Android API level 17

NFS In one place? Performance No concurrent writing 18

Benchmark 19

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 20

Android Devices ARM emulator x86 emulator (requires KVM) USB (needs privileged mode, for macos) Wifi Genymotion Cloud 21

Performance of 2 UI tests ARM emulator @ 2 mins 4.615 secs x86 emulator @ (on Linux Host) 23.497 secs Genymotion 25.335 secs 22

Out Of Memory 23

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 24

SSH Mind your language locale-gen en en_us en_us.utf-8 Set up env /root/.ssh/environment Authorization /root/.ssh/authorized_keys 25

Jenkins Env Var Global level Configure System -> Global properties -> Environment variables Node level Manage Nodes -> Configure Node -> Node Properties -> Environment variables Job level Configure Job -> Build -> Build Step -> Execute shell Plugin: Environment Injector -> Inject variables to the build process / as a build step 26

Can we get any better? Gradle distributions 27

Gradle distributions mirror server From: gradle/wrapper/gradle-wrapper.properties To: ~/.gradle/wrapper/dists SSL cert - needs to be trusted by Java keystore /etc/hosts 28

And better? Gradle caches Don t waste time downloading dependencies ~/.gradle/caches/ 29

Reveal Machine-dependent Problem 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) 30

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 31

Hiring Offices in Hamburg, Berlin, Barcelona and etc. Visa sponsor, offering relocation Android Developer ios Developer Backend / Frontend / Data / * Engineers https://de.mytaxi.com/jobs 32

спасибо!! thyrlian " thyrlian Docker Image: https://github.com/thyrlian/androidsdk 33