Deploying the solution to the public.
In the context of being a data activist providing analytics to a small community (one city or region) and not expecting high traffic on that service, it does make sense to keep the solution running in Python and try to deploy the notebook IPython server to a cloud.
In future posts I will deal with solutions for high traffic, business-type applications.
PAAS vs IAAS
Although I am tempted to whip up my own charts on the differences between Platform As A Service (PAAS) and InfraStructure AS A Service (IAAS) but I will resist beating that dead horse and repost this good chart by the folks at IBM Cloud on Twitter https://twitter.com/IBMcloud.
As you can see from the chart above the steps required to deploy my python notebook into a cloud solution are summarized in the following diagram.
The benefits for deploying the solution into IAAS will be :
- Higher degree of control over the specific configuration of the notebook.
- Full usage of the underlying operating system services(or maybe this is a disadvantage !).
The benefits for deploying the solution into PAAS :
- Faster time-to-customer.
- Blocking users from making permanent changes to the notebook files.
- Quick deployment model allows for pushing changes to the service often. (Continuous Deployment).
Deploying the Solution
For the reasons outlined above I decided to deploy my solution on IBM Bluemix ‘Platform as a service’ and the starting point for us is to use the Python Service provided by bluemix.
To deploy my solution I followed pretty much the steps outlined by Peter Parente in his post on IBM DW
The most important tweaks I have done were.
- Changed the Memory requirements in the manifest.yml to 1GB (the application consumes a good amount of memory and crashes the default 128MB when it loads the initial CSV).
- Allowed for automatic deployment from a GIT repository so I can push my changes from multiple locations since the ‘download’ function of Cloud foundry was a little bit unpredictable.
The final Result
Now I can ask the business user who wants to study the City of toronto business licenses Issuance/Cancellation data to go to the following web page
You will be prompted for a password
Use the password : opensecret
The Python sheet will show up follow the following steps.
- Select First cell (Red Arrow) and click the Run button as shown
- A button called ‘toggle code’ will show up, click the button to hide the code from now on.
- Once the code disappear from the menu select ‘run all’ and wait for a few seconds while the data is loaded
voila .. that is all you need , now you can slice and dice the city licensing data using the Python widgets as provided
Through the past 4 blog posts I have examined the use of IPython notebooks as a tool to analyze government open data and provide answers to ad-hoc questions that could be used to empower communities and citizens and enhance collaboration between the government and the public.
Using cloud technologies like IBM bluemix the use of these analytics tools can be expanded to a larger population and used to allow the community to explore the existing data and build knowledge about the different aspects of the data available and how it may affect their communities.