SlideShare a Scribd company logo
1 of 30
Download to read offline
PROTOTYPING
IN THE CLOUD
Kirsten Jones
@synedra on twitter
http://www.princesspolymath.com
Wednesday, July 24, 13
THE PRINCESS
Many years of experience with APIs/REST
Developer support, helping people be
successful
Love hacking, creating prototypes
(check my blog, lots of code samples)
Wednesday, July 24, 13
THIS TALK
How to prototype in the cloud
Deploy full application stack
Basic example in PHP (Drupal)
More extensive examples in Node and Python
Most code available on Github
Wednesday, July 24, 13
PAAS PROVIDERS
Many providers
Examples here feature free payment tier,
portability, maturity
Heroku
Appfog
Others: Engineyard, Joyent, etc.
Wednesday, July 24, 13
APPFOG / PHP
Originally PHPFog
Now supports Java, .NET, Node, Ruby,
Python, PHP
Moderate level of configuration available
Many frameworks supported
Easy quick-start
Ruby-based toolkit
Wednesday, July 24, 13
APPFOG:
CREATE NEW APPLICATION
Wednesday, July 24, 13
APPFOG:
SUPPORTED FRAMEWORKS
Wednesday, July 24, 13
APPFOG: INFRASTRUCTURE
Wednesday, July 24, 13
APPFOG: BUILDING APP
Wednesday, July 24, 13
APPFOG:
DEFAULT DRUPAL INSTALL
Wednesday, July 24, 13
APPFOG:
TOOLBELT
sudo gem install af
af login
af pull appfogdemo
Wednesday, July 24, 13
HEROKU
Polyglot system
Started with Ruby on Rails
Ruby, Node.js, Clojure, Java, Python, and Scala.
Quick deployment, fine control of processes
Examples: Django, LinkedIn Today SMS,
IODocs
Wednesday, July 24, 13
HEROKU:
DJANGO PREREQUISITES
Heroku Toolbelt (Ruby)
Python
PIP for package management
% easy_install pip
Virtualenv
% pip install virtualenv
Heroku User Account
Postgres (needed for Django)
Wednesday, July 24, 13
HEROKU:
CREATE DJANGO APP
Following the Heroku Django tutorial
% mkdir herokudjango
% cd herokudjango
% virtualenv venv --distribute
% source venv/bin/activate
% pip install django-toolbelt
% django-admin.py startproject
herokudjango .
Wednesday, July 24, 13
HEROKU:
START LOCAL DJANGO APP
foreman start
15:29:49 web.1 | started with pid 14308
15:29:49 web.1 | 2013-07-13 15:29:49 [14308] [INFO] Starting gunicorn 17.5
15:29:49 web.1 | 2013-07-13 15:29:49 [14308] [INFO] Listening at: http://
0.0.0.0:5000 (14308)
15:29:49 web.1 | 2013-07-13 15:29:49 [14308] [INFO] Using worker: sync
15:29:49 web.1 | 2013-07-13 15:29:49 [14311] [INFO] Booting worker with pid:
14311
Wednesday, July 24, 13
HEROKU:
CONFIGURE REQUIREMENTS
pip freeze > requirements.txt
Wednesday, July 24, 13
HEROKU:
INITIALIZE GIT REPOSITORY
(venv)kirsten-mac:herokudjango kirsten$ git init
Initialized empty Git repository in /Users/kirsten/oscon/
herokudjango/.git/
(venv)kirsten-mac:herokudjango kirsten$ git add .
(venv)kirsten-mac:herokudjango kirsten$ git commit -m "heroku
django app”
[master (root-commit) 39cb46c] heroku django app
…
Wednesday, July 24, 13
HEROKU:
DEFAULT SETUP
Still need to push the actual application to the server…
Wednesday, July 24, 13
HEROKU:
PUSH TO THE CLOUD
(venv)kirsten-mac:herokudjango kirsten$ git push heroku master
Counting objects: 11, done.
Delta compression using up to 8 threads.
Compressing objects: 100% (8/8), done.
Writing objects: 100% (11/11), 4.15 KiB, done.
Total 11 (delta 0), reused 0 (delta 0)
-----> Python app detected
-----> No runtime.txt provided; assuming python-2.7.4.
-----> Preparing Python runtime (python-2.7.4)
-----> Installing Distribute (0.6.36)
-----> Installing Pip (1.3.1)
-----> Installing dependencies using Pip (1.3.1)
…
-----> Discovering process types
Procfile declares types -> web
-----> Compiled slug size: 30.0MB
-----> Launching... done, v5
http://peaceful-depths-8963.herokuapp.com deployed to Heroku
To git@heroku.com:peaceful-depths-8963.git
* [new branch] master -> master
Wednesday, July 24, 13
HEROKU:
DJANGO APP IN THE CLOUD
Wednesday, July 24, 13
HEROKU:
ADMIN COMMANDS
(venv)kirsten-mac:herokudjango kirsten$ heroku ps
Process State Command
------- --------- --------------------------
web.1 up for 2m gunicorn herokudjango.wsgi
(venv)kirsten-mac:herokudjango kirsten$ heroku logs
2013-07-13T22:40:28.697577+00:00 heroku[api]: Release v2 created by synedra@gmail.com
2013-07-13T22:40:28.662735+00:00 heroku[api]: Enable Logplex by synedra@gmail.com
2013-07-13T22:42:03.033821+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/ host=peaceful-
depths-8963.herokuapp.com fwd="10.21.72.132, 173.36.196.8" dyno= connect= service= status=502 bytes=
2013-07-13T22:42:03.762626+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/favicon.ico host=peaceful-
depths-8963.herokuapp.com fwd="10.21.72.132, 173.36.196.8" dyno= connect= service= status=502 bytes=
2013-07-13T22:42:03.925807+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/favicon.ico host=peaceful-
depths-8963.herokuapp.com fwd="10.21.72.132, 173.36.196.8" dyno= connect= service= status=502 bytes=
2013-07-13T22:42:03.186189+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/ host=peaceful-
depths-8963.herokuapp.com fwd="10.21.72.132, 173.36.196.8" dyno= connect= service= status=502 bytes=
2013-07-13T22:42:09.403312+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/ host=peaceful-
depths-8963.herokuapp.com fwd="10.21.72.132, 173.36.196.8" dyno= connect= service= status=502 bytes=
2013-07-13T22:42:09.556041+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/ host=peaceful-
depths-8963.herokuapp.com fwd="10.21.72.132, 173.36.196.8" dyno= connect= service= status=502 bytes=
2013-07-14T00:59:16+00:00 heroku[slug-compiler]: Slug compilation started
2013-07-14T01:00:42.243676+00:00 heroku[api]: Scale to web=1 by synedra@gmail.com
…
2013-07-14T01:00:43+00:00 heroku[slug-compiler]: Slug compilation finished
2013-07-14T01:00:46.595118+00:00 heroku[web.1]: Starting process with command `gunicorn herokudjango.wsgi`
2013-07-14T01:00:47.265537+00:00 app[web.1]: 2013-07-14 01:00:47 [2] [INFO] Starting gunicorn 17.5
2013-07-14T01:00:47.272266+00:00 app[web.1]: 2013-07-14 01:00:47 [7] [INFO] Booting worker with pid: 7
2013-07-14T01:00:47.266249+00:00 app[web.1]: 2013-07-14 01:00:47 [2] [INFO] Using worker: sync
2013-07-14T01:00:47.266163+00:00 app[web.1]: 2013-07-14 01:00:47 [2] [INFO] Listening at: http://0.0.0.0:54065 (2)
2013-07-14T01:00:47.783995+00:00 heroku[web.1]: State changed from starting to up
2013-07-14T01:00:55.028851+00:00 heroku[router]: at=info method=GET path=/ host=peaceful-depths-8963.herokuapp.com fwd="10.21.72.132,
173.36.196.8" dyno=web.1 connect=1ms service=102ms status=200 bytes=1975
Wednesday, July 24, 13
HEROKU:
WEB DASHBOARD
Wednesday, July 24, 13
HEROKU:
APPLICATION MANAGEMENT
Wednesday, July 24, 13
HEROKU:
DEPLOY EXISTING DJANGO APP
Django/LinkedIn/Twilio Integration
https://github.com/synedra/django-linkedin-
simple
GET/POST
Stores Auth from LinkedIn
Copy this code into the new application
Procfile: web: python todaynag/manage.py runserver
Check the local server http://127.0.0.1:8000
Wednesday, July 24, 13
HEROKU:
DEPLOYED APPLICATION
Wednesday, July 24, 13
HEROKU:
NODE.JS
Take an existing app and deploy to Heroku
IODocs: https://github.com/mashery/iodocs
HowTo on PrincessPolymath.com
Wednesday, July 24, 13
HEROKU:
QUICK SETUP
% git clone http://github.com/mashery/iodocs.git
% cd iodocs/
% npm install
% echo "web: node app.js" > Procfile
% cp config.json.sample config.json
% git add –f config.json
% heroku create
% heroku addons: add redistogo
% git push heroku master
Wednesday, July 24, 13
HEROKU:
IODOCS DEPLOYED
Wednesday, July 24, 13
SUM UP
Many cloud providers to choose from
Develop locally, deploy to public facing
cloud
Major languages supported
Hackdays
Quick web apps
Experiments
Wednesday, July 24, 13
QUESTIONS?
Wednesday, July 24, 13

