Upgrade to Pro — share decks privately, control downloads, hide ads and more …

DevOpsDays Zurich 2017: What Devs Should Consid...

DevOpsDays Zurich 2017: What Devs Should Consider, When Coding Applications

Avatar for Thomas Philipona

Thomas Philipona

May 03, 2017

Other Decks in Programming

Transcript

  1. Thomas Philipona • CTO @ Puzzle ITC • OpenSource •

    Responsible for our CI/CD Processes • APPUiO – Swiss Container Platform @tphilipona phil-pona
  2. Docker in Production Monitoring Log server Storage Jenkins Mail server

    DB Server Backup Network Lifecycle Container u. Infrastruktur
  3. How it all began Multiple Workloads | OpenShift 3 |

    Internal use | Platform to run our Apps
  4. Dynamic Container Platform Restarts of nodes due to maintenance Container

    gets moved due to ressource allocation → Start up time of the Application → Robustness Reconnect of Backends → at least two instances running
  5. Start Up Time of Applications 17:11:38,607 INFO [org.jboss.as] (MSC service

    thread 1-7) WFLYSRV0049: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) starting ... ... 17:13:10,297 INFO [org.jboss.as] (Controller Boot Thread) WFLYSRV0025: WildFly Full 10.0.0.Final (WildFly Core 2.0.10.Final) started in 93046ms - Started 1235 of 1510 services (409 services are lazy, passive or on-demand)
  6. Scalability Stateless architecture No session pinning (Sessions in the database

    or at the client) No local filesystem → Easier testable . . .
  7. Avoid Long Running Tasks Avoid them completely (if possible) Separate

    processes / applications running along the application Split them into parts, allow continuation t . . .
  8. Monitoring / Healthchecks Liveness check /health Process is running If

    not ok, process gets restarted Readiness check /health/ready Deployment ok Ready for requests Fully functional Health checks as simple JSON response on a REST endpoint
  9. Cascading Checks app DB backend GET /health GET /health select

    1 from ... HTTP/1.1 200 OK { "status": "UP", "db": { "status": "UP" }, "backend": { "status": "UP" } }
  10. Cascading Errors app DB backend GET /health GET /health select

    1 from ... HTTP/1.1 299 Warning { "status": "UP", "db": { "status": "DOWN" }, "backend": { "status": "UP" } }
  11. Automation and CI/CD Git code Compile, Unit-tests Integration Tests, Package

    Deploy to Dev Acceptance Tests Deploy to UAT env Manual Tests Deploy to Prod
  12. Groovy Jenkins Pipeline Scripts stage 'Build' sh "${mvnHome}/bin/mvn versions:set -DnewVersion=${buildVersion}"

    sh "${mvnHome}/bin/mvn clean install" // prepare Dockerfile and Context sh "tar cvfz docker-context.tar.gz Dockerfile target/javaee7-wildfly-example.war" archive 'docker-context.tar.gz'
  13. If It Hurts, Do It More Frequently, and Bring the

    Pain Forward Source: Jez Humble, David Farley, Continuous Delivery, Pearson Education, Inc. 2011
  14. Automated Database Migrations DB migrationscripts are part of the deployed

    application and run during startup or deployment. $ php bin/console doctrine:schema:update $ rake db:migrate
  15. The Twelve-Factor App Framework / Manifest on how to build

    Software-as-a-Service Apps • To max the portability and decrease vendor lockin • Deployment on cloud-platforms • Ensure continuous deployment • Scalability https:/ /12factor.net/