Pragmatism in the real world

Setting up IBM Cloud Object Storage

For a little website that I'm writing, I thought that I'd use IBM Cloud Object Storage (equivalent to AWS S3) as I'm generating the pages using OpenWhisk on IBM Cloud Functions. The documentation is quite good if you want to use the website, but is a bit spread all over the place if you're using the command line, which is how I do things. As Cloud Object Storage is a bit of a mouthful, I'll… continue reading.

Custom URLs for a Cloud Foundry application

Now that I have my application deployed to Cloud Foundry, I need it to work with my own domain, such as bookshelf.akrabat.com rather than slim-bookshelf.eu-gb.mybluemix.net. We can do this via the command line which is useful. To do this we need to create a domain and then we can create a route. Create a domain To create a domain, we use the command cf create-domain {organisation name} {domain name}. For me, my organisation is "19FT",… continue reading.

CLI credentials for a Cloud Foundry database

If you need access to your Cloud Foundry database from the command line the easiest way to get a set of credentials is to create a service key. This is done using the command cf create-service-key {service-name} {key-name}. You can call the key anything, so to connect to my database that I created previously: $ cf create-service-key slim-bookshelf-db ROB_CLI Creating service key ROB_CLI for service instance slim-bookshelf-db as rob@19ft.com… OK Now that we've set up… continue reading.

Using PostgreSQL with PHP in Cloud Foundry

Having successfully deployed a PHP application to Cloud Foundry, I needed a PostgreSQL database for persistent storage. I found Lorna Mitchell's Connecting PHP to MySQL on Bluemix helpful and this article expands on that information. I want to create a cloud-based PostgreSQL database and connect it to Laravel's Eloquent in a Cloud Foundry application. This is how to do it. Create the database instance As I'm using Bluemix for my Cloud Foundry hosting, I'm using… continue reading.

Deploying a PHP application to Cloud Foundry

I recently had a requirement to deploy a Slim application somewhere. As I already have a Bluemix account, it seemed sensible to deploy it to their Application Runtimes service which is an installation of the Open Source Cloud Foundry project. This turned out to be quite easy, but there are a number of steps involved, so I'm documenting it here. Setup the CLI tools I'm a command line person, so did it all via the… continue reading.

Adding a user to your Bluemix space

I'm at the stage where I need to give another developer access to my IBM Cloud Functions actions. I'm not really an infrastructure person and I found the user management pages on the Bluemix console incomprehensible, so used the command line. This is how I did it so that I don't have to work it all out again. Add the user to your organisation These are the steps to add the user to your organisation:… continue reading.

Getting started with Serverless PHP

I've been interested in Apache OpenWhisk for a little while now and recently submitted a new feature to add PHP support to the project. As OpenWhisk is a serverless environment, most users do not run their own copy and instead use a commercial provider with IBMs Bluemix available now along with Adobes I/O Runtime and RedHat coming soon. As a result, my contribution, isn't practically useful until it's in production with a provider. Fortunately, and… continue reading.

Logging in to Bluemix via wsk

To set up the authentication for the OpenWhisk cli tool wsk you do this: $ wsk property set –apihost {host} –auth {key} > /dev/null $ wsk property unset –namespace > /dev/null The host and key are provided to from your OpenWhisk supplier. For Bluemix OpenWhisk, you can find it by logging in and then going to the Download OpenWhisk CLI page. To make my life easier, I use a bash function to swap OpenWhisk environments… continue reading.

Switching OpenWhisk environments

When developing with OpenWhisk, it's useful to use separate environments for working locally or on the cloud for development, staging and production of your application. In OpenWhisk terms, this means setting the host and the API key for your wsk command line application. $ wsk property set –apihost $host –auth $key (Of course, for live and staging, ideally, you will be using a build server!) For a Vagrant install of OpenWhisk, the host is 192.168.33.13… continue reading.