More Related Content

What's hot

Puppet camp Portland 2015: -windows (1)
Puppet camp Portland 2015: -windows (1)Puppet camp Portland 2015: -windows (1)
Puppet camp Portland 2015: -windows (1)
Puppet
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linux
tutorialsruby
 

What's hot (19)

Screenshot as a service
Screenshot as a serviceScreenshot as a service
Screenshot as a service
 
PuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with PuppetPuppetCamp SEA 1 - Version Control with Puppet
PuppetCamp SEA 1 - Version Control with Puppet
 
Using python and docker for data science
Using python and docker for data scienceUsing python and docker for data science
Using python and docker for data science
 
CouchDB Day NYC 2017: Replication
CouchDB Day NYC 2017: ReplicationCouchDB Day NYC 2017: Replication
CouchDB Day NYC 2017: Replication
 
Puppet camp Portland 2015: -windows (1)
Puppet camp Portland 2015: -windows (1)Puppet camp Portland 2015: -windows (1)
Puppet camp Portland 2015: -windows (1)
 
Gaelyk
GaelykGaelyk
Gaelyk
 
G*なクラウド ~雲のかなたに~
G*なクラウド ~雲のかなたに~G*なクラウド ~雲のかなたに~
G*なクラウド ~雲のかなたに~
 
