blog single gear

100-day Challenge #011: Running chatapp on Cloud Foundry

Translator’s note: This is the fourth article of the series “Cloud Foundry 100-day Challenge selection”. “#011” in the title means that it is 11th (published on June 18, 2015) in the original Japanese series.

The 11th topic of “Cloud Foundry 100-Day Challenge” is chatapp, which is a chat application written in Python. Let us deploy it and enjoy some chatting.

Basic Information

Retrieving Source Code

$ git clone

Enter into the chatapp directory.

$ cd chatapp/

Pushing Application

Since this is a simple chat application in Python that does not even use a database, let us push it as is first.

$ cf push chatapp
Creating app chatapp in org ueno / space test1 as ueno...


As we let it run, a Python environment is being built, the deployment proceeds, and ..


requested state: started
instances: 1/1
usage: 256M x 1 instances
last uploaded: Wed Jun 17 06:14:50 +0000 2015
stack: lucid64

     state     since                    cpu    memory        disk      details   
#0   running   2015-06-17 03:16:46 PM   0.0%   70M of 256M   0 of 1G  

The deployment has been successful, and the application has been started!

Checking Application Behavior

Anyways, the application is running, so let us go ahead and access the URL first.

Initial Screen (User Entry)

Enter user name.

Chat Screen

Enter with multiple users, and chat away.
You will be able to enjoy chatting in real time.

In Conclusion

And just like that, with merely a simle push command! Today, we have confirmed how easy things can be with Cloud Foundry.

By the way, today’s application should require the python-buildpack , since Python is used. How was this processed? The answer is that the buildpack was already included, by default, in the bosh-lite environment which we used. Let us confirm.

$ cf buildpacks
Getting buildpacks...

buildpack          position   enabled   locked   filename
java_buildpack     1          true      false
ruby_buildpack     2          true      false
nodejs_buildpack   3          true      false
go_buildpack       4          true      false
python_buildpack   5          true      false
php_buildpack      6          true      false

If your current environment doesn’t have the python-buildpack, please specify -b when executing the push for the application. Alternatively, you can also create a manifest file and write in the specifications, like you found in the end section of the fifth article. (Translator’s note: the “fifth article” indicates the one in the original Japanese articles, which is Running 243 Game on Cloud Foundry.)

The Environment Used in this Post

Written by: Isoo Ueno