Devops Intro
Devops Intro
2
Evolution of Software Engineering
3
Agile software development
Individuals and Interactions over Processes and Tools
Principles
Practices Methodologies
6
Software Development vs. Tests
Collective Code
Refactoring
Ownership
7
Automated Tests
● Reproducibility
● Fast and continuous feedback
● Automated coverage analysis
● Reducing uncertainty
● Documentation
● Saves time and money
● Accuracy
8
Types of tests
9
The problems with tests
10
Common problems about tests
● Not everybody run tests before commit
● Complex projects tend to have complex tests (Noosfero > 1h)
● Code reviews (MR) depends on whether tests work
● Some tests pass under some environments, but not in others
https://xkcd.com/303/
11
Eureka! - Continuous
Integration
12
Continuous Integration
● CI: Executing tests before deploying, which may be challenging for developers
○ Depends on automation
● CI can test different scenarios
○ Browser compatibility
○ Compatibility with different compiler versions
○ External services integration
○ Stress CI
13
Continuous Integration
● Binaries and configuration must be
○ Reproducible
○ Automated
○ We don't want unique snowflakes!
● A new release may be generated each time all tests pass
● Deploy will only succeed if the software was tested and kept stable during
development
14
My software is ready,
just need to put it into
production!
15
But wait...
● How should you handle versioning?
● Should you use a continuous build and deploy model or perform periodic builds?
● How often should you release?
● Do we have access to the production server?
● How should we delivery bug-fixes?
https://www.youtube.com/watch?v=VG5ZOOb5T9o
16
The gap between
Development and
Operation
17
Traditional Thinking
● Devs’ job is to add new features and Ops’ job is to keep the site stable and fast
● After finishing the development, send the code to Ops
● “It’s not my machines, it’s your code!” VS. “It’s not my code, it’s your machines!”
● When developers "throw software over the wall" for admins to update servers,
there is a loss of reliability and agility
19
Dev Ops
● Developers and Sysadmins should work together in the entire software lifecycle
○ Developers should not build and throw results over the fence
○ Devs think like Ops and Ops think like Devs
● All in the name of Continuous Delivery of valuable software
https://continuousdelivery.com/
20
Continuous delivery
● To run a reliable service, you need a reliable release process (not a snowflake)
● Stability drives agility
● Frequent releases = Fewer changes between versions = Easier troubleshooting
● Releasing can be as painless as pressing a button
● Must be thought from the beginning of the development cycle
○ it's cheaper to put these practices early than later
21
Developer + Operations = DevOps
● The term DevOps emerged in industry around 2008
● DevOps principles:
○ IT involvement in each phase of the system's design and development
○ Heavy reliance on automation
○ Application of engineering practices and tools to operations tasks
● Development teams control and own their own release process
DevOps is a
Culture!
22
23
DevOps - Basic Concepts
24
Ok… But how?
● Version control
● Automated tests
● Automated builds
● Automated packaging
● Automated deploy
● Infrastructure as code
● "Push on green"
● Black-box monitoring
25
26
27
Reliability
● Different behavior may arise in different environments
● It is important to work with different environments
○ Development
○ Testing*
○ Staging
○ Production
28
Deploy vs. Release
● Release
○ New features available for the client
● Deploy
○ New code that incrementally builds those new features
● Point Release Software
○ Fedora, Debian, Gitlab, Android
● Rolling Release Software
○ Arch Linux, Facebook, Github
29
Related Tools
30
https://subversion.apache.org/
https://www.mercurial-scm.org/
31
rspec.info/
junit.org/
https://cucumber.io/
Automated tests
32
https://travis-ci.org/
https://jenkins.io/
33
https://puppet.com/
https://www.chef.io/
Continuous Delivery
34
https://www.ansible.com/
munin-monitoring.org/
https://www.nagios.org/
www.zabbix.com/
Monitoring
35
https://www.docker.com/ https://linuxcontainers.org/
https://www.vagrantup.com/
www.linux-kvm.org/ https://www.virtualbox.org/
Virtualization
36
Our Experiences
37
38
"Toda vez que alguém modifica algo diretamente em um servidor de
produção, um gatinho morre em algum lugar".
Antônio Terceiro
39
Learn more
● Site Reliability Engineering: How Google Runs Production Systems
○ Chris Jones
● Engineering Software as a Service: An Agile Approach Using Cloud Computing
○ Fox, Armando and Patterson, David
● Continuous Delivery: Reliable Software Releases through Build, Test, and
Deployment Automation
○ Jez Humble
● Also, see the mentioned tools documentation
40
We code!
41