It is possible to develop a shiny app base on shiny-server by using INLA

65 views
Skip to first unread message

wang dali

unread,
Aug 10, 2022, 11:53:12 PM8/10/22
to R-inla discussion group
Dear INLA developer, I am wondering if it is possible to develop a shiny app base on shiny-server by using INLA.

I have built a shiny app by using the INLA package, it works well on the local computers, however, it fails to progress when I submit it to a shiny server (Ubuntu 20.04). 

After checking the log of the shiny server, I found that maybe the INLA package did not allow to be used in the shiny server. Are there any solutions to handling this issue?

Thank you very much!

looking forward to your reply.

Finn Lindgren

unread,
Aug 11, 2022, 5:51:56 AM8/11/22
to wang dali, R-inla discussion group
Hi,
this is up to the configuration of the hosting server. For
shinyapps.io, I haven't found a way to specify additional repositories
beyond CRAN, but that would otherwise be the natural solution, but if
you have your own server that would likely be configurable.
The section on uploading shiny apps in Paula Moraga's book,
https://www.paulamoraga.com/book-geospatial/sec-shinyexample.html,
only involves displaying pre-computed results, so it doesn't need to
have INLA installed on the server.

It is almost possible to install INLA from gihub with
remotes::install_github("https://github.com/hrue/r-inla",subdir="rinla")
but that fails due to how some of the generated documentation is
stored (or rather _not_ stored on github). That can be worked around
by making a github clone of the repo that does include the generated
files.
However, that wouldn't include the inla and fmesher binaries (unless
you build them and add them to your repository clone, but that would
involve very large files, and I wouldn't recommend it!), so those
would then need to be installed separately; in theory your app could
run inla.binary.install(os = ...) (if the server is some
linux-version), but that would lead to a slow startup time for your
app.
But then you could probably just as well run install.packages() itself
inside your app, which would also be very slow.

So getting the server to accept additional repository locations would be ideal.

Finn
> --
> You received this message because you are subscribed to the Google Groups "R-inla discussion group" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to r-inla-discussion...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/r-inla-discussion-group/c98cb505-ed5d-4c29-9d3e-802d60389bf2n%40googlegroups.com.



--
Finn Lindgren
email: finn.l...@gmail.com
Message has been deleted

wang dali

unread,
Aug 12, 2022, 5:59:14 AM8/12/22
to R-inla discussion group
Hi Finn,

Thank you very much for your kind reply, I have already installed the INLA package successfully in my own server (Ubuntu 20.04). I am building an APP based on INLA, however, it occurs some errors described below.  There is something wrong with the function of "inla.mkl.run".  

sh: 1: /usr/local/lib/R/site-library/INLA/bin/linux/64bit/inla.mkl.run: Permission denied
Error in inla.inlaprogram.has.crashed() : 
The inla-program exited with an error. Unless you interupted it yourself, please rerun with verbose=TRUE and check the output carefully.
If this does not help, please contact the developers at <he...@r-inla.org>.

I have to search for some revolution, it seems I need to enable PARDISO sparse library. I have applied for the PARDISO license already and used it on my server, however, it seems the PARDISO license just allows personal use, so we can not use it in a shiny server APP.

Are there any solutions to handling this issue?

Thank you very much!

Best wishes

Dali

Finn Lindgren

unread,
Aug 12, 2022, 6:06:57 AM8/12/22
to wang dali, R-inla discussion group
Hi,

the pardiso-license is tied to a specific username I think; I'm not
sure what the "public-accessible server" regulations are for that. But
you can run INLA without pardiso; for large models that really benefit
from pardiso I wouldn't recommend running them as part of a shiny app
anyway.

The mkl issue seems to be a permissions issue ("64bit/inla.mkl.run:
Permission denied"), likely to do with how permissions are setup for
the installed package and how the shiny R session is allowed to access
them; you'll need to check your server settings for that...

Finn
> To view this discussion on the web, visit https://groups.google.com/d/msgid/r-inla-discussion-group/4c0cf3c9-78c2-4b65-bc04-5c2f84656c20n%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages