I would like to deploy a shiny app to shinyapps.io but I keep failing to publish it all in all for several months now :-(
Could someone please explain to me step-by-step what I need to do for the specific setup outlined below?
Setup
- the app depends on a custom package that lives in a private GitHub repo
- I do not have a full-fledged R package repo that is accessible by RStudio Connect in order to install the custom package but would like to install it from GitHub
- a
.Rprofile
file lives in the root directory of the project that I'm trying to publish and it contains
local({
r <- getOption("repos")
r["CRAN"] <- "https://cran.rstudio.com/"
r["mycompany"] <- "https://github.com/rappster/mypkg/"
options(repos = r)
})
- the
tar.gz
build of the custom package lives in/opt/r-packages/<pkg-name>/<git-commit-hashkey>.tar.gz
- a
gcfg
file lives in/etc/rstudio-connect/rstudio-connect.gcfg
and it only containsSourcePackageDir = "opt/r-packages"
- the custom package has itself a number of dependencies that are all available on CRAN
- the code for the shiny app lives in several files in the root dir of the project which currently corresponds to the custom's package project (since I thought this would be the easiest to make publishing work), but I could also put it in its own RStudio/R project if that would help
Due diligence
I've read
- Deploy shiny app on shinyapp.io with package in private organization repo
- Package management in RStudio Connect
- RStudio Connect configuration options
but wasn't able to get things working.
RStudio Connect deployment error that I'm getting
<...>
[2019-02-05T11:50:16.877574592+0000] Building R package: mypkg (0.0.2.9002)
/mnt/packages/build /mnt
Warning in untar2(tarfile, files, list, exdir, restore_times) :
skipping pax global extended headers
* installing to library ‘/opt/R/3.5.1/lib/R/library’
* installing *source* package ‘mypkg’ ...
** R
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
there is no package called ‘philentropy’
ERROR: lazy loading failed for package ‘climater’
* removing ‘/opt/R/3.5.1/lib/R/library/mypkg’GET /v1/tasks/?filter=account_id:113102&filter=parent_id:584709513&count=100&offset=0 590ms
################################# End Task Log #################################
----- Deployment error -----
Error: Unhandled Exception: Child Task 584709513 failed: Error building image: Error building mypkg (0.0.2.9002). Build exited with non-zero status: 1
----- Error stack trace -----
3: stop(status$error, call. = FALSE)
2: client$waitForTask(taskId, quiet)
1: rsconnect::deployApp(appDir = "C:/Users/janko/Dropbox (Personal)/Code/R/Packages/_Dev/mypkg",
appFileManifest = "C:/Users/janko/AppData/Local/Temp/6d2a-63b4-2877-4884",
account = "janko-thyson", server = "shinyapps.io", appName = "mypkg",
appId = 585041, launch.browser = function(url) {
message("Deployment completed: ", url)
}, lint = FALSE, metadata = list(asMultiple = FALSE, asStatic = FALSE,
ignoredFiles = <...>),
logLevel = "verbose")
Error: Unhandled Exception: Child Task 584709513 failed: Error building image: Error building mypkg (0.0.2.9002). Build exited with non-zero status: 1
Execution halted
Does that mean I need to build all of my package's dependencies and also put it under opt/<pkg-dependency-name>/<git-commit-hashkey>.tar.gz
?
Sorry in case this is a duplicate or seems to be a bit unstructured/verbose, but my head is completely swirling trying to get this to work and I have no clue where to start with troubleshooting...