SlideShare a Scribd company logo
1 of 56
Start tracking your Ruby
infrastructure
@sergey_kukunin
IT Rally 2018, Івано-Франківськ
What we are talking about
What’s wrong with
Capistrano?
Problems with classic approach
● Setup a new server after failure
● Scaling
● Deploy of new dependencies
● Setup a new instance for a feature
Infrastructure as Code
Without rocket science
Advantages of the approach
● Automatization
● Scalability
● Track your changes
● A way to define application
dependencies
● Unifies zoo of technologies
Docker + Ansible: easy to start
Docker
What Docker is
Docker is about isolation
Docker example
I’m in Ubuntu
docker run -it ubuntu bash
I’m in Centos
docker run -it centos bash
Docker is NOT a VM
Glossary
● Docker Image
● Docker Container
● Dockerfile
● Docker Volume
● Docker Network
● Docker Registry
How Docker works
A couple of keynotes
● Docker is a daemon
● Docker is a client-server application
● All containers share the same kernel
● Currently, Docker runs only on Linux kernel
Dockerfile
FROM ruby:2.5
RUN apt-get update && apt-get install
-y build-essential libpq-dev nodejs
RUN mkdir /app
WORKDIR /app
ADD Gemfile /app/Gemfile
ADD Gemfile.lock /app/Gemfile.lock
RUN bundle install --jobs 4
ADD . /app
RUN bundle exec rake assets:precompile
CMD rake server
Dockerfile
# builder stage
FROM ubuntu:16.04 as builder
RUN apt-get update && 
apt-get --no-install-recommends --yes install 
ca-certificates 
cmake 
g++ 
make 
pkg-config 
graphviz 
doxygen 
git 
curl 
libtool-bin 
autoconf 
automake
Dockerfile
autoconf 
automake
WORKDIR /usr/local
## Boost
ARG BOOST_VERSION=1_66_0
ARG BOOST_VERSION_DOT=1.66.0
ARG
BOOST_HASH=5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9
RUN curl -s -L -o boost_${BOOST_VERSION}.tar.bz2
https://dl.bintray.com/boostorg/release/${BOOST_VERSION_DOT}/source/boost_${B
OOST_VERSION}.tar.bz2 
&& echo "${BOOST_HASH} boost_${BOOST_VERSION}.tar.bz2" | sha256sum -c 
&& tar -xvf boost_${BOOST_VERSION}.tar.bz2 
&& cd boost_${BOOST_VERSION} 
&& ./bootstrap.sh 
&& ./b2 --build-type=minimal link=static runtime-link=static --with-
Dockerfile
&& ./bootstrap.sh 
&& ./b2 --build-type=minimal link=static runtime-link=static --with-
chrono --with-date_time --with-filesystem --with-program_options --with-regex
--with-serialization --with-system --with-thread --with-locale
threading=multi threadapi=pthread cflags="-fPIC" cxxflags="-fPIC" stage
ENV BOOST_ROOT /usr/local/boost_${BOOST_VERSION}
# OpenSSL
ARG OPENSSL_VERSION=1.0.2n
ARG
OPENSSL_HASH=370babb75f278c39e0c50e8c4e7493bc0f18db6867478341a832a982fd15a8fe
RUN curl -s -O https://www.openssl.org/source/openssl-
${OPENSSL_VERSION}.tar.gz 
&& echo "${OPENSSL_HASH} openssl-${OPENSSL_VERSION}.tar.gz" | sha256sum -
c 
&& tar -xzf openssl-${OPENSSL_VERSION}.tar.gz 
&& cd openssl-${OPENSSL_VERSION} 
&& ./Configure linux-x86_64 no-shared --static -fPIC
Dockerfile
&& tar -xzf openssl-${OPENSSL_VERSION}.tar.gz 
&& cd openssl-${OPENSSL_VERSION} 
&& ./Configure linux-x86_64 no-shared --static -fPIC 
&& make build_crypto build_ssl 
&& make install
ENV OPENSSL_ROOT_DIR=/usr/local/openssl-${OPENSSL_VERSION}
# ZMQ
ARG ZMQ_VERSION=v4.2.3
ARG ZMQ_HASH=3226b8ebddd9c6c738ba42986822c26418a49afb
RUN git clone https://github.com/zeromq/libzmq.git -b ${ZMQ_VERSION} 
&& cd libzmq 
&& test `git rev-parse HEAD` = ${ZMQ_HASH} || exit 1 
&& ./autogen.sh 
&& CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure --enable-static --disable-
shared 
&& make 
&& make install
Dockerfile
&& make install 
&& ldconfig
# zmq.hpp
ARG CPPZMQ_HASH=6aa3ab686e916cb0e62df7fa7d12e0b13ae9fae6
RUN git clone https://github.com/zeromq/cppzmq.git -b ${ZMQ_VERSION} 
&& cd cppzmq 
&& test `git rev-parse HEAD` = ${CPPZMQ_HASH} || exit 1 
&& mv *.hpp /usr/local/include
# Readline
ARG READLINE_VERSION=7.0
ARG
READLINE_HASH=750d437185286f40a369e1e4f4764eda932b9459b5ec9a731628393dd3d3233
4
RUN curl -s -O https://ftp.gnu.org/gnu/readline/readline-
${READLINE_VERSION}.tar.gz 
&& echo "${READLINE_HASH} readline-${READLINE_VERSION}.tar.gz" |
Dockerfile
RUN curl -s -O https://ftp.gnu.org/gnu/readline/readline-
${READLINE_VERSION}.tar.gz 
&& echo "${READLINE_HASH} readline-${READLINE_VERSION}.tar.gz" |
sha256sum -c 
&& tar -xzf readline-${READLINE_VERSION}.tar.gz 
&& cd readline-${READLINE_VERSION} 
&& CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure 
&& make 
&& make install
# Sodium
ARG SODIUM_VERSION=1.0.16
ARG SODIUM_HASH=675149b9b8b66ff44152553fb3ebf9858128363d
RUN git clone https://github.com/jedisct1/libsodium.git -b ${SODIUM_VERSION}

