When a simulation is submitted, the simulation template is staged (recursively copied and mustache files rendered) to a new directory underneath the user's dataroot specified by the RAILS_DATAROOT
environment variable. In development, a .env.development
file must specify the location. This is what our .env.development file commonly looks like:
$:~/awesim_dev/rails1 (port)$ cat .env.development
export RAILS_DATAROOT=$PWD/data
export RAILS_DATABASE=db/development.sqlite3
$:~/awesim_dev/rails1 (port)$
- The files in the dataroot are automatically made URL accessible.
- To build a URL to these files, see Resolving the URL to a results file of a simulation
- To read the file's contents, see Resolving the file path to a results file of a simulation
- Don't ever copy results back to
app/assets
! When the app is shared, this will be read only to the user and will not work. The purpose of the dataroot is to specify the location of the user's data that the app can manage.