DESIGNING APPLICATIONS FOR CONTAINERIZATION AND THE CLOUD THE 12 FACTOR APPLICATION MANIFESTO

Similar documents
Cloud-Native Applications. Copyright 2017 Pivotal Software, Inc. All rights Reserved. Version 1.0

Building Microservices with the 12 Factor App Pattern

Copyright 2016 Pivotal. All rights reserved. Cloud Native Design. Includes 12 Factor Apps

Heroku. Rimantas Kybartas

PARTLY CLOUDY DESIGN & DEVELOPMENT OF A HYBRID CLOUD SYSTEM

gcp / gke / k8s microservices

The 12-Factor app and IBM Bluemix IBM Corporation

12 Factors to Cloud Success. Rafael Benevides

Implementing the Twelve-Factor App Methodology for Developing Cloud- Native Applications

12 (15) Factor App Workshop

Use Case: Scalable applications

Cloud Native Applications. 主讲人 :Capital One 首席工程师 Kevin Hoffman

what's in it for me? Ian Truslove :: Boulder Linux User Group ::

Building a Microservices Platform, Patterns and Best Practices

70-532: Developing Microsoft Azure Solutions

Beyond 1001 Dedicated Data Service Instances

AALOK INSTITUTE. DevOps Training

platform Development Process Optimization For Drupal centric projects

SCALING DRUPAL TO THE CLOUD WITH DOCKER AND AWS

Overhauling Dev Arch with Ansible Tower and Docker

70-532: Developing Microsoft Azure Solutions

Lessons Learned: Deploying Microservices Software Product in Customer Environments Mark Galpin, Solution Architect, JFrog, Inc.

Cloud Computing design patterns blueprints

DevOps Anti-Patterns. Have the Ops team deal with it. Time to fire the Ops team! Let s hire a DevOps unit! COPYRIGHT 2019 MANICODE SECURITY

OpenShift 3 Technical Architecture. Clayton Coleman, Dan McPherson Lead Engineers

" Qué me estás container?" Docker for dummies

Cloud Native Architecture 300. Copyright 2014 Pivotal. All rights reserved.

Reactive Microservices Architecture on AWS

AWS FREQUENTLY ASKED QUESTIONS (FAQ)

Microservices at Netflix Scale. First Principles, Tradeoffs, Lessons Learned Ruslan

Developing Microsoft Azure Solutions (70-532) Syllabus

What I ll be talking about. About me & bol.com The CI/CD bol.com Current setup. The future in the cloud

Exam C IBM Cloud Platform Application Development v2 Sample Test

Testing in the Cloud. Not just for the Birds, but Monkeys Too!

Getting Started With Amazon EC2 Container Service

Developing Microsoft Azure Solutions (70-532) Syllabus

Zadara Enterprise Storage in

Kubernetes The Path to Cloud Native

System Administration of PTC Windchill 11.0

Container-Native Storage

Agenda. AWS Database Services Traditional vs AWS Data services model Amazon RDS Redshift DynamoDB ElastiCache

Continuous Integration and Delivery with Spinnaker

Logging, Monitoring, and Alerting

Cloud providers, tools and best practices in running Magento on Kubernetes. Adrian Balcan MindMagnet Software

How can you implement this through a script that a scheduling daemon runs daily on the application servers?

Handel-CodePipeline Documentation

Continuous Integration and Deployment (CI/CD)

AWS 101. Patrick Pierson, IonChannel

DEVOPS COURSE CONTENT

Developing Microsoft Azure Solutions (70-532) Syllabus

Knative: Building serverless platforms on top of Kubernetes

Exam : Implementing Microsoft Azure Infrastructure Solutions

Let s say that hosting a cloudbased application is like car ownership

We are ready to serve Latest IT Trends, Are you ready to learn? New Batches Info

Performance Testing in a Containerized World. Paola Rossaro

DevOps Course Content

Elizabeth Lawler CEO & Co-Founder Conjur,

CIT 668: System Architecture. Amazon Web Services

The Long Road from Capistrano to Kubernetes

AEM Code Promotion and Content Synchronization Best Practices

Who is Docker and how he can help us? Heino Talvik

Secure VFX in the Cloud. Microsoft Azure

