Coder Social home page Coder Social logo

Comments (13)

flololan avatar flololan commented on July 17, 2024 4

Hi, I have the same Problem with it saying Not Found for the markdown part/window.

Opening a markdown project with http://localhost:3838/sample-apps/rmd/index.Rmd works. How do I fix the Not Found part?

Thanks

Using shiny-verse

from shiny.

eddelbuettel avatar eddelbuettel commented on July 17, 2024 2

First, did you look at the details in README.md for the shiny Rocker container. It has quite some hints.

Second, the ability to not run the rmd/ appears to be due to it expecting index.html but there is not. Use this path: http://localhost:3838/sample-apps/rmd/index.Rmd and you will see the demo.
Similarly, one could probably fix the index.html to point to rmd/index.Rmd ...

Third, maybe you want shiny-verse so that you don't have to install all those packages by hand.

from shiny.

eddelbuettel avatar eddelbuettel commented on July 17, 2024 1

If it is shiny-server the apps below /srv/shiny-server should be running because the shiny server daemon is running. You should not have to also invoke it as app via rmarkdown::run().

Also, just as a style, I would have written

RUN install.r rstan shiny rmarkdown shinydashboard shinyWidget   # add other ones here

as we have install.r for this, and it know about the repo to source from.

from shiny.

jpzhangvincent avatar jpzhangvincent commented on July 17, 2024 1

If it is shiny-server the apps below /srv/shiny-server should be running because the shiny server daemon is running. You should not have to also invoke it as app via rmarkdown::run().

Also, just as a style, I would have written

RUN install.r rstan shiny rmarkdown shinydashboard shinyWidget   # add other ones here

as we have install.r for this, and it know about the repo to source from.

Thanks. When I use "CMD ["/usr/bin/shiny-server.sh"]", although I get the Shiny working, the sample app for rmarkdown doesn't render. When I open the chrome debugger, it shows "http://localhost:3838/sample-apps/rmd/ 404 (Not Found)". I have installed "rmarkdown".
Screen Shot 2019-12-07 at 1 48 27 PM

from shiny.

trinker avatar trinker commented on July 17, 2024 1

@flololan Here's how you could test this. Make an app in there to see what version of rmarkdown is being run. The app folder naem could be called rmarkdown. Then put the following simple ui and server scripts in there to build a shiny app (we know this renders) to determine what version of rmarkdown you have:

The ui.R script

fluidPage( 
  hr(),
  fluidRow(column(3, verbatimTextOutput("value")))   
)

The server.r script

function(input, output) {
​  output$value <- renderPrint({ utils::packageVersion('rmarkdown') })
}

Then build and rerun http://localhost:3838/rmarkdown/ in the browser. It should take you to the screen and display the version of rmarkdown you have. If it is 1.18 that's the culprit.

If you install rmarkdown from github in your Dockerfile you'd get a newer version without this bug and all is well.

from shiny.

cboettig avatar cboettig commented on July 17, 2024

Very strange that you would get different behavior from building locally; hub is building automatically from the same Dockerfile.

I see some 404's on the example shiny file both way though, but not sure where to start debugging that one. Maybe @wch has better insight here.

from shiny.

wch avatar wch commented on July 17, 2024

It's possible that you are running into rstudio/shiny#2385.

We have a fix that was merged into the v1.3.2-patch branch: rstudio/shiny#2386

We also submitted a new version, 1.3.2, to CRAN, and hopefully it will be accepted soon.

from shiny.

vvolodko avatar vvolodko commented on July 17, 2024

Thanks for your investigation!

Yes, rstudio/shiny#2385 looks like the same issue:

$ docker container run --rm -it rocker/shiny-verse //usr/local/bin/Rscript -e 'library(shiny); sessionInfo()' | grep shiny
[1] shiny_1.3.1

$ docker container run --rm -it my/peppa //usr/local/bin/Rscript -e 'library(shiny); sessionInfo()' | grep shiny
[1] shiny_1.2.0

I'll periodically check https://cran.r-project.org/package=shiny and https://hub.docker.com/r/rocker/shiny-verse/builds to see if the issue is gone.

from shiny.

vvolodko avatar vvolodko commented on July 17, 2024

Very strange that you would get different behavior from building locally; hub is building automatically from the same Dockerfile.

Here is version of 'rocker/shiny-verse:latest' on my machine:

$ docker image history rocker/shiny-verse:latest
IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT
0052bf0992e2        39 hours ago        /bin/sh -c apt-get update -qq && apt-get -y …   451MB
<missing>           41 hours ago        /bin/sh -c #(nop)  CMD ["/usr/bin/shiny-serv…   0B
<missing>           41 hours ago        /bin/sh -c #(nop) COPY file:5a292866d694cfb8…   397B
<missing>           41 hours ago        /bin/sh -c #(nop)  EXPOSE 3838                  0B
<missing>           41 hours ago        /bin/sh -c wget --no-verbose https://downloa…   494MB
<missing>           42 hours ago        /bin/sh -c apt-get update && apt-get install…   313MB
<missing>           2 days ago          /bin/sh -c #(nop)  CMD ["R"]                    0B
<missing>           2 days ago          /bin/sh -c apt-get update   && apt-get insta…   505MB
<missing>           2 days ago          /bin/sh -c #(nop)  ENV R_VERSION=3.5.3 LC_AL…   0B
<missing>           2 days ago          /bin/sh -c #(nop)  ARG BUILD_DATE               0B
<missing>           2 days ago          /bin/sh -c #(nop)  ARG R_VERSION                0B
<missing>           2 days ago          /bin/sh -c #(nop)  LABEL org.label-schema.li…   0B
<missing>           3 weeks ago         /bin/sh -c #(nop)  CMD ["bash"]                 0B
<missing>           3 weeks ago         /bin/sh -c #(nop) ADD file:843b8a2a9df1a0730…   101MB

