Mobile: DevOps or Not DevOps

Mobile: DevOps or Not DevOps

C31c40522f24fa40daac53c0dda3d51a?s=128

Vladimir Ivanov

October 30, 2019
Tweet

Transcript

  1. Mobile: DevOps or not DevOps 1

  2. Такие чудеса, Гораций, не снились нашим DevOps-ам. 2

  3. My self 3

  4. My self • Vladimir Ivanov 3

  5. My self • Vladimir Ivanov • EPAM Systems 3

  6. You 4

  7. Mobile Landscape 5

  8. 6

  9. 7

  10. DevOps Prac,ces 8

  11. DevOps Prac,ces • Con%nuous integra%on 8

  12. DevOps Prac,ces • Con%nuous integra%on • Con%nuous delivery 8

  13. DevOps Prac,ces • Con%nuous integra%on • Con%nuous delivery • Secured

    process 8
  14. DevOps Prac,ces • Con%nuous integra%on • Con%nuous delivery • Secured

    process • Frequent releases(Canary/BG deployments) 8
  15. DevOps Prac,ces • Con%nuous integra%on • Con%nuous delivery • Secured

    process • Frequent releases(Canary/BG deployments) • Automated tes%ng 8
  16. DevOps Prac,ces • Con%nuous integra%on • Con%nuous delivery • Secured

    process • Frequent releases(Canary/BG deployments) • Automated tes%ng • Monitoring 8
  17. DevOps Prac,ces • Con%nuous integra%on • Con%nuous delivery • Secured

    process • Frequent releases(Canary/BG deployments) • Automated tes%ng • Monitoring • Automated rollback 8
  18. Alena 9

  19. Con$nuous Integra$on 10

  20. Deploy 11

  21. 12

  22. 13

  23. Rollouts 14

  24. Rollouts • Internal tes+ng, Alpha and Beta channels in Google

    Play 14
  25. Rollouts • Internal tes+ng, Alpha and Beta channels in Google

    Play • Internal tes+ng, Public Tes+ng in TestFlight 14
  26. Rollouts • Internal tes+ng, Alpha and Beta channels in Google

    Play • Internal tes+ng, Public Tes+ng in TestFlight • Public releases support staged rollouts 14
  27. Sign 15

  28. Secured process 16

  29. 17

  30. 18

  31. Android Sign 19

  32. Android Sign • Keystore(Java Keystore) 19

  33. Android Sign • Keystore(Java Keystore) • Store pass 19

  34. Android Sign • Keystore(Java Keystore) • Store pass • Key

    alias 19
  35. Android Sign • Keystore(Java Keystore) • Store pass • Key

    alias • Key pass 19
  36. 20

  37. 21

  38. 22

  39. DevOps Prac,ces • Con%nuous integra%on ✅ • Con%nuous delivery ✅

    • Secured process ✅ • Frequent releases(Canary/BG deployments) • Automated tes%ng • Monitoring • Automated rollback 23
  40. Review 24

  41. GP used to take 3-4 hours AppStore used to take

    2 weeks 25
  42. GP takes 3-4 hours days AppStore used to take 2

    weeks days 26
  43. DevOps Prac,ces • Con%nuous integra%on ✅ • Con%nuous delivery ✅

    • Secured process ✅ • Frequent releases(Canary/BG deployments) • Automated tes%ng • Monitoring • Automated rollback 27
  44. e2e tests 28

  45. 29

  46. Issues e2e tests 30

  47. Issues e2e tests • Takes a lot of ,me 30

  48. Issues e2e tests • Takes a lot of ,me •

    Requires devices 30
  49. How to cope with devices? 31

  50. How to cope with devices? • Buy our own(expensive) 31

  51. How to cope with devices? • Buy our own(expensive) •

    Test on Emulators(bad quality) 31
  52. How to cope with devices? • Buy our own(expensive) •

    Test on Emulators(bad quality) • Device Farms 31
  53. 32

  54. Device Farms 33

  55. Device Farms • AWS Device Farm 33

  56. Device Farms • AWS Device Farm • Firebase device farm

    33
  57. Device Farms • AWS Device Farm • Firebase device farm

    • Azure Device Farm 33
  58. Device Farms • AWS Device Farm • Firebase device farm

    • Azure Device Farm • Others 33
  59. Device Farms • AWS Device Farm • Firebase device farm

    • Azure Device Farm • Others • Your own 33
  60. Building your own 34

  61. What would you need 35

  62. What would you need • Web Server 35

  63. What would you need • Web Server • Logs Storage

    35
  64. What would you need • Web Server • Logs Storage

    • Devices 35
  65. What would you need • Web Server • Logs Storage

    • Devices • Media to connect to the devices(add, xcrun) 35
  66. Easy part... 36

  67. Easy part... • List of devices $ adb devices $

    xcrun simctl list 36
  68. 37

  69. Easy part... 38

  70. Easy part... • List of devices $ adb devices $

    xcrun simctl list 38
  71. Easy part... • List of devices $ adb devices $

    xcrun simctl list • Installa1on and uploading files $ adb push selfie.png /sdcard0/Downloads $ adb install -r myCoolApp.apk $ xcrun altool --upload-app --type ios --file "path/ to/application.ipa" --username "YOUR_ITMC_USER" -- password "YOUR_ITMC_PASSWORD" 38
  72. Complex thing 39

  73. Complex thing • Streaming Android: adb, scrcpy2 tool iOS: xcrun

    2 h$ps:/ /blog.rom1v.com/2018/03/introducing-scrcpy/ 39
  74. 40

  75. In EPAM 41

  76. In EPAM • Mobile farm for Mobile CC 41

  77. In EPAM • Mobile farm for Mobile CC • Free

    for the projects at the moment 41
  78. In EPAM • Mobile farm for Mobile CC • Free

    for the projects at the moment • Plans for commercial offerings 41
  79. DevOps Prac,ces • Con%nuous integra%on ✅ • Con%nuous delivery ✅

    • Secured process ✅ • Frequent releases(Canary/BG deployments) • Automated tes%ng ✅ • Monitoring • Automated rollback 42
  80. 43

  81. Observability 44

  82. Observability • Mobile apps run on the user devices and

    deployed through stores which make them unmanageable 44
  83. Observability • Mobile apps run on the user devices and

    deployed through stores which make them unmanageable • However observability is s:ll in place 44
  84. Crash Repor+ng and Analy+cs 45

  85. Crash Repor+ng and Analy+cs • Your own(with help of ACRA)

    45
  86. Crash Repor+ng and Analy+cs • Your own(with help of ACRA)

    • Firebase Analy:cs 45
  87. Crash Repor+ng and Analy+cs • Your own(with help of ACRA)

    • Firebase Analy:cs • AppCenter 45
  88. Crash Repor+ng and Analy+cs • Your own(with help of ACRA)

    • Firebase Analy:cs • AppCenter • Sentry 45
  89. Crash Repor+ng and Analy+cs • Your own(with help of ACRA)

    • Firebase Analy:cs • AppCenter • Sentry • Bugsnag 45
  90. What can be gathered 46

  91. What can be gathered • Free device memory 46

  92. What can be gathered • Free device memory • Free

    process memory 46
  93. What can be gathered • Free device memory • Free

    process memory • Device, OS Version 46
  94. What can be gathered • Free device memory • Free

    process memory • Device, OS Version • Ac6ve users 46
  95. What can be gathered • Free device memory • Free

    process memory • Device, OS Version • Ac6ve users • Session lengths 46
  96. What can be gathered • Free device memory • Free

    process memory • Device, OS Version • Ac6ve users • Session lengths • Thread dump 46
  97. What can be gathered • Free device memory • Free

    process memory • Device, OS Version • Ac6ve users • Session lengths • Thread dump • Stacktrace 46
  98. What can be gathered • Free device memory • Free

    process memory • Device, OS Version • Ac6ve users • Session lengths • Thread dump • Stacktrace • Many more 46
  99. 47

  100. Mar$n 48

  101. 49

  102. Compila(on/Obfusca(on, my ass 50

  103. 51

  104. 52

  105. 53

  106. 54

  107. 55

  108. AppCenter 56

  109. 57

  110. DevOps Prac,ces • Con%nuous integra%on ✅ • Con%nuous delivery ✅

    • Secured process ✅ • Frequent releases(Canary/BG deployments) • Automated tes%ng ✅ • Monitoring ✅ • Automated rollback 58
  111. Unfortunately 59

  112. No rollbacks of unsuccessful releases 60

  113. You need to build a new version and deploy it

    instead 61
  114. 62

  115. Possible solu*ons 63

  116. Possible solu*ons • Feature flags and server configs 63

  117. Possible solu*ons • Feature flags and server configs • Usage

    of React-Na7ve or other js based technologies 63
  118. DevOps Prac,ces • Con%nuous integra%on ✅ • Con%nuous delivery ✅

    • Secured process ✅ • Frequent releases(Canary/BG deployments) • Automated tes%ng ✅ • Monitoring ✅ • Automated rollback ❌ 64
  119. Caveats 65

  120. Hardware 66

  121. Hardware • Android can be built anywhere 66

  122. Hardware • Android can be built anywhere • iOS -

    only on Mac machines 66
  123. Long build+mes 67

  124. How to fight long build /mes 68

  125. How to fight long build /mes • Iden&fying slow code

    parts 68
  126. How to fight long build /mes • Iden&fying slow code

    parts • Caching dependencies 68
  127. How to fight long build /mes • Iden&fying slow code

    parts • Caching dependencies • Modulariza&on 68
  128. How to fight long build /mes • Iden&fying slow code

    parts • Caching dependencies • Modulariza&on • Build systems hacks 68
  129. How to fight long build /mes • Iden&fying slow code

    parts • Caching dependencies • Modulariza&on • Build systems hacks • And more10 10 h%ps:/ /medium.com/@joshgare/8-9ps-to-speed-up-your-swi=-build-and-compile-9mes-in-xcode-73081e1d84ba 68
  130. Caching 69

  131. iOS 70

  132. iOS • CocoaPods 70

  133. iOS • CocoaPods • Carthage 70

  134. iOS • CocoaPods • Carthage • Swi1PM 70

  135. iOS 71

  136. iOS • CocoaPods - source code based, own build spec

    71
  137. iOS • CocoaPods - source code based, own build spec

    • Carthage - dynamic frameworks 71
  138. iOS • CocoaPods - source code based, own build spec

    • Carthage - dynamic frameworks • Swi=PM - built by Apple 71
  139. iOS • CocoaPods - source code based, own build spec

    • Carthage - dynamic frameworks • Swi=PM - built by Apple • no resources support 71
  140. iOS • CocoaPods - source code based, own build spec

    • Carthage - dynamic frameworks • Swi=PM - built by Apple • no resources support • single language per package 71
  141. iOS • CocoaPods - source code based, own build spec

    • Carthage - dynamic frameworks • Swi=PM - built by Apple • no resources support • single language per package • problems having binary deps 71
  142. Android 72

  143. Android • Gradle 72

  144. Android • Gradle • Bazel/BUCK for companies with BIG apps

    72
  145. 73

  146. React-Na(ve doesn't benefit from caching 74

  147. But does benefit from building two apps within a single

    run 75
  148. 76

  149. 77

  150. • Checkout the code 77

  151. • Checkout the code • Install the dependencies 77

  152. • Checkout the code • Install the dependencies • Compile

    Android 77
  153. • Checkout the code • Install the dependencies • Compile

    Android • Compile iOS 77
  154. • Checkout the code • Install the dependencies • Compile

    Android • Compile iOS • Sign both 77
  155. • Checkout the code • Install the dependencies • Compile

    Android • Compile iOS • Sign both • Deploy both 77
  156. • Checkout the code • Install the dependencies • Compile

    Android • Compile iOS • Sign both • Deploy both 78
  157. Modulariza*on 79

  158. 80

  159. How to start ./gradlew clean assembleDebug --scan 81

  160. Gradle 82

  161. Gradle • Takes 1 minute to configure 1300 modules 82

  162. Gradle • Takes 1 minute to configure 1300 modules •

    Due to IO and unlimited immutability 82
  163. Bazel See the talk of Artem Zinnatullin1 1 h$ps:/ /www.droidcon.com/media-detail?video=362742329

    83
  164. Your CI/CD pipeline should support it all! 84

  165. Approaches 85

  166. Approaches 86

  167. Approaches • Install Jenkins/TeamCity/Whatever else 86

  168. Approaches • Install Jenkins/TeamCity/Whatever else • Spawn a Jenkins VM/Container

    in a Cloud 86
  169. Approaches • Install Jenkins/TeamCity/Whatever else • Spawn a Jenkins VM/Container

    in a Cloud • Use SaaS 86
  170. Local Jenkins 87

  171. Local Jenkins • Free 87

  172. Local Jenkins • Free • Great flexibility 87

  173. Local Jenkins • Free • Great flexibility • Agents system

    87
  174. Local Jenkins • Free • Great flexibility • Agents system

    • Decent plugin system 87
  175. Local Jenkins • Free • Great flexibility • Agents system

    • Decent plugin system • For iOS: just install an agent on a Mac 87
  176. Local Jenkins • Free • Great flexibility • Agents system

    • Decent plugin system • For iOS: just install an agent on a Mac • But no containeriza@on out-of-the-box 87
  177. Local Jenkins • Free • Great flexibility • Agents system

    • Decent plugin system • For iOS: just install an agent on a Mac • But no containeriza@on out-of-the-box • All support burden is on your shoulders 87
  178. It should be managed 88

  179. 89

  180. 90

  181. 91

  182. Pros ✨ More than 400 integra.ons " 100% open source

    under the MIT license ⚒ Runs on your machine, it's your app and your data $ Supports iOS, Mac, and Android apps % Extendable 92
  183. When 93

  184. When • For educa+on purposes and student projects 93

  185. When • For educa+on purposes and student projects • For

    companies which already use Jenkins 93
  186. When • For educa+on purposes and student projects • For

    companies which already use Jenkins • For security paranoids(debatable) 93
  187. Jenkins in Cloud 94

  188. Jenkins in Cloud • Solves the containeriza1on issue 94

  189. Jenkins in Cloud • Solves the containeriza1on issue • Support

    burden is par1ally decreased 94
  190. Jenkins in Cloud • Solves the containeriza1on issue • Support

    burden is par1ally decreased • Unclear how to solve Mac issue 94
  191. 3rd party services 95

  192. 3rd party services 96

  193. 3rd party services • GitLab CI 96

  194. 3rd party services • GitLab CI • Circle CI 96

  195. 3rd party services • GitLab CI • Circle CI •

    Nevercode 96
  196. 3rd party services • GitLab CI • Circle CI •

    Nevercode • App Center 96
  197. 3rd party services • GitLab CI • Circle CI •

    Nevercode • App Center • Bitrise 96
  198. GitLab CI/Circle CI 97

  199. GitLab CI/Circle CI • Very basic support(mac machines, xcode, gradle)

    97
  200. GitLab CI/Circle CI • Very basic support(mac machines, xcode, gradle)

    • Integra;on with the parent tool 97
  201. GitLab CI/Circle CI • Very basic support(mac machines, xcode, gradle)

    • Integra;on with the parent tool • Yaml editor as an interface 97
  202. GitLab CI/Circle CI • Very basic support(mac machines, xcode, gradle)

    • Integra;on with the parent tool • Yaml editor as an interface • Almost no mobile specific involved 97
  203. App Center 98

  204. App Center - Azure DevOps 99

  205. App Center - Azure DevOps • Part of the integrated

    environment(former TFS) 99
  206. App Center - Azure DevOps • Part of the integrated

    environment(former TFS) • Distribu:on des:na:ons - GP, TestFlight, Internal 99
  207. App Center - Azure DevOps • Part of the integrated

    environment(former TFS) • Distribu:on des:na:ons - GP, TestFlight, Internal • Bitbucket, Github, VSTS, GitLab(!) 99
  208. App Center - Azure DevOps • Part of the integrated

    environment(former TFS) • Distribu:on des:na:ons - GP, TestFlight, Internal • Bitbucket, Github, VSTS, GitLab(!) • Configura:on as Code ✅ 99
  209. App Center - Azure DevOps • Part of the integrated

    environment(former TFS) • Distribu:on des:na:ons - GP, TestFlight, Internal • Bitbucket, Github, VSTS, GitLab(!) • Configura:on as Code ✅ • Mobile Apps as first class ci:zens ✅ 99
  210. App Center - Azure DevOps • Part of the integrated

    environment(former TFS) • Distribu:on des:na:ons - GP, TestFlight, Internal • Bitbucket, Github, VSTS, GitLab(!) • Configura:on as Code ✅ • Mobile Apps as first class ci:zens ✅ • Cloud based ✅ 99
  211. App Center - Azure DevOps • Part of the integrated

    environment(former TFS) • Distribu:on des:na:ons - GP, TestFlight, Internal • Bitbucket, Github, VSTS, GitLab(!) • Configura:on as Code ✅ • Mobile Apps as first class ci:zens ✅ • Cloud based ✅ • Allows for Machine Pools(which solves Mac issue) 99
  212. App Center - Azure DevOps • Part of the integrated

    environment(former TFS) • Distribu:on des:na:ons - GP, TestFlight, Internal • Bitbucket, Github, VSTS, GitLab(!) • Configura:on as Code ✅ • Mobile Apps as first class ci:zens ✅ • Cloud based ✅ • Allows for Machine Pools(which solves Mac issue) • Webhooks 99
  213. App Center - Azure DevOps 100

  214. App Center - Azure DevOps • Support for ad-hoc git

    servers ❌ 100
  215. App Center - Azure DevOps • Support for ad-hoc git

    servers ❌ • SonarQube Support - ❌ 100
  216. App Center - Azure DevOps • Support for ad-hoc git

    servers ❌ • SonarQube Support - ❌ • Local debug - ❌ 100
  217. App Center - When 101

  218. App Center - When • You already have Azure DevOps/Azure

    subscrip8on 101
  219. App Center - When • You already have Azure DevOps/Azure

    subscrip8on • You're hosted in Bitbucket/Github 101
  220. App Center - When • You already have Azure DevOps/Azure

    subscrip8on • You're hosted in Bitbucket/Github • You only want apps distribu8on solu8on 101
  221. 102

  222. Nevercode 103

  223. Nevercode • Mobile Centric CI/CD 103

  224. Nevercode • Mobile Centric CI/CD • Distribu3on des3na3ons - App

    Store Connect, Google Play, HockeyApp, Crashly3cs, TestFairy 103
  225. Nevercode • Mobile Centric CI/CD • Distribu3on des3na3ons - App

    Store Connect, Google Play, HockeyApp, Crashly3cs, TestFairy • Bitbucket, GitHub or GitLab 103
  226. Nevercode • Mobile Centric CI/CD • Distribu3on des3na3ons - App

    Store Connect, Google Play, HockeyApp, Crashly3cs, TestFairy • Bitbucket, GitHub or GitLab • Cloud based ✅ 103
  227. Nevercode • Mobile Centric CI/CD • Distribu3on des3na3ons - App

    Store Connect, Google Play, HockeyApp, Crashly3cs, TestFairy • Bitbucket, GitHub or GitLab • Cloud based ✅ • Mobile Apps as first class ci3zens ✅ 103
  228. Nevercode • Mobile Centric CI/CD • Distribu3on des3na3ons - App

    Store Connect, Google Play, HockeyApp, Crashly3cs, TestFairy • Bitbucket, GitHub or GitLab • Cloud based ✅ • Mobile Apps as first class ci3zens ✅ • Webhooks ✅ 103
  229. Nevercode 104

  230. Nevercode • Configura*on as Code ❌ 104

  231. Nevercode • Configura*on as Code ❌ • Pricy ❌ 104

  232. Nevercode - When 105

  233. Nevercode - When • Flu%er apps 105

  234. Bitrise 106

  235. Bitrise • Mobile Centric CI/CD 106

  236. Bitrise • Mobile Centric CI/CD • Distribu3on des3na3ons - GP,

    TestFlight, TestFairy, App Center, Whatever 106
  237. Bitrise • Mobile Centric CI/CD • Distribu3on des3na3ons - GP,

    TestFlight, TestFairy, App Center, Whatever • Bitbucket, Github, Custom 106
  238. Bitrise • Mobile Centric CI/CD • Distribu3on des3na3ons - GP,

    TestFlight, TestFairy, App Center, Whatever • Bitbucket, Github, Custom • Configura3on as Code ✅ 106
  239. Bitrise • Mobile Centric CI/CD • Distribu3on des3na3ons - GP,

    TestFlight, TestFairy, App Center, Whatever • Bitbucket, Github, Custom • Configura3on as Code ✅ • Mobile Apps as first class ci3zens ✅ 106
  240. Bitrise • Mobile Centric CI/CD • Distribu3on des3na3ons - GP,

    TestFlight, TestFairy, App Center, Whatever • Bitbucket, Github, Custom • Configura3on as Code ✅ • Mobile Apps as first class ci3zens ✅ • Cloud based ✅ 106
  241. Bitrise • Mobile Centric CI/CD • Distribu3on des3na3ons - GP,

    TestFlight, TestFairy, App Center, Whatever • Bitbucket, Github, Custom • Configura3on as Code ✅ • Mobile Apps as first class ci3zens ✅ • Cloud based ✅ • Webhooks 106
  242. Bitrise 107

  243. Bitrise • Support for ad-hoc git servers ✅ 107

  244. Bitrise • Support for ad-hoc git servers ✅ • Support

    CI job triggers on push to Any branch 107
  245. Bitrise • Support for ad-hoc git servers ✅ • Support

    CI job triggers on push to Any branch • SonarQube Support with a community extension 107
  246. Bitrise • Support for ad-hoc git servers ✅ • Support

    CI job triggers on push to Any branch • SonarQube Support with a community extension • Local debug - ✅ 107
  247. Bitrise • Support for ad-hoc git servers ✅ • Support

    CI job triggers on push to Any branch • SonarQube Support with a community extension • Local debug - ✅ • Open source 107
  248. 108

  249. Bitrise 109

  250. Bitrise • Rather slow ❌ 109

  251. Bitrise • Rather slow ❌ • No Flu0er support(yet) ❌

    109
  252. Bitrise • Rather slow ❌ • No Flu0er support(yet) ❌

    • Flu0er support(already) ✅ 109
  253. Services Comparison App Center Nevercode Bitrise Simplicity ✅ Flu,er ✅

    Flexible ✅ Device Cloud ✅ Build cache ✅ Build cache ✅ Crash Repor;ng ✅ No Xamarin ❌ Different inf. stacks ✅ Difficult customiza;on ❌ No conf as service ❌ Open Source ✅ Funny jokes Slow ❌ 110
  254. 111

  255. DevOps Prac,ces • Secured process ✅ • Con.nuous integra.on ✅

    • Con.nuous delivery ✅ • Frequent releases(Canary/BG deployments) • Automated tes.ng ✅ • Monitoring ✅ • Automated rollback ❌ 112
  256. Summary 113

  257. Summary • Mobile is a serious business requiring automa2on 113

  258. Summary • Mobile is a serious business requiring automa2on •

    There are some caveats and issues which are overcomeable 113
  259. Summary • Mobile is a serious business requiring automa2on •

    There are some caveats and issues which are overcomeable • Except rollbacks 113
  260. 114

  261. Links 115

  262. Links • Twi%er, telegram: @vvsevolodovich 115

  263. Links • Twi%er, telegram: @vvsevolodovich • Talks: h%p:/ /speakerdeck.com/vlivanov 115

  264. Links • Twi%er, telegram: @vvsevolodovich • Talks: h%p:/ /speakerdeck.com/vlivanov •

    Email: Vladimir_Ivanov4@epam.com 115
  265. Links • Twi%er, telegram: @vvsevolodovich • Talks: h%p:/ /speakerdeck.com/vlivanov •

    Email: Vladimir_Ivanov4@epam.com • h%ps:/ /mobiusconf.com/ 115