Dedicated Bluemix Instances On Softlayer And Bluemix UK

Greetings from Strata + Hadoop World in Barcelona Spain.  Yesterday was a big day for Bluemix with two major announcements.

The first announcement was the addition of a new Bluemix “region” in the UK.  At a high level, this means that you can now deploy and run your apps within our UK data center.  This will obviously helps with latency concerns for users you may have in the UK region.  Deploying apps to the UK data center in the Bluemix UI is as simple as selecting the the UK region once logged into Bluemix and following the same process you did before.

Screen Shot 2014-11-21 at 8.39.51 AM


If you are using the Cloud Foundry command line, the Eclipse plugin, or something like the Maven or Gradle plugins, there is a new API endpoint you need to point those tools at,  For example, to point the Cloud Foundry command line at the UK region execute the following command

The second announcement we made yesterday was around dedicated instances of Bluemix on Softlayer, or for short Bluemix Dedicated.  With Bluemix Dedicated you get a private, single tenant instance of Bluemix running in ANY Softlayer datacenter that is completely managed by IBM.  With this model you still get all the advantages of a PaaS but in an instance of Bluemix only you have access to.  This solution obviously addresses some of the security concerns certain industries have around running their applications in a multi-tenant environment.  In addition the fact that you can deploy it to any Softlayer datacenter allows you to also address concerns about data leaving the country of origin.  From a functionality perspective Bluemix Dedicated will behave just like the public Bluemix instance and the catalog will contain all the same services you are familiar with.  The one difference is that certain services in the catalog will be replaced with dedicated services.  These dedicated services are private, single tenant versions of their counterparts in the public Bluemix catalog.  There are currently 5 dedicated services, Cloudant, Data Cache, MQ Light, Session Cache, and SQL DB.  Of course you are still free to connect to any public cloud service you want to use and you will be able to connect back to any on premise services you have as well.  Unlike in the public Bluemix instance connections behind your firewall are not done via the Cloud Integration service, instead they are done via a VPN connection or using Softlayer Direct Link.  For more information check out the video below as well as this blog post.








Updated: Bluemix and the Internet of Things

A few weeks ago we moved the Internet of Things service out of beta indicating it was ready for prime time.  This was exciting news except for the fact that it introduced some breaking changes, code written against the beta IoT service would most likely not work with the new service.  This included code I had written a few months ago to demonstrate the beta IoT service.  I finally had some time to go back and update this code so it works with the new IoT service.  The new code is now available in the GitHub repo.  In addition to updating the code I thought I would create an updated video of how to use the IoT service.  Check it out below!

Accessing Application Logs In Bluemix

Being able to view your application’s log files is essential for any developer.  Developers use their log statements to gain insight into what is happening in their application throughout the application lifecycle.  Accessing your logs when running your application locally is easy, but when the application is deployed to a remote server things get a little bit trickier.  In the past, when deploying your app to your own infrastructure or even infrastructure-as-a-service (IaaS) you could access your like files via SSH or FTP.  With a platform-as-a-service (PaaS) things are much different, there is no way to SSH or FTP into the infrastructure running your app because that is all controlled by the platform.  In Cloud Foundry based PaaSes such as Bluemix, access to logs from an application are exposed via something called theLoggerator.  The Loggerator is a fantastic piece of software, but luckily as a developer you don’t need to know anything about it except for the fact all the logs from your application are made available through it.  The most common way to access log files is via the Cloud Foundry command line interface (CLI).

$ cf logs

If you are going to be doing development on Bluemix, than I suggest you install the Cloud Foundry CLI even if you are not a fan of the command line.  The tool is easy to use and there are plenty of guides out there that go through the details of using it.  In some cases the only option may be to use the CLI so it is a good tool to have installed.  One of the most useful commands in the CLI is cf logs.  cf logsallows you to access the logs from your application deployed to Bluemix right from your command line so it is extremely useful when doing development.  You can access a snapshot of recent logs or stream logs right to your command line.  Here are the basic uses.

cf logs appName –recent
This command will show a subset of recent logs from the application deployed to Bluemix with the name appName.

cf logs appName
This command will tail the logs from the application deployed to Bluemix with the name appName.  You will not be able to see any of the past logs with this command.

Here is a short video describing how to use cf logs.

