SlideShare a Scribd company logo
Artem Nikitin
Heisenbug | May, 2018
New CI from scratch
These slides are already available!
https://bit.ly/2rOa0Ah
© 2018 HERE | PublicHeisenbug | May, 2018
About SDK
© 2018 HERE | PublicHeisenbug | May, 2018
https://developer.here.com/develop/mobile-sdks
Specifics of our existing SDK
• Huge codebase in C++/Java/ObjC
• 40 min checkout sources from scratch
• 6 GB size of source code after checkout
• 11M+ LOC (including dependencies)
© 2018 HERE | PublicHeisenbug | May, 2018
© 2018 HERE | PublicHeisenbug | May, 2018
Problems of existed SDK
• Build on top of huge internal monolithic core
• Big size of SDK
• No modularity in SDK
• Low developer productivity
© 2018 HERE | PublicHeisenbug | May, 2018
Problems of existed CI
• Big Jenkins setup
https://www.youtube.com/watch?v=cT8GjzM1DXk
https://conferences.oreilly.com/velocity/vl-eu-2017/public/schedule/detail/61951
• Highly opinionated CI setup
• Hard to customize
• Apple support is third class citizen
© 2018 HERE | PublicHeisenbug | May, 2018
© 2018 HERE | PublicHeisenbug | May, 2018
01
Solving architecture
problems first
Huge and complex codebase
• Huge internal codebase (10M+ LOC)
• Very modular (1000+ Git repos)
• Our project depends on almost 100 internal
dependencies
© 2018 HERE | PublicHeisenbug | May, 2018
Solution
• Using `repo` for working with codebase
https://source.android.com/setup/develop/
• Gerrit for code reviews
https://news.ycombinator.com/item?id=8605293
• Block changes to our dependencies if they are failing
our builds/tests
© 2018 HERE | PublicHeisenbug | May, 2018
Lots of boilerplate code
• Complex codebase structure with C++/Java/ObjC
• Code written by different people from different teams
• No consistency in implementation
• Lots of manually written boilerplate code
© 2018 HERE | PublicHeisenbug | May, 2018
Solution
• Using IDL to describe public API
• Using code generation to generate all the boilerplate
code based on IDL description
• We are using Djinni from Dropbox
https://github.com/dropbox/djinni
© 2018 HERE | PublicHeisenbug | May, 2018
Djinni, IDL
© 2018 HERE | PublicHeisenbug | May, 2018
Djinni, generated C++
© 2018 HERE | PublicHeisenbug | May, 2018
Djinni, generated Java
© 2018 HERE | PublicHeisenbug | May, 2018
Djinni, generated ObjC
© 2018 HERE | PublicHeisenbug | May, 2018
Complex build system
• Project setup is complicated and unfriendly
• Separate build setups for local development and for CI
© 2018 HERE | PublicHeisenbug | May, 2018
Solution
• Universal build system/setup for local development
and CI
• Make project setup as friendly as possible
© 2018 HERE | PublicHeisenbug | May, 2018
Script
© 2018 HERE | PublicHeisenbug | May, 2018
Differences in test coverage
• Platform level tests written by different people from
different teams
• As a result, sometimes test coverage differ between
platforms
© 2018 HERE | PublicHeisenbug | May, 2018
Solution
• Using BDD as a tool
• Specify test scenarios with Gherkin
• It forces to have exactly the same tests on every
platform
© 2018 HERE | PublicHeisenbug | May, 2018
02
New CI
© 2018 HERE | PublicHeisenbug | May, 2018
Foundation of our new CI
• Jenkins (TeamCity? GitLab? Travis CI? AWS CodeBuild?)
• AWS (GCP? Azure? Virtualization? Own hardware?
Kubernetes? Mesos?)
• Docker (Configuration management?)
• Mac (Own hardware? Managed hosting? Virtualization?)
© 2018 HERE | PublicHeisenbug | May, 2018
CI Overview
© 2018 HERE | PublicHeisenbug | May, 2018
EC2 + EFS
Mac nodes
Jenkins
Artifactory
Gerrit
S3 Device Farm
Workflow: Blocking change before merging
© 2018 HERE | PublicHeisenbug | May, 2018
Developer
Gerrit
Chang
e
Workflow: Verify after merging
© 2018 HERE | PublicHeisenbug | May, 2018
Gerrit
Developer
S3
Workflow: Release
© 2018 HERE | PublicHeisenbug | May, 2018
Gerrit
Artifactory
User
User
Jenkins
© 2018 HERE | PublicHeisenbug | May, 2018
EC2 + EFS
Mac nodes
Jenkins
Artifactory
Gerrit
S3 Device Farm
Jenkins
© 2018 HERE | PublicHeisenbug | May, 2018
Freestyle jobs Declarative pipeline
Easy to use + -
Maintenance - +
Configuration as Code -* +
Shared lib/code -* +
Reaction on job
status
-* +
Complex scenarios +/- +
WTF per minute min a lot
AWS
© 2018 HERE | PublicHeisenbug | May, 2018
EC2 + EFS
Mac nodes
Jenkins
Artifactory
Gerrit
S3 Device Farm
AWS
• Spot Instances - key element for scalable CI
• A way to get resources with discount up to 90%
• But no guarantee of availability!
• We paid around 65 USD for 500+ hours in April
• 0.12 USD per hour -> x3 cheaper then On-Demand price
of the same instance!
© 2018 HERE | PublicHeisenbug | May, 2018
AWS
© 2018 HERE | PublicHeisenbug | May, 2018
EC2 + EFS
Mac nodes
Jenkins
Artifactory
Gerrit
S3 Device Farm
AWS
• EFS - it’s a NAS (Network-attached storage)
• Very tricky throughput management
https://docs.aws.amazon.com/efs/latest/ug/performance.html
• You should monitor BurstCreditBalance metric
• Around 25 USD per ~100GB of cache in April
© 2018 HERE | PublicHeisenbug | May, 2018
AWS
Use cases:
• We are using it for sharing ccache cache to speed up
C++ compilation
• You can use it to share something between EC2
instances
© 2018 HERE | PublicHeisenbug | May, 2018
AWS
© 2018 HERE | PublicHeisenbug | May, 2018
EC2 + EFS
Mac nodes
Jenkins
Artifactory
Gerrit
S3 Device Farm
AWS
• S3 – object storage
• S3 isn’t a file system!
• Not just for storing files
• 2.52 USD in April for 1M+ of requests and 400GB+ of
output traffic
© 2018 HERE | PublicHeisenbug | May, 2018
AWS
Use cases:
• We are using it to store temporary build artifacts
(demo apps, reports, logs, screenshots, etc…)
• We are delivering releases to public using S3 with
CloudFront
• I’m hosting my personal blog on S3
• Once I used it like a DB for a hackathon project,
because it was easy to use and cheap J
© 2018 HERE | PublicHeisenbug | May, 2018
AWS
© 2018 HERE | PublicHeisenbug | May, 2018
EC2 + EFS
Mac nodes
Jenkins
Artifactory
Gerrit
S3 Device Farm
AWS
© 2018 HERE | PublicHeisenbug | May, 2018
AWS
• Lambda – new paradigm
• Run code on events without thinking about
infrastructure
• Pay for amount of resources and time
• Lambda’s from Java to Go -> 2x money savings
• 250K+ requests and 180K seconds in April for 3.16 USD*
© 2018 HERE | PublicHeisenbug | May, 2018
AWS
Use cases:
• Posting review feedback to code changes in Gerrit
• Killing unused EC2 instances
• Updating AMI (like Packer but with our specifics)
• Collecting metrics from test apps
• In general, it’s a great glue for AWS services
© 2018 HERE | PublicHeisenbug | May, 2018
AWS
© 2018 HERE | PublicHeisenbug | May, 2018
AWS
© 2018 HERE | PublicHeisenbug | May, 2018
EC2 + EFS
Mac nodes
Jenkins
Artifactory
Gerrit
S3 Device Farm
AWS
• Device Farm – mobile devices in cloud
• Supports fuzzing (random input events), mobile web,
android and iOS testing
• Supports Appium, Calabash and “native” tools
• Remote access to devices
• https://github.com/artemnikitin/devicefarm-ci-tool
© 2018 HERE | PublicHeisenbug | May, 2018
AWS
Must Do in the Cloud:
• Immutable infrastructure
• Infrastructure as Code
• Prepare for failures
• Monitor your spending's
© 2018 HERE | PublicHeisenbug | May, 2018
AWS
https://github.com/open-guides/og-aws
https://www.expeditedssl.com/aws-in-plain-English
https://read.acloud.guru/
https://www.slideshare.net/hornsby/10-lessons-from-10-years-of-aws
https://seleniumcamp.com/talk/scaling-execution-of-protractorjs-on-aws-
lambda-with-selenoid/
https://aws.amazon.com/blogs/devops/ui-testing-at-scale-with-aws-
lambda/
https://www.youtube.com/watch?v=EDZBYbEwhm8
https://www.youtube.com/watch?v=73-G2zQ9sHU
https://www.youtube.com/watch?v=ZgxZCXouBkY
https://www.youtube.com/watch?v=w7X4gAQTk2E
© 2018 HERE | PublicHeisenbug | May, 2018
Docker
© 2018 HERE | PublicHeisenbug | May, 2018
EC2 + EFS
Docker
• Docker – tool for operating-system-level virtualization,
aka containerization
• We are using it to encapsulate environment for builds
• We are ”backing” images in AMI
• It creates a problem. We need to keep AMI up to date
© 2018 HERE | PublicHeisenbug | May, 2018
Docker
© 2018 HERE | PublicHeisenbug | May, 2018
Mac nodes
© 2018 HERE | PublicHeisenbug | May, 2018
EC2 + EFS
Mac nodes
Jenkins
Artifactory
Gerrit
S3 Device Farm
Mac nodes
• It’s ok to manage 1 or 2 node(s) manually
• It’s become a nightmare on a higher scale
• Not everything can be automated easily
© 2018 HERE | PublicHeisenbug | May, 2018
Mac nodes
• Ansible – tool for configuration management
• Works for Linux, MacOS, Windows
• What was done: managing operations via CLI
• What is still missing: how to manage system stuff?
(MacOS updates, Xcode updates, etc…)
© 2018 HERE | PublicHeisenbug | May, 2018
Mac nodes
© 2018 HERE | PublicHeisenbug | May, 2018
Mac nodes
© 2018 HERE | PublicHeisenbug | May, 2018
In the end…
• We have our own CI setup what fits our needs
• CI is relatively cheap
• It can scale until we have money
• We found some ways of managing Mac nodes
automatically
© 2018 HERE | PublicHeisenbug | May, 2018
Thank you
Contact
Artem Nikitin hi@artemnikitin.com artemnikitin artemnikitin
Building CI from scratch

