Greetings,
Apologies if this has been addressed elsewhere: having problems finding it if so.
We have RStudio Connect deployed on a server, and many of the assets we will be publishing to rsconnect will need access to different slices of a large dataset which is more-or-less stored as an HDF5 file.
I was wondering if we could host this HDF5 file on the local HD of the server that is serving rsconnect, and have our published assets reference that dataset by its local path on that server.
Could we, for instance, copy the file somewhere in RStudio Connect's Server.DataDir
directory, and then have our assets (1) detect if they are running within RStudio Connect; and (2) conditional on that rig up a path to the HDF5 file in the Server.DataDir
, or something similar like that?
For instance, if we assume Server.DataDir
is kept to its default value of /var/lib/rstudio-connect
, could I just have our server admin drop my data.h5
file in there and do something like this somewhere in a shiny app I want to deploy to rsconnect?
if (Sys.getenv("R_CONFIG_ACTIVE") == "rsconnect") {
h5.path <- "/var/lib/rstudio-connect/data.h5"
} else {
h5.path <- "/somewhere/on/my/laptop/data.h5"
}
dat <- rhdf5::h5read(h5.path, "foo/A")
If not, is there something else we could do along those lines? We wouldn't need any type of security / user access restriction around accessing that particular hdf5 file, and the assets we publish to rsconnect would not need to modify/write that file either.
I'm not the admin of the server, so can't play with different flavors of what I'm asking / proposing here, so any insight anyone can provide that I could pass along would be greatly appreciated.
Thanks!
-Steve