App Configuration via ShinyProxy.YML -container unresponsive?

EDIT: I have made the syntax fix, but I am still getting an error

I am trying to run the euler app provided in the link: http://www.shinyproxy.io/deploying-apps/

-I have had the dockerfile to SUCCESFULLY BUILD via: the euler DockerFile:

FROM openanalytics/r-base

MAINTAINER Tobias Verbeke "tobias.verbeke@openanalytics.eu"


RUN apt-get update && apt-get install -y \
    sudo \
    pandoc \
    pandoc-citeproc \
    libcurl4-gnutls-dev \
    libcairo2-dev \
    libxt-dev \
    libssl-dev \
    libssh2-1-dev \
    libssl1.0.0

RUN apt-get update && apt-get install -y \
    libmpfr-dev

RUN R -e "install.packages(c('shiny', 'rmarkdown', repos='https://cloud.r-project.org/')"

RUN R -e "install.packages('Rmpfr', repos='https://cloud.r-project.org/')"

RUN mkdir /etc/euler
COPY euler /etc/euler

COPY Rprofile.site /usr/lib/R/etc/

EXPOSE 3838

CMD ["R", "-e shiny::runApp('/etc/euler')"]

I have trouble figuring out how to set up the .yml within the java.jar file. here is my current setup under “apps”

  apps:
  - name: 01_hello
    docker-cmd: ["R", "-e shinyproxy::run_01_hello()"]
    docker-image: openanalytics/shinyproxy-demo
    ldap-groups: scientists, mathematicians
  - name: 06_tabsets
    docker-cmd: ["R", "-e shinyproxy::run_06_tabsets()"]
    docker-image: openanalytics/shinyproxy-demo
    ldap-groups: scientists
  - name: Euler
    docker-cmd: ["R", "-e shiny::runApp('/etc/euler')"]
    docker-image: openanalytics/r-base
    ldap-groups: scientists

Once I am on the localhost page, I am able to login and view the apps. “Euler” is listed along with the other apps. However once I click Euler. I see on the terminal that the container is unresponsive trying again (1/20).
What am I doing wrong?

Hi @Babacar_Diouf,

It seems that you are missing quotes and a slash, try changing
docker-cmd: ["R", "-e shiny::runApp(etc/euler)"]
into
docker-cmd: ["R", "-e shiny::runApp('/etc/euler')"]

Alternatively, you can omit docker-cmd since you have specified CMD in your Dockerfile.

Hello mnazarov, I have made the proper changes, but I am still getting this error that the container is unresponsive trying again (1/20).

Hi,

Looking at your Dockerfile, I think the issue is missing dependencies of the Rmpfr R package, namely gmp and mpfr system libraries - see https://cran.r-project.org/web/packages/Rmpfr/README.html for details.
Please see also http://www.shinyproxy.io/troubleshooting/ for possible issues, and ways to pinpoint problems (e.g. trying to run docker container manually)

1 Like

Thanks, I will check it out today and keep you updated.

Some side questions as I am still confused about the dockerfile documentation:

DOCKFILE:
If I made my own app I wouldn’t use openanalytics/r-base on the first line of the dockerfile right?

I assume the
RUN mkdir /etc/euler
COPY euler /etc/euler, and
CMD ["R", "-e shiny::runApp('/etc/euler')"] can be which ever same path I choose?

.YML:

the docker-cmd:, has to match the CMD in the docker file?

Where are the docker-image: 's located for the ShinyApps above?I am confused what to put in the docker-image field if I create my own ShinyApp.

Thanks.

Normally you would use it, since it provides you with OS and R installed in the docker container. You can also use alternative images, but you will need to make sure all the required dependencies are there.

Indeed folder in the container (/etc/euler in your case) can be any available path.

docker-cmd need to match the command to start your shiny app; indeed CMD is ignored by the shinyproxy (unless no docker-cmd is specified), but may be useful when e.g. you want to run container manually.

It is enough that docker images are available to the docker running on your system, i.e. they are built or pulled from a repository. You can see a list of available images by running docker images.

You might find useful the ‘getting started guide’ for Docker: Overview of the Docker workshop | Docker Docs

Just tried running:

sudo docker run -p 3838:3838 openanalytics/r-base R -e 'shiny::runApp(etc/euler/test)' to run the docker manually.

Here is my output:

R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)

R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.

  Natural language support but running in an English locale

R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.

Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.

> shiny::runApp(etc/euler)
Error in loadNamespace(name) : there is no package called ‘shiny’
Calls: :: ... tryCatch -> tryCatchList -> tryCatchOne -> <Anonymous>
Execution halted

Does this mean I am missing something in that file directory /etc/euler? I thought the dockerfile would temporarily add contents and use this path to run the container.

Thanks.

You shouldn’t be running openanalytics/r-base, but instead the image you built form the Dockerfile (you mentioned you successfully built it in the first post). If you followed the http://www.shinyproxy.io/deploying-apps/ instructions it would be called openanalytics/shinyproxy-template.

If you read the error message it says shiny is not installed, and indeed it is not included in the openanalytics/r-base image.

1 Like

I found my issue the euler file was within the openanalytics/shinyproxy-template and I did not need to create the files within my local computer /etc/euler as in the original docker file that consists of /root/euler within the docker image itself.

Thanks for your assistance.