Heroku By Bhagwat Kumar http://twitter.com/bhagwatkumar5th Jan 2013
Agenda Cloud Computing and Heroku Process Model Dynos Manifold Deployment Stack Add-on Services Usage and Billing CLI
Cloud Computing and HerokuCloud computing is a general term for anything that involves delivering hosted services over the Internet.SAASPAASIAAS
Heroku a new way of building and deploying web apps. Spend 100% of your time on application code. Forget managing servers, deployment, ongoing operations, or scaling.
How it works? Deploy – just a git push Connect – add 3 party resources rd Command – Use CLI/web interface Observe – All activities logged using Logplex Scale – independent scaling of components Relax - takes full responsibility for your apps health.
Process Model Process Type Web : web application Worker : timed jobs and queuing systems Each app has a set of running processes and the processes are instantiated using Process Type as prototype.
Dyno Basic unit of composition on Heroku. A lightweight container running a single user-specified command/process. Possible commands – Web processes – Worker processes – Other processes defined in Procfile
Dyno composition Your app Framework support Config vars Own file system for temp usage 512MB of RAM
Dyno Manifold Provides an environment for your apps dynos: • distributed • fault-tolerant • horizontally scalable Tasks • restarting faulty dyno • checking for idle dyno • restarting on config change
Deployment StackA stack is a complete deployment environment including : base operating system language runtime associated libraries.
Usage & Billing Usage is computed from wall-clock time, not CPU time. Current charge : $0.05 per hour per dyno Each app gets 750 free dyno-hours/month – run 1 dyno for an entire month for free OR – run 2 dynos for 1/2 of a month Add-on services have their own charges
Get readyRegister here https://api.heroku.com/signup/devcenterInstall Heroku Toolbelt (CLI) from https://toolbelt.heroku.com/Or if you use Ubuntu then :wget -qO- https://toolbelt.heroku.com/install-ubuntu.sh | sh
Sample commands (git)add heroku remote to existing projectgit remote add heroku firstname.lastname@example.org:project.gitpush different project code on existing heroku appgit push --force heroku masterDeploy git yourbranch instead of mastergit push heroku yourbranch:masterRemove heroku remote from the projectgit remote rm heroku
Sample commands (config)See all the config available for your projectheroku configAdd a key-value pair to configheroku config:add COMPANY=Intelligrape SoftwareRemove keys from configsheroku config:remove COMPANY OTHER_VAR//config variables are available as System properties on heroku.// in Java/Groovy System.getenv(COMPANY)
Sample commands (sharing)Change owner of the heroku projectheroku sharing:transfer email@example.comAdd collaboratorheroku sharing:add firstname.lastname@example.orgRemove collaboratorheroku sharing:remove email@example.com
Sample commands (process)See all running processesheroku pswatch heroku psRestart all dynosheroku restartRun bash shellheroku run bash