SlideShare a Scribd company logo
Building containers
Turbocharged!
Shopify
• All the commerce
• 165k+ merchants, 8 Billion GMV
• 300M+ unique visits/month
• 4000+ containers
• RoR, MySQL, Redis, Memcache, Elasticsearch, Chef, Go,
Podding, Multi-DC,...
Docker at Shopify
• Serving production traffic for over a year
• Gives developers more freedom (and responsibility) around
how applications are being ran
• Offers super fast and reliable deploys1
1
When it works. Warstories are plenty
Building containers
Dockerfiles
Super simple (Dockerfile is essentially shell commands + a
handful of specialized instructions)
Super efficient (Detects changes and skips things that have not
changed)
Super inefficient and complicated for anything nontrivial
Simple, eh?
FROM ruby:2.1.3
RUN apt-get update
RUN apt-get upgrade
RUN apt-get install -qq -y libmysqlclient-dev
RUN useradd --create-home rails_is_fun
WORKDIR /home/rails_is_fun
COPY . /home/rails_is_fun
RUN bundle install
CMD bundle exec unicorn -p 3000
NOPE NOPE NOPE
FROM ruby:2.1.3
RUN apt-get update
RUN apt-get upgrade
RUN apt-get install -qq -y libmysqlclient-dev
RUN useradd --create-home rails_is_fun
WORKDIR /home/rails_is_fun
COPY Gemfile /home/rails_is_fun/Gemfile
COPY Gemfile.lock /home/rails_is_fun/Gemfile.lock
RUN bundle install
COPY . /home/rails_is_fun
CMD bundle exec unicorn -p 3000
Even with this you have no concept of Gem cache, so any
changes to Gemfile essentially means building them from
scratch
Not to mention the burden of apt-get update/upgrade
What about secrets?
When building application containers its pretty common to
have secrets (API keys, DB urls etc.).
Dockerfile doesn't support any temporary/external files. While
building you can't use VOLUMES either
No real solutions. Everything is bad (secrets in plaintext in
layers, external wrappers etc)
#!/bin/bash
gem install ejson
ejson decrypt config/config.production.ejson > config.json
docker build -t rails_is_fun .
rm -rf config.json
The things we needed
• Performance (not only for building a lot of containers but
building a single one quickly)
• Security. We handle money and peoples private
information, so having a secure system is kinda important
• Coordinator for builds
Solution: Write your own builder
Our custom builder Locutus is a Golang app that:
• Listens to webhooks (every commit to GH triggers a build)
• Builds containers
• Pushes to our private registry
• Has a webgui showing the build step-by-step
• Sends hooks about build statuses
• Scales horizontally, eg. we can have N builders
The interesting part, building
We replaced Dockerfiles with prepare, precompile and
compile scripts (vanilla Bash)
These scripts actually represent a different build phase and live
in the app repo
Each phase does a docker run with the script and saves the
container with docker commit.
prepare
is used for your system packages (eg. apt-get install
libmysqlclient-dev).
In this phase we only copy the script itself to our baseimage
We cache this image based on the md5sum of the prepare
During Shopify builds we really rarely have to run this phase
since system level depencies doesn't change often.
precompile
is used for application dependencies and asset building (eg.
bundle install)
Used for creating a folder of wanted artifacts. Only thing that is
persisted is /artifacts
Run on every build, but build upon the previous cache of the
specific app (and branch). So we never end up pulling all gems
because of a Gemfile change etc.
compile
is used for moving the generated arfifacts to correct folders
(eg. .bundle) and finishing setup
Run on every build, but super fast since we are just doing
bunch of mv and rm (to cleanup caches etc. to slim the image)
The result of this phase is the final image we actually can
deploy to be run.
Build times around 40-50 seconds thanks to heavy caching
Containers never see the keys that are used for decrypting
secrets
Questions?
ps. http://www.shopify.com/careers

More Related Content

What's hot

Dev objective2015 lets git together
Dev objective2015 lets git togetherDev objective2015 lets git together
Dev objective2015 lets git together
ColdFusionConference
 
Nginx conference 2015
Nginx conference 2015Nginx conference 2015
Nginx conference 2015
ING-IT
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
Betclic Everest Group Tech Team
 
