{"id":438,"date":"2013-11-06T17:29:21","date_gmt":"2013-11-06T17:29:21","guid":{"rendered":"http:\/\/corneliadavis.com\/blog\/?p=438"},"modified":"2013-11-06T17:29:21","modified_gmt":"2013-11-06T17:29:21","slug":"running-a-local-as-in-on-your-laptop-cloud-foundry-instance","status":"publish","type":"post","link":"https:\/\/corneliadavis.com\/blog\/2013\/11\/06\/running-a-local-as-in-on-your-laptop-cloud-foundry-instance\/","title":{"rendered":"Running a Local (as in, on your laptop) Cloud Foundry Instance"},"content":{"rendered":"<p>More than two years ago on the CF blog the <a href=\"http:\/\/blog.cloudfoundry.com\/2011\/08\/24\/we-shrunk-the-cloud-introducing-micro-cloud-foundry-for-developers\/\">availability of Micro Cloud Foundry<\/a> was announced \u2013 this was a version of Cloud Foundry that would run on a laptop.\u00a0 It came in the form of a vmdk that you could run either using VMWare Workstation or VMWare Fusion.\u00a0 Later posts talked about a release lifecyle that would provide frequent updates to the Micro release, so as to keep it in synch with the constantly-being-updated public offering running on cloudfoundry.com. It was an interesting experiment that had legs for more than a year, but didn\u2019t end up panning out all that well; I can share a personal anecdote that illustrates one of the reasons. More than a year ago when I was with EMC, I was working with some product groups that wanted to use CF, but not via cloudfoundry.com, but rather with a customized version of CF.\u00a0 They deployed a private cloud in their data center but then wanted to enable their developers with a matching \u201cmicro\u201d instance running on their personal workstations.\u00a0 We looked into the process of getting a customized version of Micro CF but in the end the answer was convoluted enough to keep us from making any progress. As it happens, we weren\u2019t alone.<\/p>\n<p>And now, here we are on the verge of our first supported release and I\u2019m happy to report two way cool things.\u00a0 First, there are now numerous, very viable options for getting a local CF instance up and running, and second, the CF community has become so vibrant that two of the three options I\u2019ll describe have come from outside of Pivotal.  In this post I\u2019ll share with you my personal experiences with and opinions on these three options.<\/p>\n<p>I\u2019ll go through these in the order in which they appeared on the scene, which is, incidentally, the order in which I began using them.<\/p>\n<h1>CF Vagrant Installer from Altoros<\/h1>\n<p>In April of this year the good folks at <a href=\"http:\/\/www.altoros.com\/\">Altoros<\/a> released the <a href=\"https:\/\/github.com\/Altoros\/cf-vagrant-installer\">cf-vagrant-installer<\/a>.\u00a0 This project required you have <a href=\"http:\/\/www.vagrantup.com\/\">vagrant<\/a> and a hypervisor (no license fees if you use <a href=\"https:\/\/www.virtualbox.org\/\">Virtual Box<\/a>), as well as ruby installed on your host machine (laptop), and then allowed you to clone the git repo and run the \u201cvagrant up\u201d command.\u00a0 Worked really well if you timed it just right, but because the standing up of the CF components was done via chef scripts that are a part of the project, keeping the installer up to date with the <a href=\"https:\/\/github.com\/cloudfoundry\/cf-release\/tree\/master\/releases\">CF releases<\/a> has proven challenging.<\/p>\n<p>This was the first of the three options that I used earlier this year and I was incredibly grateful to have it.\u00a0 That said, because of the aforementioned challenges in <a href=\"https:\/\/groups.google.com\/a\/cloudfoundry.org\/forum\/#!searchin\/vcap-dev\/altoros%7Csort:date\/vcap-dev\/vAV4t6LhcYQ\/yFq2o-rmOEgJ\">keeping this in synch<\/a> with the evolving CF releases, and dwindling activity in the project, I no longer recommend it.<\/p>\n<h1>CF Nise Installer from NTT Labs<\/h1>\n<p>Just a month after the release from Altoros, NTT Labs released the <a href=\"https:\/\/github.com\/yudai\/cf_nise_installer\">cf_nise_installer<\/a>.\u00a0 The install can be run with the help of vagrant, or you can create an Ubuntu 10.04 machine yourself (virtual or physical) and run two commands WITHIN that VM.\u00a0 You don\u2019t need to install ruby on your host (really nice if your laptop is a Windows box) \u2013 in fact, if you run the installer in your own Ubuntu machine then there are absolutely NO dependencies on software running natively on your laptop.\u00a0 The basic mechanics of how the Nise installer does its thing is that it leverages a BOSH emulator, also created by NTT Labs, and the install then 1) clones the <a href=\"https:\/\/github.com\/cloudfoundry\/cf-release\">cf-release repository<\/a> (which is the official release vehicle for the OSS Cloud Foundry), 2) creates a release using the BOSH cli and 3) deploys that release onto the VM via this BOSH emulator, called <a href=\"https:\/\/github.com\/nttlabs\/nise_bosh\">Nise BOSH<\/a>.\u00a0 Because the deployment leverages cf-release directly, it doesn\u2019t get out of synch with the CF release \u2013 that is, it IS the CF release.\u00a0 By default the cf_nise_installer will install the latest \u201cfinal build\u201d as found in the <a href=\"https:\/\/github.com\/cloudfoundry\/cf-release\/tree\/master\/releases\">releases directory<\/a>.\u00a0 It\u2019s true that the BOSH emulator has to keep up with changes to BOSH and the <a href=\"https:\/\/github.com\/yudai\/cf_nise_installer\/blob\/master\/manifests\/micro.yml\">deployment manifest<\/a> must also be updated, but <a href=\"https:\/\/github.com\/yudai\">yudai<\/a> is remarkably responsive and it\u2019s a rare day where someone reports an issue on one of the mailing lists and doesn\u2019t have a resolution from him in just a couple of hours (I\u2019m honestly not sure that the guy ever sleeps ;-)).<\/p>\n<p>In spite of the third tool I am just about to describe, the cf_nise_installer remains the option I most often recommend for standing up a local cloud foundry <span style=\"text-decoration: underline;\">quickly<\/span>, because, well, it just works \u2013 and in about 30 minutes.<\/p>\n<h1>BOSH-lite<\/h1>\n<p>While the <a href=\"https:\/\/github.com\/cloudfoundry\/bosh-lite\/commits\/master\">commit history<\/a> dates back to June of this year, it was more like August when <a href=\"https:\/\/github.com\/cloudfoundry\/bosh-lite\">bosh-lite<\/a> matured enough for consumption.\u00a0 This project was initiated from within Pivotal and, most simply put, it is an implementation of a Warden CPI for BOSH. If your not thinking this, let me seed this in your consciousness\u2026<\/p>\n<p>A warden CPI. Oh, now, That. Is. Cool!<\/p>\n<p>BOSH is a product that allows you to deploy and manage complex distributed applications, like the Cloud Foundry Runtime and Services, over the top of any IaaS.\u00a0 BOSH just needs to be able to provision virtual machines and then it lays things down onto those machines and monitors them too.\u00a0 We\u2019ve had support for VMWare, Openstack (provided in partnership with <a href=\"http:\/\/www.pistoncloud.com\/\">Piston Cloud<\/a>) and AWS for some time, and <a href=\"https:\/\/www.ntt-global.com\/\">NTT<\/a> <a href=\"https:\/\/groups.google.com\/a\/cloudfoundry.org\/forum\/#!topic\/bosh-dev\/MKuzx5ykGHE\">recently announced<\/a> one for <a href=\"https:\/\/github.com\/cloudfoundry-community\/bosh-cloudstack-cpi\">CloudStack<\/a> (and there are more in the works too). <a href=\"https:\/\/github.com\/cloudfoundry\/warden\">Warden<\/a> is a system that serves up light-weight Linux containers \u2013 that is, super-lean virtual machines.\u00a0 The CF runtime provides application isolation by hosting deployed applications inside of warden containers, and now bosh-lite uses that same technology for the VMs into which CF components are deployed.<\/p>\n<p>With a Warden CPI for BOSH, you now have the ability to run full BOSH on your laptop, and hence you can do a full BOSH deployment of CF on your laptop.\u00a0 I know I said it already but, whoa, that is way cool.<\/p>\n<p>That said, there are a few gotchas.\u00a0 First, if you clone the repo today you will find that by default, the vagrant config uses 6GB of RAM \u2013 pretty hefty (I have been able to do it with 3 or 4 Gig).\u00a0 You will also need to install a number of things on your laptop to be able to do the install.\u00a0 All told, I\u2019ll confess that it took me the better part of a day to sort through all of the dependencies, clean up my laptop sufficiently and get it all up and running.\u00a0 And I recently witnessed a partner have roughly the same experience.<\/p>\n<p>One of the best things, however, is that once you have bosh-lite installed, then the deployment of CF proceeds in the same manner as it would if you were deploying CF into the cloud. This has the obvious advantage of allowing you to gain necessary experience with an important toolset, <a href=\"http:\/\/docs.cloudfoundry.com\/docs\/running\/bosh\/\">BOSH<\/a>, but that is, admittedly, a fairly significant burden for the newbie.\u00a0 Another advantage that the bosh-lite approach has over CF Nise is that because the CF components are isolated from one another in the Warden containers, you won\u2019t have issues with various CF pieces bumping into each other \u2013 CF Nise cannot, for example, deploy the CF runtime and most of the services on the same box.<\/p>\n<h1>To summarize:<\/h1>\n<ol>\n<li>I no longer recommend the vagrant installer from Altoros.<\/li>\n<li>If you are looking to get the simplest CF instance stood up on your laptop, don\u2019t need CF services right away (but you might be working on creating your own service broker \u2013 that\u2019s okay), then I highly recommend cf_nise_installer.<\/li>\n<li>If you have enough RAM and are looking for a full-blown deployment of CF with services, and\/or you are primarily interested in learning BOSH, then go with bosh-lite.<\/li>\n<\/ol>\n<p>I have options 2 and 3 operational on my laptop and depending on the task before me I choose one over the other.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>More than two years ago on the CF blog the availability of Micro Cloud Foundry was announced \u2013 this was a version of Cloud Foundry that would run on a laptop.\u00a0 It came in the form of a vmdk that you could run either using VMWare Workstation or VMWare Fusion.\u00a0 Later posts talked about a [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[21,23,34],"tags":[53,60],"class_list":["post-438","post","type-post","status-publish","format-standard","hentry","category-paas","category-pivotal","category-tools-2","tag-cloudfoundry","tag-developer"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/posts\/438","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/comments?post=438"}],"version-history":[{"count":0,"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/posts\/438\/revisions"}],"wp:attachment":[{"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/media?parent=438"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/categories?post=438"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/corneliadavis.com\/blog\/wp-json\/wp\/v2\/tags?post=438"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}