More Related Content

PDF
Build a RESTful API with the Serverless Framework
PDF
SFScon18 - Gerhard Sulzberger - Jason Tevnan - gitops with gitlab + terraform
PPT
Use Cases of #Grails in #WebApplications
PDF
Facilitez votre transition DevOps grâce à l'automatisation de votre infras...
PDF
Building Event-Driven Workflows with Knative and Tekton
PDF
Building and Running Workloads the Knative Way
PDF
SPRING BOOT DANS UN CONTAINER OUTILS ET PRATIQUES
PDF
Function as a Service with Knative and riff
Build a RESTful API with the Serverless Framework
SFScon18 - Gerhard Sulzberger - Jason Tevnan - gitops with gitlab + terraform
Use Cases of #Grails in #WebApplications
Facilitez votre transition DevOps grâce à l'automatisation de votre infras...
Building Event-Driven Workflows with Knative and Tekton
Building and Running Workloads the Knative Way
SPRING BOOT DANS UN CONTAINER OUTILS ET PRATIQUES
Function as a Service with Knative and riff

What's hot (20)

PDF
Visual Recognition with Anki Cozmo and TensorFlow
PDF
IaC on AWS Cloud
PDF
Knative from an Enterprise Perspective
PPTX
Alfresco Process Services (APS) and the Internet of Things
PPTX
Intro to the Google Cloud for Developers
PDF
Case Study: Migration to GitLab (from Bitbucket) at AppsFlyer
PDF
The what, why and how of knative
PPTX
Leveraging Helm to manage Deployments on Kubernetes
PDF
Cloud-native Patterns (July 4th, 2019)
PDF
Serverless with Google Cloud Functions
PDF
Neptue Graph Database - 0 to Production
PDF
Reactive Microservices with Quarkus
PPTX
Trying out the Go language with Google App Engine
PDF
Transformational DevOps with AWS Native Tools
PDF
Activiti & Activiti Cloud DevCon
PDF
Kubernetes on AWS @ Zalando Tech
PDF
Cloud Native Unleashed
PPTX
Global azurebootcamp2019vancouver aks_presentation_by_ashprasad_arjavprasad
PDF
Serverless Functions: Accelerating DevOps Adoption
PDF
When to use Serverless? When to use Kubernetes?
Visual Recognition with Anki Cozmo and TensorFlow
IaC on AWS Cloud
Knative from an Enterprise Perspective
Alfresco Process Services (APS) and the Internet of Things
Intro to the Google Cloud for Developers
Case Study: Migration to GitLab (from Bitbucket) at AppsFlyer
The what, why and how of knative
Leveraging Helm to manage Deployments on Kubernetes
Cloud-native Patterns (July 4th, 2019)
Serverless with Google Cloud Functions
Neptue Graph Database - 0 to Production
Reactive Microservices with Quarkus
Trying out the Go language with Google App Engine
Transformational DevOps with AWS Native Tools
Activiti & Activiti Cloud DevCon
Kubernetes on AWS @ Zalando Tech
Cloud Native Unleashed
Global azurebootcamp2019vancouver aks_presentation_by_ashprasad_arjavprasad
Serverless Functions: Accelerating DevOps Adoption
When to use Serverless? When to use Kubernetes?
Ad

Similar to Building CI from scratch (20)

PDF
AWS hurries to the rescue
PPTX
Exploring a simpler, more portable, less overhead solution to deploy Elastics...
PDF
Emulators as an Emerging Best Practice for API Providers
PPTX
DevNetCreate Workshop - build a react app - React crash course
PDF
Http Services in Rust on Containers
PDF
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
PDF
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
DOCX
SamSegalResume
PDF
introduction to kubernetes slide deck by Roach
PDF
Apache Airflow at Dailymotion
PDF
TechWiseTV Workshop: Cisco Hybrid Cloud Platform for Google Cloud
PPTX
Lessons learnt in CI/CD with AWS serverless architecture
PDF
Kubernetes Forum Seoul 2019: Re-architecting Data Platform with Kubernetes
PPTX
Amsterdam Titanium User Group - Cloud Services for Apps Nov 2013
PDF
Sam segal resume
PPTX
Get the Exact Identity Solution You Need - In the Cloud - Overview
PDF
Exploring Google APIs with Python
PDF
CodeStarではじめるRailsアプリのCodeDeploy化
PDF
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023
PDF
Combinação de logs, métricas e rastreamentos para observabilidade unificada
AWS hurries to the rescue
Exploring a simpler, more portable, less overhead solution to deploy Elastics...
Emulators as an Emerging Best Practice for API Providers
DevNetCreate Workshop - build a react app - React crash course
Http Services in Rust on Containers
Jenkins Pipeline @ Scale. Building Automation Frameworks for Systems Integration
Convert your Full Trust Solutions to the SharePoint Framework (SPFx)
SamSegalResume
introduction to kubernetes slide deck by Roach
Apache Airflow at Dailymotion
TechWiseTV Workshop: Cisco Hybrid Cloud Platform for Google Cloud
Lessons learnt in CI/CD with AWS serverless architecture
Kubernetes Forum Seoul 2019: Re-architecting Data Platform with Kubernetes
Amsterdam Titanium User Group - Cloud Services for Apps Nov 2013
Sam segal resume
Get the Exact Identity Solution You Need - In the Cloud - Overview
Exploring Google APIs with Python
CodeStarではじめるRailsアプリのCodeDeploy化
Github Copilot vs Amazon CodeWhisperer for Java developers at JCON 2023
Combinação de logs, métricas e rastreamentos para observabilidade unificada
Ad

Recently uploaded (20)

PDF
Advanced methodologies resolving dimensionality complications for autism neur...
DOCX
The AUB Centre for AI in Media Proposal.docx
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Encapsulation_ Review paper, used for researhc scholars
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
NewMind AI Monthly Chronicles - July 2025
PPTX
Big Data Technologies - Introduction.pptx
PDF
The Rise and Fall of 3GPP – Time for a Sabbatical?
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PPTX
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
Modernizing your data center with Dell and AMD
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Chapter 3 Spatial Domain Image Processing.pdf
Advanced methodologies resolving dimensionality complications for autism neur...
The AUB Centre for AI in Media Proposal.docx
Unlocking AI with Model Context Protocol (MCP)
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Understanding_Digital_Forensics_Presentation.pptx
Encapsulation_ Review paper, used for researhc scholars
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
NewMind AI Monthly Chronicles - July 2025
Big Data Technologies - Introduction.pptx
The Rise and Fall of 3GPP – Time for a Sabbatical?
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
Effective Security Operations Center (SOC) A Modern, Strategic, and Threat-In...
20250228 LYD VKU AI Blended-Learning.pptx
Detection-First SIEM: Rule Types, Dashboards, and Threat-Informed Strategy
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Mobile App Security Testing_ A Comprehensive Guide.pdf
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
Modernizing your data center with Dell and AMD
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Chapter 3 Spatial Domain Image Processing.pdf

