using octave script with Heroku app - node.js

I have a web application that I am trying to push to Heroku that relies largely on calling an Octave script. For development/testing, I am using an EC2 instance and node.js. On the EC2 instance I have installed Octave.
However when I push to Heroku and try to call this octave script (via ajax call), I get this error:
https://devcenter.heroku.com/articles/error-codes#h13-connection-closed-without-response
I read that Heroku runs on AWS instances, so I am assuming that it is possible to somehow call an Octave script, since I have done it on my own EC2 instance.
Scattered documentation makes me think that I will have to tell Heroku to install Octave when I push to Heroku, but I am not sure how to do this. Would it be in the node start script (and if so, how)? Or is it something else that I am missing?
EDIT: I am thinking it may instead have to be done through the Heroku buildpack -- can anybody confirm this?
EDIT 2: I think the answer is that I need an Octave buildpack, similar to:
https://github.com/virtualstaticvoid/heroku-buildpack-r
but for Octave instead of R. It looks like one does not exist so I will try my hand at making a custom buildpack.

Yes, you have to use a buildpack. I made one that allows you to run Octave scripts:
https://github.com/wclark3/heroku-buildpack-octave-dynare
It also includes Dynare, a macro-modeling package. So if you come across this answer and you only need Octave, just fork the repo and take out the lines that include Dynare from bin/compile.

Related

WebStorm remote interpreter not working with TSLint

I followed this link to setup a remote interpreter with Docker in WebStorm, now I would like to use it as the interpreter for the TSLint plugin, I get this in the upper window:
But when I try to configure the interpreter I only get the option for a local interpreter.
Is there any way to configure it to use the remote one?
This is what I see:
Not possible ATM. Here is official explanation: https://youtrack.jetbrains.com/issue/WEB-25411#comment=27-1906237
This is the correct behavior described in Help (https://www.jetbrains.com/help/webstorm/2016.3/node-js.html)
The reason is that the project Node.js interpreter is used in many places - to run TypeScript service/compiler, external linters, etc. And all these services require local Node.js interpreter, they can't be run remotely. The only place where remote interpreters are supported is Node.js running/debugging. That's why setting up remote interpreter is only possible from Node.js Run configuration
There are requests to add support for remote execution for Karma/Mocha/ESLint -- see those tickets -- maybe you will find and answer there (or create new Feature Request ticket if these tickets below do not have clear answer/not suitable for your needs):
https://youtrack.jetbrains.com/issue/WEB-20824
https://youtrack.jetbrains.com/issue/WEB-14665
https://youtrack.jetbrains.com/issue/WEB-22179
On related note (this comment and around):
https://youtrack.jetbrains.com/issue/WEB-22572#comment=27-1836383
If so...our Docker integration isn't currently for that use case. Everything to do with the development – linters, build tools, test runners, ts language service, angular language service, angular cli, react project generator, react native, etc. – runs against a local NodeJS and node_modules.

How does the openshift build system work?

I'm struggling with how to set up an openshift build, where I have two projects in one. Both (the frontend and the node backend) have their own package.json but only the latter needs to be started.
I'm using the hooks in the .openshift directory, but there seems to be more 'magic' going on in the background. For example nowhere in my build code there is an npm start declared. Openshift seems to run the command automatically. Is there maybe a way to deactivate this behaviour? What is going on the background? Is the build-process defined by the package I'm using? And if so, how to change it?
If all fails, I really would like to use an external build-server. Is that possible?

OpenShift Online, NodeJS, Jenkins, and package dependencies - can someone explain?

I'm running a NodeJS app on Openshift using Jenkins for building deployments (and I'm pretty new to both Node and cloud-based servers). My app depends on a package that has a binary component, so I can't just check it into git - it fails when it's executed on the server. I'm wondering what's the best way to deploy these sorts of dependencies. I see that there is an $OPENSHIFT_DEPENDENCIES_DIR (as well as $OPENSHIFT_BUILD_DEPENDENCIES_DIR), but I can't find any information about how (or if) these can be utilized for node modules. It would be great if I could keep all my dependencies on the server and out of my source tree.
Thanks!
Update: I forgot to mention that I need to apply a patch to the package in question, which is why I can't just rely on it being auto-installed via package.json. Plus, it seems awfully redundant/slow to rebuild all your dependencies on every deployment.
I'm also new to nodejs. I've been playing with nodeJs for about 6 months from now. As for my personal experience nodejitsu is the best cloud-hosting service for nodejs. As I said so due to the following reasons.
You can simply install jitsu command line in your terminal
Your app can be deployed with all the dependencies and databases using the package.json file
They support all the types of sockets either
A very good alternative for jitsu is heroku But sometimes heroku fails with Socket.IO and stuff.

Environment management Node.js plugins/methods for Heroku apps?

It seems that my workflow would be improved if I had some way to automatically manage my environment variables so I can have different sets load automatically depending on if the server is running locally or running on Heroku.
What are my choices? Heroku must be using something on their end, because there are variable like local.env.PORT. What are they using? I was thinking that maybe if I use the same thing it would be easier.
I believe you can use the Foreman ruby gem with Heroku even if you are deploying apps using Node.js.
Foreman allows you to specify different application configurations on your local and remote application servers. I use it to control and manage my workers, web instances on Heroku for my rails apps.
Here's a link to a Heroku page showing how to manage environment variables using foreman:
https://devcenter.heroku.com/articles/config-vars
You're looking for something like figaro which is quite useful. There is a node-figaro project inspired by figaro, but the docs are unclear on how to actually use the project to initialize environment variables.

Is it possible to control Heroku via a Node.js app (like the Heroku Ruby gem does)?

I'm used to being able to control my Heroku app instance using the Heroku gem. Is there a Node package that provides the same functionality? I would like to create some Hubot scripts for doing things like restarting my app.
Just grab the source code (https://github.com/heroku/heroku) and look at the API calls and replicate this in your node.js code
There's nothing public AFAIK but the Heroku gem merely interacts with Heroku's (unpublished) REST api - I'm pretty sure it would be easy to reverse engineer the few calls you'd need from the existing Ruby Gem so you can perform similar actions via Node.

Resources