Google apps script introduction
Google apps script introductionGoogle apps script introduction
Google apps script introduction
 
Blockchain Workshop - Software Freedom Day 2017
Blockchain Workshop - Software Freedom Day 2017Blockchain Workshop - Software Freedom Day 2017
Blockchain Workshop - Software Freedom Day 2017
 
G* on GAE/J 挑戦編
G* on GAE/J 挑戦編G* on GAE/J 挑戦編
G* on GAE/J 挑戦編
 
gunicorn introduction
gunicorn introductiongunicorn introduction
gunicorn introduction
 
CouchDB Day NYC 2017: Mango
CouchDB Day NYC 2017: MangoCouchDB Day NYC 2017: Mango
CouchDB Day NYC 2017: Mango
 
mapserver_install_linux
mapserver_install_linuxmapserver_install_linux
mapserver_install_linux
 
PuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of PuppetPuppetCamp SEA 1 - Use of Puppet
PuppetCamp SEA 1 - Use of Puppet
 
Getting Started with Puppet on Windows - PuppetConf 2014
Getting Started with Puppet on Windows - PuppetConf 2014Getting Started with Puppet on Windows - PuppetConf 2014
Getting Started with Puppet on Windows - PuppetConf 2014
 
Batou - multi-(host|component|environment|version|platform) deployment
Batou - multi-(host|component|environment|version|platform) deploymentBatou - multi-(host|component|environment|version|platform) deployment
Batou - multi-(host|component|environment|version|platform) deployment
 
PuppetCamp SEA 1 - Puppet Deployment at OnApp
PuppetCamp SEA 1 - Puppet Deployment  at OnAppPuppetCamp SEA 1 - Puppet Deployment  at OnApp
PuppetCamp SEA 1 - Puppet Deployment at OnApp
 
Hadoop Installation
Hadoop InstallationHadoop Installation
Hadoop Installation
 
GDG DevFest 2013 - PHP Web Apps on Google Cloud
GDG DevFest 2013 - PHP Web Apps on Google CloudGDG DevFest 2013 - PHP Web Apps on Google Cloud
GDG DevFest 2013 - PHP Web Apps on Google Cloud
 

