Question-and-Answer Resource for the Building Energy Modeling Community
Get started with the Help page
Ask Your Question
3

Running openstudio ruby scripts remotely through a web interface

asked 2015-06-17 14:16:55 -0600

dpud12's avatar

updated 2017-08-05 13:30:22 -0600

My team is developing a web application that takes a few user inputs, and then based on those inputs modifies an OpenStudio model through ruby measures, runs the OpenStudio model, and then reports the outputs. We are using ASP.NET to develop the web app (as a team member has extensive experience in this language, and none in Ruby on Rails), however, whenever we attempt to run a ruby measure remotely through the web app it never runs the ruby script. What is extremely peculiar is that the web app does run the ruby script when it is run on the local host. We are at a loss for what could be causing this failure when running remotely, and have spent a significant amount of time already trying to debug to no avail. Any idea what the problem might be, or have seen any documented cases of running a ruby script through a web app? Thanks in advance for any insights.

edit retag flag offensive close merge delete

Comments

Have you resolved this yet?

Are you trying to use the C# bindings to OpenStudio? Or are you running OpenStudio measures via a system call?

Dan's comment is valid around checking the log files. I would also check security settings. Are you using IIS? If so you will probably have to allow IUSR access to the run directories for the measures and probably OpenStudio.

long's avatar long  ( 2015-06-30 13:02:57 -0600 )edit

We are running via a system call, and we did solve it, see my answer below

dpud12's avatar dpud12  ( 2015-07-02 11:43:13 -0600 )edit

3 Answers

Sort by » oldest newest most voted
5

answered 2015-07-02 11:40:54 -0600

dpud12's avatar

There were two main issues that were resolved in order to fix the OpenStudio and Ruby remote server bug. The first one was that the path name to the ruby files could not contain any spaces, so any spaces found had to be replaced with underscores. This resolved the issue of calling the Ruby code but did not resolve fully executing the code. This was solved by integrating the setup files of Ruby, OpenStudio and Energyplus with ASP. ASP.net doesn’t have proper permission to access files outside the application folder.

edit flag offensive delete link more
6

answered 2015-06-17 15:25:28 -0600

updated 2015-06-30 13:03:29 -0600

long's avatar

The VirtualPulse project has made a similar web application that runs measures, though they are not using ASP.NET. I can't really comment on why your system isn't working, it's possible some additional security settings are enabled in the production environment? You should look through your log files and see what you can find.

edit flag offensive delete link more
-3

answered 2015-06-17 15:02:37 -0600

updated 2015-06-17 15:07:23 -0600

You may want to consider using our framework for large scale anaylsis, even if you are doing smaller runs. You can setup vagrant on your server instead of relying on third party hosting from Amazon.

I have an example programmatic modeling repository setup that uses a ruby rake task to generate the analysis json instead of an Excel spreadsheet. I use this approach for integration testing of a string of measures (more robust than the basic test that comes with each measure).

Here is a link to one of the example workflows. You could gather user input via a web interface to populate this.

Back to your specific issue, are you getting a specific ruby error, like the measure not finding OpenStudio?

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Training Workshops

Careers

Question Tools

1 follower

Stats

Asked: 2015-06-17 14:16:55 -0600

Seen: 513 times

Last updated: Jul 02 '15