and my build:

$ docker image history my/peppa:latest
IMAGE               CREATED             CREATED BY                                      SIZE                COMMENT
29b53cd5a15d        18 hours ago        /bin/sh -c #(nop)  EXPOSE 80                    0B
c91228826358        18 hours ago        /bin/sh -c #(nop)  VOLUME [/var/log/shiny-se…   0B
93f2857a086c        18 hours ago        /bin/sh -c #(nop)  VOLUME [/var/lib/shiny-se…   0B
9d96ef866b22        18 hours ago        /bin/sh -c #(nop) COPY dir:0f7dcb89f712c8059…   3.05MB
b3129dbb166f        18 hours ago        /bin/sh -c #(nop) COPY file:c11f72f43a4fc04d…   338B
1216f39e73f6        18 hours ago        /bin/sh -c #(nop) COPY file:2f2309baddd5d793…   569B
25d5a87c4b7a        18 hours ago        /bin/sh -c apt-get update -qq   && RUNTIMEDE…   242MB
15eb12c26e61        3 weeks ago         /bin/sh -c #(nop)  CMD ["/usr/bin/shiny-serv…   0B
<missing>           3 weeks ago         /bin/sh -c #(nop) COPY file:5a292866d694cfb8…   397B
<missing>           3 weeks ago         /bin/sh -c #(nop)  EXPOSE 3838                  0B
<missing>           3 weeks ago         /bin/sh -c wget --no-verbose https://downloa…   494MB
<missing>           3 weeks ago         /bin/sh -c apt-get update && apt-get install…   313MB
<missing>           3 weeks ago         /bin/sh -c #(nop)  CMD ["R"]                    0B
<missing>           3 weeks ago         /bin/sh -c apt-get update   && apt-get insta…   505MB
<missing>           3 weeks ago         /bin/sh -c #(nop)  ENV R_VERSION=3.5.3 LC_AL…   0B
<missing>           3 weeks ago         /bin/sh -c #(nop)  ARG BUILD_DATE               0B
<missing>           3 weeks ago         /bin/sh -c #(nop)  ARG R_VERSION                0B
<missing>           3 weeks ago         /bin/sh -c #(nop)  LABEL org.label-schema.li…   0B
<missing>           3 weeks ago         /bin/sh -c #(nop)  CMD ["bash"]                 0B
<missing>           3 weeks ago         /bin/sh -c #(nop) ADD file:843b8a2a9df1a0730…   101MB

I didn't install biocLite.R and added some shiny apps on the top, but the main difference is dates of the layers. So, I think some layers were taken from the cache.

from shiny.

cboettig avatar cboettig commented on July 17, 2024

@vvolodko good call, hub did have caching enabled. I've unchecked that now so the nightly builds should pick up the new packages, including hopefully the 1.3.2 version when it hits the CRAN mirrors.

from shiny.

jpzhangvincent avatar jpzhangvincent commented on July 17, 2024

I have a similar issue. When I go to the url "localhost:3838/my_app" it shows me "not found". The following is my dockerfile. Any ideas? Thanks

# get shiny serves plus tidyverse packages image
FROM rocker/shiny-verse:latest

# system libraries of general use
RUN apt-get update && apt-get install -y \
    sudo \
    pandoc \
    pandoc-citeproc \
    libcurl4-gnutls-dev \
    libcairo2-dev \
    libxt-dev \
    libssl-dev \
    libssh2-1-dev \
    nmap \
    vim

# install R packages required
# (change it dependeing on the packages you need)
RUN R -e "dotR <- file.path(Sys.getenv('HOME'), '.R'); if (!file.exists(dotR)) {dir.create(dotR)}; M <- file.path(dotR, 'Makevars'); if (!file.exists(M)) file.create(M);cat('\nCXX14FLAGS=-O3 -march=native -mtune=native -fPIC', 'CXX14=g++', file = M, sep = '\n', append = TRUE)"
RUN R -e "install.packages('rstan', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('shiny', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('rmarkdown', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('shinydashboard', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('shinyWidgets', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('shinycssloaders', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('magrittr', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('glue', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('DT', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('plotly', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('flexdashboard', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('Rcpp', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('chron', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('zoo', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('lubridate', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('strucchange', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('tsoutliers', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('anomalize', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('changepoint', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('data.table', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('tsoutliers', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('quantreg', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('future', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('furrr', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('purrr', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('prophet', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('futile.logger', repos='http://cran.rstudio.com/')"
RUN R -e "install.packages('here', repos='http://cran.rstudio.com/')"


# copy the app to the image - to change
COPY my_app /srv/shiny-server/my_app
COPY Dockerfile /srv/shiny-server/

# select port
EXPOSE 3838

# allow permission
RUN sudo chown -R shiny:shiny /srv/shiny-server

# run app
# CMD ["/usr/bin/shiny-server.sh"]
CMD ["R", "-e rmarkdown::run('/srv/shiny-server/my_app/my_app.Rmd',shiny_args=list(host='0.0.0.0',port=3838))"]

from shiny.

trinker avatar trinker commented on July 17, 2024

@eddelbuettel Is this possibly because the rmarkdown package being used is v. 1.18 and is related to this: rstudio/rmarkdown#1731 and this rstudio/rmarkdown#1714?

from shiny.

eddelbuettel avatar eddelbuettel commented on July 17, 2024

I do not know those two issues, sorry. I am also unaware of any systemic issues with rmarkdown.

from shiny.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.