Php app on Open Ondemand

“Increase number of languages to build and deploy apps in. OnDemand web apps are limited to apps written in Ruby, Python and Node. We want to extend this to other languages like PHP and Java.”

I am bringing up a web application thorough Passenger app or batch connect (interactive) app. The Web application is written in php + java script. In Open Ondemand roadmap, ondemand 2.0 will support PHP and Java. Is OSC already supporting PHP? Can you share the methods to use PHP through Passenger app or interactive app?

Thank you!

If you want to have an interactive app written PHP where the web app is made available to launch in OnDemand through an “interactive app plugin”, whose sessions are started by users typically through a batch job, then you can use any language as long as you understand how to start that web server. There are several challenges with this:

  1. If the web app generates non-relative URLs in its HTML responses, you need to be able to configure the web app to know about the suburi it will be served from, which is created dynamically during job submission
  2. You need to configure some type of authentication for the app. If the app doesn’t support it by default you could stick a sidecar proxy in front to provide that authentication. We did that to launch an R Shiny app and there is an example of providing an authenticating proxy for using Tensorboard from Stanford RC.

If you are interested in launching web apps on the OnDemand web-host on-demand, similar to how the dashboard, files, shell, job composer, and active jobs apps launch, that is what this Scalability goal refers to with “extending the number of languages supported”.

For this, I’ve experimented using Passenger Generic Language Support within OnDemand to launch an app written in Go, and at OSC we are successfully using Passenger GLS outside of OnDemand to launch Shiny R apps in production.

The issue with GLS as it relates to OnDemand is that it starts the web processes listening on a TCP socket instead of an IPC socket like Passenger does with Ruby, Python, and NodeJS so that creates a security issue that we need to first solve. We are talking about placing the PUN in a container for 2.0 to solve this, but we haven’t done that yet.

After that is done, I imagine we would modify nginx_stage so that if a bin/passenger_app_start exists, then we add a config for GLS that looks something like:

copy  passenger_app_start_command "/path/to/app/bin/passenger_app_start $PORT";

So for PHP you would need a web server that can serve that app, and then Passenger would launch that app using the provided command.

Thank you very much for these detailed explanations.

I already deployed R shiny server through batch connect. You are recommending this shiny server https://github.com/OSC/bc_osc_example_shiny, while I am using https://github.com/OSC/bc_rshiny Is my understanding correct that this rshiny does not provide a sidecar proxy in front to provide the authentication?

I will explore the tensor board implementation.