athos coimbra ribeiro - 9532618 arthur de moura del ...athoscr/files/devops_intro.pdfdev ops 20...

41
DevOps Continuous Integration and Delivery Arthur de Moura Del Esposte - 9534332 Athos Coimbra Ribeiro - 9532618 1 Presentation reviewed by Rogério Cardoso

Upload: others

Post on 21-Mar-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

DevOpsContinuous Integration and Delivery

Arthur de Moura Del Esposte - 9534332

Athos Coimbra Ribeiro - 9532618

1

Presentation reviewed by Rogério Cardoso

Page 2: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Evolution of Software Engineering

2

Page 3: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Evolution of Software Engineering

● Software has evolved in Complexity, Price, Support, Impact…

● Software engineering has evolved as well:

○ Methodologies

○ Practices

○ Tools

● Software Engineering aims to deliver valuable high-quality software.

3

Page 4: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Agile software developmentIndividuals and Interactions over Processes and Tools

Working software over Comprehensive documentation

Customer collaboration over Contract negotiation

Responding to change over Following a plan

4

● SaaS Book - Chapters 1, 7, 8, 9, 10, 12

● http://www.agilemanifesto.org/

● http://noop.nl/2008/06/top-20-best-agile-development-books-ever.html

Page 5: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Agile software development

5

● SaaS Book - Chapters 1, 7, 8, 9, 10, 12

● http://www.agilemanifesto.org/

● http://noop.nl/2008/06/top-20-best-agile-development-books-ever.html

Principles

Practices Methodologies

Page 6: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Eureka! - Automated Tests

6

Page 7: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Software Development vs. Tests

7

Iterative Development

Continuous Delivery

Refactoring

Test!

Simplicity

Feedback

Collective Code Ownership

Page 8: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Automated Tests● Reproducibility

● Fast and continuous feedback

● Automated coverage analysis

● Reducing uncertainty

● Documentation

● Saves time and money

● Accuracy

Whenever a test fails it proves that something is not working as expected!

8

Page 9: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Types of tests

Production Tests like black-box

monitoring may also ensure that small

core functionalities are available.

9

Page 10: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

The problems with tests

10

Page 11: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Common problems about tests

11

● 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

Running tests

https://xkcd.com/303/

“My tests are running”

Page 12: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Eureka! - Continuous Integration

12

Page 13: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

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

● Test may run after each single change

SaaS Book, 12.3

13

CI

Page 14: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

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

Page 15: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

My software is ready, just need to put it into production!

15

Page 16: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

But wait...

16

● 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

Page 17: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

The gap between Development and Operation

17

Page 18: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Traditional Thinking

18

● 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

10+ Deploys Per Day: Dev and Ops Cooperation at Flickr

Page 19: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Eureka! - DevOps

19

Page 20: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Dev Ops

20

● 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/

Page 21: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

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

Page 22: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

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

22

DevOps is a Culture!

Page 23: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

23

Page 24: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

DevOps - Basic Concepts

24

Page 25: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Ok… But how?● Version control

● Automated tests

● Automated builds

● Automated packaging

● Automated deploy

● Infrastructure as code

● "Push on green"

● Black-box monitoring

25

Page 26: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

26

Page 27: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

27

Page 28: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Reliability● Different behavior may arise in different environments

● It is important to work with different environments

○ Development

○ Testing*

○ Staging

○ Production

* Book does not mention a testing environment

28

Page 29: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

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

Page 30: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Related Tools

30

Page 31: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Version Control System31

https://subversion.apache.org/https://www.mercurial-scm.org/

https://git-scm.com/

Page 32: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Automated tests32

junit.org/

rspec.info/

https://cucumber.io/

Page 33: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Continuous Integration33

https://travis-ci.org/

https://about.gitlab.com/gitlab-ci/

https://jenkins.io/

Page 34: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Continuous Delivery34

https://www.chef.io/

https://puppet.com/

https://www.ansible.com/

Page 35: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Monitoring35

munin-monitoring.org/

www.zabbix.com/

https://www.nagios.org/

Page 36: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Virtualization36

https://www.vagrantup.com/

www.linux-kvm.org/

https://www.docker.com/ https://linuxcontainers.org/

https://www.virtualbox.org/

Page 37: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

Our Experiences

37

Page 38: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

38

Page 39: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

39

"Toda vez que alguém modifica algo diretamente em um servidor de produção, um gatinho morre em algum lugar".

Antônio Terceiro

Page 40: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

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

Page 41: Athos Coimbra Ribeiro - 9532618 Arthur de Moura Del ...athoscr/files/devops_intro.pdfDev Ops 20 Developers and Sysadmins should work together in the entire software lifecycle Developers

We code!

41