teal.gallery icon indicating copy to clipboard operation
teal.gallery copied to clipboard

cannot run gallery apps according to `README`

Open chlebowa opened this issue 2 years ago • 10 comments

The README for teal.gallery says:

Running the restore_and_run("APP_NAME") will run the APP_NAME by restoring the packages using renv restore_and_run("basic-teal")

This does not work. First, the link to sourceme.R is 404, the file has been moved to teal.galley/_internal/utils. Second, this happens:

> source("./_internal/utils/sourceme.R")
> restore_and_run("basic-teal")
Downloading https://github.com/insightsengineering/teal.gallery/archive/HEAD.tar.gz
- Updated 1 record in "/tmp/RtmpKoQX1F/shinyappae535d39f48d/teal.gallery-6cbee27c2e9c63e4b549a36170c109ad604bfc47/basic-teal/renv.lock".
- Updated 1 record in "/tmp/RtmpKoQX1F/shinyappae535d39f48d/teal.gallery-6cbee27c2e9c63e4b549a36170c109ad604bfc47/basic-teal/renv.lock".
- Updated 1 record in "/tmp/RtmpKoQX1F/shinyappae535d39f48d/teal.gallery-6cbee27c2e9c63e4b549a36170c109ad604bfc47/basic-teal/renv.lock".
- Updated 1 record in "/tmp/RtmpKoQX1F/shinyappae535d39f48d/teal.gallery-6cbee27c2e9c63e4b549a36170c109ad604bfc47/basic-teal/renv.lock".
- Updated 1 record in "/tmp/RtmpKoQX1F/shinyappae535d39f48d/teal.gallery-6cbee27c2e9c63e4b549a36170c109ad604bfc47/basic-teal/renv.lock".
- Updated 1 record in "/tmp/RtmpKoQX1F/shinyappae535d39f48d/teal.gallery-6cbee27c2e9c63e4b549a36170c109ad604bfc47/basic-teal/renv.lock".
- Updated 1 record in "/tmp/RtmpKoQX1F/shinyappae535d39f48d/teal.gallery-6cbee27c2e9c63e4b549a36170c109ad604bfc47/basic-teal/renv.lock".
# Bootstrapping renv 1.0.3 ---------------------------------------------------
- Downloading renv ... FAILED
Error in h(simpleError(msg, call)) : failed to download:
All download methods failed

I can run the app with

(apps <- list.files(pattern = "app\\.R", recursive = TRUE))
shiny::shinyAppFile(apps[1], options = list("launch.browser" = TRUE))

to use my won environment but that's not the point, is it?

chlebowa avatar Oct 21 '23 11:10 chlebowa

Regarding the sourcing of the remote sourceme.R file. I notice that the redirect fails when I'm connected to one network (broadband connection) while it succeeds when I'm using another network (mobile hotspot) I think there is some issue with certain ISPs blocking it. I will change it to https://raw.githubusercontent.com/insightsengineering/teal.gallery/main/_internal/utils/sourceme.R so it will work regardless. Edit: Okay, I'm not able to access this link through one of my networks. Are you able to view the Raw code when you click it from here?

Now, regarding the restore_and_run("basic-teal") which did not work for you (it does for me btw) I would like to know more regarding this to figure out what is going on. Could you please provide these details?

  1. Which R version are you using?
  2. What version of renv are you using packageVersion('renv')?

And yes, you're right the point is to not make the user install anything other than renv and having to set the GitHub_PAT so our teal packages can be installed via GitHub (In future, after the CRAN releases this will go away)

vedhav avatar Oct 21 '23 12:10 vedhav

Why not link to system.file(...)?

> R.version
               _                                          
platform       x86_64-pc-linux-gnu                        
arch           x86_64                                     
os             linux-gnu                                  
system         x86_64, linux-gnu                          
status         Patched                                    
major          4                                          
minor          2.2                                        
year           2022                                       
month          11                                         
day            10                                         
svn rev        83330                                      
language       R                                          
version.string R version 4.2.2 Patched (2022-11-10 r83330)
nickname       Innocent and Trusting      

> packageVersion("renv")
[1] ‘1.0.1’

chlebowa avatar Oct 23 '23 07:10 chlebowa

I tried to restore and run using the same R and renv version in my machine and it worked fine so that's not an issue:

> R.version
               _
platform       aarch64-apple-darwin20
arch           aarch64
os             darwin20
system         aarch64, darwin20
status
major          4
minor          2.2
year           2022
month          10
day            31
svn rev        83211
language       R
version.string R version 4.2.2 (2022-10-31)
nickname       Innocent and Trusting
> packageVersion('renv')
[1] ‘1.0.1’

vedhav avatar Oct 23 '23 08:10 vedhav