automated deployment

22
AUTOMATED DEPLOYMENT with open-source tools 2017.03.12 Sardor Muminov

Upload: sardorbek-muminov

Post on 21-Mar-2017

39 views

Category:

Software


0 download

TRANSCRIPT

Page 1: Automated deployment

AUTOMATED DEPLOYMENT

with open-source tools

2017.03.12Sardor Muminov

Page 2: Automated deployment

Who I am

● Backend software engineer

● IT systems engineer

● Open source enthusiast

● Python, Javascript and Rust (learning)

muminoff

muminoff

Page 3: Automated deployment

Software deployment is all of the activities that make a software system available for use.

― Wikipedia

Page 4: Automated deployment

Manual deployments

● not consistent across environments

● slow, neither repeatable nor reliable

● require extensive documentation (often outdated)

● hinder collaboration (usually conducted by a few experts)

Page 5: Automated deployment

Why automated deployment?

● less error-prone and much more repeatable

● anyone in the team can deploy software

● engineers spend their time developing software

● deploying to somewhere new is not a headache

● you can release more frequently

Page 6: Automated deployment

Traditional workflow (FTP, SFTP, SCP)

FTP, SSH HTTPCodebase

Local

WindowsmacOSLinux

Server

Directory

Web-server

WindowsmacOSLinux

Request

Browser

Mobile

API client

Page 7: Automated deployment

Traditional workflow (Git, SVN, Mercurial)

git push Codebase

Local Server

Directory

Web-server

Request

Browser

Mobile

API client

HTTP

VCS

Repository

versions

git pull

WindowsmacOSLinux

GithubGitlab

Self hosted

WindowsmacOSLinux

Page 8: Automated deployment

Automated workflow

VCS

commitcheckout

Build Automation

poll for changes

www

Productionenvironment

Unit tests

test

Sandboxenvironment

deploy

deployDeveloper

Page 9: Automated deployment

Open source automation tools

● Chef

● Puppet

● Salt

● Ansible

● Fabric

Page 10: Automated deployment

Chef

● Written in Ruby (client) / Erlang (server)

● Not-easy to learn and deploy

● Highly mature and works at massive scale

● Used by big companies

○ (e.g. Facebook, Microsoft, Bloomberg)

Page 11: Automated deployment

Puppet

● Written in Ruby

● Requires master (track infrastructure)

● Depends on agent

● Used by big companies

○ (e.g. RedHat, Microsoft)

Page 12: Automated deployment

Salt

● Written in Python

● Requires agent (minions)

● Depends on PyDSL and Python

● Used by big companies

○ (e.g. Pivotal, CloudFlare)

Page 13: Automated deployment

Ansible

● Written in Python

● Agent-less

● Supports any programming language

● Excellent security using SSH / SSH2

● Being used by companies:

○ NASA, Twitter, Attlasian

○ Evernote, RedHat, Cisco

○ EASports, GoPro, etc.

Page 14: Automated deployment

Fabric

● Written in Python

● Easy to learn, extend

● Programmatically integration

● Can be integrated with 3rd party tools

Page 15: Automated deployment

Summary

Benefits Manual deployment Automated deployment

Less time consumption ⚝ ◾

Less error prone ⚝ ◾

Repeatable ⚝ ◾

Collaboration ⚝ ◾

Page 16: Automated deployment

Continuous Delivery Vs. Continuous Deployment

Page 17: Automated deployment

Continuous Delivery Vs. Continuous Deployment

Page 18: Automated deployment

Example workflow (Ansible)10.1.2.40

Ubuntu/xenial

10.1.2.41

CentOS/7

10.1.2.43

Debian/jessie

localhost

Docker

192.168.2.3

VMWare

Developer

Host inventory10.1.2.4010.1.2.4110.1.2.43

playbook

Page 19: Automated deployment

Example workflow (Ansible)

Developer10.1.2.60

Server

deploy

$ git pull origin master

$ npm install

$ bower install

$ gulp run build

$ supervisorctl restart all

$ service nginx reload

Page 20: Automated deployment

Demo

Page 22: Automated deployment

Thank you