Viewers also liked

Designing for developers
Designing for developersDesigning for developers
Designing for developers
Kirsten Hunter
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2
Hugo Hamon
 

Viewers also liked (20)

Développeurs, cachez-moi ça ! (Paris Web 2011)
Développeurs, cachez-moi ça ! (Paris Web 2011)Développeurs, cachez-moi ça ! (Paris Web 2011)
Développeurs, cachez-moi ça ! (Paris Web 2011)
 
API First
API FirstAPI First
API First
 
The History of PHPersistence
The History of PHPersistenceThe History of PHPersistence
The History of PHPersistence
 
Facebook appsincloud
Facebook appsincloudFacebook appsincloud
Facebook appsincloud
 
Liberating your data
Liberating your dataLiberating your data
Liberating your data
 
API 101 Workshop from APIStrat Conference
API 101 Workshop from APIStrat ConferenceAPI 101 Workshop from APIStrat Conference
API 101 Workshop from APIStrat Conference
 
Symfony2 en pièces détachées
Symfony2 en pièces détachéesSymfony2 en pièces détachées
Symfony2 en pièces détachées
 
Liberating your data
Liberating your dataLiberating your data
Liberating your data
 
Api 101
Api 101Api 101
Api 101
 
Symfony2 - Un Framework PHP 5 Performant
Symfony2 - Un Framework PHP 5 PerformantSymfony2 - Un Framework PHP 5 Performant
Symfony2 - Un Framework PHP 5 Performant
 
Designing for developers
Designing for developersDesigning for developers
Designing for developers
 
Quantifying fitness
Quantifying fitnessQuantifying fitness
Quantifying fitness
 
Design Patterns avec PHP 5.3, Symfony et Pimple
Design Patterns avec PHP 5.3, Symfony et PimpleDesign Patterns avec PHP 5.3, Symfony et Pimple
Design Patterns avec PHP 5.3, Symfony et Pimple
 
Monitor the quality of your Symfony projects
Monitor the quality of your Symfony projectsMonitor the quality of your Symfony projects
Monitor the quality of your Symfony projects
 
This stuff is cool, but...HOW CAN I GET MY COMPANY TO DO IT?
This stuff is cool, but...HOW CAN I GET MY COMPANY TO DO IT?This stuff is cool, but...HOW CAN I GET MY COMPANY TO DO IT?
This stuff is cool, but...HOW CAN I GET MY COMPANY TO DO IT?
 
Speed up your developments with Symfony2
Speed up your developments with Symfony2Speed up your developments with Symfony2
Speed up your developments with Symfony2
 
Polyglot copy
Polyglot copyPolyglot copy
Polyglot copy
 
Symfony2 - extending the console component
Symfony2 - extending the console componentSymfony2 - extending the console component
Symfony2 - extending the console component
 
Git store
Git storeGit store
Git store
 
Quantifying your-fitness
Quantifying your-fitnessQuantifying your-fitness
Quantifying your-fitness
 

Similar to Prototyping in the cloud

2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku
ronnywang_tw
 
Хокку про Heroku
Хокку про HerokuХокку про Heroku
Хокку про Heroku
GeeksLab Odessa
 

Similar to Prototyping in the cloud (20)

2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku2012 coscup - Build your PHP application on Heroku
2012 coscup - Build your PHP application on Heroku
 
Quick and Dirty Python Deployments with Heroku
Quick and Dirty Python Deployments with HerokuQuick and Dirty Python Deployments with Heroku
Quick and Dirty Python Deployments with Heroku
 
IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...
IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...
IBCAST 2021: Observations and lessons learned from the APNIC Community Honeyn...
 
I/O Extended 2019 WebTech - New capabilities for the web
I/O Extended 2019 WebTech - New capabilities for the webI/O Extended 2019 WebTech - New capabilities for the web
I/O Extended 2019 WebTech - New capabilities for the web
 
Хокку про Heroku
Хокку про HerokuХокку про Heroku
Хокку про Heroku
 
Хокку про Heroku
Хокку про HerokuХокку про Heroku
Хокку про Heroku
 
Hacking pokemon go [droidcon tel aviv 2016]
Hacking pokemon go [droidcon tel aviv 2016]Hacking pokemon go [droidcon tel aviv 2016]
Hacking pokemon go [droidcon tel aviv 2016]
 
Keep it simple web development stack
Keep it simple web development stackKeep it simple web development stack
Keep it simple web development stack
 
Managing and Monitoring Application Performance
Managing and Monitoring Application PerformanceManaging and Monitoring Application Performance
Managing and Monitoring Application Performance
 
Collaboration hack with slackbot - PyCon HK 2018 - 2018.11.24
Collaboration hack with slackbot - PyCon HK 2018 - 2018.11.24Collaboration hack with slackbot - PyCon HK 2018 - 2018.11.24
Collaboration hack with slackbot - PyCon HK 2018 - 2018.11.24
 
Docker for data science
Docker for data scienceDocker for data science
Docker for data science
 
Docker in Production: Reality, Not Hype
Docker in Production: Reality, Not HypeDocker in Production: Reality, Not Hype
Docker in Production: Reality, Not Hype
 
Puppet Data Mining
Puppet Data MiningPuppet Data Mining
Puppet Data Mining
 
Princeton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance ToolingPrinceton Wintersession: Software Quality Assurance Tooling
Princeton Wintersession: Software Quality Assurance Tooling
 
Naive application development
Naive application developmentNaive application development
Naive application development
 
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
Package a PyApp as a Flatpak Package: An HTTP Server for Example @ PyCon APAC...
 
REST with Eve and Python
REST with Eve and PythonREST with Eve and Python
REST with Eve and Python
 
Oracle API Gateway Installation
Oracle API Gateway InstallationOracle API Gateway Installation
Oracle API Gateway Installation
 
vBACD - Introduction to Opscode Chef - 2/29
vBACD - Introduction to Opscode Chef - 2/29vBACD - Introduction to Opscode Chef - 2/29
vBACD - Introduction to Opscode Chef - 2/29
 
Best Practices in Handling Performance Issues
Best Practices in Handling Performance IssuesBest Practices in Handling Performance Issues
Best Practices in Handling Performance Issues
 

More from Kirsten Hunter

API 101 - Understanding APIs.
API 101 - Understanding APIs.API 101 - Understanding APIs.
API 101 - Understanding APIs.
Kirsten Hunter
 
Demystifying REST - SFRails meetup
Demystifying REST - SFRails meetupDemystifying REST - SFRails meetup
Demystifying REST - SFRails meetup
Kirsten Hunter
 

More from Kirsten Hunter (14)

Api intensive - What they Are
Api intensive - What they AreApi intensive - What they Are
Api intensive - What they Are
 
Designing irresistible apis
Designing irresistible apisDesigning irresistible apis
Designing irresistible apis
 
Designing irresistible apis
Designing irresistible apisDesigning irresistible apis
Designing irresistible apis
 
Api 101
Api 101Api 101
Api 101
 
Designing irresistible APIs
Designing irresistible APIsDesigning irresistible APIs
Designing irresistible APIs
 
API 101 - Understanding APIs.
API 101 - Understanding APIs.API 101 - Understanding APIs.
API 101 - Understanding APIs.
 
Demystifying REST - SFRails meetup
Demystifying REST - SFRails meetupDemystifying REST - SFRails meetup
Demystifying REST - SFRails meetup
 
Rest schema design
Rest schema designRest schema design
Rest schema design
 
Successful developers
Successful developersSuccessful developers
Successful developers
 
Demystifying REST
Demystifying RESTDemystifying REST
Demystifying REST
 
PHP Architect Virtual Cloud summit
PHP Architect Virtual Cloud summitPHP Architect Virtual Cloud summit
PHP Architect Virtual Cloud summit
 
Social Marketing with LinkedIn
Social Marketing with LinkedInSocial Marketing with LinkedIn
Social Marketing with LinkedIn
 
LinkedIn Everywhere
LinkedIn EverywhereLinkedIn Everywhere
LinkedIn Everywhere
 
Creating Professional Applications with the LinkedIn API
Creating Professional Applications with the LinkedIn APICreating Professional Applications with the LinkedIn API
Creating Professional Applications with the LinkedIn API
 

Recently uploaded

IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
vu2urc
 

Recently uploaded (20)

2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 

