12 factor app - overops blog · $ heroku run console running `console` attached to terminal... up,...

83
12 Factor App Best Practices for Scala Deployment

Upload: others

Post on 21-May-2020

13 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

12 Factor AppBest Practices for Scala Deployment

Page 2: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

2005 2015

WAR files JAR files

App Servers Microservices

Java Scala

Hot-Deploy Continuous Deploy

Page 3: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Joe Kutner@codefinger

JVM Platform Owner

@Heroku

Joe Kutner

Page 4: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

12 Factor Appa methodology

ScalabilityMaintainability

Portability

Page 5: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

• Immutable

• Ephemeral

• Declarative

• Automated

Page 6: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

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

Page 7: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

addSbtPlugin(

"com.typesafe.sbt" % "sbt-native-packager" % "0.7.6"

)

project/plugins.sbt

Page 8: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

$ sbt stage

Page 9: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

without further ado…

Page 10: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

The 12 Factors• Codebase

• Dependencies

• Config

• Backing services

• Build, release, run

• Processes

• Port binding

• Concurrency

• Disposability

• Dev/prod parity

• Logs

• Admin processes

Page 11: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Thank You!

Goodbye!

(just kidding)

Page 12: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

The 12 Factors• Codebase

• Dependencies

• Config

• Backing services

• Build, release, run

• Processes

• Port binding

• Concurrency

• Disposability

• Dev/prod parity

• Logs

• Admin processes

Page 13: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

The 12 Factors• Codebase

• Dependencies

• Config

• Backing services

• Build, release, run

• Processes

• Port binding

• Concurrency

• Disposability

• Dev/prod parity

• Logs

• Admin processes

Page 14: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Use Version Control

Page 15: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created
Page 16: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created
Page 17: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

BAD

Page 18: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

BAD

App #1 App #2

Page 19: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

my-project

! build.sbt

! app

! conf

! public

! my-library

! build.sbt

! src

! main

! scala

Page 20: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

my-project

! build.sbt

! app

! conf

! public

! my-library

! my-sub-project

! build.sbt

! src

! main

! scala

BAD

Page 21: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Submodules

Page 22: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

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

Page 23: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

The 12 Factors• Codebase

• Dependencies

• Config

• Backing services

• Build, release, run

• Processes

• Port binding

• Concurrency

• Disposability

• Dev/prod parity

• Logs

• Admin processes

Page 24: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Don’t check JAR files into Git

Page 25: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created
Page 26: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Never rely on implicit

existence of system-wide

packages

Explicitly declare

and isolate

dependencies

Page 27: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

global local

BAD GOOD

Dependencies

~/.m2

~/.ivy2

(ok in dev)

target/

Page 28: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Vendoring

GOOD

Page 29: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

$ 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

...

Page 30: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

The 12 Factors• Codebase

• Dependencies

• Config

• Backing services

• Build, release, run

• Processes

• Port binding

• Concurrency

• Disposability

• Dev/prod parity

• Logs

• Admin processes

Page 31: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Don’t check passwords into Git

Page 32: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Or was it “DUH”?

😳

Page 33: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Can you make your app open source

at any moment, without compromising

any credentials?

Litmus Test

Page 34: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

• 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

Anything that changes between deployment environments:

(does not include things like conf/routes)

Configuration is…

Page 35: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Configuration belongs

in the environment,

not in the application

Configuration should

be strictly separated

from code

Page 36: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

db.default.url=${DATABASE_URL}

conf/application.conf

Page 37: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

The 12 Factors• Codebase

• Dependencies

• Config

• Backing services

• Build, release, run

• Processes

• Port binding

• Concurrency

• Disposability

• Dev/prod parity

• Logs

• Admin processes

Page 38: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

db.default.url=${DATABASE_URL}

conf/application.conf

Page 39: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

The 12 Factors• Codebase

• Dependencies

• Config

• Backing services

• Build, release, run

• Processes

• Port binding

• Concurrency

• Disposability

• Dev/prod parity

• Logs

• Admin processes

Page 40: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

build, release, run

Page 41: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

$ sbt stage

...

$ sbt deployHeroku

...

# in the cloud!

$ target/universal/stage/bin/my-app

build

release

run

Page 42: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

$ sbt run

BAD

(in production)

Page 43: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

simple build tool

Page 44: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

The 12 Factors• Codebase

• Dependencies

• Config

• Backing services

• Build, release, run

• Processes

• Port binding

• Concurrency

• Disposability

• Dev/prod parity

• Logs

• Admin processes

Page 45: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