Building CI from scratch

  • 1. Artem Nikitin Heisenbug | May, 2018 New CI from scratch
  • 2. These slides are already available! https://bit.ly/2rOa0Ah © 2018 HERE | PublicHeisenbug | May, 2018
  • 3. About SDK © 2018 HERE | PublicHeisenbug | May, 2018 https://developer.here.com/develop/mobile-sdks
  • 4. Specifics of our existing SDK • Huge codebase in C++/Java/ObjC • 40 min checkout sources from scratch • 6 GB size of source code after checkout • 11M+ LOC (including dependencies) © 2018 HERE | PublicHeisenbug | May, 2018
  • 5. © 2018 HERE | PublicHeisenbug | May, 2018
  • 6. Problems of existed SDK • Build on top of huge internal monolithic core • Big size of SDK • No modularity in SDK • Low developer productivity © 2018 HERE | PublicHeisenbug | May, 2018
  • 7. Problems of existed CI • Big Jenkins setup https://www.youtube.com/watch?v=cT8GjzM1DXk https://conferences.oreilly.com/velocity/vl-eu-2017/public/schedule/detail/61951 • Highly opinionated CI setup • Hard to customize • Apple support is third class citizen © 2018 HERE | PublicHeisenbug | May, 2018
  • 8. © 2018 HERE | PublicHeisenbug | May, 2018
  • 10. Huge and complex codebase • Huge internal codebase (10M+ LOC) • Very modular (1000+ Git repos) • Our project depends on almost 100 internal dependencies © 2018 HERE | PublicHeisenbug | May, 2018
  • 11. Solution • Using `repo` for working with codebase https://source.android.com/setup/develop/ • Gerrit for code reviews https://news.ycombinator.com/item?id=8605293 • Block changes to our dependencies if they are failing our builds/tests © 2018 HERE | PublicHeisenbug | May, 2018
  • 12. Lots of boilerplate code • Complex codebase structure with C++/Java/ObjC • Code written by different people from different teams • No consistency in implementation • Lots of manually written boilerplate code © 2018 HERE | PublicHeisenbug | May, 2018
  • 13. Solution • Using IDL to describe public API • Using code generation to generate all the boilerplate code based on IDL description • We are using Djinni from Dropbox https://github.com/dropbox/djinni © 2018 HERE | PublicHeisenbug | May, 2018
  • 14. Djinni, IDL © 2018 HERE | PublicHeisenbug | May, 2018
  • 15. Djinni, generated C++ © 2018 HERE | PublicHeisenbug | May, 2018
  • 16. Djinni, generated Java © 2018 HERE | PublicHeisenbug | May, 2018
  • 17. Djinni, generated ObjC © 2018 HERE | PublicHeisenbug | May, 2018
  • 18. Complex build system • Project setup is complicated and unfriendly • Separate build setups for local development and for CI © 2018 HERE | PublicHeisenbug | May, 2018
  • 19. Solution • Universal build system/setup for local development and CI • Make project setup as friendly as possible © 2018 HERE | PublicHeisenbug | May, 2018
  • 20. Script © 2018 HERE | PublicHeisenbug | May, 2018
  • 21. Differences in test coverage • Platform level tests written by different people from different teams • As a result, sometimes test coverage differ between platforms © 2018 HERE | PublicHeisenbug | May, 2018
  • 22. Solution • Using BDD as a tool • Specify test scenarios with Gherkin • It forces to have exactly the same tests on every platform © 2018 HERE | PublicHeisenbug | May, 2018
  • 24. © 2018 HERE | PublicHeisenbug | May, 2018
  • 25. Foundation of our new CI • Jenkins (TeamCity? GitLab? Travis CI? AWS CodeBuild?) • AWS (GCP? Azure? Virtualization? Own hardware? Kubernetes? Mesos?) • Docker (Configuration management?) • Mac (Own hardware? Managed hosting? Virtualization?) © 2018 HERE | PublicHeisenbug | May, 2018
  • 26. CI Overview © 2018 HERE | PublicHeisenbug | May, 2018 EC2 + EFS Mac nodes Jenkins Artifactory Gerrit S3 Device Farm
  • 27. Workflow: Blocking change before merging © 2018 HERE | PublicHeisenbug | May, 2018 Developer Gerrit Chang e
  • 28. Workflow: Verify after merging © 2018 HERE | PublicHeisenbug | May, 2018 Gerrit Developer S3
  • 29. Workflow: Release © 2018 HERE | PublicHeisenbug | May, 2018 Gerrit Artifactory User User
  • 30. Jenkins © 2018 HERE | PublicHeisenbug | May, 2018 EC2 + EFS Mac nodes Jenkins Artifactory Gerrit S3 Device Farm
  • 31. Jenkins © 2018 HERE | PublicHeisenbug | May, 2018 Freestyle jobs Declarative pipeline Easy to use + - Maintenance - + Configuration as Code -* + Shared lib/code -* + Reaction on job status -* + Complex scenarios +/- + WTF per minute min a lot
  • 32. AWS © 2018 HERE | PublicHeisenbug | May, 2018 EC2 + EFS Mac nodes Jenkins Artifactory Gerrit S3 Device Farm
  • 33. AWS • Spot Instances - key element for scalable CI • A way to get resources with discount up to 90% • But no guarantee of availability! • We paid around 65 USD for 500+ hours in April • 0.12 USD per hour -> x3 cheaper then On-Demand price of the same instance! © 2018 HERE | PublicHeisenbug | May, 2018
  • 34. AWS © 2018 HERE | PublicHeisenbug | May, 2018 EC2 + EFS Mac nodes Jenkins Artifactory Gerrit S3 Device Farm
  • 35. AWS • EFS - it’s a NAS (Network-attached storage) • Very tricky throughput management https://docs.aws.amazon.com/efs/latest/ug/performance.html • You should monitor BurstCreditBalance metric • Around 25 USD per ~100GB of cache in April © 2018 HERE | PublicHeisenbug | May, 2018
  • 36. AWS Use cases: • We are using it for sharing ccache cache to speed up C++ compilation • You can use it to share something between EC2 instances © 2018 HERE | PublicHeisenbug | May, 2018
  • 37. AWS © 2018 HERE | PublicHeisenbug | May, 2018 EC2 + EFS Mac nodes Jenkins Artifactory Gerrit S3 Device Farm
  • 38. AWS • S3 – object storage • S3 isn’t a file system! • Not just for storing files • 2.52 USD in April for 1M+ of requests and 400GB+ of output traffic © 2018 HERE | PublicHeisenbug | May, 2018
  • 39. AWS Use cases: • We are using it to store temporary build artifacts (demo apps, reports, logs, screenshots, etc…) • We are delivering releases to public using S3 with CloudFront • I’m hosting my personal blog on S3 • Once I used it like a DB for a hackathon project, because it was easy to use and cheap J © 2018 HERE | PublicHeisenbug | May, 2018
  • 40. AWS © 2018 HERE | PublicHeisenbug | May, 2018 EC2 + EFS Mac nodes Jenkins Artifactory Gerrit S3 Device Farm
  • 41. AWS © 2018 HERE | PublicHeisenbug | May, 2018
  • 42. AWS • Lambda – new paradigm • Run code on events without thinking about infrastructure • Pay for amount of resources and time • Lambda’s from Java to Go -> 2x money savings • 250K+ requests and 180K seconds in April for 3.16 USD* © 2018 HERE | PublicHeisenbug | May, 2018
  • 43. AWS Use cases: • Posting review feedback to code changes in Gerrit • Killing unused EC2 instances • Updating AMI (like Packer but with our specifics) • Collecting metrics from test apps • In general, it’s a great glue for AWS services © 2018 HERE | PublicHeisenbug | May, 2018
  • 44. AWS © 2018 HERE | PublicHeisenbug | May, 2018
  • 45. AWS © 2018 HERE | PublicHeisenbug | May, 2018 EC2 + EFS Mac nodes Jenkins Artifactory Gerrit S3 Device Farm
  • 46. AWS • Device Farm – mobile devices in cloud • Supports fuzzing (random input events), mobile web, android and iOS testing • Supports Appium, Calabash and “native” tools • Remote access to devices • https://github.com/artemnikitin/devicefarm-ci-tool © 2018 HERE | PublicHeisenbug | May, 2018
  • 47. AWS Must Do in the Cloud: • Immutable infrastructure • Infrastructure as Code • Prepare for failures • Monitor your spending's © 2018 HERE | PublicHeisenbug | May, 2018
  • 49. Docker © 2018 HERE | PublicHeisenbug | May, 2018 EC2 + EFS
  • 50. Docker • Docker – tool for operating-system-level virtualization, aka containerization • We are using it to encapsulate environment for builds • We are ”backing” images in AMI • It creates a problem. We need to keep AMI up to date © 2018 HERE | PublicHeisenbug | May, 2018
  • 51. Docker © 2018 HERE | PublicHeisenbug | May, 2018
  • 52. Mac nodes © 2018 HERE | PublicHeisenbug | May, 2018 EC2 + EFS Mac nodes Jenkins Artifactory Gerrit S3 Device Farm
  • 53. Mac nodes • It’s ok to manage 1 or 2 node(s) manually • It’s become a nightmare on a higher scale • Not everything can be automated easily © 2018 HERE | PublicHeisenbug | May, 2018
  • 54. Mac nodes • Ansible – tool for configuration management • Works for Linux, MacOS, Windows • What was done: managing operations via CLI • What is still missing: how to manage system stuff? (MacOS updates, Xcode updates, etc…) © 2018 HERE | PublicHeisenbug | May, 2018
  • 55. Mac nodes © 2018 HERE | PublicHeisenbug | May, 2018
  • 56. Mac nodes © 2018 HERE | PublicHeisenbug | May, 2018
  • 57. In the end… • We have our own CI setup what fits our needs • CI is relatively cheap • It can scale until we have money • We found some ways of managing Mac nodes automatically © 2018 HERE | PublicHeisenbug | May, 2018
  • 58. Thank you Contact Artem Nikitin hi@artemnikitin.com artemnikitin artemnikitin