Containers not just for production nov8
Containers not just for production nov8Containers not just for production nov8
Containers not just for production nov8
HARITHA HARI
 
Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence
Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence
Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence
Parag Gajbhiye
 
Docker Practical Use Cases
Docker Practical Use CasesDocker Practical Use Cases
Docker Practical Use Cases
Alexei Yuzhakov
 
Silverstripe CMS 4.9.0 release and beyound
Silverstripe CMS 4.9.0 release and beyoundSilverstripe CMS 4.9.0 release and beyound
Silverstripe CMS 4.9.0 release and beyound
MaximeRainville1
 
Get acquainted with the new ASP.Net 5
Get acquainted with the new ASP.Net 5Get acquainted with the new ASP.Net 5
Get acquainted with the new ASP.Net 5
Suyati Technologies
 
[D2 COMMUNITY] Open Container Seoul Meetup - Kubernetes를 이용한 서비스 구축과 openshift
[D2 COMMUNITY] Open Container Seoul Meetup - Kubernetes를 이용한 서비스 구축과 openshift[D2 COMMUNITY] Open Container Seoul Meetup - Kubernetes를 이용한 서비스 구축과 openshift
[D2 COMMUNITY] Open Container Seoul Meetup - Kubernetes를 이용한 서비스 구축과 openshift
NAVER D2
 
2015 05-06-elias weingaertner-docker-intro
2015 05-06-elias weingaertner-docker-intro2015 05-06-elias weingaertner-docker-intro
2015 05-06-elias weingaertner-docker-intro
Haufe-Lexware GmbH & Co KG
 
Introduction to Git for developers
Introduction to Git for developersIntroduction to Git for developers
Introduction to Git for developers
Dmitry Guyvoronsky
 
JS digest. November 2017
JS digest. November 2017JS digest. November 2017
JS digest. November 2017
ElifTech
 
Living with microservices at Pipedrive
Living with microservices at PipedriveLiving with microservices at Pipedrive
Living with microservices at Pipedrive
Renno Reinurm
 
Command box, Package Manager, Automation, REPL
Command box, Package Manager, Automation, REPLCommand box, Package Manager, Automation, REPL
Command box, Package Manager, Automation, REPL
ColdFusionConference
 
The Three Musketeers
The Three MusketeersThe Three Musketeers
The Three Musketeers
Frederic Lemay
 
GitBucket: Open source self-hosting Git server built by Scala
GitBucket: Open source self-hosting Git server built by ScalaGitBucket: Open source self-hosting Git server built by Scala
GitBucket: Open source self-hosting Git server built by Scala
takezoe
 
Javantura v4 - Self-service app deployment with Kubernetes and OpenShift - Ma...
Javantura v4 - Self-service app deployment with Kubernetes and OpenShift - Ma...Javantura v4 - Self-service app deployment with Kubernetes and OpenShift - Ma...
Javantura v4 - Self-service app deployment with Kubernetes and OpenShift - Ma...
HUJAK - Hrvatska udruga Java korisnika / Croatian Java User Association
 
C#: Past, Present and Future
C#: Past, Present and FutureC#: Past, Present and Future
C#: Past, Present and Future
Rodolfo Finochietti
 
Mój przepis na skalowalną architekturę mikroserwisową? Apollo Federation i Gr...
Mój przepis na skalowalną architekturę mikroserwisową? Apollo Federation i Gr...Mój przepis na skalowalną architekturę mikroserwisową? Apollo Federation i Gr...
Mój przepis na skalowalną architekturę mikroserwisową? Apollo Federation i Gr...
The Software House
 
Managing changes to eZPublish Database
Managing changes to eZPublish DatabaseManaging changes to eZPublish Database
Managing changes to eZPublish Database
Gaetano Giunta
 

What's hot (20)

Dev objective2015 lets git together
Dev objective2015 lets git togetherDev objective2015 lets git together
Dev objective2015 lets git together
 
Nginx conference 2015
Nginx conference 2015Nginx conference 2015
Nginx conference 2015
 
Mini-training: Let’s Git It!
Mini-training: Let’s Git It!Mini-training: Let’s Git It!
Mini-training: Let’s Git It!
 
Containers not just for production nov8
Containers not just for production nov8Containers not just for production nov8
Containers not just for production nov8
 
Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence
Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence
Introduction to Git(BitBucket) , Continuous Integration (Bamboo) & Confluence
 