&& cd libsodium 
&& test `git rev-parse HEAD` = ${SODIUM_HASH} || exit 1 
&& ./autogen.sh
Dockerfile
&& cd libsodium 
&& test `git rev-parse HEAD` = ${SODIUM_HASH} || exit 1 
&& ./autogen.sh 
&& CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure 
&& make 
&& make check 
&& make install
WORKDIR /src
COPY . .
ARG NPROC
RUN rm -rf build && 
if [ -z "$NPROC" ];then make -j$(nproc) release-static;else make -j$NPROC
release-static;fi
# runtime stage
FROM ubuntu:16.04
Dockerfile
# runtime stage
FROM ubuntu:16.04
RUN apt-get update && 
apt-get --no-install-recommends --yes install ca-certificates && 
apt-get clean && 
rm -rf /var/lib/apt
COPY --from=builder /src/build/release/bin/* /usr/local/bin/
# Contains the blockchain
VOLUME /root/.bitmonero
# Generate your wallet via accessing the container and run:
# cd /wallet
# monero-wallet-cli
VOLUME /wallet
Dockerfile
VOLUME /wallet
EXPOSE 18080
EXPOSE 18081
ENTRYPOINT ["monerod", "--p2p-bind-ip=0.0.0.0", "--p2p-bind-port=18080", "--
rpc-bind-ip=0.0.0.0", "--rpc-bind-port=18081", "--non-interactive", "--
confirm-external-bind"]
More keynotes
● Image is a stack of layered snapshots
● Image is read-only
● Container is immutable
● Distinguish the build time and the run time
Use cases
● A developer defines an exact application environment himself
● To resolve environment conflicts between applications
● Try and forget
● To run tests in parallel without interfering each other
● To define a unified interface to treat any application
Docker Registry
Questions?
Configuration
Management
Systems
Ansible
Why Ansible
It’s flexible
It’s so easy to start
Glossary: Module and Task
Glossary: Inventory and Group
Glossary: Playbook
Glossary: Variable
Glossary: Variable
Glossary: Variable
Glossary: Role
Glossary: Role
Glossary: Variables in Role
Glossary: Playbook
File templates
Glossary: Galaxy
A couple of keynotes
● Ansible is written on Python, but it’s YAML
● You define the desired state
● Ansible is declarative, but it has all constructions
● Docker removes the constraint of variety of recipes
● You can start with a single file
● You can build all architecture as you do in code
You can do OOP in Ansible
Combine it together
Do whatever you want
Cons
● Takes more time for single server setup
● Hard to make quick’n’dirty hacks
● Isolation makes some things hard
○ Zero downtime deploy
● WAT??? for classic admin
○ Need to pay more for DevOps
● Little problems
○ Ansible requires Python on a server
Further
Terraform
Docker Swarm
Kubernetes
Questions?
Thank you
for the listening

More Related Content

What's hot

Developing and Deploying PHP with Docker
Developing and Deploying PHP with DockerDeveloping and Deploying PHP with Docker
Developing and Deploying PHP with DockerPatrick Mizer
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Ontico
 
Programowanie AWSa z CLI, boto, Ansiblem i libcloudem
Programowanie AWSa z CLI, boto, Ansiblem i libcloudemProgramowanie AWSa z CLI, boto, Ansiblem i libcloudem
Programowanie AWSa z CLI, boto, Ansiblem i libcloudemMaciej Lasyk
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on DockerBen Hall
 
How to stay sane during your Vagrant journey
How to stay sane during your Vagrant journeyHow to stay sane during your Vagrant journey
How to stay sane during your Vagrant journeyJakub Wadolowski
 
Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014D
 
What Have Syscalls Done for you Lately?
What Have Syscalls Done for you Lately?What Have Syscalls Done for you Lately?
What Have Syscalls Done for you Lately?Docker, Inc.
 
Docker deploy
Docker deployDocker deploy
Docker deployEric Ahn
 
Getting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyGetting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyAndré Rømcke
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesLuciano Fiandesio
 
Learn basic ansible using docker
Learn basic ansible using dockerLearn basic ansible using docker
Learn basic ansible using dockerLarry Cai
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Ben Hall
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Ben Hall
 
Docker Compose to Production with Docker Swarm
Docker Compose to Production with Docker SwarmDocker Compose to Production with Docker Swarm
Docker Compose to Production with Docker SwarmMario IC
 
Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsBen Hall
 
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012Gosuke Miyashita
 

What's hot (20)

Developing and Deploying PHP with Docker
Developing and Deploying PHP with DockerDeveloping and Deploying PHP with Docker
Developing and Deploying PHP with Docker
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)
 
Statyczna analiza kodu PHP
Statyczna analiza kodu PHPStatyczna analiza kodu PHP
Statyczna analiza kodu PHP
 
(Re)discover your AEM
(Re)discover your AEM(Re)discover your AEM
(Re)discover your AEM
 
Programowanie AWSa z CLI, boto, Ansiblem i libcloudem
Programowanie AWSa z CLI, boto, Ansiblem i libcloudemProgramowanie AWSa z CLI, boto, Ansiblem i libcloudem
Programowanie AWSa z CLI, boto, Ansiblem i libcloudem
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on Docker
 
How to stay sane during your Vagrant journey
How to stay sane during your Vagrant journeyHow to stay sane during your Vagrant journey
How to stay sane during your Vagrant journey
 
Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014Dockerizing Symfony Applications - Symfony Live Berlin 2014
Dockerizing Symfony Applications - Symfony Live Berlin 2014
 
What Have Syscalls Done for you Lately?
What Have Syscalls Done for you Lately?What Have Syscalls Done for you Lately?
What Have Syscalls Done for you Lately?
 
Docker deploy
Docker deployDocker deploy
Docker deploy
 
Getting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyGetting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and Symfony
 
Docker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutesDocker 101 - from 0 to Docker in 30 minutes
Docker 101 - from 0 to Docker in 30 minutes
 
Learn basic ansible using docker
Learn basic ansible using dockerLearn basic ansible using docker
Learn basic ansible using docker
 
Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)Running Docker in Development & Production (DevSum 2015)
Running Docker in Development & Production (DevSum 2015)
 
Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)Running Docker in Development & Production (#ndcoslo 2015)
Running Docker in Development & Production (#ndcoslo 2015)
 
Docker Compose to Production with Docker Swarm
Docker Compose to Production with Docker SwarmDocker Compose to Production with Docker Swarm
Docker Compose to Production with Docker Swarm
 
Real World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js ApplicationsReal World Lessons on the Pain Points of Node.js Applications
Real World Lessons on the Pain Points of Node.js Applications
 
Everything as a code
Everything as a codeEverything as a code
Everything as a code
 
CoreOS Overview
CoreOS OverviewCoreOS Overview
CoreOS Overview
 
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
Inside Sqale's Backend at Sapporo Ruby Kaigi 2012
 

Similar to Start tracking your ruby infrastructure

Introduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group CologneIntroduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group CologneD
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionBen Hall
 
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Bo-Yi Wu
 
CoreOS @ summer meetup in Utrecht
CoreOS @ summer meetup in UtrechtCoreOS @ summer meetup in Utrecht
CoreOS @ summer meetup in UtrechtTimo Derstappen
 
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz LachJDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz LachPROIDEA
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slidesDocker, Inc.
 
Making kubernetes simple for developers
Making kubernetes simple for developersMaking kubernetes simple for developers
Making kubernetes simple for developersSuraj Deshmukh
 
廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班Paul Chao
 
Docker 進階實務班
Docker 進階實務班Docker 進階實務班
Docker 進階實務班Philip Zheng
 
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) ItalyClustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) ItalyGiovanni Toraldo
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline Docker, Inc.
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇Philip Zheng
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for DevelopmentChris Tankersley
 
Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Ben Hall
 
Scaling docker with kubernetes
Scaling docker with kubernetesScaling docker with kubernetes
Scaling docker with kubernetesLiran Cohen
 
Docker module 1
Docker module 1Docker module 1
Docker module 1Liang Bo
 
Scaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceScaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceBen Hall
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017Paul Chao
 

Similar to Start tracking your ruby infrastructure (20)

Introduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group CologneIntroduction to Docker & CoreOS - Symfony User Group Cologne
Introduction to Docker & CoreOS - Symfony User Group Cologne
 
Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
 
Real World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and ProductionReal World Experience of Running Docker in Development and Production
Real World Experience of Running Docker in Development and Production
 
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署
 
Docker linuxday 2015
Docker linuxday 2015Docker linuxday 2015
Docker linuxday 2015
 
CoreOS @ summer meetup in Utrecht
CoreOS @ summer meetup in UtrechtCoreOS @ summer meetup in Utrecht
CoreOS @ summer meetup in Utrecht
 
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz LachJDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
JDO 2019: Tips and Tricks from Docker Captain - Łukasz Lach
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
 
Making kubernetes simple for developers
Making kubernetes simple for developersMaking kubernetes simple for developers
Making kubernetes simple for developers
 
廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班廣宣學堂: 容器進階實務 - Docker進深研究班
廣宣學堂: 容器進階實務 - Docker進深研究班
 
Docker 進階實務班
Docker 進階實務班Docker 進階實務班
Docker 進階實務班
 
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) ItalyClustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
Clustering with Docker Swarm - Dockerops 2016 @ Cento (FE) Italy
 
DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline  DCSF 19 Building Your Development Pipeline
DCSF 19 Building Your Development Pipeline
 
時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇時代在變 Docker 要會:台北 Docker 一日入門篇
時代在變 Docker 要會:台北 Docker 一日入門篇
 
Killer Docker Workflows for Development
Killer Docker Workflows for DevelopmentKiller Docker Workflows for Development
Killer Docker Workflows for Development
 
Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016Deploying Windows Containers on Windows Server 2016
Deploying Windows Containers on Windows Server 2016
 
Scaling docker with kubernetes
Scaling docker with kubernetesScaling docker with kubernetes
Scaling docker with kubernetes
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
 
Scaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container ServiceScaling Docker Containers using Kubernetes and Azure Container Service
Scaling Docker Containers using Kubernetes and Azure Container Service
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
 

Recently uploaded

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Principled Technologies
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...Martijn de Jong
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...apidays
 

Recently uploaded (20)

Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
Deploy with confidence: VMware Cloud Foundation 5.1 on next gen Dell PowerEdg...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 

Start tracking your ruby infrastructure

  • 1. Start tracking your Ruby infrastructure @sergey_kukunin IT Rally 2018, Івано-Франківськ
  • 2. What we are talking about
  • 4. Problems with classic approach ● Setup a new server after failure ● Scaling ● Deploy of new dependencies ● Setup a new instance for a feature
  • 6. Advantages of the approach ● Automatization ● Scalability ● Track your changes ● A way to define application dependencies ● Unifies zoo of technologies
  • 7. Docker + Ansible: easy to start
  • 9. What Docker is Docker is about isolation
  • 10. Docker example I’m in Ubuntu docker run -it ubuntu bash I’m in Centos docker run -it centos bash
  • 12.
  • 13. Glossary ● Docker Image ● Docker Container ● Dockerfile ● Docker Volume ● Docker Network ● Docker Registry
  • 15. A couple of keynotes ● Docker is a daemon ● Docker is a client-server application ● All containers share the same kernel ● Currently, Docker runs only on Linux kernel
  • 16. Dockerfile FROM ruby:2.5 RUN apt-get update && apt-get install -y build-essential libpq-dev nodejs RUN mkdir /app WORKDIR /app ADD Gemfile /app/Gemfile ADD Gemfile.lock /app/Gemfile.lock RUN bundle install --jobs 4 ADD . /app RUN bundle exec rake assets:precompile CMD rake server
  • 17. Dockerfile # builder stage FROM ubuntu:16.04 as builder RUN apt-get update && apt-get --no-install-recommends --yes install ca-certificates cmake g++ make pkg-config graphviz doxygen git curl libtool-bin autoconf automake
  • 18. Dockerfile autoconf automake WORKDIR /usr/local ## Boost ARG BOOST_VERSION=1_66_0 ARG BOOST_VERSION_DOT=1.66.0 ARG BOOST_HASH=5721818253e6a0989583192f96782c4a98eb6204965316df9f5ad75819225ca9 RUN curl -s -L -o boost_${BOOST_VERSION}.tar.bz2 https://dl.bintray.com/boostorg/release/${BOOST_VERSION_DOT}/source/boost_${B OOST_VERSION}.tar.bz2 && echo "${BOOST_HASH} boost_${BOOST_VERSION}.tar.bz2" | sha256sum -c && tar -xvf boost_${BOOST_VERSION}.tar.bz2 && cd boost_${BOOST_VERSION} && ./bootstrap.sh && ./b2 --build-type=minimal link=static runtime-link=static --with-
  • 19. Dockerfile && ./bootstrap.sh && ./b2 --build-type=minimal link=static runtime-link=static --with- chrono --with-date_time --with-filesystem --with-program_options --with-regex --with-serialization --with-system --with-thread --with-locale threading=multi threadapi=pthread cflags="-fPIC" cxxflags="-fPIC" stage ENV BOOST_ROOT /usr/local/boost_${BOOST_VERSION} # OpenSSL ARG OPENSSL_VERSION=1.0.2n ARG OPENSSL_HASH=370babb75f278c39e0c50e8c4e7493bc0f18db6867478341a832a982fd15a8fe RUN curl -s -O https://www.openssl.org/source/openssl- ${OPENSSL_VERSION}.tar.gz && echo "${OPENSSL_HASH} openssl-${OPENSSL_VERSION}.tar.gz" | sha256sum - c && tar -xzf openssl-${OPENSSL_VERSION}.tar.gz && cd openssl-${OPENSSL_VERSION} && ./Configure linux-x86_64 no-shared --static -fPIC
  • 20. Dockerfile && tar -xzf openssl-${OPENSSL_VERSION}.tar.gz && cd openssl-${OPENSSL_VERSION} && ./Configure linux-x86_64 no-shared --static -fPIC && make build_crypto build_ssl && make install ENV OPENSSL_ROOT_DIR=/usr/local/openssl-${OPENSSL_VERSION} # ZMQ ARG ZMQ_VERSION=v4.2.3 ARG ZMQ_HASH=3226b8ebddd9c6c738ba42986822c26418a49afb RUN git clone https://github.com/zeromq/libzmq.git -b ${ZMQ_VERSION} && cd libzmq && test `git rev-parse HEAD` = ${ZMQ_HASH} || exit 1 && ./autogen.sh && CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure --enable-static --disable- shared && make && make install
  • 21. Dockerfile && make install && ldconfig # zmq.hpp ARG CPPZMQ_HASH=6aa3ab686e916cb0e62df7fa7d12e0b13ae9fae6 RUN git clone https://github.com/zeromq/cppzmq.git -b ${ZMQ_VERSION} && cd cppzmq && test `git rev-parse HEAD` = ${CPPZMQ_HASH} || exit 1 && mv *.hpp /usr/local/include # Readline ARG READLINE_VERSION=7.0 ARG READLINE_HASH=750d437185286f40a369e1e4f4764eda932b9459b5ec9a731628393dd3d3233 4 RUN curl -s -O https://ftp.gnu.org/gnu/readline/readline- ${READLINE_VERSION}.tar.gz && echo "${READLINE_HASH} readline-${READLINE_VERSION}.tar.gz" |
  • 22. Dockerfile RUN curl -s -O https://ftp.gnu.org/gnu/readline/readline- ${READLINE_VERSION}.tar.gz && echo "${READLINE_HASH} readline-${READLINE_VERSION}.tar.gz" | sha256sum -c && tar -xzf readline-${READLINE_VERSION}.tar.gz && cd readline-${READLINE_VERSION} && CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure && make && make install # Sodium ARG SODIUM_VERSION=1.0.16 ARG SODIUM_HASH=675149b9b8b66ff44152553fb3ebf9858128363d RUN git clone https://github.com/jedisct1/libsodium.git -b ${SODIUM_VERSION} && cd libsodium && test `git rev-parse HEAD` = ${SODIUM_HASH} || exit 1 && ./autogen.sh
  • 23. Dockerfile && cd libsodium && test `git rev-parse HEAD` = ${SODIUM_HASH} || exit 1 && ./autogen.sh && CFLAGS="-fPIC" CXXFLAGS="-fPIC" ./configure && make && make check && make install WORKDIR /src COPY . . ARG NPROC RUN rm -rf build && if [ -z "$NPROC" ];then make -j$(nproc) release-static;else make -j$NPROC release-static;fi # runtime stage FROM ubuntu:16.04
  • 24. Dockerfile # runtime stage FROM ubuntu:16.04 RUN apt-get update && apt-get --no-install-recommends --yes install ca-certificates && apt-get clean && rm -rf /var/lib/apt COPY --from=builder /src/build/release/bin/* /usr/local/bin/ # Contains the blockchain VOLUME /root/.bitmonero # Generate your wallet via accessing the container and run: # cd /wallet # monero-wallet-cli VOLUME /wallet
  • 25. Dockerfile VOLUME /wallet EXPOSE 18080 EXPOSE 18081 ENTRYPOINT ["monerod", "--p2p-bind-ip=0.0.0.0", "--p2p-bind-port=18080", "-- rpc-bind-ip=0.0.0.0", "--rpc-bind-port=18081", "--non-interactive", "-- confirm-external-bind"]
  • 26. More keynotes ● Image is a stack of layered snapshots ● Image is read-only ● Container is immutable ● Distinguish the build time and the run time
  • 27. Use cases ● A developer defines an exact application environment himself ● To resolve environment conflicts between applications ● Try and forget ● To run tests in parallel without interfering each other ● To define a unified interface to treat any application
  • 29.
  • 45. A couple of keynotes ● Ansible is written on Python, but it’s YAML ● You define the desired state ● Ansible is declarative, but it has all constructions ● Docker removes the constraint of variety of recipes ● You can start with a single file ● You can build all architecture as you do in code
  • 46. You can do OOP in Ansible
  • 48.
  • 50. Cons ● Takes more time for single server setup ● Hard to make quick’n’dirty hacks ● Isolation makes some things hard ○ Zero downtime deploy ● WAT??? for classic admin ○ Need to pay more for DevOps ● Little problems ○ Ansible requires Python on a server
  • 52.
  • 53.
  • 56. Thank you for the listening