0

I have a simple cloud IDE,I want to make it able to build and run applications remotely, the target application's source files will be in a remote server in isolated virtual machine (e.g Windows 8.1,or Ubuntu 14.04). It's not difficult to build that application but how to run it and view its output to users ?

What if it's a desktop application (suppose it's written in C# or Java or Python)?

Note: users access there applications only using browsers (e.g Firefox,Chrome,...)

Edit: desktop application may contains GUI stuff not only console ;)

Ahmed T. Ali
  • 1,021
  • 1
  • 13
  • 22
  • Is the output stored in a log file or in some other way? Regardless, you will need to build a separate web server which monitors the output and displays it if you want to access it from a browser. – Martin Lehmann Jan 28 '15 at 09:39
  • 1
    @MartinLehmann it may contains GUI items that need user events – Ahmed T. Ali Jan 28 '15 at 09:48

2 Answers2

1

You need a web application.Now this web application when loads send request to backend code that backend code will do SSH to remote machine and read the file from specific location.Now that read stream will be send back in response and displayed on web based UI. In these type of application few thinks matters.

1) Like if you whole file at once then it will take time to display that content to user.Better idea will be read around 100 lines at once and when user scroll down then again send request to web server to read next 100 lines in this way you can decrease response time and better user experience.

Innovation
  • 1,514
  • 17
  • 32
  • 1
    is it applicable when application contains GUI items (like swing for java,or pyQt) ? – Ahmed T. Ali Jan 28 '15 at 09:50
  • No for web based application there is no need to use any GUI components.You can just use html and css to display results returned by backend code. – Innovation Jan 28 '15 at 09:53
  • I got confused now.what is the exact scenario you want.Do you have any application (swing based) and you want to convert it into web based? – Innovation Jan 28 '15 at 09:55
  • 1
    I have an online IDE, and I want to make it able to build and run application remotely and show the output in the browser even if it's a desktop app – Ahmed T. Ali Jan 28 '15 at 09:58
  • 2
    For that you have to convert desktop based application into web based and run web server on the remote machine.So that you can run internal file management etc directly over there.Another idea can be to use tools like teamviewer to view results. – Innovation Jan 28 '15 at 10:01
  • 1
    I heard that Ajax swing (http://www.creamtec.com/products/ajaxswing/) convert swing application to web application, Is there any other tool for other languages ? – Ahmed T. Ali Jan 28 '15 at 10:05
0

Each of the languages you mentioned offers a Web Services framework of some kind. Pick one, and implement something that a) starts your app, b) shows the output. Depending on the processing time (how long it takes to complete) you might even get away with just one.

You can go for a self-contained, standalone service:

Alternatively, you might use a container (server) for your app, like Apache with mod_mono or IIS for C#, Tomcat, Jetty, Jboss for Java, Apache with mod_wsgi for Python (just examples).

The web service would probably sit on the remote machine, so it could use system calls ('command line') to run your core app, and then it would send the results over http. Since you mention GUI, there could be more layers to the solution:

  1. The GUI - static HTML, desktop app, sending requests to the 2nd layer, say displaying dropdowns for parameter1 and -2
  2. The Web Service - takes the params from the request, say http://remote.machine.land/start/app?parameter1=X&parameter2=Y, runs a local command like /home/users/myapp.sh -parameter1=X -parameter2=Y
  3. The application itself - not necessarily aware of any internet out there.

This way you stay free to change/enhance any part at a time, call the 2. layer programmatically, introduce load-balancing, etc. 3.

Community
  • 1
  • 1
ptrk
  • 1,800
  • 1
  • 15
  • 24