Application Management Webinar. Daniela Field

Microsoft Architecting Microsoft Azure Solutions.

Installing and Administering a Satellite Environment

EPHEMERAL DEVOPS: ADVENTURES IN MANAGING SHORT-LIVED SYSTEMS

TM DevOps Use Case. 2017TechMinfy All Rights Reserved

Ruby in the Sky with Diamonds. August, 2014 Sao Paulo, Brazil

GoDocker. A batch scheduling system with Docker containers

Hosted Azure for your business. Build virtual servers, deploy with flexibility, and reduce your hardware costs with a managed cloud solution.

Managing Openstack in a cloud-native way

Scaling DreamFactory

Advanced Continuous Delivery Strategies for Containerized Applications Using DC/OS

Think Small to Scale Big

AirBespoke Inventory Tracking System

Architecting for the.

QuartzDesk Web Application Installation and Upgrade Guide for Apache Tomcat 6.x, 7.x, 8.x and 9.x

1. How do you deploy an application to Cloud Foundry with multiple instances, on a non-default domain?

Getting Started With Containers

In-cluster Open Source Testing Framework

How Netflix Leverages Multiple Regions to Increase Availability: Isthmus and Active-Active Case Study

Amir Zipory Senior Solutions Architect, Redhat Israel, Greece & Cyprus

Microservices with Red Hat. JBoss Fuse

Developing and Testing Java Microservices on Docker. Todd Fasullo Dir. Engineering

Contents in Detail. Foreword by Xavier Noria

App Service Overview. Rand Pagels Azure Technical Specialist - Application Development US Great Lakes Region

Oracle Application Container Cloud

Demystifying the Cloud With a Look at Hybrid Hosting and OpenStack

Running Containerized Microservices on AWS. November 2017

CloudCenter for Developers

StreamSets Control Hub Installation Guide

Exam Objectives for MCSA Installation, Storage, and Compute with Windows Server 2016

Oracle Application Express: Administration 1-2

Multi-Cloud and Application Centric Modeling, Deployment and Management with Cisco CloudCenter (CliQr)

Cloud Computing /AWS Course Content

Prometheus. A Next Generation Monitoring System. Brian Brazil Founder

Amazon Web Services (AWS) Solutions Architect Intermediate Level Course Content

Scaling for the Enterprise

Release It! Second Edition

CNA Cloud-native applications

Transcription:

DESIGNING APPLICATIONS FOR CONTAINERIZATION AND THE CLOUD THE 12 FACTOR APPLICATION MANIFESTO

THIS IS THE DEV PART DESIGNING OUR APPLICATIONS TO BE PREDICTABLE, FLEXIBLE, RELIABLE, SCALABLE AND COMPLETELY BORING ON A DAY TO DAY BASIS FROM AN OPERATIONAL POINT OF VIEW

THE PUBLIC CLOUD BEFORE DOCKER 2012, Heroku Platform as a Service Small Inexpensive VMs Temporary lifespan Built in load balancing, log aggregation, deployment tooling via git Still had a free tier 12 Factor Manifesto The contributors to this document have been directly involved in the development and deployment of hundreds of apps, and indirectly witnessed the development, operation, and scaling of hundreds of thousands of apps via our work on the Heroku platform.

THE TWELVE-FACTOR APPLICATION MANIFESTO 12FACTOR.NET I. Codebase One codebase tracked in revision control, many deploys II. Dependencies III. Config Explicitly declare and isolate dependencies Store config in the environment IV. Backing services Treat backing services as attached resources V. Build, release, run Strictly separate build and run stages VI. Processes Execute the app as one or more stateless processes VII. Port binding Export services via port binding VIII. Concurrency Scale out via the process model IX. Disposability Maximize robustness with fast startup and graceful shutdown X. Dev/prod parity XI. Logs Keep development, staging, and production as similar as possible Treat logs as event streams XII. Admin processes Run admin/management tasks as one-off processes

END GOAL UI/API Port Immutable, self-contained deployment artifact. Can run in different operational environments without changes. Well instrumented, logically transparent Logic UI/API Metrics Secure Predictable Output Log Easy to scale to different workflow needs Easy to develop over time, especially for a team Config DB

