Friday, July 6, 2018
Testing the IBM Cloud
Although I have a Google Cloud free account, I recently decided to try out IBM's Cloud Lite account. I wasn't just interested in learning, I was also wondering if it could be a viable backup to my Google cloud account. I'm not concerned with reliability, rather I'm concerned with dependability, since free services could be discontinued or otherwise shutdown.
The Cloud lite description says it includes, "256 MB of instantaneous Cloud Foundry runtime memory, plus 2 GB with Kubernetes Clusters". I hadn't heard of Kubernetes before, but from a quick review of their web site, it appears to be a platform for deploying scalable docker images. For comparison, the Google compute platform which provides a Linux (Ubuntu 16.04 in my case) VM with 512MB of RAM and 30GB of disk. I prefer the simplicity and familiarity of a Linux VM with full root access, but I thought there still should be a way to run a LAMP image with Kubernetes.
The IBM Cloud dashboard allows you to choose from the available services based on your account options. Choosing the IBM Cloud Kubernetes Service from the dashboard links to another page to create a cluster. However clicking on the create cluster button brings up a new page with the message: "Kubernetes clusters are not available with your current account type." I opened up a support ticket about it, but after 10 days there has been no action on the ticket.
Since the Kubernetes wasn't working, I decided to try Cloud Foundry Apps. In order to use cloud foundry, it is necessary to download their commandline tools. With the Google cloud you get access to a development shell separate from your compute instance VM, and that shell has all the google cloud tools pre-installed. This is one way the Google cloud is easier and simpler to use.
Instead of setting up a bare cloud foundry app, I decided to use their boilerplate Flask application. The setup process in the web dashboard lets you choose a subdomain of mybluemix.net, so I chose http://rd-flask.mybluemix.net/. In order to modify the app, IBM's docs instruct you to download the sample code, make changes locally, then push the changes to the could using their CLI tools. However, at least in the case of the Python Flask app, there was no download instructions, and no link to the sample code. After going through the CLI docs, I found it is possible to ssh into the vm instance for your app using "bluemix cf ssh". Yet any changes I made to the code online were wiped whenever I restarted the service.
After some more research, I realized this problem is several months old. In the end, I was able to find an earlier version of the template code, fork it, and updated it to match the code running in the app container. The repo I forked specified "python-2.7.11" in runtime.txt, but the cloud foundry only supports 2.7.12 & 2.7.13 (along 3.x). At first I changed it to 2.7.12 in my fork, but then I removed the runtime.txt so it will use the default version of python. I also added some brief instructions on uploading it to the IBM cloud. You'll find the fork at https://github.com/nerdralph/Flask-Demo.