cf push: push your scala/play apps to cloud...
TRANSCRIPT
![Page 1: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/1.jpg)
1 © Copyright 2015 EMC Corporation. All rights reserved.
cf push: Push your Scala/Play apps to Cloud Foundry RAGHAVAN N. SRINIVAS @ragss
![Page 2: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/2.jpg)
2 © Copyright 2015 EMC Corporation. All rights reserved.
• Rags (not to Riches) and work for EMC CODE
• Middleware and Application programmer
• Architect and Evangelist
• Part time teaching at UML and writing at InfoQ
• Philosophy: It’s better to have an unanswered question than a unquestioned answer
Who am I?
![Page 3: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/3.jpg)
3 © Copyright 2015 EMC Corporation. All rights reserved.
• Overview and Architecture
• Applications and Services
• Evolving Data Schemas
• Demos
• Resources and Summary
Agenda
![Page 4: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/4.jpg)
4 © Copyright 2015 EMC Corporation. All rights reserved.
Business Expectations Exceed IT Capabilities
Cloud
IT Technology Eras
Mainframe Client-Server The exponential increase in business expectations is unsustainable for IT
MILLIONS OF APPS BILLIONS
OF USERS
* Source: Gartner, 2013: “Hunting and Harvesting in a Digital World: The 2013 CIO Agenda” $ $ $ $ $ $
ABILITY OF IT TO DELIVER S/W
STEADY IT BUDGETS*
BUSINESS EXPECTATIONS
![Page 5: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/5.jpg)
5 © Copyright 2015 EMC Corporation. All rights reserved.
PaaS (On Premise & Off Premise)
Traditional IT
Storage Servers
Networking
O/S Middleware
Virtualization
Data Applications
Runtime
You
Man
age
O/S
IaaS
Storage Servers
Networking
Middleware
Virtualization
Data Applications
Runtime
You
Man
age
IaaS
Business Value, Agility & Cost Savings
PaaS
Storage Servers
Networking
Middleware
Virtualization
Data Applications
Runtime
O/S Cloud Foundry
+ OpenStack
You
Man
age
![Page 6: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/6.jpg)
6 © Copyright 2015 EMC Corporation. All rights reserved. 6
• Microservices: a radical departure from traditional monolithic applications
• 12 Factor Linux applications • In both cases, the enterprise is
forced to “think different.”
Microservices Architectures
![Page 7: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/7.jpg)
7 © Copyright 2015 EMC Corporation. All rights reserved.
Provision VM
Install Applica;on Run;me
Deploy Applica;on
Configure Load Balancer
Configure Service Connec;vity
Configure Firewall
cf push
Configure SSL Termina;on cf bind-‐service
Application Development – IaaS vs PaaS
cf scale
![Page 8: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/8.jpg)
8 © Copyright 2015 EMC Corporation. All rights reserved.
Cloud Foundry Enterprise Capabilities At A Glance
Application Containerization
Monitoring, Logs and Performance as-a-Service
Integrated Services: Data, Mobile, Platform
High Availability and Scaling
Network Isolation and Security Groups
Automatic Middleware Configuration
Simple Service Binding
Automatic IaaS Provisioning
Roles and Policy Management
Running on top of
![Page 9: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/9.jpg)
9 © Copyright 2015 EMC Corporation. All rights reserved.
Removing Developer and Operator Constrains
BUILD APPLICATION
PUSH FIRST RELEASE
MAINTAIN APPLICATION
UPDATE APPLICATIONS
RETIRE APPLICATIONS
• Auto-detect frameworks • Link to PaaS
• Self-service deploy • Dynamic routing • CI/CD
• Elastic scale • Integrated HA • Autoscaling and APM • Log aggregation • Policy and Auth
• A/B versioning • Live upgrades
• Self-service removal
![Page 10: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/10.jpg)
10 © Copyright 2015 EMC Corporation. All rights reserved.
Gold
Silver
Cloud Foundry Foundation
![Page 11: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/11.jpg)
11 © Copyright 2015 EMC Corporation. All rights reserved.
Cloud Foundry Runtime Architecture
Ops Manager UI
Ops Manager Director Operations Manager
Service
Service Broker
Service Nodes
Service Broker
Service Nodes
Service
App Log Aggregator
Login Server
Dynamic Router
Cloud Controller
UAA
Health Manager
DEA Pool
Messaging (NATS)
Apps
Metrics Collec;on
Apps
HA Proxy LB
Elastic Runtime
![Page 12: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/12.jpg)
12 © Copyright 2015 EMC Corporation. All rights reserved.
BOSH DB Blob Store
Worker NATS Health Monitor
CPI
Director CLI
Inner shell Outer shell
Agents
When you deploy Cloud Foundry the following sequence of steps occur: 1. Target a BOSH director using CLI 2. Upload a Stemcell 3. Get a Release from a repo 4. Create a deployment manifest 5. BOSH Deploy Cloud Foundry:
• Prepare deployment • Compile packages • Create and bind VMs • Pull in job configurations • Create needed job
instances – this is where things get pushed live
![Page 13: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/13.jpg)
13 © Copyright 2015 EMC Corporation. All rights reserved.
Message Bus
Behind the Scenes - BOSH
IaaS
DB
BOSH Director
Blobs
Health Monitor
Deploy Worker VMs
Messaging
Target VM Health Manager
Target VM Cloud Controller
Target VM
PaaS Ops
Deployment • Packages
• Blobs • Source
• Jobs • Manifest
![Page 14: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/14.jpg)
14 © Copyright 2015 EMC Corporation. All rights reserved.
Apps and Services
![Page 15: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/15.jpg)
15 © Copyright 2015 EMC Corporation. All rights reserved.
Stage an Application Ro
uter
Blobstore DB
DEA Detect Compile Upload No Yes
System Buildpacks
+ =
Cloud Controller
App Ops
Pivotal CF Elas;c Run;me
![Page 16: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/16.jpg)
16 © Copyright 2015 EMC Corporation. All rights reserved.
Application Deployment Overview App Ops
① Upload app bits and metadata
push app
Router
② Create and bind services
③ Stage application
④ Deploy application Cloud Foundry Elas;c Run;me
Blobstore DB
Cloud Controller
Service Broker Node(s)
DEA DEA
DEA DEA
+ app MD
+ =
Service credentials
![Page 17: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/17.jpg)
17 © Copyright 2015 EMC Corporation. All rights reserved.
Creating and Binding a Service
Router Cloud Foundry
Run;me (ERS)
DB Service credentials
reserve resources create service (HTTP)
create service (HTTP)
bind service (HTTP)
bind service (HTTP)
obtain connection data
CLI Cloud Controller
Service Broker
Data Service
App Ops
![Page 18: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/18.jpg)
18 © Copyright 2015 EMC Corporation. All rights reserved.
DEA
Apps
Service Broker
Service Nodes Cloud Controller
create
bind
Service Brokers generate connection details and credentials for managed services CC encrypts and stores credentials in CCDB Credentials are exposed to bound applications via VCAP_SERVICES environment variable
connect
Managed Services
![Page 19: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/19.jpg)
19 © Copyright 2015 EMC Corporation. All rights reserved.
VCAP_SERVICES environment variable is visible only to members of the org and space containing the service instance
VCAP_SERVICES=" { "p-mysql": [ { "name": "music-db", "label": "p-mysql", "tags": [ "mysql", "relational” ], "plan": "100mb-dev", "credentials": { "hostname": "192.168.1.147", "port": 3306, "name": "cf_aceae021_7f27_48db_9844_d7c151f29195", "username": "Tr12ZI4hPu4OPJPY", "password": "fuTWBqpGeyvv0qge", "uri": "mysql://Tr12ZI4hPu4OPJPY:[email protected]:3306/ cf_aceae021_7f27_48db_9844_d7c151f29195?reconnect=true” } } ] } "
Managed Services
![Page 20: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/20.jpg)
20 © Copyright 2015 EMC Corporation. All rights reserved.
Evolving Schemas with evolutions
![Page 21: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/21.jpg)
21 © Copyright 2015 EMC Corporation. All rights reserved.
• Scripts written in plain old SQL • Evolutions to default database at conf/evolutions/default(1.sql, 2.sql, …)!
# --- !Ups!
CREATE TABLE User (!
);!
# --- !Downs!
DROP TABLE User;!
Evolving Data Schemas
![Page 22: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/22.jpg)
22 © Copyright 2015 EMC Corporation. All rights reserved.
Demos
![Page 23: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/23.jpg)
23 © Copyright 2015 EMC Corporation. All rights reserved.
Resources and Summary
![Page 24: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/24.jpg)
24 © Copyright 2015 EMC Corporation. All rights reserved.
� Sign up for the CF and BOSH mailing lists.
� Install Cloud Foundry on OpenStack (blog out soon)
� Learn how to write 12-factor applications.
� Free workshop and roadshows. CFAD!
� Register for the next Cloud Foundry Summit (May)
� Try out Pivotal Web Services (http://run.pivotal.io)
� Join the Cloud Foundry Community Boston.
Call for Action
![Page 25: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/25.jpg)
25 © Copyright 2015 EMC Corporation. All rights reserved.
https://ace.ng.bluemix.net/
http://www.hpcloud.com/products-services/application-paas
http://www.anynines.com/
https://run.pivotal.io/
Resources
![Page 26: cf push: Push your Scala/Play apps to Cloud Foundrydownloads.typesafe.com/website/presentations/ScalaDaysSF... · 2015-03-25 · 3. Get a Release from a repo 4. Create a deployment](https://reader033.vdocuments.mx/reader033/viewer/2022050209/5f5b875bac6d01073568b0d8/html5/thumbnails/26.jpg)