Skip to content

Commit

Permalink
Merge pull request #5554 from ryanlovett/datahub-scoped-creds-rstudio-2
Browse files Browse the repository at this point in the history
Use Rprofile.site instead of Renviron.site.
  • Loading branch information
ryanlovett authored Feb 21, 2024
2 parents 35c3dc4 + eb974d6 commit a805673
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 27 deletions.
9 changes: 3 additions & 6 deletions deployments/datahub/images/default/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,12 @@ RUN curl --silent --location --fail ${SHINY_SERVER_URL} > /tmp/shiny-server.deb
apt install --no-install-recommends --yes /tmp/shiny-server.deb && \
rm /tmp/shiny-server.deb

# Set CRAN mirror to rspm before we install anything
# Install our custom Rprofile.site file
COPY Rprofile.site /usr/lib/R/etc/Rprofile.site
# Create directory for additional R/RStudio setup code
RUN mkdir /etc/R/Rprofile.site.d
# RStudio needs its own config
COPY rsession.conf /etc/rstudio/rsession.conf
# Enable customizations to Renviron.site
COPY Renviron.site.append /tmp/Renviron.site.append
RUN cat /tmp/Renviron.site.append >> /etc/R/Renviron.site && \
mkdir /etc/R/Renviron.site.d/ && \
rm /tmp/Renviron.site.append

# R_LIBS_USER is set by default in /etc/R/Renviron, which RStudio loads.
# We uncomment the default, and set what we wanna - so it picks up
Expand Down
20 changes: 0 additions & 20 deletions deployments/datahub/images/default/Renviron.site.append

This file was deleted.

19 changes: 18 additions & 1 deletion deployments/datahub/images/default/Rprofile.site
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,21 @@ options(repos = c(CRAN = "https://packagemanager.rstudio.com/all/__linux__/jammy
# below sets it to be binary. This may improve image build times.
# If it works, it'd be better to dynamically set the R version as above, and
# also the RStudio Server version if possible.
options(HTTPUserAgent = "RStudio Server (2021.9.1.372); R (4.3.1 x86_64-pc-linux-gnu x86_64 linux-gnu)")
options(HTTPUserAgent = "RStudio Server (2023.12.0.369); R (4.3.2 x86_64-pc-linux-gnu x86_64 linux-gnu)")


## Source extra Rprofile files.
#
# This lets us easily add new code via extraFiles (or other z2jh-related
# magic) without having to rebuild the image each time.

# Get a list of files in the directory
rprofile_dir <- "/etc/R/Rprofile.site.d/"
rprofile_files <- list.files(rprofile_dir, full.names = TRUE)

# Source each file
for (rprofile_file in rprofile_files) {
cat("Sourcing:", rprofile_file, "\n")
source(rprofile_file)
}

0 comments on commit a805673

Please sign in to comment.