SlideShare a Scribd company logo
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
Start tracking your ruby infrastructure
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
Start tracking your ruby infrastructure
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
Start tracking your ruby infrastructure
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
Start tracking your ruby infrastructure
Start tracking your ruby infrastructure
Terraform
Docker Swarm
Kubernetes
Questions?
Thank you
for the listening

More Related Content

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
Patrick Mizer
 
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)Использование Docker в CI / Александр Акбашев (HERE Technologies)
Использование Docker в CI / Александр Акбашев (HERE Technologies)
Ontico
 
Statyczna analiza kodu PHP
Statyczna analiza kodu PHPStatyczna analiza kodu PHP
Statyczna analiza kodu PHP
The Software House
 
(Re)discover your AEM
(Re)discover your AEM(Re)discover your AEM
(Re)discover your AEM
Jakub Wadolowski
 
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
Maciej Lasyk
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on Docker
Ben 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 journey
Jakub 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 2014
D
 
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 deploy
Eric 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 Symfony
André 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 minutes
Luciano Fiandesio
 
Learn basic ansible using docker
Learn basic ansible using dockerLearn basic ansible using docker
Learn basic ansible using docker
Larry 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 Swarm
Mario 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 Applications
Ben Hall
 
Everything as a code
Everything as a codeEverything as a code
Everything as a code
Aleksandr Tarasov
 
CoreOS Overview
CoreOS OverviewCoreOS Overview
CoreOS Overview
Victor S. Recio
 
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
Gosuke Miyashita
 
Developing and Deploying PHP with Docker
Developing and Deploying PHP with DockerDeveloping and Deploying PHP with Docker
Developing and Deploying PHP with Docker
Patrick 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 libcloudem
Maciej Lasyk
 
Running .NET on Docker
Running .NET on DockerRunning .NET on Docker
Running .NET on Docker
Ben 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 journey
Jakub 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 2014
D
 
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 deploy
Eric 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 Symfony
André 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 minutes
Luciano Fiandesio
 
Learn basic ansible using docker
Learn basic ansible using dockerLearn basic ansible using docker
Learn basic ansible using docker
Larry 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 Swarm
Mario 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 Applications
Ben 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 2012
Gosuke Miyashita
 

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
D
 
Docker, c'est bonheur !
Docker, c'est bonheur !Docker, c'est bonheur !
Docker, c'est bonheur !
Alexandre Salomé
 
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
Ben Hall
 
Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署Drone CI/CD 自動化測試及部署
Drone CI/CD 自動化測試及部署
Bo-Yi Wu
 
Docker linuxday 2015
Docker linuxday 2015Docker linuxday 2015
Docker linuxday 2015
Massimiliano Dessì
 
CoreOS @ summer meetup in Utrecht
CoreOS @ summer meetup in UtrechtCoreOS @ summer meetup in Utrecht
CoreOS @ summer meetup in Utrecht
Timo 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 Lach
PROIDEA
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
Docker, Inc.
 
Making kubernetes simple for developers
Making kubernetes simple for developersMaking kubernetes simple for developers
Making kubernetes simple for developers
Suraj 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) Italy
Giovanni 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 Development
Chris 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 2016
Ben Hall
 
Scaling docker with kubernetes
Scaling docker with kubernetesScaling docker with kubernetes
Scaling docker with kubernetes
Liran Cohen
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
Liang 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 Service
Ben Hall
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
Paul Chao
 
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
D
 
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
Ben 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 Utrecht
Timo 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 Lach
PROIDEA
 
Docker Security workshop slides
Docker Security workshop slidesDocker Security workshop slides
Docker Security workshop slides
Docker, Inc.
 
Making kubernetes simple for developers
Making kubernetes simple for developersMaking kubernetes simple for developers
Making kubernetes simple for developers
Suraj 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) Italy
Giovanni 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 Development
Chris 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 2016
Ben Hall
 
Scaling docker with kubernetes
Scaling docker with kubernetesScaling docker with kubernetes
Scaling docker with kubernetes
Liran Cohen
 
Docker module 1
Docker module 1Docker module 1
Docker module 1
Liang 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 Service
Ben Hall
 
手把手帶你學Docker 03042017
手把手帶你學Docker 03042017手把手帶你學Docker 03042017
手把手帶你學Docker 03042017
Paul Chao
 

Recently uploaded (20)

What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
tecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdftecnologias de las primeras civilizaciones.pdf
tecnologias de las primeras civilizaciones.pdf
fjgm517
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?How Can I use the AI Hype in my Business Context?
How Can I use the AI Hype in my Business Context?
Daniel Lehner
 
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc Webinar: Consumer Expectations vs Corporate Realities on Data Broker...
TrustArc
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdfComplete Guide to Advanced Logistics Management Software in Riyadh.pdf
Complete Guide to Advanced Logistics Management Software in Riyadh.pdf
Software Company
 
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Massive Power Outage Hits Spain, Portugal, and France: Causes, Impact, and On...
Aqusag Technologies
 
HCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser EnvironmentsHCL Nomad Web – Best Practices and Managing Multiuser Environments
HCL Nomad Web – Best Practices and Managing Multiuser Environments
panagenda
 
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes Partner Innovation Updates for May 2025
ThousandEyes
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded DevelopersLinux Support for SMARC: How Toradex Empowers Embedded Developers
Linux Support for SMARC: How Toradex Empowers Embedded Developers
Toradex
 
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
Transcript: #StandardsGoals for 2025: Standards & certification roundup - Tec...
BookNet Canada
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
AI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global TrendsAI and Data Privacy in 2025: Global Trends
AI and Data Privacy in 2025: Global Trends
InData Labs
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 

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
  • 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
  • 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
  • 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
  • 56. Thank you for the listening