2018- The Year I Met PAAS

Sophie Burke
4 min readJan 21, 2018

So recently I had a very unique experience with cloud platforms. I wanted to explore the world of cloud hosting for a few of the basic applications I’m working on. As I chatted with friends about hosting options, like Google and AWS, someone mentioned Cloud Foundry.

I went searching for Cloud Foundry and found this from Pivotal.

They offer a 30 day free trial to try out hosting apps on cloud on Cloud Foundry.

I am presently woking on a master’s degree that involves topics such as data science and Python.

I wondered how I could venture to use Pivotal Cloud foundry to host my basic Python apps. Granted I would need more than 30 days worth of time to keep my apps and account alive until graduation, but I still wanted to experience how this cloud works.

Pivotal Cloud Foundry is a PAAS, that’s Platform as a Service. That means I don’t have to care about hosting machines or setting up firewall rules to be accessible to the outside world and the other configurations that are regularly done when installing an app on a cloud like AWS or Google or Azure.

I have some experience setting something up on AWS from last year. So when I read that all I had to do was to push apps to the cloud I was both excited and confused.

Excited as I didn’t have to manage anything on my own. For example, what if my cloud machine instance went down ? What if my app stopped running ? I didn’t have to worry about these things. Yeay!

Confused as I have not experienced working on a PAAS-type environment at work. I am more used to cloud platforms that need a lot of configuration before anything actually does work.

So I created a new account on Pivotal url below and selected signing/register top right for new accounts.

This will take you to a form which you fill and get registered. It will automatically log you into the Pivotal web service page.

This is what it will look like as below. It shows there are 0 apps in my space called “Develoment”. SophiaBurke is my Organization name. There can be multiple spaces like “development” within the same Org. So it is multi-tenant from the start.

Once you are inside this page, download the command line utility cli binary. You will find it under the Tools tab in the left menu.

So how do you Push apps into cloud foundry ?

It took me a while to understand and figure out that the Cli utility is needed to push apps from my mac machine to the Pivotal Cloud PAAS. Once installed you login to cloud foundry. My command line console is green window. It will ask for your email which you registered when you created a new account and type the same password here you chose during registration.

So download and install your flavor of the cli for PC/Mac.

Once I installed the cli on my mac, I was ready to push apps.

How do you push apps? What does push even mean here ?

With a cloud PAAS like the one shown here, all you do is to bring your apps. Much like either you can cook food yourself vs buy it. Not that I know about cooking food — no, just kidding, I do.

At any rate, PAAS simplifies this part for you. All you do is develop apps and bring it to Cloud Foundry.

I will show you what pushing an app means now.

So in my Github account, I have gone ahead and created a Python flask app. I chose Flask since I am presently playing with it.

Here is the url for Python flask. It allows us to create api’s in Python.

So I looked up existing examples of flask on Cloud Foundry and assembled it into my Git Repo here. You can clone it and just push your app.

https://github.com/sophburke/Python-CloudFoundry

It has a main file : hello.py . This is where our program logic is created. Notice the default route (‘/’) and the function that wires into it called hello_world().

Procfile and txt are instructions to the Python compiler.

Manifest.yml is another important file. When you type cf push , your code is uploaded to cloud by the cf cli and the manifest file provides additional instructions to the cli.

In our case the manifest file has these contents

— -
applications:
- name: hello-world-flask
memory: 128M

Every app on Cloud Foundry has a name and in our case we are also setting a memory default of 128 mb.

Once the app is uploaded to Cloud Foundry, we can see it here:

https://hello-world-flask.cfapps.io/

How easy was it ?All I did was just push my code. Finally I will be able to put more stuff there, but for now I learnt this new way of app development with PAAS.

Happy coding in 2018!

--

--