From fa19299885b2166d2a49397789b8e0451883383d Mon Sep 17 00:00:00 2001 From: Zach Hannum Date: Fri, 15 Nov 2024 12:46:40 -0500 Subject: [PATCH 1/5] Add workbench-session, starting with r-session-complete --- workbench-session/.env | 4 + workbench-session/.snyk | 20 +++++ workbench-session/Dockerfile.ubuntu2204 | 64 +++++++++++++++ workbench-session/NEWS.md | 92 ++++++++++++++++++++++ workbench-session/README.md | 78 ++++++++++++++++++ workbench-session/docker-compose.test.yml | 16 ++++ workbench-session/positron.extensions.conf | 2 + workbench-session/test/goss.yaml | 69 ++++++++++++++++ workbench-session/test/run_tests.sh | 19 +++++ workbench-session/vscode.extensions.conf | 5 ++ 10 files changed, 369 insertions(+) create mode 100644 workbench-session/.env create mode 100644 workbench-session/.snyk create mode 100644 workbench-session/Dockerfile.ubuntu2204 create mode 100644 workbench-session/NEWS.md create mode 100644 workbench-session/README.md create mode 100644 workbench-session/docker-compose.test.yml create mode 100644 workbench-session/positron.extensions.conf create mode 100644 workbench-session/test/goss.yaml create mode 100755 workbench-session/test/run_tests.sh create mode 100644 workbench-session/vscode.extensions.conf diff --git a/workbench-session/.env b/workbench-session/.env new file mode 100644 index 00000000..5138f057 --- /dev/null +++ b/workbench-session/.env @@ -0,0 +1,4 @@ +R_VERSION=4.1.0 +PYTHON_VERSION=3.9.5 +RSW_VERSION=2024.09.1+394.pro7 +DRIVERS_VERSION=2024.03.0-1 diff --git a/workbench-session/.snyk b/workbench-session/.snyk new file mode 100644 index 00000000..909ad99a --- /dev/null +++ b/workbench-session/.snyk @@ -0,0 +1,20 @@ +# Snyk (https://snyk.io) policy file, patches or ignores known vulnerabilities. +version: v1.25.0 +# ignores vulnerabilities until expiry date; change duration by modifying expiry date +ignore: + SNYK-GOLANG-GITHUBCOMCREWJAMSAML-5971016: + - '*': + reason: >- + Reported upstream in + https://github.com/rstudio/rstudio-pro/issues/6529 + expires: 2024-08-31T00:00:00.000Z + created: 2024-07-02T20:33:30.847Z + SNYK-GOLANG-GITHUBCOMGOJOSEGOJOSEV3-6070737: + - '*': + reason: >- + Confirmed fixed upstream in + https://github.com/rstudio/rstudio-pro/issues/6635. Patch will be + ingested in Workbench 2024.08.0 (expected within 1 week). + expires: 2024-08-07T00:00:00.000Z + created: 2024-07-31T17:46:24.852Z +patch: {} diff --git a/workbench-session/Dockerfile.ubuntu2204 b/workbench-session/Dockerfile.ubuntu2204 new file mode 100644 index 00000000..95b04386 --- /dev/null +++ b/workbench-session/Dockerfile.ubuntu2204 @@ -0,0 +1,64 @@ +FROM product-base-pro as build + +ARG DEBIAN_FRONTEND=noninteractive +ARG R_VERSION=4.4.0 +ARG R_VERSION_ALT=4.3.3 +ARG PYTHON_VERSION=3.9.17 +ARG PYTHON_VERSION_ALT=3.8.17 +ARG JUPYTERLAB_VERSION=3.6.5 +ARG RSW_VERSION=2024.09.1+394.pro7 +ARG RSW_NAME=rstudio-workbench +ARG RSW_DOWNLOAD_URL=https://download2.rstudio.org/server/jammy/amd64 +ARG SCRIPTS_DIR=/opt/positscripts + +ENV WORKBENCH_JUPYTER_PATH=/usr/local/bin/jupyter + +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +RUN apt-get update \ + && apt-get install --no-install-recommends -y \ + krb5-user \ + libcurl4-gnutls-dev \ + libuser \ + libuser1-dev \ + libpq-dev \ + rrdtool \ + subversion \ + && RSW_VERSION_URL=$(echo -n "${RSW_VERSION}" | sed 's/+/-/g') \ + && curl -fsSL -o rstudio-workbench.deb "${RSW_DOWNLOAD_URL}/${RSW_NAME}-${RSW_VERSION_URL}-amd64.deb" \ + # Pre 7/25/23 packages + && gpg --keyserver keyserver.ubuntu.com --recv-keys 3F32EE77E331692F \ + # Post 7/25 packages + && gpg --keyserver keys.openpgp.org --recv-keys 51C0B5BB19F92D60 \ + && dpkg-sig --verify ./rstudio-workbench.deb \ + && apt-get install -yq --no-install-recommends ./rstudio-workbench.deb \ + && rm ./rstudio-workbench.deb \ + && apt-get autoremove -y \ + && apt-get clean \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /var/lib/rstudio-server/r-versions + +### Install Quarto to PATH ### +RUN ln -s /lib/rstudio-server/bin/quarto/bin/quarto /usr/local/bin/quarto + +### Install TinyTeX using Quarto ### +RUN $SCRIPTS_DIR/install_quarto.sh --install-tinytex --add-path-tinytex + +RUN /opt/python/"${PYTHON_VERSION}"/bin/python -m venv /opt/python/jupyter \ + && /opt/python/jupyter/bin/python -m pip install --upgrade pip \ + && /opt/python/jupyter/bin/python -m pip install --upgrade setuptools \ + && /opt/python/jupyter/bin/python -m pip install \ + jupyterlab~=4.2.4 \ + notebook \ + pwb_jupyterlab~=1.0 \ + && ln -s /opt/python/jupyter/bin/jupyter /usr/local/bin/jupyter \ + && /opt/python/${PYTHON_VERSION}/bin/python -m pip install ipykernel \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python -m pip install ipykernel \ + && /opt/python/${PYTHON_VERSION}/bin/python -m ipykernel install --name py${PYTHON_VERSION} --display-name "Python ${PYTHON_VERSION}" \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python -m ipykernel install --name py${PYTHON_VERSION_ALT} --display-name "Python ${PYTHON_VERSION_ALT}" \ + && /opt/python/jupyter/bin/python -m pip cache purge + +ENV PATH="/opt/python/jupyter/bin:${PATH}" + +COPY vscode.extensions.conf /etc/rstudio/vscode.extensions.conf + +EXPOSE 8788/tcp diff --git a/workbench-session/NEWS.md b/workbench-session/NEWS.md new file mode 100644 index 00000000..77917139 --- /dev/null +++ b/workbench-session/NEWS.md @@ -0,0 +1,92 @@ +# 2023.03.1 +- Update Python VSCode extension to version 2023.6.1 + +# 2023.03.0 + +- Update R versions to 4.1.3 and 4.2.3 +- Update Python versions to 3.8.15 and 3.9.14 + +# 2022.12.0 + +- Upgrade workbench to 2022.12.0 +- Use the new `WORKBENCH_JUPYTER_PATH` env var to configure jupyter location +- Remove `vscode.conf/exe` configuration in favor of the new, internal default `code-server` installation +- Refactor image to build _FROM_ the new `product-base-pro` image + +# 2022.07.0 + +- Add a `/usr/local/bin/jupyter` symlink +- Configure Workbench to preinstall R, Python, and Quarto extensions for users on session startup +- Add workbench_jupyterlab python package for the jupyterlab extension + +# 2021.09.0 + +- **BREAKING**: Rename `RSP_` variables to `RSW_`. Rename RStudio Server Pro to RStudio Workbench +- **BREAKING**: Change `R_VERSION` to 4.1.0 +- **BREAKING**: Change `PYTHON_VERSION` to 3.9.5 +- **BREAKING**: R and Python packages are no longer installed by default in session images. + +We have removed R and Python packages from the session image. This should: +- reduce the image build time and size +- make it easier for data scientists to develop reproducible environments +- eliminate conflicts between system libraries and subsequent user updates + +If the removal of these system libraries introduces some problems for you, please file an issue. + +# 1.4.1717-3 + +## Overview + +R is at `/opt/R/4.0.2/bin/R` +python is at `/opt/python/3.7.7/bin/python` +jupyter is at `/opt/python/3.7.7/bin/jupyter` +code-server is at `/opt/code-server/bin/code-server` + +## Changes + +- Update RStudio Professional Drivers to 1.8.0 +- `BREAKING`: `code-server` no longer supports the `/opt/code-server/code-server` location. + - As a result, you need to set `exe=/opt/code-server/bin/code-server` + - After two changes in a row, we suspect this is the final change for a while +_vscode.conf_ +``` +enabled=1 +exe=/opt/code-server/bin/code-server +``` + +# 1.4.1106-5 + +## Overview + +R is at `/opt/R/4.0.2/bin/R` +python is at `/opt/python/3.7.7/bin/python` +jupyter is at `/opt/python/3.7.7/bin/jupyter` +code-server is at `/opt/code-server/code-server` + +## Changes + +- `BREAKING`: Changed code-server version and insulated against version upgrades in the future. To update: +change: + +_vscode.conf_ +``` +enabled=1 +exe=/opt/code-server/code-server-3.2.0-linux-x86_64/code-server +``` +to: +_vscode.conf_ +``` +enabled=1 +exe=/opt/code-server/code-server +``` + +- Update Drivers to version 1.7.0 + +# 1.4.1103-4 + +## Overview + +R is at `/opt/R/4.0.2/bin/R` +python is at `/opt/python/3.7.7/bin/python` +jupyter is at `/opt/python/3.7.7/bin/jupyter` +code-server is at `/opt/code-server/code-server-3.2.0-linux-x86_64/code-server` diff --git a/workbench-session/README.md b/workbench-session/README.md new file mode 100644 index 00000000..243c17d1 --- /dev/null +++ b/workbench-session/README.md @@ -0,0 +1,78 @@ +# Quick reference + +* Maintained by: [the Posit Docker team](https://github.com/rstudio/rstudio-docker-products) +* Where to get help: [our Github Issues page](https://github.com/rstudio/rstudio-docker-products/issues) +* RStudio Workbench image: [Docker Hub](https://hub.docker.com/r/rstudio/rstudio-workbench) +* RStudio r-session-complete image: [Docker Hub](https://hub.docker.com/r/rstudio/r-session-complete) + +# Supported tags and respective Dockerfile links + +* [`jammy`, `ubuntu2204`, `jammy-2024.09.1`, `ubuntu2204-2024.09.1`](https://github.com/rstudio/rstudio-docker-products/blob/main/r-session-complete/Dockerfile.ubuntu2204) + +# What are the r-session-complete images? + +Images for R and Python sessions and jobs to be used RStudio Workbench, Launcher, and Kubernetes. + +# Notice for support + +1. This image may introduce **BREAKING** changes; as such we recommend: + - Avoid using the `{operating-system}` tags to avoid unexpected version changes, and + - Always read through the [NEWS](./NEWS.md) to understand the changes before updating. +1. Outdated images will be removed periodically from DockerHub as product version updates are made. Please make plans to + update at times or use your own build of the images. +1. These images are meant as a starting point for your needs. Consider creating a fork of this repo, where you can + continue to merge in changes we make while having your own security scanning, base OS in use, or other custom + changes. We + provide [instructions for how to build and use](#how-to-use-these-docker-images) + for these cases. +1. **Security Note:** These images are provided AS IS based on the build environment at the time their product version was released/updated. They should be reviewed and updated before production use. If your organization has a specific set of security requirements related to CVE/Vulnerability severity levels, you should plan to use the [instructions for building](https://github.com/rstudio/rstudio-docker-products#instructions-for-building) to clone this repository, and rebuild these images to your specific internal security standards. + +# How to use these images + +The Docker images built from these Dockerfiles are intended to be used for R and +Jupyter sessions and jobs with RStudio Workbench (RSW), Launcher, and +Kubernetes. + +Note: These Docker images are not equipped or intended to be used to run RStudio +Workbench within a Docker container. Visit the +[rstudio/rstudio-worbench Docker Hub page](https://hub.docker.com/r/rstudio/rstudio-workbench) +for images built for that purpose. + +For more information about RStudio Workbench and Launcher, refer to the +[Launcher Overview](https://solutions.rstudio.com/launcher/overview/) on the +RStudio Solutions website. + +For more information about how to use these images with RStudio Workbench and +Launcher, refer to the RStudio support article on [Using Docker images with +RStudio Workbench, Launcher, and +Kubernetes](https://support.rstudio.com/hc/en-us/articles/360019253393-Using-Docker-images-with-RStudio-Server-Pro-Launcher-and-Kubernetes). + +We provide simple ways to extend and build the Dockerfiles. After you have cloned the repo, you can create your own +containers fairly simply with the provided Justfile. + +## Overview + +Built images are available from the +[rstudio/r-session-complete](https://hub.docker.com/r/rstudio/r-session-complete) +repository on Docker Hub. + +These images include the following layers: + +* Base OS +* RSW session components +* System packages required for R, R packages, and RStudio Professional Drivers +* One version of R +* One version of Python +* Jupyter Notebooks, JupyterLab, and RSW/RSC notebook extensions +* RStudio Professional Drivers + +# Licensing + +The license associated with the RStudio Docker Products repository is located [in LICENSE.md](https://github.com/rstudio/rstudio-docker-products/blob/main/LICENSE.md). + +As is the case with all container images, the images themselves also contain other software which may be under other +licenses (i.e. bash, linux, system libraries, etc., along with any other direct or indirect dependencies of the primary +software being contained). + +It is an image user's responsibility to ensure that use of this image (and any of its dependent layers) complies with +all relevant licenses for the software contained in the image. diff --git a/workbench-session/docker-compose.test.yml b/workbench-session/docker-compose.test.yml new file mode 100644 index 00000000..80d19f5d --- /dev/null +++ b/workbench-session/docker-compose.test.yml @@ -0,0 +1,16 @@ +version: '2.3' +services: + + sut: + image: $IMAGE_NAME + command: /run_tests.sh + entrypoint: [] + environment: + # uses .env by default + - RSW_VERSION + - R_VERSION + - PYTHON_VERSION + volumes: + - "./test/run_tests.sh:/run_tests.sh" + - "./test/goss.yaml:/tmp/goss.yaml" + - "./test/goss_vars.yaml:/tmp/goss_vars.yaml" diff --git a/workbench-session/positron.extensions.conf b/workbench-session/positron.extensions.conf new file mode 100644 index 00000000..42191cc9 --- /dev/null +++ b/workbench-session/positron.extensions.conf @@ -0,0 +1,2 @@ +posit.shiny +posit.publisher diff --git a/workbench-session/test/goss.yaml b/workbench-session/test/goss.yaml new file mode 100644 index 00000000..030ff180 --- /dev/null +++ b/workbench-session/test/goss.yaml @@ -0,0 +1,69 @@ +file: + /usr/lib/rstudio-server: + exists: true + /usr/lib/rstudio-server/bin/rsession: + exists: true + /usr/local/bin/jupyter: + exists: true + {{ $version_split := split "." .Env.RSW_VERSION }} + {{ if or (ge ($version_split._0 | atoi) 2025) (and (ge ($version_split._0 | atoi) 2024) (ge ($version_split._1 | atoi) 7)) }} + /usr/lib/rstudio-server/bin/pwb-code-server/bin/code-server: + exists: true + {{ else }} + /usr/lib/rstudio-server/bin/code-server/bin/code-server: + exists: true + {{ end }} + /opt/rstudio-drivers: + exists: true + filetype: directory + /var/lib/rstudio-server/r-versions: + exists: false + /usr/local/bin/quarto: + exists: true + filetype: symlink + +command: + "echo '{ \"cells\": [], \"metadata\": {}, \"nbformat\": 4, \"nbformat_minor\": 2}' | /opt/python/jupyter/bin/jupyter nbconvert --to notebook --stdin --stdout": + title: jupyter_works + timeout: 60000 + exit-status: 0 + +# Ensure correct R version + "/opt/R/{{.Env.R_VERSION}}/bin/R --version": + title: r_version_match + exit-status: 0 + stdout: [ + "{{.Env.R_VERSION}}" + ] + +# Ensure correct python version + "/opt/python/{{.Env.PYTHON_VERSION}}/bin/python3 --version": + title: python_version_matches + exit-status: 0 + stdout: [ + "{{ .Env.PYTHON_VERSION }}" + ] + + "python3 --version": + title: python_in_path_var + exit-status: 0 + stdout: [ + "{{ .Env.PYTHON_VERSION }}" + ] + + "jupyter --version": + title: jupyter_in_path_var + timeout: 60000 + exit-status: 0 + +# Ensure Quarto works + "/usr/local/bin/quarto check --quiet": + title: quarto_check + exit-status: 0 + +# Ensure TinyTeX is installed + "quarto list tools": + title: quarto_tinytex_installed + exit-status: 0 + stderr: + - "/tinytex\\s+Up to date\\s+v\\d{4}\\.\\d{2}(\\.\\d{2})?\\s+v\\d{4}\\.\\d{2}(\\.\\d{2})?/" diff --git a/workbench-session/test/run_tests.sh b/workbench-session/test/run_tests.sh new file mode 100755 index 00000000..8aff0f84 --- /dev/null +++ b/workbench-session/test/run_tests.sh @@ -0,0 +1,19 @@ +#!/bin/bash + +GOSS_FILE=${GOSS_FILE:-/test/goss.yaml} +GOSS_VERSION=${GOSS_VERSION:-0.4.6} +GOSS_MAX_CONCURRENT=${GOSS_MAX_CONCURRENT:-50} + +if [ -f /etc/debian_version ]; then + OS="ubuntu" +else + echo "OS not supported. Exiting" + exit 1 +fi + +# install goss to tmp location and make executable +curl -fsSL https://github.com/aelsabbahy/goss/releases/download/v$GOSS_VERSION/goss-linux-amd64 -o /tmp/goss \ + && chmod +x /tmp/goss \ + && GOSS=/tmp/goss + +OS=$OS GOSS_FILE=$GOSS_FILE $GOSS v --format documentation --max-concurrent $GOSS_MAX_CONCURRENT diff --git a/workbench-session/vscode.extensions.conf b/workbench-session/vscode.extensions.conf new file mode 100644 index 00000000..80e04b95 --- /dev/null +++ b/workbench-session/vscode.extensions.conf @@ -0,0 +1,5 @@ +quarto.quarto +REditorSupport.r@2.8.2 +ms-python.python +posit.shiny +ms-toolsai.jupyter From f184da83e45a8c4f58519f1e808d0810657e2b88 Mon Sep 17 00:00:00 2001 From: Zach Hannum Date: Fri, 15 Nov 2024 13:13:19 -0500 Subject: [PATCH 2/5] Remove RSW from Workbench Session --- workbench-session-init/README.md | 4 +- workbench-session/.env | 1 - workbench-session/Dockerfile.ubuntu2204 | 21 +---- workbench-session/NEWS.md | 94 +---------------------- workbench-session/README.md | 18 ++--- workbench-session/docker-compose.test.yml | 1 - 6 files changed, 16 insertions(+), 123 deletions(-) diff --git a/workbench-session-init/README.md b/workbench-session-init/README.md index 662b595f..76c82b74 100644 --- a/workbench-session-init/README.md +++ b/workbench-session-init/README.md @@ -7,8 +7,8 @@ This directory contains a Dockerfile and script that will create an init contain * Maintained by: [the Posit Docker team](https://github.com/rstudio/rstudio-docker-products) * Where to get help: [our Github Issues page](https://github.com/rstudio/rstudio-docker-products/issues) * Posit Workbench image: [Docker Hub](https://hub.docker.com/r/rstudio/rstudio-workbench) -* RStudio r-session-complete image: [Docker Hub](https://hub.docker.com/r/rstudio/r-session-complete) -* Workbench Session Init image: [Docker Hub](https://hub.docker.com/r/rstudio/workbench-session-init) +* Posit Workbench session image: [Docker Hub](https://hub.docker.com/r/rstudio/workbench-session) +* Posit Workbench session init image: [Docker Hub](https://hub.docker.com/r/rstudio/workbench-session-init) ## Supported tags and respective Dockerfile links diff --git a/workbench-session/.env b/workbench-session/.env index 5138f057..1c5333d8 100644 --- a/workbench-session/.env +++ b/workbench-session/.env @@ -1,4 +1,3 @@ R_VERSION=4.1.0 PYTHON_VERSION=3.9.5 -RSW_VERSION=2024.09.1+394.pro7 DRIVERS_VERSION=2024.03.0-1 diff --git a/workbench-session/Dockerfile.ubuntu2204 b/workbench-session/Dockerfile.ubuntu2204 index 95b04386..28743789 100644 --- a/workbench-session/Dockerfile.ubuntu2204 +++ b/workbench-session/Dockerfile.ubuntu2204 @@ -6,9 +6,6 @@ ARG R_VERSION_ALT=4.3.3 ARG PYTHON_VERSION=3.9.17 ARG PYTHON_VERSION_ALT=3.8.17 ARG JUPYTERLAB_VERSION=3.6.5 -ARG RSW_VERSION=2024.09.1+394.pro7 -ARG RSW_NAME=rstudio-workbench -ARG RSW_DOWNLOAD_URL=https://download2.rstudio.org/server/jammy/amd64 ARG SCRIPTS_DIR=/opt/positscripts ENV WORKBENCH_JUPYTER_PATH=/usr/local/bin/jupyter @@ -23,22 +20,9 @@ RUN apt-get update \ libpq-dev \ rrdtool \ subversion \ - && RSW_VERSION_URL=$(echo -n "${RSW_VERSION}" | sed 's/+/-/g') \ - && curl -fsSL -o rstudio-workbench.deb "${RSW_DOWNLOAD_URL}/${RSW_NAME}-${RSW_VERSION_URL}-amd64.deb" \ - # Pre 7/25/23 packages - && gpg --keyserver keyserver.ubuntu.com --recv-keys 3F32EE77E331692F \ - # Post 7/25 packages - && gpg --keyserver keys.openpgp.org --recv-keys 51C0B5BB19F92D60 \ - && dpkg-sig --verify ./rstudio-workbench.deb \ - && apt-get install -yq --no-install-recommends ./rstudio-workbench.deb \ - && rm ./rstudio-workbench.deb \ && apt-get autoremove -y \ && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && rm -rf /var/lib/rstudio-server/r-versions - -### Install Quarto to PATH ### -RUN ln -s /lib/rstudio-server/bin/quarto/bin/quarto /usr/local/bin/quarto + && rm -rf /var/lib/apt/lists/* ### Install TinyTeX using Quarto ### RUN $SCRIPTS_DIR/install_quarto.sh --install-tinytex --add-path-tinytex @@ -57,7 +41,8 @@ RUN /opt/python/"${PYTHON_VERSION}"/bin/python -m venv /opt/python/jupyter \ && /opt/python/${PYTHON_VERSION_ALT}/bin/python -m ipykernel install --name py${PYTHON_VERSION_ALT} --display-name "Python ${PYTHON_VERSION_ALT}" \ && /opt/python/jupyter/bin/python -m pip cache purge -ENV PATH="/opt/python/jupyter/bin:${PATH}" +# Add Jupyter, Python, and Quarto to the PATH +ENV PATH="/opt/python/jupyter/bin:/opt/python/bin:/usr/lib/rstudio-server/bin/quarto/bin:${PATH}" COPY vscode.extensions.conf /etc/rstudio/vscode.extensions.conf diff --git a/workbench-session/NEWS.md b/workbench-session/NEWS.md index 77917139..e76e114b 100644 --- a/workbench-session/NEWS.md +++ b/workbench-session/NEWS.md @@ -1,92 +1,4 @@ -# 2023.03.1 -- Update Python VSCode extension to version 2023.6.1 +# 2024-11-15 -# 2023.03.0 - -- Update R versions to 4.1.3 and 4.2.3 -- Update Python versions to 3.8.15 and 3.9.14 - -# 2022.12.0 - -- Upgrade workbench to 2022.12.0 -- Use the new `WORKBENCH_JUPYTER_PATH` env var to configure jupyter location -- Remove `vscode.conf/exe` configuration in favor of the new, internal default `code-server` installation -- Refactor image to build _FROM_ the new `product-base-pro` image - -# 2022.07.0 - -- Add a `/usr/local/bin/jupyter` symlink -- Configure Workbench to preinstall R, Python, and Quarto extensions for users on session startup -- Add workbench_jupyterlab python package for the jupyterlab extension - -# 2021.09.0 - -- **BREAKING**: Rename `RSP_` variables to `RSW_`. Rename RStudio Server Pro to RStudio Workbench -- **BREAKING**: Change `R_VERSION` to 4.1.0 -- **BREAKING**: Change `PYTHON_VERSION` to 3.9.5 -- **BREAKING**: R and Python packages are no longer installed by default in session images. - -We have removed R and Python packages from the session image. This should: -- reduce the image build time and size -- make it easier for data scientists to develop reproducible environments -- eliminate conflicts between system libraries and subsequent user updates - -If the removal of these system libraries introduces some problems for you, please file an issue. - -# 1.4.1717-3 - -## Overview - -R is at `/opt/R/4.0.2/bin/R` -python is at `/opt/python/3.7.7/bin/python` -jupyter is at `/opt/python/3.7.7/bin/jupyter` -code-server is at `/opt/code-server/bin/code-server` - -## Changes - -- Update RStudio Professional Drivers to 1.8.0 -- `BREAKING`: `code-server` no longer supports the `/opt/code-server/code-server` location. - - As a result, you need to set `exe=/opt/code-server/bin/code-server` - - After two changes in a row, we suspect this is the final change for a while -_vscode.conf_ -``` -enabled=1 -exe=/opt/code-server/bin/code-server -``` - -# 1.4.1106-5 - -## Overview - -R is at `/opt/R/4.0.2/bin/R` -python is at `/opt/python/3.7.7/bin/python` -jupyter is at `/opt/python/3.7.7/bin/jupyter` -code-server is at `/opt/code-server/code-server` - -## Changes - -- `BREAKING`: Changed code-server version and insulated against version upgrades in the future. To update: -change: - -_vscode.conf_ -``` -enabled=1 -exe=/opt/code-server/code-server-3.2.0-linux-x86_64/code-server -``` -to: -_vscode.conf_ -``` -enabled=1 -exe=/opt/code-server/code-server -``` - -- Update Drivers to version 1.7.0 - -# 1.4.1103-4 - -## Overview - -R is at `/opt/R/4.0.2/bin/R` -python is at `/opt/python/3.7.7/bin/python` -jupyter is at `/opt/python/3.7.7/bin/jupyter` -code-server is at `/opt/code-server/code-server-3.2.0-linux-x86_64/code-server` +- Add NEWS.md +- Add daily builds diff --git a/workbench-session/README.md b/workbench-session/README.md index 243c17d1..1c97a7bd 100644 --- a/workbench-session/README.md +++ b/workbench-session/README.md @@ -2,8 +2,9 @@ * Maintained by: [the Posit Docker team](https://github.com/rstudio/rstudio-docker-products) * Where to get help: [our Github Issues page](https://github.com/rstudio/rstudio-docker-products/issues) -* RStudio Workbench image: [Docker Hub](https://hub.docker.com/r/rstudio/rstudio-workbench) -* RStudio r-session-complete image: [Docker Hub](https://hub.docker.com/r/rstudio/r-session-complete) +* Posit Workbench image: [Docker Hub](https://hub.docker.com/r/rstudio/rstudio-workbench) +* Posit Workbench session image: [Docker Hub](https://hub.docker.com/r/rstudio/workbench-session) +* Posit Workbench session init image: [Docker Hub](https://hub.docker.com/r/rstudio/workbench-session-init) # Supported tags and respective Dockerfile links @@ -33,22 +34,20 @@ The Docker images built from these Dockerfiles are intended to be used for R and Jupyter sessions and jobs with RStudio Workbench (RSW), Launcher, and Kubernetes. -Note: These Docker images are not equipped or intended to be used to run RStudio +Note: These Docker images are not equipped or intended to be used to run Posit Workbench within a Docker container. Visit the [rstudio/rstudio-worbench Docker Hub page](https://hub.docker.com/r/rstudio/rstudio-workbench) for images built for that purpose. -For more information about RStudio Workbench and Launcher, refer to the +For more information about Posit Workbench and Launcher, refer to the [Launcher Overview](https://solutions.rstudio.com/launcher/overview/) on the RStudio Solutions website. For more information about how to use these images with RStudio Workbench and Launcher, refer to the RStudio support article on [Using Docker images with -RStudio Workbench, Launcher, and -Kubernetes](https://support.rstudio.com/hc/en-us/articles/360019253393-Using-Docker-images-with-RStudio-Server-Pro-Launcher-and-Kubernetes). +RStudio Workbench, Launcher, and Kubernetes](https://support.rstudio.com/hc/en-us/articles/360019253393-Using-Docker-images-with-RStudio-Server-Pro-Launcher-and-Kubernetes). -We provide simple ways to extend and build the Dockerfiles. After you have cloned the repo, you can create your own -containers fairly simply with the provided Justfile. +We provide simple ways to extend and build the Dockerfiles. After you have cloned the repo, you can create your own containers fairly simply with the provided Justfile. ## Overview @@ -59,8 +58,7 @@ repository on Docker Hub. These images include the following layers: * Base OS -* RSW session components -* System packages required for R, R packages, and RStudio Professional Drivers +* System packages required for R, R packages, RStudio Professional Drivers, and Workbench Session Components * One version of R * One version of Python * Jupyter Notebooks, JupyterLab, and RSW/RSC notebook extensions diff --git a/workbench-session/docker-compose.test.yml b/workbench-session/docker-compose.test.yml index 80d19f5d..ab22c81a 100644 --- a/workbench-session/docker-compose.test.yml +++ b/workbench-session/docker-compose.test.yml @@ -7,7 +7,6 @@ services: entrypoint: [] environment: # uses .env by default - - RSW_VERSION - R_VERSION - PYTHON_VERSION volumes: From 5d9c081217ba42cf2344a298a42752cf160202de Mon Sep 17 00:00:00 2001 From: Zach Hannum Date: Tue, 19 Nov 2024 13:01:48 -0500 Subject: [PATCH 3/5] Add workbench session target/matrix --- .github/workflows/build-bake.yaml | 42 +++++++++++++++++++++++++++++++ docker-bake.hcl | 30 ++++++++++++++++++++++ workbench-session/README.md | 2 +- 3 files changed, 73 insertions(+), 1 deletion(-) diff --git a/.github/workflows/build-bake.yaml b/.github/workflows/build-bake.yaml index e2d9f539..bb8301ca 100644 --- a/.github/workflows/build-bake.yaml +++ b/.github/workflows/build-bake.yaml @@ -323,6 +323,48 @@ jobs: snyk-org: ${{ secrets.SNYK_ORG }} snyk-token: '${{ secrets.SNYK_TOKEN }}' + workbench-session: + needs: [setup] + name: Workbench Session + runs-on: ubuntu-latest-8x + + concurrency: + group: bake-workbench-session-${{ github.ref }} + cancel-in-progress: true + + env: + target: workbench-session + GIT_SHA: ${{ needs.setup.outputs.GIT_SHA }} + + steps: + - name: Checkout + if: github.event_name == 'schedule' + uses: actions/checkout@v4 + with: + ref: 'main' + + - name: Checkout + if: github.event_name != 'schedule' + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + id: setup-buildx + with: + buildkitd-config: ./share/buildkitd.toml + + - name: Build, Test, and Push + uses: ./.github/actions/bake-test-push + with: + target: ${{ env.target }} + push-image: ${{ github.ref == 'refs/heads/main' || github.event_name == 'schedule' }} + ghcr-token: ${{ secrets.GITHUB_TOKEN }} + dockerhub-username: ${{ secrets.DOCKER_HUB_USERNAME }} + dockerhub-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + gcp-json: '${{ secrets.GCP_ARTIFACT_REGISTRY_JSON }}' + snyk-org: ${{ secrets.SNYK_ORG }} + snyk-token: '${{ secrets.SNYK_TOKEN }}' + workbench-session-init: needs: [setup, versions] name: Workbench Session Init diff --git a/docker-bake.hcl b/docker-bake.hcl index 3306e3a9..e03890c4 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -185,6 +185,10 @@ variable WORKBENCH_BUILD_MATRIX { } } +variable WORKBENCH_SESSION_MATRIX { + default = PRO_BUILD_MATRIX +} + variable WORKBENCH_SESSION_INIT_BUILD_MATRIX { default = { builds = [ @@ -221,6 +225,7 @@ group "default" { "package-manager", "r-session-complete", "workbench", + "workbench-session", "workbench-session-init", ] } @@ -441,6 +446,31 @@ target "r-session-complete" { } } +target "workbench-session" { + inherits = ["base"] + name = "workbench-session-${builds.os}-r${replace(builds.r_primary, ".", "-")}_${replace(builds.r_alternate, ".", "-")}-py${replace(builds.py_primary, ".", "-")}_${replace(builds.py_alternate, ".", "-")}" + + tags = [ + "ghcr.io/rstudio/workbench-session:${builds.os}-r${builds.r_primary}_${builds.r_alternate}-py${builds.py_primary}_${builds.py_alternate}", + "docker.io/rstudio/workbench-session:${builds.os}-r${builds.r_primary}_${builds.r_alternate}-py${builds.py_primary}_${builds.py_alternate}", + ] + + dockerfile = "Dockerfile.${builds.os}" + context = "workbench-session" + contexts = { + product-base-pro = "target:product-base-pro-${builds.os}-r${replace(builds.r_primary, ".", "-")}_${replace(builds.r_alternate, ".", "-")}-py${replace(builds.py_primary, ".", "-")}_${replace(builds.py_alternate, ".", "-")}" + } + + matrix = BASE_BUILD_MATRIX + args = { + R_VERSION = builds.r_primary + R_VERSION_ALT = builds.r_alternate + PYTHON_VERSION = builds.py_primary + PYTHON_VERSION_ALT = builds.py_alternate + JUPYTERLAB_VERSION = DEFAULT_JUPYTERLAB_VERSION + } +} + target "workbench" { inherits = ["base"] diff --git a/workbench-session/README.md b/workbench-session/README.md index 1c97a7bd..c921d26c 100644 --- a/workbench-session/README.md +++ b/workbench-session/README.md @@ -52,7 +52,7 @@ We provide simple ways to extend and build the Dockerfiles. After you have clone ## Overview Built images are available from the -[rstudio/r-session-complete](https://hub.docker.com/r/rstudio/r-session-complete) +[rstudio/workbench-session](https://hub.docker.com/r/rstudio/workbench-session) repository on Docker Hub. These images include the following layers: From 0a988be44b82b79df238947a016985669d516dd2 Mon Sep 17 00:00:00 2001 From: Zach Hannum Date: Tue, 19 Nov 2024 16:30:07 -0500 Subject: [PATCH 4/5] Put Quarto on path in earlier layer --- workbench-session/Dockerfile.ubuntu2204 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/workbench-session/Dockerfile.ubuntu2204 b/workbench-session/Dockerfile.ubuntu2204 index 28743789..06461bf1 100644 --- a/workbench-session/Dockerfile.ubuntu2204 +++ b/workbench-session/Dockerfile.ubuntu2204 @@ -24,6 +24,9 @@ RUN apt-get update \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* +# Add Jupyter, Python, and Quarto to the PATH +ENV PATH="/opt/python/jupyter/bin:/opt/python/bin:/usr/lib/rstudio-server/bin/quarto/bin:${PATH}" + ### Install TinyTeX using Quarto ### RUN $SCRIPTS_DIR/install_quarto.sh --install-tinytex --add-path-tinytex @@ -41,9 +44,6 @@ RUN /opt/python/"${PYTHON_VERSION}"/bin/python -m venv /opt/python/jupyter \ && /opt/python/${PYTHON_VERSION_ALT}/bin/python -m ipykernel install --name py${PYTHON_VERSION_ALT} --display-name "Python ${PYTHON_VERSION_ALT}" \ && /opt/python/jupyter/bin/python -m pip cache purge -# Add Jupyter, Python, and Quarto to the PATH -ENV PATH="/opt/python/jupyter/bin:/opt/python/bin:/usr/lib/rstudio-server/bin/quarto/bin:${PATH}" - COPY vscode.extensions.conf /etc/rstudio/vscode.extensions.conf EXPOSE 8788/tcp From 016e1daa42d87ef9005ce244d69d754dbb2678f9 Mon Sep 17 00:00:00 2001 From: Zach Hannum Date: Tue, 19 Nov 2024 16:49:38 -0500 Subject: [PATCH 5/5] Set QUARTO_VERSION as arg --- workbench-session/Dockerfile.ubuntu2204 | 1 + 1 file changed, 1 insertion(+) diff --git a/workbench-session/Dockerfile.ubuntu2204 b/workbench-session/Dockerfile.ubuntu2204 index 06461bf1..060933b3 100644 --- a/workbench-session/Dockerfile.ubuntu2204 +++ b/workbench-session/Dockerfile.ubuntu2204 @@ -7,6 +7,7 @@ ARG PYTHON_VERSION=3.9.17 ARG PYTHON_VERSION_ALT=3.8.17 ARG JUPYTERLAB_VERSION=3.6.5 ARG SCRIPTS_DIR=/opt/positscripts +ARG QUARTO_VERSION=1.3.340 ENV WORKBENCH_JUPYTER_PATH=/usr/local/bin/jupyter