12 Factor App. Best Practices for Scala Deployment



Similar documents
Developing Cloud Applications using IBM Bluemix. Brian DePradine (Development lead Liberty buildpack)

Amazon Elastic Beanstalk

Reaching for the cloud: the potential and the reality of using cloud-based platforms. Speaker: Michael Michaelides October 22, 2015

Practical Guide to Platform as a Service.

NGASI Universal APP Panel Administration and User Guide WebAppShowcase DBA NGASI

APP DEVELOPMENT ON THE CLOUD MADE EASY WITH PAAS

WEBAPP PATTERN FOR APACHE TOMCAT - USER GUIDE

OpenShift. Marek Jelen, OpenShift, Red Hat

SCOUT IN THE CLOUD. How to Scale Eclipse Scout Applications in the Cloud? Judith Gull & Thomas Schweigler

Operations and Monitoring with Spring

Platform as a Service and Container Clouds

ConcourseSuite 7.0. Installation, Setup, Maintenance, and Upgrade

Configuring EPM System for SAML2-based Federation Services SSO

GlassFish v3. Building an ex tensible modular Java EE application server. Jerome Dochez and Ludovic Champenois Sun Microsystems, Inc.

Working with WebSphere 4.0

OpenShift on OpenStack

OpenShift on you own cloud. Troy Dawson OpenShift Engineer, Red Hat November 1, 2013

Building a Scalable News Feed Web Service in Clojure

Docker Java Application with Solr, Mongo, & Cassandra: Design, Deployment, Service Discovery, and Management in Production

Programming on the Web(CSC309F) Tutorial: Servlets && Tomcat TA:Wael Aboelsaadat

The cloud server setup program installs the cloud server application, Apache Tomcat, Java Runtime Environment, and PostgreSQL.

Session Storage in Zend Server Cluster Manager

How to choose the right PaaS Platform?

Architecting ColdFusion For Scalability And High Availability. Ryan Stewart Platform Evangelist

JBS-102: Jboss Application Server Administration. Course Length: 4 days

AklaBox. The Ultimate Document Platform for your Cloud Infrastructure. Installation Guideline

Spark Job Server. Evan Chan and Kelvin Chu. Date

Sample copy. Introduction To WebLogic Server Property of Web 10.3 Age Solutions Inc.

Deploy Your First CF App on Azure with Template and Service Broker. Thomas Shao, Rita Zhang, Bin Xia Microsoft Azure Team

DEPLOYING EMC DOCUMENTUM BUSINESS ACTIVITY MONITOR SERVER ON IBM WEBSPHERE APPLICATION SERVER CLUSTER

Secure Messaging Server Console... 2

CA Unified Infrastructure Management

OpenESB standalone edition Version 3.0 OpenESB set up in a multiple environments context. Application configurations and variables

How To Monitor A Server With Zabbix

From the Intranet to Mobile. By Divya Mehra and Stian Thorgersen

RSA Security Analytics

JAVA IN THE CLOUD PAAS PLATFORM IN COMPARISON

Installation Runbook for Avni Software Defined Cloud

Install guide for Websphere 7.0

SOA Software API Gateway Appliance 7.1.x Administration Guide

User Guide for VMware Adapter for SAP LVM VERSION 1.2

Deploying Intellicus Portal on IBM WebSphere

JusticeConnect AVL for Windows SETUP GUIDE

Installation Guide for contineo

TIBCO Silver Fabric Continuity User s Guide

ActiveVOS Clustering with JBoss

Uptime Infrastructure Monitor. Installation Guide

GeoCloud Project Report GEOSS Clearinghouse

Debugging Mobile Apps

OpenShift Enterprise PaaS by Red Hat. Andrey Markelov RHCA Red Hat, Presales Solution Architect

Configuring Apache HTTP Server as a Reverse Proxy Server for SAS 9.2 Web Applications Deployed on BEA WebLogic Server 9.2

Jenkins World Tour 2015 Santa Clara, CA, September 2-3

Cloudwork Dashboard User Manual

Cloud Hosting. QCLUG presentation - Aaron Johnson. Amazon AWS Heroku OpenShift

IRF2000 IWL3000 SRC1000 Application Note - Develop your own Apps with OSGi - getting started

Considerations for Adopting PaaS (Platform as a Service)

HOW TO SETUP EVOKO ROOM MANAGER EVO WITH EXCHANGE

Jenkins TestLink Plug-in Tutorial

Running and Testing Java EE Applications in Embedded Mode with JupEEter Framework

WebLogic Server Administration

System Administration Training Guide. S100 Installation and Site Management

