Cloud Foundry is an open Platform as a Service (PaaS) project that can support multiple frameworks, cloud providers, and application services at cloud scale. The presentation demonstrates how Smalltalk can be deployed on Cloud Foundry, including pushing a Smalltalk application, staging to load code into an image, and starting the saved image. Support would need to be added to the VMC client and Cloud Foundry server to automatically detect and run Smalltalk applications. Similarly, GemStone applications could be deployed to Cloud Foundry by supporting Topaz as a runtime and GemStone as a service.
AWS Community Day CPH - Three problems of Terraform
Â
Smalltalk In the Cloud
1. Smalltalk in the Cloud
ESUG 2012, Friday, 31 August 2012, 11:15 â 11:45 AM, Gent, Belgium
James Foster, Sr. Member Technical Staff, VMware
Š 2009 VMware Inc. All rights reserved
2. Abstract
Cloud Foundry is the open "Platform as a Service" (PaaS) project
initiated by VMware. It can support multiple frameworks, multiple
cloud providers, and multiple application services all on a cloud
scale platform.
In this presentation we show how Smalltalk can fit in this
environment.
3. Agenda
ď§Overview of Cloud Foundry (corporate marketing slides)
ď§Smalltalk use described with demo
ď§Experience report from Tim Felgentreff at HPI
VMware
4. Hosting Options
What is provided by vendor:
Type Utilities Hardware Stack Applications
Self-hosting
Data center ďĄ
IaaS ďĄ ďĄ
PaaS ďĄ ďĄ ďĄ
SaaS ďĄ ďĄ ďĄ ďĄ
Utilities: Network, power, A/C
Hardware: CPU, RAM, disk
Stack: operating system, web server, database, runtime, framework
Application: this is the programmer's concern
5. Introducing Cloud FoundryTM
The Open Platform as a Service
March 2012 www.cloudfoundry.com
Š 2009 VMware Inc. All rights reserved
6. The Open
Platform as a Service
Deploy and scale applications in
seconds, without locking yourself
into a single cloud
6
8. Cloud Foundry open Platform as a Service
The PaaS of choice for the Cloud era
Simple
⢠Lets developers focus on their code and not wiring middleware
Open
⢠Avoid lock-in to specific cloud, frameworks or service
⢠Completely open source from day one
Flexible and Scalable
⢠Self service, deploy and scale your applications in seconds
⢠Extensible architecture to âdigestâ future cloud innovation
8
9. Cloud Foundry â key audiences
IT Developers IT Operations
âWrite code, not ticketsâ âIT as a service providerâ
Boost
application
velocity
ďź Friction-free deployment ďź More responsive to developers
ďź No machines or middleware to manage ďź Elastic and dynamically scalable
ďź Latest high productivity frameworks ďź Improved efficiency
ďź Choice of application services ďź Digest future cloud advances
ďź Cloud portability ďź Cloud portability
9
11. Cloud Foundry open PaaS - Choice of application services
vFabric
Postgres
Data
Services
vFabric
RabbitMQTM Msg
Services
Other
Services
Additional partners
services âŚ
11
12. Cloud Foundry open PaaS - Choice of clouds
Data Private
Services
Clouds
Msg Public
Services
Clouds Partners
.COM
Other Micro
Services Clouds
12
13. Multi-cloud flexibility is critical to your long-term success
ď§ Make use of both public and private clouds without rewriting your
applications
ď§ Protect against vendor lock-in
ď§ Meet different compliance and geographical needs
ď§ Accommodate peak loads while optimizing costs
ď§ Manage your growth and changing needs over time
13
14. Cloud Foundry: Making multi-cloud a reality
Choice of Private Choice of Public Choice of Cloud
Cloud Distributions Cloud Providers Infrastructure
.COM
Bare metal
14
16. Micro Cloud FoundryTM â Industry first downloadable PaaS
Micro Cloud Foundry
Runtimes & Frameworks
Services
Your Laptop/PC
Single VM instance of
Cloud Foundry
that runs on a developerâs
MAC or PC
16
19. How Apps are Accessed on Cloud Foundry
Request Web Interface
Load
Balancing
and Response
Routing
Web
App
App Instance
DB âvmc push MyAppâ
Service
19
20. How Apps are Scaled on Cloud Foundry
Request
Load
Balancing
Response
and
Routing
App Instances
Web Web Web
App App App
DB âvmc instances MyApp 3â
Service
20
21. How Apps are Updated on Cloud Foundry
Previous Instance Updated New
Version Stopped Code Version
Web Web Web Web
App App App App
DB DB
Service Service
âvmc update MyAppâ
21
22. Create a Trivial Ruby Application
ď§ In a new directory, create 'env.rb':
require 'rubygems'
require 'sinatra'
configure do
disable :protection
end
get '/' do
host = ENV['VMC_APP_HOST']
port = ENV['VMC_APP_PORT']
"<h1>Hello ESUG! via: #{host}:#{port}</h1>"
end
get '/env' do
res = ''
ENV.each do |k, v|
res << "#{k}: #{v}<br/>"
end
res
end
23
23. Deploy the Ruby Application
ď§ Try the application locally
⢠ruby env.rb
ď§ Push the application to the cloud (with a unique name):
⢠vmc push MYAPP -n
ď§ View the application:
⢠http://myapp.smalltalkcon.org and http://myapp.smalltalkcon.org/env
ď§ Increase the number of instances:
⢠vmc instances MYAPP +1
ď§ View the application again and note differences
⢠Port number and directory may change
ď§ Delete your application:
⢠vmc delete MYAPP
24
24. Push Process
Creating Application: OK
Uploading Application:
Checking for available resources: OK
Packing application: OK
Uploading (0K): OK
Push Status: OK
Staging Application 'james-ruby': OK
Starting Application 'james-ruby': OK
Laptop with
vmc and Server with
application Cloud Foundry at
*.smalltalkcon.org
25
25. Server Architecture
VMC Client Web Browsers
Router / Firewall / Proxy Server at 64.20.104.5 (*.smalltalkcon.org)
Router
Ruby
Application
Cloud Controller
Instance(s)
Droplet
Execution
Agent
Health Mgr
w2s2-gst-cf1
26
26. Adding Smalltalk to Cloud Foundry
Smalltalk
Data Private
Services
Clouds
GemStone
Msg Public
Services
Clouds
Other Micro
Services Clouds
Smalltalk image from http://www.freudenbergs.de/bert/balloon.html
27
27. Support for "Traditional" Programming Model
ď§ Ruby
⢠Interpreter works with text files
⢠Application code "includes" external libraries
⢠Frameworks (Rails, Sinatra) can be pre-loaded on server
ď§ Java / Scala / Groovy
⢠Runtime VM works with "jar" files
⢠Application code "includes" external libraries
⢠Frameworks (Spring, Lift, Grails) can be pre-loaded on server
ď§ How is Smalltalk different?
⢠Let me count the ways!
⢠Monolithic image with full application and framework
28
28. Smalltalk can Fit!
ď§ Code can exist outside image
⢠Package or file-in
ď§ Push
⢠Ship "code" to server during push phase
⢠All files under a root directory are sent to server
ď§ Staging
⢠Launch Smalltalk, load code into image, and save image
ď§ Starting
⢠Launch saved image
⢠Determine port on which to listen (environment variable or command line)
⢠Start HTTP server on designated port
ď§ Consider a Pharo application
⢠Same ideas should work with Squeak, Cincom Smalltalk, and VA Smalltalk
29
30. Special File in Application Directory: aida.st
| portString |
portString := SmalltalkImage current getSystemAttribute: 3.
(portString isNil or: [portString isEmpty])
ifTrue: [portString := '8888'].
AIDASite default
stop;
port: portString asNumber;
start.
Author fullName: 'CloudFoundry'.
WebDemoApp compile: 'introductionElement
| e |
e := WebElement new.
e addText: self observee introduction.
e addText: ''<p>Listening on port: '' ,
session parent site port printString , ''</p>''.
^e'.
31
31. Changes to Cloud Foundry for Aida
ď§ VMC
⢠Add Aida to list of supported frameworks
⢠Auto-detect 'aida.st' as indicating Aida framework and CogVM runtime
ď§ VCAP (Cloud Foundry Server)
⢠Chef scripts to download and install CogVM and Aida one-click image
⢠Staging code to install code and save as new image
⢠Startup code to change listening port
32
32. GemStone and Cloud Foundry
ď§ Cloud Foundry Services
⢠MySQL, MongoDB, Redis
⢠GemStone/S maps reasonably well to these services
ď§ Runtime & Framework
⢠Topaz is the command-line executable
⢠Support for file-in scripts
⢠Startup needs to do lazy-initialization
⢠Don't install code if it is already present
ď§ Changes to VMC for GemStone
⢠vmc-stic is modified to recognize a Topaz application
⢠Look for main.tpz in deployment directory
⢠Other files will be copied to server as well (e.g., *.mcz)
33
33. Server Architecture
VMC Client Web Browsers
Router / Firewall / Proxy Server at 64.20.104.5 (*.smalltalkcon.org)
Router
Ruby Topaz Topaz GemStone
Cloud Controller
Application Application Application Database
Instance(s) Instance(s) Instance(s) Server
Droplet
Execution Droplet Droplet
Agent Execution Execution
Agent Agent
Health Mgr
w2s2-gst-cf1 w2s2- w2s2- w2s2-
gst-cf2 gst-cf3 gst-cf4
34
34. Micro Cloud
ď§ Develop application locally
ď§ Deploy it to a public cloud
ď§ Intermediate step of testing deployment to a private cloud
⢠You have better access to logs to debug problems!
39
35. Experience Report
ď§ HPI students build Seaside applications in lecture
ď§ Internal Cloud Foundry setup for students to show their projects
⢠Described at http://blog.bithug.org/2012/02/cloud-foundry-squeak
⢠Cloud Foundry code at https://github.com/timfel/vcap
⢠Squeak code at http://ss3.gemstone.com/ss/CloudFoundry.html
ď§ Will be promoted for all students in upcoming Seaside lecture
40
36. Key takeaways
ď§ PaaS is the application platform for the Cloud era
ď§ Cloud Foundry is the simple, open and flexible PaaS of choice
ď§ Whatâs next?
⢠Signup - www.cloudfoundry.com
⢠Get the source code - www.cloudfoundry.org
⢠Download your Micro Cloud Foundry â my.cloudfoundry.com/micro
⢠Learn more on the Cloud Foundry blog - blog.cloudfoundry.com
⢠Follow us - @cloudfoundry
41
37. Thanks & Questions?
ď§ Thanks to
⢠Dale Henrichs, Peter McLean, and Monty Williams of VMware
⢠John Thornton (JonnyT) for the vmc-stic Ruby Gem and for testing things
⢠Norm Green and VMware for the opportunity to work on this project
⢠Tim Felgentreff of HPI
ď§ Contact info for James Foster
⢠jfoster@vmware.com
⢠http://programminggems.wordpress.com/
42