vjdorazio / TwoRavens

A web application for data exploration, statistical analysis, model construction and meta analysis tools, that integrates with Zelig and Dataverse.
http://datascience.iq.harvard.edu/tworavens
Other
1 stars 4 forks source link

rook application, configurable output directory for images and preprocess files #38

Open raprasad opened 7 years ago

raprasad commented 7 years ago

Note: without these changes, the production app cannot serve preprocess files and images.


Currently, (in dev mode), rook writes:

  1. images to the /rook directory
  2. preprocess files to the /data directory

To do:

Add R config file that sets the write functions to the following directories as well as creates the correct paths in JSON responses

  1. Dev mode.
    • Should point to the rook working directory under TwoRavens
      • rook_output_images = /rook/rook-files/images
      • rook_output_preprocess = /rook/rook-files/preprocess
      • server_name = http://127.0.0.1:8080 (included in JSON when serving images/preprocess)
        • JSON might have: http://127.0.0.1:8080/rook-files/images/423545.png
  2. Prod mode
    • These are absolute paths used in production
      • rook_output_images = /var/www/rook-files/images
      • rook_output_preprocess = /var/www/rook-files/preprocess
      • server_name = http://0.0.0.0 (this will change but have it 0.0.0.0 for now)
        • JSON might have: http://0.0.0.0/rook-files/images/423545.png
  3. Rook app to serve these files
    • Create an app to serve from the url rook-files; something similar to:
       R.server$add(app = File$new(getwd()), name = "rook-files")
    • Note: the directory served by this app will depend on whether it's dev or prod. e.g. prod might be:
       R.server$add(app = File$new("/var/www/rook-files"), name = "rook-files")`