Docker Practical Use Cases
Docker Practical Use CasesDocker Practical Use Cases
Docker Practical Use Cases
 
Silverstripe CMS 4.9.0 release and beyound
Silverstripe CMS 4.9.0 release and beyoundSilverstripe CMS 4.9.0 release and beyound
Silverstripe CMS 4.9.0 release and beyound
 
Get acquainted with the new ASP.Net 5
Get acquainted with the new ASP.Net 5Get acquainted with the new ASP.Net 5
Get acquainted with the new ASP.Net 5
 
[D2 COMMUNITY] Open Container Seoul Meetup - Kubernetes를 이용한 서비스 구축과 openshift
[D2 COMMUNITY] Open Container Seoul Meetup - Kubernetes를 이용한 서비스 구축과 openshift[D2 COMMUNITY] Open Container Seoul Meetup - Kubernetes를 이용한 서비스 구축과 openshift
[D2 COMMUNITY] Open Container Seoul Meetup - Kubernetes를 이용한 서비스 구축과 openshift
 
2015 05-06-elias weingaertner-docker-intro
2015 05-06-elias weingaertner-docker-intro2015 05-06-elias weingaertner-docker-intro
2015 05-06-elias weingaertner-docker-intro
 
Introduction to Git for developers
Introduction to Git for developersIntroduction to Git for developers
Introduction to Git for developers
 
JS digest. November 2017
JS digest. November 2017JS digest. November 2017
JS digest. November 2017
 
Living with microservices at Pipedrive
Living with microservices at PipedriveLiving with microservices at Pipedrive
Living with microservices at Pipedrive
 
Command box, Package Manager, Automation, REPL
Command box, Package Manager, Automation, REPLCommand box, Package Manager, Automation, REPL
Command box, Package Manager, Automation, REPL
 
The Three Musketeers
The Three MusketeersThe Three Musketeers
The Three Musketeers
 
GitBucket: Open source self-hosting Git server built by Scala
GitBucket: Open source self-hosting Git server built by ScalaGitBucket: Open source self-hosting Git server built by Scala
GitBucket: Open source self-hosting Git server built by Scala
 
Javantura v4 - Self-service app deployment with Kubernetes and OpenShift - Ma...
Javantura v4 - Self-service app deployment with Kubernetes and OpenShift - Ma...Javantura v4 - Self-service app deployment with Kubernetes and OpenShift - Ma...
Javantura v4 - Self-service app deployment with Kubernetes and OpenShift - Ma...
 
C#: Past, Present and Future
C#: Past, Present and FutureC#: Past, Present and Future
C#: Past, Present and Future
 
Mój przepis na skalowalną architekturę mikroserwisową? Apollo Federation i Gr...
Mój przepis na skalowalną architekturę mikroserwisową? Apollo Federation i Gr...Mój przepis na skalowalną architekturę mikroserwisową? Apollo Federation i Gr...
Mój przepis na skalowalną architekturę mikroserwisową? Apollo Federation i Gr...
 
Managing changes to eZPublish Database
Managing changes to eZPublish DatabaseManaging changes to eZPublish Database
Managing changes to eZPublish Database
 

Similar to Vincit Teatime 2015.2 - Niko Kurtti: SaaSiin pa(i)nostusta

CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
E. Camden Fisher
 
OpenStack Summit
OpenStack SummitOpenStack Summit
OpenStack Summit
Docker, Inc.
 
Docker intro
Docker introDocker intro
Docker intro
spiddy
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
Docker, Inc.
 
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
dotCloud
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
Phuc Nguyen
 
JOSA TechTalks - Docker in Production
JOSA TechTalks - Docker in ProductionJOSA TechTalks - Docker in Production
JOSA TechTalks - Docker in Production
Jordan Open Source Association
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
Jeffrey Ellin
 
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
devopsdaysaustin
 
Docker-Intro
Docker-IntroDocker-Intro
Docker-Intro
Sujai Sivasamy
 
Automating CICD Pipeline with GitLab and Docker Containers for Java Applications
Automating CICD Pipeline with GitLab and Docker Containers for Java ApplicationsAutomating CICD Pipeline with GitLab and Docker Containers for Java Applications
Automating CICD Pipeline with GitLab and Docker Containers for Java Applications
Jelastic Multi-Cloud PaaS
 
