/ Hackathon

Getting started for a hackathon with Bluemix

This weekend I planned to show up at the Swiss Re Hackathon. I hope to learn something new and god willing create something interesting!

I've loved the traditional IBM Watson stuff and have tried to play around with it quite a bit. I still think it has a long way to go and the application isn't yet upto the point of accuracy needed to make something really useful! (I hope I am wrong!).

However, IBM recently made quite a few acquisitions of quality products and rolled them up into the Watson Umbrella! I felt the new gamut of apps available to be comprehensive and mature enough to play with them again! This hackathon presents an opportunity to try that out along with meeting some great people!

The IBM team put together some very useful presentations and a great introductory video talk!


Getting Started

Now, let us look at creating a sample app using Cloud Foundry! Installation is straight forward. Download the installer from the releases page and you are all set!

I plan to use Meteor, so everything hereon will be Meteor focussed!

Let's first create a sample app:

Create the sample app

meteor create --example todos

Connect to Bluemix

cf api https://api.ng.bluemix.net

Login to Bluemix

Replace with the user credentials

cf login -u [email protected] -o [email protected] -s dev

Push the app without starting

cf push meteor-todos -b https://github.com/cloudfoundry-community/cf-meteor-buildpack.git --no-start

I ran into this nasty error!

A bit of research, showed me the way out! See Tip #3 in this post!

I needed to a .cfignore file in the root directory of the application. Add the below line to the file and you should be ready to go!

.meteor/local/

.cfignore is similar to .gitignore. The cf tool ignores the folders or files!.

This is actually very important! Look at the file sizes uploaded before and after! The entire local build directory does not need to be uploaded!

Before .cfignore

Before .cfignore

After .cfignore

After .cfignore

Note the difference! The upload needed reduced from 13.3M to 521.9K!

Create the MongoDB instance

Now, we need to create the MongoDB instance the app can bind to!

cf create-service mongodb 100 todos-mongodb

Now, we need to attach the service

cf bind-service meteor-todos todos-mongodb

Start the Meteor application

cf start meteor-todos

That's it! The meteor app was up and running at http://meteor-todos.mybluemix.net

Questions / Research Queue

Resources