I generally use cf logs when doing development and testing, I almost always have a window open tailing the logs of the application I am working on.  Tailing the log files of your application is very useful when deploying applications to Bluemix.  Often times you may run into errors when doing deployments to Bluemix and it is not clear what went wrong.  Your first instinct might be to run cf logs appName –recentto see what went wrong.  Unfortunately you will notice that in most cases the commands exits without showing you any logs.  This happens because the file system is temporary, meaning that the contents of the file system (including your logs) are lost when the application is stopped, and since your application failed to start your logs don’t stick around for too long.  To solve this problem what I do when I deploy an application is use cf logs appName to tail the logs while the deployment is taking place.  This works as long as the application is created in Bluemix by the time you run the command.  For a quick demo of how to do this take a look at this video.

Using Persistent Logging Services

Once your application is deployed and somewhat stable you will want to use a logging service.  There are a couple of reasons for wanting to use a logging service.  The first reason is using cf logs appName –recent will only allow you to see so far back in your logs.  The only way to view logs of your app over a long period of time is to use a logging service.  Second, as discussed above, logs are deleted after the application restarts, and restarts can happen as a normal corse of operation, especially if you are practicing continuous integration and delivery.  As with any type of cloud service you have a couple of options when it comes to logging services.

IBM’s Monitoring And Analytics

If you browse the Bluemix catalog you will come across the Monitoring and Analytics service.  This service can be used with any app using the IBM Liberty or Node.js runtimes.  This service offers a variety of additional features besides log collection but log collection comes in the free plan.  With this service you can only view logs from the past 24 hours, so if you need your logs to be persisted longer than 24 hours consider one of the 3rd party services.  The nice thing about this service is that it offers great searching functionality so you can easily identify patterns in your logs.  Here is a short video that describing how to use the Monitoring and Analytics service.

3rd Paty Logging Services

In addition to the Monitoring And Analytics service in the IBM Bluemix catalog, you are free to use any 3rd party logging service that supports the syslog protocol.  This includes services such as Papertail, Splunk Storm, SumoLogic, and Logentries.  To use one of these services you must first setup an account with one of them.  Most of them offer some level of functionality for free giving you an opportunity to try out each of them and pick the one you like best.  After picking a service to use, you will go through a process where you register the application with the service and it provides you with a syslog URL to use.  Once you have this URL the process of connecting the Loggerator in Bluemix to the 3rd party service is the same.  To do this you need to use the Cloud Foundry CLI to create whats called a user provided service (this is one of those cases where you need to use the CLI to do this).  The command is simple, just run

cf cups <serviceName> -l <syslog url>

In the above command, replace <serviceName> with any name you would like and <syslog url> with the URL you got from your 3rd party logging service.  The URL should begin with syslog://, for example here is an example of a URL from the Papertrail service.


Using 3rd party logging services is pretty simple as you can see in this video.

Why I Have Started To Embrace The Command Line

Last night my tweet inspired a debate on Twitter about the use of the command line.  Oddly enough I was in a meeting with a customer yesterday and due to some problem I encountered during my demo I had to open the command line.  Once I did this he immediately asked me “Do I need to use the command line?”.  (As a side note the person who asked this question was not a developer or system admin.)   In addition a few weeks ago at MWLUG, Nathan Freeman, who I have the utmost respect for as a person and a developer, stopped me in the middle of my presentation and told me he was completely lost because I was using the Git CLI.  So with so much talk about my use of the command line I figured I would explain why I use it.

It was not long ago that I was not a fan of the command line.  Being a Java developer I lived in Eclipse.  Eclipse did everything for me, it generated code for me, it had type ahead, it would build my code, and I could even run and debug my code….everything I needed in one place.  I knew that I could do all of this outside of Eclipse using various text editors and command line tools, but why would I?  Then one day at work we decided to use an Apache project for one of the projects we were working on.  When I looked at the project documentation they stated they were using Maven to manage the project.  Doing some Googling I found instructions on how to install Maven and realized it was a command line tool, my first thought was “YUK”!  Being an Eclipse lover I immediately Googled to see if there was a plugin for Eclipse and there was, the plugin was called M2Eclipse.  Hallelujah, I could continue to live in Eclipse.  Eventually though I ran into a problem with the Apache project where the Eclipse Maven tools were failing to build the Apache project and I had to use the command line tools.  I bit the bullet and installed the Maven CLI so I could continue to do my work.

