Friday, March 21, 2014

Trying Bluemix! - First steps

Bluemix (http://www.bluemix.net) is the new PaaS offering from IBM. Based on open-standards, it is a cloud-based platform for building, managing and running apps of all types (web, mobile, big data, new smart devices).

I've just tried to give it a shot and this is my recommended approach to make a sample run and have an understanding of some of the basics to create a larger app:

First of all you'll need CloudFoundry tools, which oyu can get from: http://docs.cloudfoundry.org/devguide/installcf/install-go-cli.html

Once you have this installed you can follow this sample here: http://www.ibm.com/developerworks/cloud/library/cl-bluemix-nodejs-app/

But you'll need to make some changes as that document has a couple of things that has changed since it was published:

git clone https://github.com/ibmjstart/bluemix-node-mysql-upload.git
cd bluemix-node-mysql-upload\app

"\Program Files (x86)\CloudFoundry\cf.exe" create-service mysql 100 mysql-node-upload

move manifest.yml.v5 manifest.yml

---
       

       
applications: #Reference http://docs.cloudfoundry.com/docs/using/deploying-apps/manifest.html

- name: whatevername #Application Name. Unique to the user's Space

  memory: 256M #The maximum memory to allocate to each application instance

  instances: 1 #The number of instances of the application to start

  --- url: pcolazurdo-test-${random-word}.${target-base} #deprecated, kept for temporary compatibility

  host: whatevername #Hostname for app routing. Unique to domain

  --- domain: ${target-base} #Bluemix Parent Domain Name

  path: . #Path to the application to be pushed

  command: node app.js #The command to use to start the application




       
 


"\Program Files (x86)\CloudFoundry\cf.exe" push runtime-name

After this you have to go to the console and assign the Mysql service to the Application Runtime and restart the Runtime

No comments: