Slide 1

Slide 1 text

Building deployment pipeline: DevOps way Андрей Ребров Инженерный тренер ScrumTrek

Slide 2

Slide 2 text

No content

Slide 3

Slide 3 text

Continuous Deployment - Ожидание

Slide 4

Slide 4 text

Continuous Deployment - Реальность

Slide 5

Slide 5 text

Инструменты разработки != инструменты админов

Slide 6

Slide 6 text

Недоверие Ops к Dev

Slide 7

Slide 7 text

«Прохладные истории» сломанных стендов

Slide 8

Slide 8 text

Решение •  Обеспечить прозрачность процесса •  Обеспечить качество поставок •  Свести dev и ops в одном месте

Slide 9

Slide 9 text

Delivery Pipeline – наш выбор

Slide 10

Slide 10 text

Это тоже delivery pipeline

Slide 11

Slide 11 text

No content

Slide 12

Slide 12 text

Culture Automation Measurement Sharing

Slide 13

Slide 13 text

Culture

Slide 14

Slide 14 text

Automation •  CI Server •  Code Analysis •  Auto Tests •  Configuration Management

Slide 15

Slide 15 text

CI Server •  Рассмотрим на примере Jenkins

Slide 16

Slide 16 text

Что нужно 1.  Ставим pipeline plugin 2.  Делаем dependency между задачами 3.  Создаем новый pipeline view 4.  …. 5.  Profit!

Slide 17

Slide 17 text

Альтернативы

Slide 18

Slide 18 text

Configuration Management •  VM control •  OS control •  Installation control •  …

Slide 19

Slide 19 text

Как неправильно

Slide 20

Slide 20 text

Например

Slide 21

Slide 21 text

Vagrant Vagrant::Config.run do |config| config.vm.box = "precise32" config.vm.box_url = http://files.vagrantup.com/precise32.box config.vm.network :hostonly, "192.168.33.10” config.vm.share_folder("v-web", "/vagrant/www", "./www", :nfs => true) config.vm.share_folder("v-db", "/vagrant/db", "./db", :nfs => true) config.vm.forward_port 80, 8080 config.vm.provision :shell, :inline => "apt-get update --fix- missing” end

Slide 22

Slide 22 text

Docker from ubuntu:12.10 run apt-get update run DEBIAN_FRONTEND=noninteractive apt-get install -q -y python run DEBIAN_FRONTEND=noninteractive apt-get install -q -y python-pip run pip install django run DEBIAN_FRONTEND=noninteractive apt-get install -q -y curl run curl -L https://github.com/shykes/helloflask/archive/ master.tar.gz | tar -xzv run cd helloflask-master && pip install -r requirements.txt

Slide 23

Slide 23 text

Нужно больше инструментов!

Slide 24

Slide 24 text

Еще больше!

Slide 25

Slide 25 text

No content

Slide 26

Slide 26 text

Что важно •  Useful reports •  Useful logging •  Vizualisation – Dashboards – Graphs – …

Slide 27

Slide 27 text

Работаем с логами

Slide 28

Slide 28 text

Node    Node   Logstash   Elas.cSearch   Kibana   Как можно все это собрать

Slide 29

Slide 29 text

Запуск Lumberjack /opt/lumberjack/bin/lumberjack -- host your.logstash.host -- port port-for- these-logs --ssl-ca-path /etc/ssl/ logstash.pub Для генерации ключей на logstash сервере: openssl req -x509 -newkey rsa:2048 -keyout /etc/ ssl/ logstash.key -out /etc/ssl/logstash.pub - nodes -days 365

Slide 30

Slide 30 text

Конфигурируем Logstash #1 input { lumberjack { type => "apache-access" port => 3338 ssl_certificate => "/etc/ssl/logstash.pub" ssl_key => "/etc/ssl/logstash.key" } }

Slide 31

Slide 31 text

Конфигурируем Logstash #2 filter { date { type => "apache-access" timestamp => "dd/MMM/yyyy:HH:mm:ss Z" } }

Slide 32

Slide 32 text

Конфигурируем Logstash #3 output { elasticsearch { embedded => false cluster => logs host => "172.28.2.2" index => "apache-%{+YYYY.MM}" type => "apache-access" } }

Slide 33

Slide 33 text

Запуск Logstash /usr/bin/java -jar /opt/logstash/logstash.jar agent -f -l

Slide 34

Slide 34 text

Конфигурируем Elasticsearch cluster.name: logs index.number_of_replicas: 0 path.data: /elasticsearch/data path.work: /elasticsearch/work path.logs: /elasticsearch/logs bootstrap.mlockall: true discovery.zen.ping.multicast.enabled: false

Slide 35

Slide 35 text

Запускаем Elasticsearch ./bin/elasticsearch –f или в фоне ./bin/elasticsearch

Slide 36

Slide 36 text

Запускаем Kibana ruby kibana.rb

Slide 37

Slide 37 text

Визуализация

Slide 38

Slide 38 text

Что есть на рынке

Slide 39

Slide 39 text

Graphite output { graphite { host => "10.10.10.10" port => 2003 type => "system-netstats" metrics => [ hosts.%{@source_host}.netstats.interfaces.%{iface}.rxpck_s, "%{rxpck_s}”] } }

Slide 40

Slide 40 text

Что на выходе

Slide 41

Slide 41 text

Twitter @andrebrov E-mail [email protected] Skype rebrov.andrey Вопросы?