Not to long after that I started to use Git.  Again the Git CLI seemed hard for me, I wanted something for Eclipse.  There is a nice Git plugin for Eclipse (or even better something like SourceTree) so again I was able to avoid the command line.  However I noticed something else the more I looked at GitHub projects.  They all said “To get the code run $ git clone”  None of them referenced using an IDE to clone the git repo.  I also noticed some projects taking things one step further tell you to run “git clone” and then run something like “mvn -P run” and that would clone, build, test and deploy code on an embedded web server (not all projects have this functionality).  This is when things started to click for me.  Think about if you wanted to do the same thing with something like Eclipse.  You would have to start Eclipse, clone the git repo, setup a debug configuration to run my maven build, setup a Tomcat server in Eclipse, add the war the maven build produced to your Tomcat configuration, and then start Tomcat from Eclipse.  You could run “mvn -P run” from within Eclipse as well and use the embedded web server from within Eclipse eliminating the need to setup and configure Tomcat but I would argue that you are now eliminating the need for using Eclipse, but it is certainly a valid argument.  If all you want to do is run the application, why go through all the work of using an IDE when you can have the app up and running using the command line by the time your IDE starts?  I have embraced this pattern in my own projects, so much so that I have created projects that can be cloned, built, tested, and deployed to the cloud with 2 commands from the command line.

I can understand those who view the command line as a step backward in simplicity.  You have to remember commands, you can easily screw things up when typing them, installation of command line tools can be a pain, I understand all of this and have been bitten by them many times.  However, the productivity gains you can get are tremendous.  I am not saying the command line is the only option, in fact I don’t exclusively use the command line, there are many times where I still go back into Eclipse.  Recently though I have integrated the command line into my developer toolbox and I have found that it has made me more productive than I was before.  If you are not a command line user today I hope you consider using some command line tools in the future and don’t try and avoid them.  If you spend some time upfront learning the tool I am sure you will find it only makes you a better developer.

Using Your Domino Data In Apps Deployed To Bluemix

Over the past few weeks I have done presentations on Bluemix at two ICS user groups, MWLUG and ICONUK.  I did pretty much the same presentation at both mainly focused on introducing developers to Bluemix.  Obviously, since these user groups are focused mainly around ICS, there is interest in how Domino and XPages fits into the Bluemix story.  Well as of right now you cannot deploy your XPages apps to Bluemix.  However, Kramer Reeves announced at MWLUG that ICS is investigating how to make this dream come true.  As we all know an investigation is no guarantee, so what is a Domino developer to do in the mean time?  While you can’t deploy your XPage applications, there is no reason why you can’t use the data stored in your NSFs.  You just need to use another runtime, such as Java, Node.js, Ruby, PHP, or any other runtime Bluemix supports, to build the front end and business logic of your application.

So how do you do it?  Well you start by familiarizing yourself with Domino Access Services.  Domino Access Services (DAS) essentially allows you to access and manipulate the data within your NSFs over HTTP using REST.  The good thing about DAS is that you can get this functionality without having to write any code.  You essentially enable DAS on your Domino server and then enable it on the NSFs you want to access over HTTP.  This is all spelled out in the documentation that can be found here.  Once you have DAS enabled any application that has an internet connection can access and manipulate the data within your NSF, this includes mobile apps, web apps, or any app deployed to Bluemix as long as the Domino server is accessible to the public internet.  All you need to do is make HTTP requests.

However there are many situations where your Domino server many not be accessible to the public internet, what do you do then?  Your first instinct might be to try to setup a VPN connection.  Well that is not possible with Bluemix because Bluemix is a PaaS.  You can’t even SSH into the machine your app is running on in Bluemix never mind setup a VPN connection.  The good news is that there is a service in Bluemix called Cloud Integration that you can use to connect to pretty much any server that might be running on a private network or be behind a firewall.  I wrote a separate blog post on using this service, you can read more about it here.  By using the Cloud Integration service in Bluemix you can then use the REST APIs on your Domino server from your Bluemix application even if those REST APIs are not exposed to the public internet!  Pretty cool stuff.

To demonstrate this I have created a short video showing you how.










In addition my session from MWLUG was recorded, so you can watch that as well.