Docker and-daily-devops
Docker and-daily-devopsDocker and-daily-devops
Docker and-daily-devops
Satria Ady Pradana
 
Docker & Daily DevOps
Docker & Daily DevOpsDocker & Daily DevOps
Docker & Daily DevOps
Satria Ady Pradana
 
MoldCamp - multidimentional testing workflow. CIBox.
MoldCamp  - multidimentional testing workflow. CIBox.MoldCamp  - multidimentional testing workflow. CIBox.
MoldCamp - multidimentional testing workflow. CIBox.
Andrii Podanenko
 
How bigtop leveraged docker for build automation and one click hadoop provis...
How bigtop leveraged docker for build automation and  one click hadoop provis...How bigtop leveraged docker for build automation and  one click hadoop provis...
How bigtop leveraged docker for build automation and one click hadoop provis...
Evans Ye
 
Dockerize Our Development Machine
Dockerize Our Development MachineDockerize Our Development Machine
Dockerize Our Development Machine
Panji Gautama
 
Containers and Docker
Containers and DockerContainers and Docker
Containers and Docker
Damian T. Gordon
 
Docker - Portable Deployment
Docker - Portable DeploymentDocker - Portable Deployment
Docker - Portable Deployment
javaonfly
 
Docker mentorweek
Docker mentorweekDocker mentorweek
Docker mentorweek
Pavan Wankhade
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
Aditya Konarde
 

Similar to Vincit Teatime 2015.2 - Niko Kurtti: SaaSiin pa(i)nostusta (20)

CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
CT Software Developers Meetup: Using Docker and Vagrant Within A GitHub Pull ...
 
OpenStack Summit
OpenStack SummitOpenStack Summit
OpenStack Summit
 
Docker intro
Docker introDocker intro
Docker intro
 
DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2DockerCon 15 Keynote - Day 2
DockerCon 15 Keynote - Day 2
 
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
Write Once and REALLY Run Anywhere | OpenStack Summit HK 2013
 
Docker introduction
Docker introductionDocker introduction
Docker introduction
 
JOSA TechTalks - Docker in Production
JOSA TechTalks - Docker in ProductionJOSA TechTalks - Docker in Production
JOSA TechTalks - Docker in Production
 
Docker Introduction
Docker IntroductionDocker Introduction
Docker Introduction
 
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
2016 - Easing Your Way Into Docker: Lessons From a Journey to Production
 
Docker-Intro
Docker-IntroDocker-Intro
Docker-Intro
 
Automating CICD Pipeline with GitLab and Docker Containers for Java Applications
Automating CICD Pipeline with GitLab and Docker Containers for Java ApplicationsAutomating CICD Pipeline with GitLab and Docker Containers for Java Applications
Automating CICD Pipeline with GitLab and Docker Containers for Java Applications
 
Docker and-daily-devops
Docker and-daily-devopsDocker and-daily-devops
Docker and-daily-devops
 
Docker & Daily DevOps
Docker & Daily DevOpsDocker & Daily DevOps
Docker & Daily DevOps
 
MoldCamp - multidimentional testing workflow. CIBox.
MoldCamp  - multidimentional testing workflow. CIBox.MoldCamp  - multidimentional testing workflow. CIBox.
MoldCamp - multidimentional testing workflow. CIBox.
 
How bigtop leveraged docker for build automation and one click hadoop provis...
How bigtop leveraged docker for build automation and  one click hadoop provis...How bigtop leveraged docker for build automation and  one click hadoop provis...
How bigtop leveraged docker for build automation and one click hadoop provis...
 
Dockerize Our Development Machine
Dockerize Our Development MachineDockerize Our Development Machine
Dockerize Our Development Machine
 
Containers and Docker
Containers and DockerContainers and Docker
Containers and Docker
 
Docker - Portable Deployment
Docker - Portable DeploymentDocker - Portable Deployment
Docker - Portable Deployment
 
Docker mentorweek
Docker mentorweekDocker mentorweek
Docker mentorweek
 
Introduction to Docker
Introduction to DockerIntroduction to Docker
Introduction to Docker
 

More from VincitOy

