Recent changes to the Cloud Foundry stacks supported by IBM Bluemix have led to a number of issues for users. I’ve helped users diagnose and fix issues that have occurred due to a mistmatches between the platform stack, applications and the buildpack. Learning a number of techniques for helping to discover and resolve these issues and I wanted to share them with everyone else.
Running on Cloud Foundry’s Platform-as-a-Service solution, we take for granted that low-level concepts like operating systems are abstracted away from the developer.
However, when we run into issues it can be necessary to jump into the weeds and find out what’s going on under the hood…
What are Cloud Foundry “stacks”?
According to the documentation…
A stack is a prebuilt root filesystem (rootfs) which works in tandem with a buildpack and is used to support running applications.
Think of the stack as the underlying operating-system running your application. This will be combined with the buildpack to instantiate the runtime environment.
Most users don’t have to care which stack they are running on.
However, if your application needs a specific version of a system library or you want to verify a specific command line application is installed, you may need to dig deeper…
What “stacks” does my platform support?
Using the Cloud Foundry CLI, issue the following command to see what stacks are available on the platform.
1 2 3 4 5 6 7 8
Stack information contains the unique name for each stack and the underlying operating system version.
Which “stack” is my application running on?
Since v6.11.0, the stack for an application has been shown in the CLI application info output.
1 2 3 4 5 6 7 8 9 10 11 12 13 14
How can I choose the “stack” my application runs on?
Users can set the stack for an application using the -s command-line parameter during deployment. The stack identifier should match one of the names shown in the output from the cf stacks command.
How are the “stacks” defined?
How can I poke around inside a “stack” locally?
Using Docker, we can easily pull down the same “base” operating system used for a specifc “stack” and run locally.
For the cflinuxfs2 stack, we can pull down the Ubuntu Trusty image and run a terminal inside it.
How can I easily migrate existing applications to a new stack?
Rather than having to re-deploy each application separately, there’s a great CF CLI plugin to automatically migrate all your applications from lucid64 to cflinuxfs2.