Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Continuous Delivery - Voxxed Days Cluj-Napoca 2017

177 views

Published on

Presentation at the Voxxed Days Cluj-Napoca 2017 conference.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

Continuous Delivery - Voxxed Days Cluj-Napoca 2017

  1. 1. Rafal Leszko (@RafalLeszko, rafal.leszko@gmail.com) Continuous Delivery: Jenkins, Docker and Spring Boot
  2. 2. Senior Software Engineer
  3. 3. I used to work for
  4. 4. Author
  5. 5. Jez Humble
  6. 6. What is Continuous Delivery?
  7. 7. Continuous Delivery "The ability to get changes-features, configuration changes, bug fixes, experiments - into production or into the hands of users safely and quickly in a sustainable way"
  8. 8. Have you heard the story of Yahoo and Flickr?
  9. 9. ● 11.6 seconds Mean time between deployments (weekday) ● 1,079 Max # of deployments in a single hour ● 10,000 Mean # of hosts simultaneously receiving a deployment ● 30,000 Max # of hosts simultaneously receiving a deployment
  10. 10. So, how does the "traditional" software delivery look like?
  11. 11. "Traditional" Delivery Customer "Agile" team Centralized QA IT Operations Analysis + Design Development Testing + Showcase Integration + QA Release and operation Acceptance Tests
  12. 12. How can we automate the process?
  13. 13. Continuous Integration Customer "Agile" team Centralized QA IT Operations Analysis + Design Development Testing + Showcase Integration + QA Release and operation Acceptance Tests
  14. 14. What is CI?
  15. 15. Continuous Integration
  16. 16. https://github.com/Dynatrace/ufo
  17. 17. Continuous Integration Customer "Agile" team Centralized QA IT Operations Analysis + Design Development Testing + Showcase Integration + QA Release and operation Acceptance Tests
  18. 18. "last mile" Continuous Integration Customer "Agile" team Centralized QA IT Operations Analysis + Design Development Testing + Showcase Integration + QA Release and operation Acceptance Tests
  19. 19. Automated Tests "last mile" Continuous Integration Customer "Agile" team Centralized QA IT Operations Analysis + Design Development Testing + Showcase Integration + QA Release and operation Acceptance Tests
  20. 20. Automated Testing
  21. 21. "Acceptance testing is a test performed to determine if the business requirements or contracts are met. It involves black-box testing against the complete system from the user perspective and its positive result should imply the acceptance for the software delivery."
  22. 22. Should acceptance testing be automated?
  23. 23. If acceptance testing is automated, what is the role of a QA?
  24. 24. Automated Tests "last mile" Continuous Integration Customer "Agile" team Centralized QA IT Operations Analysis + Design Development Testing + Showcase Integration + QA Release and operation Acceptance Tests
  25. 25. Configuration Management + MonitoringAutomated Tests "last mile" Continuous Integration Customer "Agile" team Centralized QA IT Operations Analysis + Design Development Testing + Showcase Integration + QA Release and operation Acceptance Tests
  26. 26. Continuous Delivery Pipeline
  27. 27. Checkout Compile Unit Tests Deploy to Staging Acceptance Tests Release Smoke Test
  28. 28. What is Spring Boot?
  29. 29. "Spring Boot makes it easy to create stand-alone, production-grade Spring based Applications that you can 'just run'. We take an opinionated view of the Spring platform and third-party libraries so you can get started with minimum fuss. Most Spring Boot applications need very little Spring configuration."
  30. 30. Spring Boot features ● Create stand-alone Spring applications ● Embed Tomcat or Jetty directly (no need to deploy WAR files) ● Provides a 'starter' POM to simplify the Maven configuration ● Automatically configure Spring whenever possible (CoC) ● Provide production-ready features such as metrics, health checks and externalized configuration ● No code generation and no XML configuration
  31. 31. dev machine github server jenkins server push pull
  32. 32. Checkout Compile Unit Tests Deploy to Staging Acceptance Tests Release Smoke Test
  33. 33. issues? ● Each server has to be configured ● Different environment in staging and production ● Different Java version for different applications ● Applications using the same ports ● Versioning
  34. 34. What is Docker?
  35. 35. server application app.jar
  36. 36. server application app.jar java -jar app.jar
  37. 37. server application app2.jar java -jar app.jar application app.jar
  38. 38. treat your servers like cattle, not pets
  39. 39. Issues with virtualization ● Low performance: Virtual machine emulates the whole computer architecture, so there is a significant overhead ● High resource consumption: Emulation requires a lot of resources and has to be done separately for each application. ● Large image size: Each application is delivered with the full operating system
  40. 40. Dockerfile: FROM frolvlad/alpine­oraclejdk8:slim ADD build/libs/vox­0.0.1­SNAPSHOT.jar app.jar ENTRYPOINT ["java","­jar","app.jar"]
  41. 41. FROM frolvlad/alpine­oraclejdk8:slim ADD build/libs/vox­0.0.1­SNAPSHOT.jar app.jar ENTRYPOINT ["java","­jar","app.jar"] docker build ­t <image_tag> . Dockerfile:
  42. 42. $ docker run ­­name <container_name> <image_tag> 
  43. 43. $ docker run ­­name <container_name> <image_tag> 
  44. 44. Docker registry ● registry for docker images
  45. 45. What is an artifact repository?
  46. 46. How to push Docker image to the registry?
  47. 47. image_tag = <registry_address>/<image_name>:<version>
  48. 48. image_tag = <registry_address>/<image_name>:<version> docker push <image_tag>
  49. 49. image_tag = <registry_address>/<image_name>:<version> docker push <image_tag> docker pull <image_tag>
  50. 50. Port Mapping $ docker run ­p 8080:8080 ­­name <container_name>  <image_tag> 
  51. 51. External Docker Host $ docker run ­p 8080:8080 ­­name <container_name>  <image_tag>  $ docker run ­H 192.168.0.15:2375 ­p 8080:8080  ­­name <container_name> <image_tag>
  52. 52. Example $ docker run ­H 192.168.0.15:2375 ­p 8080:8080 ­d  ­­name exchange­rate 192.168.0.20/exchange­rate:15
  53. 53. dev machine github server jenkins server push pull staging machine production machine deploy acceptance test deploy smoke test docker registry push pull pull
  54. 54. Manual Testing
  55. 55. Legacy Projects
  56. 56. Performance Tests
  57. 57. Is Continuous Delivery just a tool?
  58. 58. "continuous"
  59. 59. Trunk-based development
  60. 60. Features branches
  61. 61. Feature Toggle
  62. 62. Easy?
  63. 63. Questions?

×