DEMO!

Page 46: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

$ sbt stage

...

$ sbt deployHeroku

...

# in the cloud!

$ target/universal/stage/bin/scaladays

build

release

run

Page 47: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

The 12 Factors• Codebase

• Dependencies

• Config

• Backing services

• Build, release, run

• Processes

• Port binding

• Concurrency

• Disposability

• Dev/prod parity

• Logs

• Admin processes

Page 48: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Processes should be stateless

Page 49: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

sticky sessions

😞

Page 50: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

The 12 Factors• Codebase

• Dependencies

• Config

• Backing services

• Build, release, run

• Processes

• Port binding

• Concurrency

• Disposability

• Dev/prod parity

• Logs

• Admin processes

Page 51: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

The twelve-factor app

is completely self-contained

The web app exports HTTP

as a service by binding to a port

Page 52: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

.war

Traditional Deployment

Page 53: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

.jar

Modern Deployment

Page 54: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

The 12 Factors• Codebase

• Dependencies

• Config

• Backing services

• Build, release, run

• Processes

• Port binding

• Concurrency

• Disposability

• Dev/prod parity

• Logs

• Admin processes

Page 55: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Actors

Futures

Agents

RELAX BRO, I GOT THIS…

Page 56: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Scale Up

Scale Out

Page 57: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

web.1

web.2

worker.1 clock.1

Workload Diversity

Num

ber

of P

rocesses

worker.2

worker.3

Page 58: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

The 12 Factors• Codebase

• Dependencies

• Config

• Backing services

• Build, release, run

• Processes

• Port binding

• Concurrency

• Disposability

• Dev/prod parity

• Logs

• Admin processes

Page 59: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Graceful shutdown

Quick startup

Resilience to failure

Page 60: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Servers are not pets

Servers are cattle

Page 61: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Application Servers are

not disposable

Page 62: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Microservices are

disposable

Page 63: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Easy to replace

Decoupled from

external infrastructure

Easy to modify

Page 64: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Microservices

Page 65: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

The 12 Factors• Codebase

• Dependencies

• Config

• Backing services

• Build, release, run

• Processes

• Port binding

• Concurrency

• Disposability

• Dev/prod parity

• Logs

• Admin processes

Page 66: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

dev

sqlite

postgres

stage

mysql

postgres

prod

postgres

postgres

=

=

=

=

Page 67: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

dev

jetty

jetty

stage

tomcat

jetty

prod

jboss

jetty

=

=

=

=

Page 68: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

dev

jetty

{}

stage

tomcat

{}

prod

jboss

{}

=

=

=

=

Page 69: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Dropwizard

Page 70: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

disposable

⇒reproducible

parity⇒

Page 71: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

The 12 Factors• Codebase

• Dependencies

• Config

• Backing services

• Build, release, run

• Processes

• Port binding

• Concurrency

• Disposability

• Dev/prod parity

• Logs

• Admin processes

Page 72: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

The 12 Factors• Codebase

• Dependencies

• Config

• Backing services

• Build, release, run

• Processes

• Port binding

• Concurrency

• Disposability

• Dev/prod parity

• Logs

• Admin processes

Page 73: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Admin tasks should be

run in isolated processes

Page 74: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

$ 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>

Page 75: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

web1

web2

web3

admin

Page 76: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

$ heroku run sbt console

?

Page 77: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

simple build tool

Page 78: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

addSbtPlugin(

"com.typesafe.sbt" % "sbt-native-packager" % "0.7.6"

)

project/plugins.sbt

Page 79: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

console: target/universal/stage/bin/my-app \

-main scala.tools.nsc.MainGenericRunner \

-usejavacp

Procfile

worker: target/universal/stage/bin/my-app \

-main com.example.MyWorker

Page 80: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

The 12 Factors• Codebase

• Dependencies

• Config

• Backing services

• Build, release, run

• Processes

• Port binding

• Concurrency

• Disposability

• Dev/prod parity

• Logs

• Admin processes

Page 81: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

http://12factor.net

http://jkutner.github.io

Page 82: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Add sbt-native-packager1.

Run `sbt stage`2.

Deploy to Heroku?3.

Go to the sbt-native-packager talk4.

What next?

Page 83: 12 Factor App - OverOps Blog · $ heroku run console Running `console` attached to terminal... up, run.2581 Picked up JAVA_TOOL_OPTIONS: -Djava.rmi.server.useCode... Failed to created

Joe Kutner@codefinger

JVM Platform Owner

@Heroku

http://www.slideshare.net/jkutner/12-factor-scala