Prototyping in the cloud

  • 1. PROTOTYPING IN THE CLOUD Kirsten Jones @synedra on twitter http://www.princesspolymath.com Wednesday, July 24, 13
  • 2. THE PRINCESS Many years of experience with APIs/REST Developer support, helping people be successful Love hacking, creating prototypes (check my blog, lots of code samples) Wednesday, July 24, 13
  • 3. THIS TALK How to prototype in the cloud Deploy full application stack Basic example in PHP (Drupal) More extensive examples in Node and Python Most code available on Github Wednesday, July 24, 13
  • 4. PAAS PROVIDERS Many providers Examples here feature free payment tier, portability, maturity Heroku Appfog Others: Engineyard, Joyent, etc. Wednesday, July 24, 13
  • 5. APPFOG / PHP Originally PHPFog Now supports Java, .NET, Node, Ruby, Python, PHP Moderate level of configuration available Many frameworks supported Easy quick-start Ruby-based toolkit Wednesday, July 24, 13
  • 11. APPFOG: TOOLBELT sudo gem install af af login af pull appfogdemo Wednesday, July 24, 13
  • 12. HEROKU Polyglot system Started with Ruby on Rails Ruby, Node.js, Clojure, Java, Python, and Scala. Quick deployment, fine control of processes Examples: Django, LinkedIn Today SMS, IODocs Wednesday, July 24, 13
  • 13. HEROKU: DJANGO PREREQUISITES Heroku Toolbelt (Ruby) Python PIP for package management % easy_install pip Virtualenv % pip install virtualenv Heroku User Account Postgres (needed for Django) Wednesday, July 24, 13
  • 14. HEROKU: CREATE DJANGO APP Following the Heroku Django tutorial % mkdir herokudjango % cd herokudjango % virtualenv venv --distribute % source venv/bin/activate % pip install django-toolbelt % django-admin.py startproject herokudjango . Wednesday, July 24, 13
  • 15. HEROKU: START LOCAL DJANGO APP foreman start 15:29:49 web.1 | started with pid 14308 15:29:49 web.1 | 2013-07-13 15:29:49 [14308] [INFO] Starting gunicorn 17.5 15:29:49 web.1 | 2013-07-13 15:29:49 [14308] [INFO] Listening at: http:// 0.0.0.0:5000 (14308) 15:29:49 web.1 | 2013-07-13 15:29:49 [14308] [INFO] Using worker: sync 15:29:49 web.1 | 2013-07-13 15:29:49 [14311] [INFO] Booting worker with pid: 14311 Wednesday, July 24, 13
  • 16. HEROKU: CONFIGURE REQUIREMENTS pip freeze > requirements.txt Wednesday, July 24, 13
  • 17. HEROKU: INITIALIZE GIT REPOSITORY (venv)kirsten-mac:herokudjango kirsten$ git init Initialized empty Git repository in /Users/kirsten/oscon/ herokudjango/.git/ (venv)kirsten-mac:herokudjango kirsten$ git add . (venv)kirsten-mac:herokudjango kirsten$ git commit -m "heroku django app” [master (root-commit) 39cb46c] heroku django app … Wednesday, July 24, 13
  • 18. HEROKU: DEFAULT SETUP Still need to push the actual application to the server… Wednesday, July 24, 13
  • 19. HEROKU: PUSH TO THE CLOUD (venv)kirsten-mac:herokudjango kirsten$ git push heroku master Counting objects: 11, done. Delta compression using up to 8 threads. Compressing objects: 100% (8/8), done. Writing objects: 100% (11/11), 4.15 KiB, done. Total 11 (delta 0), reused 0 (delta 0) -----> Python app detected -----> No runtime.txt provided; assuming python-2.7.4. -----> Preparing Python runtime (python-2.7.4) -----> Installing Distribute (0.6.36) -----> Installing Pip (1.3.1) -----> Installing dependencies using Pip (1.3.1) … -----> Discovering process types Procfile declares types -> web -----> Compiled slug size: 30.0MB -----> Launching... done, v5 http://peaceful-depths-8963.herokuapp.com deployed to Heroku To git@heroku.com:peaceful-depths-8963.git * [new branch] master -> master Wednesday, July 24, 13
  • 20. HEROKU: DJANGO APP IN THE CLOUD Wednesday, July 24, 13
  • 21. HEROKU: ADMIN COMMANDS (venv)kirsten-mac:herokudjango kirsten$ heroku ps Process State Command ------- --------- -------------------------- web.1 up for 2m gunicorn herokudjango.wsgi (venv)kirsten-mac:herokudjango kirsten$ heroku logs 2013-07-13T22:40:28.697577+00:00 heroku[api]: Release v2 created by synedra@gmail.com 2013-07-13T22:40:28.662735+00:00 heroku[api]: Enable Logplex by synedra@gmail.com 2013-07-13T22:42:03.033821+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/ host=peaceful- depths-8963.herokuapp.com fwd="10.21.72.132, 173.36.196.8" dyno= connect= service= status=502 bytes= 2013-07-13T22:42:03.762626+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/favicon.ico host=peaceful- depths-8963.herokuapp.com fwd="10.21.72.132, 173.36.196.8" dyno= connect= service= status=502 bytes= 2013-07-13T22:42:03.925807+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/favicon.ico host=peaceful- depths-8963.herokuapp.com fwd="10.21.72.132, 173.36.196.8" dyno= connect= service= status=502 bytes= 2013-07-13T22:42:03.186189+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/ host=peaceful- depths-8963.herokuapp.com fwd="10.21.72.132, 173.36.196.8" dyno= connect= service= status=502 bytes= 2013-07-13T22:42:09.403312+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/ host=peaceful- depths-8963.herokuapp.com fwd="10.21.72.132, 173.36.196.8" dyno= connect= service= status=502 bytes= 2013-07-13T22:42:09.556041+00:00 heroku[router]: at=info code= desc="Blank app" method=GET path=/ host=peaceful- depths-8963.herokuapp.com fwd="10.21.72.132, 173.36.196.8" dyno= connect= service= status=502 bytes= 2013-07-14T00:59:16+00:00 heroku[slug-compiler]: Slug compilation started 2013-07-14T01:00:42.243676+00:00 heroku[api]: Scale to web=1 by synedra@gmail.com … 2013-07-14T01:00:43+00:00 heroku[slug-compiler]: Slug compilation finished 2013-07-14T01:00:46.595118+00:00 heroku[web.1]: Starting process with command `gunicorn herokudjango.wsgi` 2013-07-14T01:00:47.265537+00:00 app[web.1]: 2013-07-14 01:00:47 [2] [INFO] Starting gunicorn 17.5 2013-07-14T01:00:47.272266+00:00 app[web.1]: 2013-07-14 01:00:47 [7] [INFO] Booting worker with pid: 7 2013-07-14T01:00:47.266249+00:00 app[web.1]: 2013-07-14 01:00:47 [2] [INFO] Using worker: sync 2013-07-14T01:00:47.266163+00:00 app[web.1]: 2013-07-14 01:00:47 [2] [INFO] Listening at: http://0.0.0.0:54065 (2) 2013-07-14T01:00:47.783995+00:00 heroku[web.1]: State changed from starting to up 2013-07-14T01:00:55.028851+00:00 heroku[router]: at=info method=GET path=/ host=peaceful-depths-8963.herokuapp.com fwd="10.21.72.132, 173.36.196.8" dyno=web.1 connect=1ms service=102ms status=200 bytes=1975 Wednesday, July 24, 13
  • 24. HEROKU: DEPLOY EXISTING DJANGO APP Django/LinkedIn/Twilio Integration https://github.com/synedra/django-linkedin- simple GET/POST Stores Auth from LinkedIn Copy this code into the new application Procfile: web: python todaynag/manage.py runserver Check the local server http://127.0.0.1:8000 Wednesday, July 24, 13
  • 26. HEROKU: NODE.JS Take an existing app and deploy to Heroku IODocs: https://github.com/mashery/iodocs HowTo on PrincessPolymath.com Wednesday, July 24, 13
  • 27. HEROKU: QUICK SETUP % git clone http://github.com/mashery/iodocs.git % cd iodocs/ % npm install % echo "web: node app.js" > Procfile % cp config.json.sample config.json % git add –f config.json % heroku create % heroku addons: add redistogo % git push heroku master Wednesday, July 24, 13
  • 29. SUM UP Many cloud providers to choose from Develop locally, deploy to public facing cloud Major languages supported Hackdays Quick web apps Experiments Wednesday, July 24, 13