I. CODEBASE ONE CODEBASE TRACKED IN REVISION CONTROL, MANY DEPLOYS Revision control is not a backup Repeatability and the ability to roll back What Changed? Do Computer Science. Track your experiments. Multiple programmers? Without it, Docker just makes things worse Version your Docker images, too

SOME QUICK THOUGHTS ABOUT CODE Learn how to branch, review, merge These are basic trades-skills Code is conversation With your colleagues With the future Organization Matters Just use Git. Everyone uses Git Automated deployment demands automated testing

II. DEPENDENCIES EXPLICITLY DECLARE AND ISOLATE DEPENDENCIES Your App s Server Deployment artifacts are like space capsules Bring it all with you, isolate the environment False economy of shared libraries Disk space is cheaper than time Fat deployment artifacts Build the environment on demand with Puppet Bring the server with you via Docker Your App Your App s Libraries

II. DEPENDENCIES EXPLICITLY DECLARE AND ISOLATE DEPENDENCIES Deployment artifacts are like space capsules Bring it all with you, isolate the environment Doesn t have to be a single file. Just a single directory. False economy of shared libraries Disk space is cheaper than time Fat deployment artifacts Build the environment on demand with Puppet Bring the server with you via Docker Your App s Server Your App and its Libraries

II. DEPENDENCIES EXPLICITLY DECLARE AND ISOLATE DEPENDENCIES Deployment artifacts are like space capsules Bring it all with you, isolate the environment False economy of shared libraries Disk space is cheaper than time Fat deployment artifacts Build the environment on demand with Puppet Bring the server with you via Docker Your App, its Libraries, and its Server

III. CONFIG STORE CONFIGURATION IN THE ENVIRONMENT "Environment == where the application runs Configuration == Tier specific App Same App Still the Same App Use the same delivery artifact on every tier Test QA Production testdb.wisc.edu logintest.wisc.edu Debug:true qadb.wisc.edu loginqa.wisc.edu Debug:true proddb.wisc.edu login.wisc.edu Debug:false

III. CONFIG STORE CONFIGURATION IN THE ENVIRONMENT Externalization strategies Files on each server App Same App Still the Same App Container provided Configuration server Environment variables Test QA Production testdb.wisc.edu logintest.wisc.edu Debug:true qadb.wisc.edu loginqa.wisc.edu Debug:true proddb.wisc.edu login.wisc.edu Debug:false

III. CONFIG STORE CONFIGURATION IN THE ENVIRONMENT Externalization strategies Files on each server Container provided Configuration server Environment variables /etc/myapp/config.yml server: port: 8082 datasource: url: jdbc:myprod.doit.wisc.edu:1880/mydb User: dbuser password: dbpassword

III. CONFIG STORE CONFIGURATION IN THE ENVIRONMENT Externalization strategies Files on each server Container provided Configuration server Environment variables conf/context.xml <Environment name="spring.profiles.active" value="testqa,localusers" type="java.lang.string" override="false" /> <GlobalNamingResources> <Resource name="jdbc/mydatabaseds" auth="container" type="javax.sql.datasource" maxtotal="100" maxidle="30" maxwaitmillis="10000" username="my_db_user" password="my_db_user_passwd" driverclassname="com.mysql.jdbc.driver" url="jdbc:mysql://database.doit.wisc.edu:3306/mydb"/> </GlobalNamingResources>

III. CONFIG STORE CONFIGURATION IN THE ENVIRONMENT Externalization strategies Files on each server Container provided Configuration server Environment variables

III. CONFIG STORE CONFIGURATION IN THE ENVIRONMENT Externalization strategies Files on each server Container provided Configuration server Environment variables ${DB_HOSTNAME} ${DB_USER} ${DB_PASS}

IV. BACKING SERVICES TREAT BACKING SERVICES AS ATTACHED RESOURCES Deployment artifacts should be immutable Provide a way to declaratively configure which resources are used Databases Development H2 Production Oracle (DRMT) Production 2 years from now Aurora (AWS) Filesystem and cloud storage paths Administrative email addresses Hostnames Local AMQP server AMQP Cluster CloudAMQP Consider what it does, not what it is Local Redis Redis Cluster Elasticache (AWS)

V. BUILD, RELEASE, RUN STRICTLY SEPARATE BUILD AND RUN STAGES Never, ever, ever edit your production artifacts! But when you do, make sure you can propagate that change back to your souce code repository. Ability to roll software back to a previous state Build Release Run + Config Deployment artifacts should be immutable Tagged release executables or archives Uniquely tagged and versioned Docker containers Configuration needs to be versioned, too

VI. PROCESSES EXECUTE THE APP AS ONE OR MORE STATELESS PROCESSES 1_45.compute.amazonaws.com 1_24.compute.amazonaws.com 1_46.compute.amazonaws.com 1_25.compute.amazonaws.com Store all non-transient state outside the application The Shopping Cart Use a dedicated cache if necessary Redis Memcached 1_11.compute.amazonaws.com Cattle 1_12.compute.amazonaws.com A database User Sessions fido.doit.wisc.edu polly.doit.wisc.edu fluffy.doit.wisc.edu ben.doit.wisc.edu Not Pets spot.doit.wisc.edu

VII. PORT BINDING EXPORT SERVICES VIA PORT BINDING Application servers are a dependency BYOAS RAM is cheaper than time Isolation vs Sharing Practice Good Operational Hygiene Multiple instances Your App Operations shouldn t need to know what s in here Port 8200 Your Docker Container

VIII. CONCURRENCY SCALE OUT VIA THE PROCESS MODEL You ll only need this if your project is a success Process More is better than bigger Search Process Scale out, not up Up is limited, out is limitless The rest of the factors prepare for this Search Gateway Batch Jobs Scaling becomes a financial decision, not a technical one Render Store Render

IX. DISPOSABILITY MAXIMIZE ROBUSTNESS WITH FAST STARTUP AND GRACEFUL SHUTDOWN Cattle, not Pets Cycle time affects turnaround time Less costly the deployment, the more often you can deploy Adaptive scaling Chaos Monkey and the Simian Army

X. DEV/PROD PARITY KEEP DEVELOPMENT, STAGING, AND PRODUCTION AS SIMILAR AS POSSIBLE Time Gap How long between deployments? Personnel Gap How much do you need to know about the app to deploy it? Who or What deploys it? Tools Gap It worked on my machine. Docker makes this easier docker run -d -p 49160:22 -p 49161:1521 wnameless/oracle-xe-11 docker run --name some-mysql -e MYSQL_ROOT_PASSWORD=my-secret-pw -d mysql:8 QA must be identical to production

XI. LOGS TREAT LOGS AS EVENT STREAMS Are your application logs full of information or noise? Structured logging <timestamp> <host> <netid> <operation> Mapped Diagnostic Context Log Aggregation Disks in the cloud, or inside a container, are usually ephemeral and often read-only

XII. ADMIN PROCESSES RUN ADMIN/MANAGEMENT TASKS AS ONE-OFF PROCESSES Heroku-ism, Ruby-centric Highly restricted access to production services May not be able to access the database or other resources locally Reconsider whether admin processes are actually needed Consider adding protected endpoints to handle these tasks Create a separate application for these tasks

XII.01 METRICS SEND TELEMETRY AS EVENT STREAMS Generic metrics are easy, but not as useful Create metrics for your own business processes What tells you that the application is working? Graphite, Grafana, StatsD, Metrics.NET Once you start collecting metrics, you ll want to collect more metrics. This is a sign you re doing it right.

XII.02 AUTHENTICATION AND AUTHORIZATION DON T LEAVE THIS UNTIL LAST Plan for security concerns up front Role Based Authorization Control Use Shibboleth for Authentication Use Manifest for Authorization

TAKE THESE IDEAS WITH YOU USE REVISION CONTROL!!!1111!!! Deploy self-sufficient artifacts Abstract external dependencies Store all configuration in the environment Use the same artifact on every tier Keep copies of your releases. Have releases. Assume your app could be killed at any time

QUESTIONS? Devops@DOIT Office 365 Team Application Design Review Brownbags Every other Friday at Noon, DoIT 3139AB applicationdesignreview@office365.wisc.edu Brian Hill <brian.hill@wisc.edu>