Vincit Teatime 2015.2 - Aleksi Häkli: SaaSiin pa(i)nostusta
Vincit Teatime 2015.2 - Aleksi Häkli: SaaSiin pa(i)nostustaVincit Teatime 2015.2 - Aleksi Häkli: SaaSiin pa(i)nostusta
Vincit Teatime 2015.2 - Aleksi Häkli: SaaSiin pa(i)nostusta
VincitOy
 
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a gitVincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
VincitOy
 
Vincit ankkasarjakuva
Vincit ankkasarjakuvaVincit ankkasarjakuva
Vincit ankkasarjakuva
VincitOy
 
Tampere goes agile 2015
Tampere goes agile 2015Tampere goes agile 2015
Tampere goes agile 2015
VincitOy
 
Digijytky kunnossapidossa 2015 - Simsotec
Digijytky kunnossapidossa 2015 - SimsotecDigijytky kunnossapidossa 2015 - Simsotec
Digijytky kunnossapidossa 2015 - Simsotec
VincitOy
 
Digijytky kunnossapidossa 2015 - M-Files
Digijytky kunnossapidossa 2015 - M-FilesDigijytky kunnossapidossa 2015 - M-Files
Digijytky kunnossapidossa 2015 - M-Files
VincitOy
 
Digijytky kunnossapidossa 2015 - Oliotalo
Digijytky kunnossapidossa 2015 - OliotaloDigijytky kunnossapidossa 2015 - Oliotalo
Digijytky kunnossapidossa 2015 - Oliotalo
VincitOy
 
Digijytky kunnossapidossa 2015 - Vincit
Digijytky kunnossapidossa 2015 - VincitDigijytky kunnossapidossa 2015 - Vincit
Digijytky kunnossapidossa 2015 - Vincit
VincitOy
 
Itseohjautuvan organisaation muutos
Itseohjautuvan organisaation muutosItseohjautuvan organisaation muutos
Itseohjautuvan organisaation muutos
VincitOy
 
Vincit markkinointi AMKE VIMMA 2.6.2015
Vincit markkinointi AMKE VIMMA 2.6.2015Vincit markkinointi AMKE VIMMA 2.6.2015
Vincit markkinointi AMKE VIMMA 2.6.2015
VincitOy
 
Vincit Teatime 2015 - Case Käyttöauto: Google Glass
Vincit Teatime 2015 - Case Käyttöauto: Google GlassVincit Teatime 2015 - Case Käyttöauto: Google Glass
Vincit Teatime 2015 - Case Käyttöauto: Google Glass
VincitOy
 
Vincit Teatime 2015 - Heikki Salo: Case ZenRobotics: JavaScriptin äärirajoilla
Vincit Teatime 2015 - Heikki Salo: Case ZenRobotics: JavaScriptin äärirajoillaVincit Teatime 2015 - Heikki Salo: Case ZenRobotics: JavaScriptin äärirajoilla
Vincit Teatime 2015 - Heikki Salo: Case ZenRobotics: JavaScriptin äärirajoilla
VincitOy
 
Vincit Teatime 2015 - Niko Kurtti: Case Shopify: SaaS:n testaaminen, mihin un...
Vincit Teatime 2015 - Niko Kurtti: Case Shopify: SaaS:n testaaminen, mihin un...Vincit Teatime 2015 - Niko Kurtti: Case Shopify: SaaS:n testaaminen, mihin un...
Vincit Teatime 2015 - Niko Kurtti: Case Shopify: SaaS:n testaaminen, mihin un...
VincitOy
 
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
VincitOy
 
Implementation of an intelligent car wash service - Vincit Teatime 2013
Implementation of an intelligent car wash service - Vincit Teatime 2013Implementation of an intelligent car wash service - Vincit Teatime 2013
Implementation of an intelligent car wash service - Vincit Teatime 2013
VincitOy
 
Projektipäivät 2014: V-Käyrä & Apgar
Projektipäivät 2014: V-Käyrä & ApgarProjektipäivät 2014: V-Käyrä & Apgar
Projektipäivät 2014: V-Käyrä & Apgar
VincitOy
 
Vincit V-Käyrä
Vincit V-KäyräVincit V-Käyrä
Vincit V-Käyrä
VincitOy
 