The deployment of OHMS TM. in private cloud

LAE 5.1. Windows Server Installation Guide. Version 1.0

OpenSSO: Simplify Your Single-Sign-On Needs. Sang Shin Java Technology Architect Sun Microsystems, inc. javapassion.com

Data Center Automation with YADT

Java Application Server Guide. For Version 10.3 or Later

Put a Firewall in Your JVM Securing Java Applications!

Step by Step Guide to implement SMS authentication to F5 Big-IP APM (Access Policy Manager)

Developing Service-Oriented Architecture Applications with OSGi

JAMF Software Server Installation Guide for Linux. Version 8.6

Web Server Configuration Guide

How To Sync Quickbooks With Qvinci.Com On A Pc Or Macbook Or Mac Book (For A Webbook) With A Flashbook (For An Ubuntu Account) With An Ipo (For Macbook) On A Mac

From the Monolith to Microservices: Evolving Your Architecture to Scale. Randy linkedin.com/in/randyshoup

TG Web. Technical FAQ

ZeroTurnaround License Server User Manual 1.4.0

QUICK START. GO-Global Cloud 4.1 SETTING UP A LINUX CLOUD SERVER AND HOST INSTALL THE CLOUD SERVER ON LINUX

OPC and DCOM: 5 things you need to know Author: Randy Kondor, B.Sc. in Computer Engineering

Geoportal Server Installation Guide for GlassFish Contents

HP Cloud Service Automation

Mark Bennett. Search and the Virtual Machine

Perforce : Commons Administrator s Guide. April 2014

Integration in Action using JBoss Middleware. Ashokraj Natarajan - Cognizant

ISLET: Jon Schipp, Ohio Linux Fest An Attempt to Improve Linux-based Software Training

Monitoring Experience Redefined

OpenStack Private Cloud

DEPLOYMENT ROADMAP March 2015

80% 50x. 30x. CASE STUDY: How WaveMaker Got Faster, Better, More Agile with Docker. Lower Costs. Better Performance. Greater App Density

STREAMEZZO RICH MEDIA SERVER

mod_cluster A new httpd-based load balancer Brian Stansberry JBoss, a division of Red Hat

McAfee Cloud Identity Manager

CloverETL Server Reference Manual

Data Transfer Management with esync 1.5

NSi Mobile Installation Guide. Version 6.2

Transcription:

12 Factor App Best Practices for Scala Deployment

2005 2015 WAR files JAR files App Servers Microservices Hot-Deploy Continuous Deploy Java Scala

Joe Kutner @codefinger JVM Platform Owner @Heroku

12 Factor App a methodology Scalability Maintainability Portability

Immutable Ephemeral Declarative Automated

https://github.com/sbt/sbt-native-packager

project/plugins.sbt addsbtplugin( "com.typesafe.sbt" % "sbt-native-packager" % "0.7.6" )

$ sbt stage

without further ado

The 12 Factors Codebase Dependencies Config Backing services Build, release, run Processes Port binding Concurrency Disposability Dev/prod parity Logs Admin processes

Thank You! Goodbye! (just kidding)

The 12 Factors Codebase Dependencies Config Backing services Build, release, run Processes Port binding Concurrency Disposability Dev/prod parity Logs Admin processes

The 12 Factors Codebase Dependencies Config Backing services Build, release, run Processes Port binding Concurrency Disposability Dev/prod parity Logs Admin processes

Use Version Control

BAD

App #1 App #2 BAD

my-project! build.sbt! app! conf! public! my-library! build.sbt! src! main! scala

my-project! build.sbt! app! conf! public! my-library! my-sub-project! build.sbt! src! main! scala BAD

Submodules

$ git submodule add https://github.com/jkutner/play-sub-project

The 12 Factors Codebase Dependencies Config Backing services Build, release, run Processes Port binding Concurrency Disposability Dev/prod parity Logs Admin processes

Don t check JAR files into Git

Explicitly declare and isolate dependencies Never rely on implicit existence of system-wide packages

Dependencies global BAD ~/.m2 local GOOD target/ ~/.ivy2 (ok in dev)

Vendoring GOOD

$ sbt stage... $ tree target/universal/stage/lib/ target/universal/stage/lib/ "## ch.qos.logback.logback-classic-1.1.1.jar "## ch.qos.logback.logback-core-1.1.1.jar "## com.fasterxml.jackson.core.jackson-annotations-2.3... "## com.fasterxml.jackson.core.jackson-core-2.3.2.jar "## com.fasterxml.jackson.core.jackson-databind-2.3.2.jar "## com.google.guava.guava-16.0.1.jar...

