Best way to deploy an R script with Meteor -
i'm using syncedcron call script written in r using npm.require('child_process'). works fine on local, i've worked out relative path between script , bit of .meteor folder gets called from.
this breaks in production though because app gets bundled , path changes. i'm using mup deploy amazon, , far can see doesn't take r script it.
are there neat solutions deploying non-node bits of code meteor?
good question. here idea below.
have installed r on amazon? if , use unix system ubuntu, use
whereis
path execute r on amazonfor r script, store in
/private
folder , useassets
all files inside top-level directory called private accessible server code , can loaded via assets api. can used private data files , files in project directory don't want accessible outside.
assets allows server code in meteor application access static server assets, located in private subdirectory of application's tree. assets not processed source files , copied directly application's bundle.
static server assets included placing them in application's private subdirectory. example, if application's private subdirectory includes directory called nested file called rscript.txt inside it, server code can read rscript.txt running:
var rscript = assets.gettext('nested/rscript.txt');
you can pass script along input when execute on server.
(ref)
Comments
Post a Comment