Need more speed! Pain of mobile app development. Case: Virittäjät
Need more speed! Pain of mobile app development. Case: VirittäjätNeed more speed! Pain of mobile app development. Case: Virittäjät
Need more speed! Pain of mobile app development. Case: Virittäjät
VincitOy
 
Trello projektinhallinnan työkaluna
Trello projektinhallinnan työkalunaTrello projektinhallinnan työkaluna
Trello projektinhallinnan työkaluna
VincitOy
 
Avaus - Vincit Teatime 2014
Avaus - Vincit Teatime 2014Avaus - Vincit Teatime 2014
Avaus - Vincit Teatime 2014
VincitOy
 

More from VincitOy (20)

Vincit Teatime 2015.2 - Aleksi Häkli: SaaSiin pa(i)nostusta
Vincit Teatime 2015.2 - Aleksi Häkli: SaaSiin pa(i)nostustaVincit Teatime 2015.2 - Aleksi Häkli: SaaSiin pa(i)nostusta
Vincit Teatime 2015.2 - Aleksi Häkli: SaaSiin pa(i)nostusta
 
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a gitVincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
Vincit Teatime 2015.2 - Otto Kekäläinen: Don't be a git
 
Vincit ankkasarjakuva
Vincit ankkasarjakuvaVincit ankkasarjakuva
Vincit ankkasarjakuva
 
Tampere goes agile 2015
Tampere goes agile 2015Tampere goes agile 2015
Tampere goes agile 2015
 
Digijytky kunnossapidossa 2015 - Simsotec
Digijytky kunnossapidossa 2015 - SimsotecDigijytky kunnossapidossa 2015 - Simsotec
Digijytky kunnossapidossa 2015 - Simsotec
 
Digijytky kunnossapidossa 2015 - M-Files
Digijytky kunnossapidossa 2015 - M-FilesDigijytky kunnossapidossa 2015 - M-Files
Digijytky kunnossapidossa 2015 - M-Files
 
Digijytky kunnossapidossa 2015 - Oliotalo
Digijytky kunnossapidossa 2015 - OliotaloDigijytky kunnossapidossa 2015 - Oliotalo
Digijytky kunnossapidossa 2015 - Oliotalo
 
Digijytky kunnossapidossa 2015 - Vincit
Digijytky kunnossapidossa 2015 - VincitDigijytky kunnossapidossa 2015 - Vincit
Digijytky kunnossapidossa 2015 - Vincit
 
Itseohjautuvan organisaation muutos
Itseohjautuvan organisaation muutosItseohjautuvan organisaation muutos
Itseohjautuvan organisaation muutos
 
Vincit markkinointi AMKE VIMMA 2.6.2015
Vincit markkinointi AMKE VIMMA 2.6.2015Vincit markkinointi AMKE VIMMA 2.6.2015
Vincit markkinointi AMKE VIMMA 2.6.2015
 
Vincit Teatime 2015 - Case Käyttöauto: Google Glass
Vincit Teatime 2015 - Case Käyttöauto: Google GlassVincit Teatime 2015 - Case Käyttöauto: Google Glass
Vincit Teatime 2015 - Case Käyttöauto: Google Glass
 
Vincit Teatime 2015 - Heikki Salo: Case ZenRobotics: JavaScriptin äärirajoilla
Vincit Teatime 2015 - Heikki Salo: Case ZenRobotics: JavaScriptin äärirajoillaVincit Teatime 2015 - Heikki Salo: Case ZenRobotics: JavaScriptin äärirajoilla
Vincit Teatime 2015 - Heikki Salo: Case ZenRobotics: JavaScriptin äärirajoilla
 
Vincit Teatime 2015 - Niko Kurtti: Case Shopify: SaaS:n testaaminen, mihin un...
Vincit Teatime 2015 - Niko Kurtti: Case Shopify: SaaS:n testaaminen, mihin un...Vincit Teatime 2015 - Niko Kurtti: Case Shopify: SaaS:n testaaminen, mihin un...
Vincit Teatime 2015 - Niko Kurtti: Case Shopify: SaaS:n testaaminen, mihin un...
 
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
Improving Code Quality In Medical Software Through Code Reviews - Vincit Teat...
 
Implementation of an intelligent car wash service - Vincit Teatime 2013
Implementation of an intelligent car wash service - Vincit Teatime 2013Implementation of an intelligent car wash service - Vincit Teatime 2013
Implementation of an intelligent car wash service - Vincit Teatime 2013
 
Projektipäivät 2014: V-Käyrä & Apgar
Projektipäivät 2014: V-Käyrä & ApgarProjektipäivät 2014: V-Käyrä & Apgar
Projektipäivät 2014: V-Käyrä & Apgar
 
Vincit V-Käyrä
Vincit V-KäyräVincit V-Käyrä
Vincit V-Käyrä
 
Need more speed! Pain of mobile app development. Case: Virittäjät
Need more speed! Pain of mobile app development. Case: VirittäjätNeed more speed! Pain of mobile app development. Case: Virittäjät
Need more speed! Pain of mobile app development. Case: Virittäjät
 
Trello projektinhallinnan työkaluna
Trello projektinhallinnan työkalunaTrello projektinhallinnan työkaluna
Trello projektinhallinnan työkaluna
 
Avaus - Vincit Teatime 2014
Avaus - Vincit Teatime 2014Avaus - Vincit Teatime 2014
Avaus - Vincit Teatime 2014
 

Recently uploaded

Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
innovationoecd
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Precisely
 
SAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloudSAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloud
maazsz111
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
LucaBarbaro3
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
Hiike
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
HarisZaheer8
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
Intelisync
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
tolgahangng
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
Javier Junquera
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
akankshawande
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Wask
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
Zilliz
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
saastr
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Tatiana Kojar
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
Shinana2
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
Dinusha Kumarasiri
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
shyamraj55
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
Tatiana Kojar
 
Public CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptxPublic CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptx
marufrahmanstratejm
 

Recently uploaded (20)

Presentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of GermanyPresentation of the OECD Artificial Intelligence Review of Germany
Presentation of the OECD Artificial Intelligence Review of Germany
 
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their MainframeDigital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
Digital Banking in the Cloud: How Citizens Bank Unlocked Their Mainframe
 
SAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloudSAP S/4 HANA sourcing and procurement to Public cloud
SAP S/4 HANA sourcing and procurement to Public cloud
 
Trusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process MiningTrusted Execution Environment for Decentralized Process Mining
Trusted Execution Environment for Decentralized Process Mining
 
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - HiikeSystem Design Case Study: Building a Scalable E-Commerce Platform - Hiike
System Design Case Study: Building a Scalable E-Commerce Platform - Hiike
 
AWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptxAWS Cloud Cost Optimization Presentation.pptx
AWS Cloud Cost Optimization Presentation.pptx
 
A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024A Comprehensive Guide to DeFi Development Services in 2024
A Comprehensive Guide to DeFi Development Services in 2024
 
Serial Arm Control in Real Time Presentation
Serial Arm Control in Real Time PresentationSerial Arm Control in Real Time Presentation
Serial Arm Control in Real Time Presentation
 
GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)GNSS spoofing via SDR (Criptored Talks 2024)
GNSS spoofing via SDR (Criptored Talks 2024)
 
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development ProvidersYour One-Stop Shop for Python Success: Top 10 US Python Development Providers
Your One-Stop Shop for Python Success: Top 10 US Python Development Providers
 
TrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy SurveyTrustArc Webinar - 2024 Global Privacy Survey
TrustArc Webinar - 2024 Global Privacy Survey
 
Digital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying AheadDigital Marketing Trends in 2024 | Guide for Staying Ahead
Digital Marketing Trends in 2024 | Guide for Staying Ahead
 
Fueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte WebinarFueling AI with Great Data with Airbyte Webinar
Fueling AI with Great Data with Airbyte Webinar
 
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
Overcoming the PLG Trap: Lessons from Canva's Head of Sales & Head of EMEA Da...
 
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
Skybuffer AI: Advanced Conversational and Generative AI Solution on SAP Busin...
 
dbms calicut university B. sc Cs 4th sem.pdf
dbms  calicut university B. sc Cs 4th sem.pdfdbms  calicut university B. sc Cs 4th sem.pdf
dbms calicut university B. sc Cs 4th sem.pdf
 
Azure API Management to expose backend services securely
Azure API Management to expose backend services securelyAzure API Management to expose backend services securely
Azure API Management to expose backend services securely
 
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with SlackLet's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
Let's Integrate MuleSoft RPA, COMPOSER, APM with AWS IDP along with Slack
 
Skybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoptionSkybuffer SAM4U tool for SAP license adoption
Skybuffer SAM4U tool for SAP license adoption
 
Public CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptxPublic CyberSecurity Awareness Presentation 2024.pptx
Public CyberSecurity Awareness Presentation 2024.pptx
 

Vincit Teatime 2015.2 - Niko Kurtti: SaaSiin pa(i)nostusta

  • 2. Shopify • All the commerce • 165k+ merchants, 8 Billion GMV • 300M+ unique visits/month • 4000+ containers • RoR, MySQL, Redis, Memcache, Elasticsearch, Chef, Go, Podding, Multi-DC,...
  • 3.
  • 4.
  • 5. Docker at Shopify • Serving production traffic for over a year • Gives developers more freedom (and responsibility) around how applications are being ran • Offers super fast and reliable deploys1 1 When it works. Warstories are plenty
  • 7. Dockerfiles Super simple (Dockerfile is essentially shell commands + a handful of specialized instructions) Super efficient (Detects changes and skips things that have not changed) Super inefficient and complicated for anything nontrivial
  • 8. Simple, eh? FROM ruby:2.1.3 RUN apt-get update RUN apt-get upgrade RUN apt-get install -qq -y libmysqlclient-dev RUN useradd --create-home rails_is_fun WORKDIR /home/rails_is_fun COPY . /home/rails_is_fun RUN bundle install CMD bundle exec unicorn -p 3000
  • 10. FROM ruby:2.1.3 RUN apt-get update RUN apt-get upgrade RUN apt-get install -qq -y libmysqlclient-dev RUN useradd --create-home rails_is_fun WORKDIR /home/rails_is_fun COPY Gemfile /home/rails_is_fun/Gemfile COPY Gemfile.lock /home/rails_is_fun/Gemfile.lock RUN bundle install COPY . /home/rails_is_fun CMD bundle exec unicorn -p 3000 Even with this you have no concept of Gem cache, so any changes to Gemfile essentially means building them from scratch Not to mention the burden of apt-get update/upgrade
  • 11.
  • 12. What about secrets? When building application containers its pretty common to have secrets (API keys, DB urls etc.). Dockerfile doesn't support any temporary/external files. While building you can't use VOLUMES either No real solutions. Everything is bad (secrets in plaintext in layers, external wrappers etc)
  • 13. #!/bin/bash gem install ejson ejson decrypt config/config.production.ejson > config.json docker build -t rails_is_fun . rm -rf config.json
  • 14. The things we needed • Performance (not only for building a lot of containers but building a single one quickly) • Security. We handle money and peoples private information, so having a secure system is kinda important • Coordinator for builds
  • 15. Solution: Write your own builder
  • 16. Our custom builder Locutus is a Golang app that: • Listens to webhooks (every commit to GH triggers a build) • Builds containers • Pushes to our private registry • Has a webgui showing the build step-by-step • Sends hooks about build statuses • Scales horizontally, eg. we can have N builders
  • 17. The interesting part, building We replaced Dockerfiles with prepare, precompile and compile scripts (vanilla Bash) These scripts actually represent a different build phase and live in the app repo Each phase does a docker run with the script and saves the container with docker commit.
  • 18. prepare is used for your system packages (eg. apt-get install libmysqlclient-dev). In this phase we only copy the script itself to our baseimage We cache this image based on the md5sum of the prepare During Shopify builds we really rarely have to run this phase since system level depencies doesn't change often.
  • 19. precompile is used for application dependencies and asset building (eg. bundle install) Used for creating a folder of wanted artifacts. Only thing that is persisted is /artifacts Run on every build, but build upon the previous cache of the specific app (and branch). So we never end up pulling all gems because of a Gemfile change etc.
  • 20. compile is used for moving the generated arfifacts to correct folders (eg. .bundle) and finishing setup Run on every build, but super fast since we are just doing bunch of mv and rm (to cleanup caches etc. to slim the image) The result of this phase is the final image we actually can deploy to be run.
  • 21. Build times around 40-50 seconds thanks to heavy caching Containers never see the keys that are used for decrypting secrets
  • 22.
  • 23.