LiveBlog on a Cloud Platform
  • Hi,

    I am just investigating on how to install liveblog on a cloud platform (PaaS).

    We are using Cloud Foundry in my company and I have some isues trying to install it there.
    I am trying the manual for the development server. (https://github.com/superdesk/Live-Blog/blob/master/INSTALL.md)
    My problem is that I need to set the port via an environment variable inside the application.properties. The port is known on startup and not before. Unfortunately I am not so familiar with Python.

    I am wondering if somebody already tried to install it on PaaS like Cloud Foundry and has maybe some hints.

    Greetings,
    Alex
  • 4 Comments sorted by
  • i think you can go with a wrapper script which will fill the configuration file with the right port and then start the app
    Innovations developer, Sourcefabric
  • Just in case somebody wants to try it also on Cloud Foundry.
    With the following steps I made it running.

    First follow steps in https://github.com/superdesk/Live-Blog/blob/master/INSTALL.md until the end of the installation chapter.

    Go to directory ally-py/live-blog

    Create following files for Cloud Foundry to detect the right buildpack:

    runtime.txt just containing: python-3.2.0

    requirements.txt leaving blank

    Create a start.sh file with following content.

    echo Port:$PORT
    sed -i 's/server_port: 8080/server_port: '"$PORT"'/g' distribution/application.properties
    sed -i 's/server_url: localhost:8080/server_url: app-name.yourdomain.com:80/g' distribution/plugins.properties
    python3.2 distribution/application.py

    The start.sh script is doing the following:
    It is replacing the port in the application.properties with the right one used by Cloud Foundry on startup. It replaces the server_url where liveblog searches for javascript resources with the application url. It starts the application.

    The application can be pushed to Cloud Foundry by using:

    cf push app-name -c "sh start.sh"

    This instruction is without warranty because I did not test all functionality.
    Furthermore the production way of installing liveblog is described by using mongrel2. I am not sure this will be possible on Cloud Foundry.
    Post edited by Alexander Blotny at 2015-02-17 11:36:22
  • Thanks for your input, Alexander!

    By the way, I want to inform you what in upcoming Liveblog 3.0 we already have configuration by environment variables and in general more common workflow (like using already mentioned requirements.txt and upraising in popularity Dockerfile-s)
    Innovations developer, Sourcefabric
  • That sounds interesting.
    Is there a timeframe when version 3.0 will be ready?