Finally you can find my slides from MWLUG on SlideShare.

Deploying Your Hybrid Cloud Apps Has Never Been Easier With Bluemix

Public clouds are great.  They offer great elasticity and cost savings, and in the case of a PaaS like Bluemix, allows us (developers) to forget about maintaining any infrastructure and focus in on our code.  However we all realize that public cloud can’t be used for everything.  There are some applications and services that must remain in our own data centers on private networks.  The reasons why vary, maybe it is too much work to move the resource to the cloud, or maybe the data in the resource is too sensitive to risk exposing outside of your firewall.  Whatever the reason may be, you are bound to come across a scenario where you need to access private resources in your public cloud applications.  What are your options?  One option is to try to setup some type of VPN and create a secure connection between the public cloud and your private network.  This is probably the route to take if you are using an IaaS provider like SoftLayer to run your application.  With a PaaS this is not possible, you don’t have access to the machine your application is running on or the network it is using, so if you choose Bluemix to deploy your application what are your options?

Luckily Bluemix has a solution for this problem and it is called Cloud Integration.  The Cloud Integration service uses something called secure connectors to talk securely to your applications running behind the firewall.  These secure connectors run behind your firewall and establish a tunnel to the Cloud Integrations service (or Cast Iron Live).  The key here is that it is the secure connector is establishing the connection to the Cloud Integration service in Bluemix and not the other way around (this works on the premise that your servers running behind the firewall can talk to servers running in the cloud while servers in the cloud cannot talk to servers running behind your firewall.)  Once the Cloud Integration service knows about your server via the secure connector and a tunnel is established, your Bluemix app can use the Cloud Integration service to access data from your server behind the firewall.  Out of the box the Cloud Integration service has secure connectors for DB2, Oracle, and SAP, however you can use Cast Iron Live to connect to a wide range of services on a private network.

I make it sound very simple above, and it is, but your need to understand how everything works to make it click :)  Below is a number of videos walking through how you can use the Cloud Integration service to expose REST APIs behind your firewall to an app running in Bluemix.  I chose REST APIs because it is something almost every developer is familiar with and has not ties to a specific language or stack.  Anyone can write REST APIs in their favorite language to expose the data the need to their cloud based applications.

Creating A Secure Connector

Creating Your Orchestrations

Using Your Cloud Integration APIs In A Bluemix App


Bluemix Session At MWLUG



Tomorrow I will be heading out to Grand Rapid MI to attend and speak at MWLUG (Midwest Lotus User Group).  If you are attending and would like to learn more about Bluemix, IBM’s new platform for deploying applications to the cloud, be sure to stop by my session at 11AM on Thursday.

Achieving Developer Nirvana With Codename BlueMix
BlueMix is a platform for composing and running virtually any application in the cloud without having to worry about the hardware, software, and networking needed to do so. This means that developers can be left to do what they do best….CODE! By eliminating the need to deal with the infrastructure typically required to deploy an app to the cloud, and providing a catalog packed with services from IBM and its partners, BlueMix allows developers to get their apps in the hands of their users with the lightening speed, quality and innovation their users demand. It doesn’t matter if your next app is targeting web, mobile, or the internet of things, you too can achieve developer nirvana with BlueMix, and it all starts by attending this session!

Unlike most of the other sessions at the conference, mine is not directly related to IBM Collaboration Solutions, however I do have a nice surprise to tie things back to the ICS community.  There is no reason why you can’t deploy applications to Bluemix that use products from ICS ;)  I am not going to give you the details here, you have to come to my session to find out!!!

Webinar: Building Highly Scalable Applications With Bluemix

The elasticity of the cloud is a huge selling point for most developers when considering where to deploy their applications.  The ability to add and remove instances of your application based on the load against it saves you a lot of time and money.  However you can’t just deploy any application to the cloud and expect it will behave properly when scaled horizontally.  In fact, if you didn’t think about scalability when building your application chances are your application will break when scaled.

Luckily if you keep scalability in mind when building your application there are a number of patterns you can use to make sure your application will scale flawlessly in the cloud.  On August 19th I will be hosting a webinar going over many of these patterns and how you can use them when building your next cloud application.  You can register for the webinar here, and join your fellow developers on August 19th to learn how to build applications that scale.