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

D1-2 Thomas Philipona - What Devs Should Consid...

D1-2 Thomas Philipona - What Devs Should Consider, When Coding Applications

The third generation of OpenShift is built around applications running in Docker containers and makes use of Kubernetes when it comes to orchestration and management. Accurately exposing the underlying Docker concepts and, hence, facilitating the composition of applications, OpenShift v3 opens up new prospects for both operations and development.

First of all, we want to discuss challenges of Docker in a production environment and brush-up how deployment and network configuration works.

Secondly, we show how OpenShift v3 integrates with Docker and how it eases much of the burden developers used to struggle with in former PaaS environments. These alleviations allow developers to turn toward higher-level tasks like deployment automation or container building.

Next, we examine different approaches to implement Continuous Delivery and showcase our CI/CD environment at Puzzle ITC with a particular focus on Jenkins, database migrations, and integration testing.

Finally, we explain what it actually means to develop cloud-ready applications. There are some rules and best practices to be followed in order for applications to leverage the PaaS layer. One of the perspectives of the presentation is to cause awareness for this ruleset and to demonstrate how to avoid the most common design pitfalls which will imply collisions with PaaS concepts. We are going to talk about persistent storage, environment configuration, logging, monitoring, and some other aspects of a Twelve-Factor app.

DevOpsDays Zurich

May 08, 2017
Tweet

More Decks by DevOpsDays Zurich

Other Decks in Technology

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/