rocker-org / rocker-versioned2

Run current & prior versions of R using docker. rocker/r-ver, rocker/rstudio, rocker/shiny, rocker/tidyverse, and so on.
https://rocker-project.org
GNU General Public License v2.0
390 stars 163 forks source link

R is taking longer to start than usual (infinite loop) #823

Open sbirq opened 1 month ago

sbirq commented 1 month ago

Launching an R Studio session running on Azure Container Instances results in a frozen screen with the message. "R is taking longer to start than usual"

It seems completely random. We have multiple Dockerfiles with different packages. Sometimes the R instance is frozen for one particular user, then someone else can log in from another webbrowser.

#Base image https://hub.docker.com/u/rocker/
FROM rocker/tidyverse:latest

## copy files
COPY install_packages.R /install_packages.R
COPY packages_scan.R /packages_scan.R
COPY rstudio-prefs.json /home/rstudio/.config/rstudio/rstudio-prefs.json
COPY rserver.conf /etc/rstudio/rserver.conf

# Install ODBC and dependencies
RUN apt-get update && apt-get install -y \
    cron \
    nano \
    tdsodbc \
    odbc-postgresql \
    libsqliteodbc \
    apt-transport-https \
    curl \
    gnupg \
    unixodbc-dev \
    ## clean up
    && apt-get clean \ 
    && rm -rf /var/lib/apt/lists/ \ 
    && rm -rf /tmp/downloaded_packages/ /tmp/*.rds

RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/debian/9/prod.list > /etc/apt/sources.list.d/mssql-release.list
RUN apt-get update -y
RUN ACCEPT_EULA=Y apt-get install --yes --no-install-recommends msodbcsql18 
RUN curl -sL https://aka.ms/InstallAzureCLIDeb | bash

## install R-packages (and for ARL also NEA packages)
RUN Rscript /install_packages.R

# Install depencendcies
RUN apt-get update \
   && apt-get upgrade -y \
   && apt-get install -y \
   # for rJava
   default-jre \
   # for V8
   libv8-dev \
   python3-pip \
   libpython3-dev \
   libmagick++-dev  

# Run the R packages scan
RUN Rscript /packages_scan.R

This is the install_packages.R file:

package_list <- c(
    "abind",
  "alphavantager",
  "anytime",
  "BH",
  "binman",
  "bitops",
  "caret",
  "caTools",
  "checkmate",
  "chron",
  "clipr",
  "clock",
  "config",
  "crosstalk",
  "crul",
  "diagram",
  "Dict",
  "excel.link",
  "filelock",
  "flextable",
  "fontBitstreamVera",
  "fontLiberation",
  "fontquiver",
  "foreach",
  "forecast",
  "Formula",
  "fracdiff",
  "furrr",
  "future",
  "future.apply",
  "gdtools",
  "gfonts",
  "ggcorrplot",
  "ggrepel",
  "globals",
  "gower",
  "gridExtra",
  "gsubfn",
  "hardhat",
  "Hmisc",
  "htmlTable",
  "httpcode",
  "ipred",
  "jtools",
  "keyring",
  "lava",
  "lazyeval",
  "listenv",
  "lmtest",
  "markdown",
  "MatrixModels",
  "matrixStats",
  "ModelMetrics",
  "numDeriv",
  "odbc",
  "officer",
  "oysteR",
  "padr",
  "pander",
  "parallelly",
  "parsnip",
  "patchwork",
  "PerformanceAnalytics",
  "plotly",
  "plyr",
  "pROC",
  "prodlim",
  "progressr",
  "proto",
  "quadprog",
  "Quandl",
  "quantmod",
  "RcppArmadillo",
  "RcppEigen",
  "RcppParallel",
  "RcppRoll",
  "recipes",
  "reshape2",
  "riingo",
  "rJava",
  "rjson",
  "rsample",
  "RSelenium",
  "semver",
  "shape",
  "slider",
  "sodium",
  "sparklyr",
  "sqldf",
  "SQUAREM",
  "tidymodels",
  "tidyquant",
  "timeDate",
  "timetk",
  "translations",
  "triebeard",
  "tseries",
  "tsfeatures",
  "TTR",
  "tune",
  "urca",
  "urltools",
  "viridis",
  "waiter",
  "warp",
  "wdman",
  "workflows",
  "workflowsets",
  "xlsx",
  "xlsxjars",
  "XML",
  "xts",
  "yardstick",
  "shiny",
  "shinydashboard",
  "shinyjs",
  "DT",
  "readxl",
  "dplyr",
  "tidyr",
  "writexl",
  "lubridate",
  "openxlsx",
  "data.table",
  "stringr",
  "rtools",
  "diffdf")

install.packages(package_list)

tinytex::install_tinytex()

Additionally we have the following packages file for a specific tool:

package_list <- c(
  "fastDummies",
  "timeSeries",
  "gss",
  "stabledist",
  "fBasics",
  "fitdistrplus",
  "ggsci",
  "cowplot",
  "ggsignif",
  "polynom",
  "rstatix",
  "ggpubr",
  "moments",
  "nortest",
  "outliers",
  "oysteR",
  "randtests",
  "reactR",
  "reactable",
  "rlist",
  "rpivotTable",
  "shinyBS",
  "shinyMatrix",
  "shinyWidgets",
  "sandwich",
  "strucchange",
  "magick",
  "pryr",
  "rapportools",
  "summarytools",
  "extraDistr",
  "trend")

install.packages(package_list)

rstudio-prefs.json

{
    "save_workspace": "never",
    "always_save_history": false,
    "reuse_sessions_for_project_links": true,
    "posix_terminal_shell": "bash",
    "initial_working_directory": "/aci/scripts",
    "python_type": "system",
    "python_version": "3.10.12",
    "python_path": "/usr/bin/python3.10",
    "rainbow_parentheses": true,
    "default_project_location": "/aci/scripts",
    "default_open_project_location": "/aci/scripts"
}

rserver.conf

rsession-which-r=/usr/local/bin/R
auth-timeout-minutes=0

packages_scan.R

library("oysteR")
audit_installed_r_pkgs()

Already tried to remove the packages, still didn't change anything. Anyone ideas?

eitsupi commented 3 weeks ago

I don't see how this relates to this repository, could you please fill in the issue template?