The 12 Factors Codebase Dependencies Config Backing services Build, release, run Processes Port binding Concurrency Disposability Dev/prod parity Logs Admin processes

Don t check passwords into Git

Or was it DUH?

Litmus Test Can you make your app open source at any moment, without compromising any credentials?

Configuration is Anything that changes between deployment environments: Resource handles to the database, Memcached, and other backing services Credentials to external services such as Amazon S3 or Twitter Per-deploy values such as the canonical hostname for the deploy (does not include things like conf/routes)

Configuration should be strictly separated from code Configuration belongs in the environment, not in the application

conf/application.conf db.default.url=${database_url}

The 12 Factors Codebase Dependencies Config Backing services Build, release, run Processes Port binding Concurrency Disposability Dev/prod parity Logs Admin processes

conf/application.conf db.default.url=${database_url}

The 12 Factors Codebase Dependencies Config Backing services Build, release, run Processes Port binding Concurrency Disposability Dev/prod parity Logs Admin processes

build, release, run

build $ sbt stage... release run $ sbt deployheroku... # in the cloud! $ target/universal/stage/bin/my-app

$ sbt run BAD (in production)

simple build tool

The 12 Factors Codebase Dependencies Config Backing services Build, release, run Processes Port binding Concurrency Disposability Dev/prod parity Logs Admin processes

DEMO!

build $ sbt stage... release run $ sbt deployheroku... # in the cloud! $ target/universal/stage/bin/scaladays

The 12 Factors Codebase Dependencies Config Backing services Build, release, run Processes Port binding Concurrency Disposability Dev/prod parity Logs Admin processes

Processes should be stateless

sticky sessions

The 12 Factors Codebase Dependencies Config Backing services Build, release, run Processes Port binding Concurrency Disposability Dev/prod parity Logs Admin processes

The twelve-factor app is completely self-contained The web app exports HTTP as a service by binding to a port

Traditional Deployment.war

Modern Deployment.jar

The 12 Factors Codebase Dependencies Config Backing services Build, release, run Processes Port binding Concurrency Disposability Dev/prod parity Logs Admin processes

Actors Futures Agents RELAX BRO, I GOT THIS

Scale Up Scale Out

worker.3 Number of Processes web.2 worker.2 web.1 worker.1 clock.1 Workload Diversity

The 12 Factors Codebase Dependencies Config Backing services Build, release, run Processes Port binding Concurrency Disposability Dev/prod parity Logs Admin processes

Quick startup Resilience to failure Graceful shutdown

Servers are not pets Servers are cattle

Application Servers are not disposable

Microservices are disposable

Easy to replace Easy to modify Decoupled from external infrastructure

Microservices

The 12 Factors Codebase Dependencies Config Backing services Build, release, run Processes Port binding Concurrency Disposability Dev/prod parity Logs Admin processes

dev = stage = prod sqlite mysql postgres postgres = postgres = postgres

dev = stage = prod jetty tomcat jboss jetty = jetty = jetty

dev = stage = prod jetty tomcat jboss {} = {} = {}

Dropwizard

parity reproducible disposable

The 12 Factors Codebase Dependencies Config Backing services Build, release, run Processes Port binding Concurrency Disposability Dev/prod parity Logs Admin processes

The 12 Factors Codebase Dependencies Config Backing services Build, release, run Processes Port binding Concurrency Disposability Dev/prod parity Logs Admin processes

Admin tasks should be run in isolated processes

$ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created JLineReader: java.lang.noclassdeffou... Falling back to SimpleReader. Welcome to Scala version 2.11.1 (OpenJDK 64-Bit Server... Type in expressions to have them evaluated. Type :help for more information. scala>

web1 web3 web2 admin

$ heroku run sbt console?

simple build tool

project/plugins.sbt addsbtplugin( "com.typesafe.sbt" % "sbt-native-packager" % "0.7.6" )

Procfile console: target/universal/stage/bin/my-app \ -main scala.tools.nsc.maingenericrunner \ -usejavacp worker: target/universal/stage/bin/my-app \ -main com.example.myworker

The 12 Factors Codebase Dependencies Config Backing services Build, release, run Processes Port binding Concurrency Disposability Dev/prod parity Logs Admin processes

http://12factor.net http://jkutner.github.io

What next? 1. 2. 3. 4. Add sbt-native-packager Run `sbt stage` Deploy to Heroku? Go to the sbt-native-packager talk

Joe Kutner @codefinger JVM Platform Owner @Heroku http://www.slideshare.net/jkutner/12-factor-scala