automated deployment
TRANSCRIPT
AUTOMATED DEPLOYMENT
with open-source tools
2017.03.12Sardor Muminov
Who I am
● Backend software engineer
● IT systems engineer
● Open source enthusiast
● Python, Javascript and Rust (learning)
muminoff
muminoff
Software deployment is all of the activities that make a software system available for use.
― Wikipedia
Manual deployments
● not consistent across environments
● slow, neither repeatable nor reliable
● require extensive documentation (often outdated)
● hinder collaboration (usually conducted by a few experts)
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
Traditional workflow (FTP, SFTP, SCP)
FTP, SSH HTTPCodebase
Local
WindowsmacOSLinux
Server
Directory
Web-server
WindowsmacOSLinux
Request
Browser
Mobile
API client
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
Automated workflow
VCS
commitcheckout
Build Automation
poll for changes
www
Productionenvironment
Unit tests
test
Sandboxenvironment
deploy
deployDeveloper
Open source automation tools
● Chef
● Puppet
● Salt
● Ansible
● Fabric
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)
Puppet
● Written in Ruby
● Requires master (track infrastructure)
● Depends on agent
● Used by big companies
○ (e.g. RedHat, Microsoft)
Salt
● Written in Python
● Requires agent (minions)
● Depends on PyDSL and Python
● Used by big companies
○ (e.g. Pivotal, CloudFlare)
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.
Fabric
● Written in Python
● Easy to learn, extend
● Programmatically integration
● Can be integrated with 3rd party tools
Summary
Benefits Manual deployment Automated deployment
Less time consumption ⚝ ◾
Less error prone ⚝ ◾
Repeatable ⚝ ◾
Collaboration ⚝ ◾
Continuous Delivery Vs. Continuous Deployment
Continuous Delivery Vs. Continuous 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
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
…
Demo
References
1. https://en.wikipedia.org/wiki/Software_deployment
2. https://en.wikipedia.org/wiki/Software_release_life_cycle
3. https://en.wikipedia.org/wiki/Release_management
4. https://en.wikipedia.org/wiki/DevOps
5. https://en.wikipedia.org/wiki/Ansible_(software)
6. https://www.ansible.com
7. http://www.fabfile.org/
Thank you