From d0bb9bb926120ae97996e237bb6b21a2682da679 Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Mon, 7 Aug 2023 07:59:38 -0700 Subject: [PATCH 01/17] Add openssh-client packages into base image to ensure SSH in all downstream images --- product/base/Dockerfile.centos7 | 1 + product/base/Dockerfile.ubuntu1804 | 1 + product/base/Dockerfile.ubuntu2204 | 1 + 3 files changed, 3 insertions(+) diff --git a/product/base/Dockerfile.centos7 b/product/base/Dockerfile.centos7 index 0612f9f4..27341082 100644 --- a/product/base/Dockerfile.centos7 +++ b/product/base/Dockerfile.centos7 @@ -22,6 +22,7 @@ RUN yum upgrade -y -q \ libuser-devel \ libxml2-devel \ openssl-devel \ + openssh-clients \ pandoc \ perl-Digest-MD5 \ postgresql-libs \ diff --git a/product/base/Dockerfile.ubuntu1804 b/product/base/Dockerfile.ubuntu1804 index c5ca6baf..dafa1442 100644 --- a/product/base/Dockerfile.ubuntu1804 +++ b/product/base/Dockerfile.ubuntu1804 @@ -62,6 +62,7 @@ RUN apt-get update --fix-missing \ libxml2-dev \ locales \ make \ + openssh-client \ pandoc \ perl \ sudo \ diff --git a/product/base/Dockerfile.ubuntu2204 b/product/base/Dockerfile.ubuntu2204 index 690b6783..f326b3e3 100644 --- a/product/base/Dockerfile.ubuntu2204 +++ b/product/base/Dockerfile.ubuntu2204 @@ -62,6 +62,7 @@ RUN apt-get update --fix-missing \ libxml2-dev \ locales \ make \ + openssh-client \ pandoc \ perl \ sudo \ From 600181272c6217d9866d4a8ddaa67125df4d2ad7 Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Mon, 7 Aug 2023 09:33:06 -0700 Subject: [PATCH 02/17] Fix GPG call in Ubuntu 18.04 base --- product/base/Dockerfile.ubuntu1804 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product/base/Dockerfile.ubuntu1804 b/product/base/Dockerfile.ubuntu1804 index dafa1442..6fb30a9a 100644 --- a/product/base/Dockerfile.ubuntu1804 +++ b/product/base/Dockerfile.ubuntu1804 @@ -81,7 +81,7 @@ RUN apt-get update --fix-missing \ ### Install tini ### ADD https://cdn.rstudio.com/platform/tini/v${TINI_VERSION}/tini-amd64 /tini ADD https://cdn.rstudio.com/platform/tini/v${TINI_VERSION}/tini-amd64.asc /tini.asc -RUN gpg --batch --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \ +RUN gpg --keyserver keyserver.ubuntu.com --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \ && gpg --batch --verify /tini.asc /tini \ && chmod +x /tini \ && ln -s /tini /usr/local/bin/tini From bfe25b121a55b565edde63484aa8dc101864e840 Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Mon, 7 Aug 2023 09:41:13 -0700 Subject: [PATCH 03/17] Fix path in build --- .github/workflows/build-prerelease.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-prerelease.yaml b/.github/workflows/build-prerelease.yaml index 2e2ec3ae..66addbdf 100644 --- a/.github/workflows/build-prerelease.yaml +++ b/.github/workflows/build-prerelease.yaml @@ -124,7 +124,7 @@ jobs: if: steps.build1.outcome == 'failure' uses: ./.github/actions/build-test-scan-push with: - context: .${{ matrix.config.product }} + context: ./${{ matrix.config.product }} os: ${{ matrix.config.os }} product: product-base image-tags: ${{ steps.get-tags.outputs.IMAGE_TAGS }} From 1b7c4907ed58a902728ab09e2e82d890d1c23ce2 Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Mon, 7 Aug 2023 10:59:17 -0700 Subject: [PATCH 04/17] Add `ca-certificates` and explicit `gpg` install to PPM build (#608) * Add `ca-certificates` and explicit `gpg` install * Remove GPG after PPM install --- package-manager/Dockerfile.ubuntu1804 | 4 ++-- package-manager/Dockerfile.ubuntu2204 | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/package-manager/Dockerfile.ubuntu1804 b/package-manager/Dockerfile.ubuntu1804 index 927f61d8..d9d57a90 100644 --- a/package-manager/Dockerfile.ubuntu1804 +++ b/package-manager/Dockerfile.ubuntu1804 @@ -32,7 +32,7 @@ RUN apt-get update -qq && \ ARG RSPM_VERSION=2023.04.0-6 ARG RSPM_DOWNLOAD_URL=https://cdn.rstudio.com/package-manager/ubuntu/amd64 RUN apt-get update --fix-missing \ - && apt-get install -y --no-install-recommends gdebi-core dpkg-sig \ + && apt-get install -y --no-install-recommends ca-certificates gdebi-core gpg dpkg-sig \ && curl -O ${RSPM_DOWNLOAD_URL}/rstudio-pm_${RSPM_VERSION}_amd64.deb \ # Pre 7/25/23 packages && gpg --keyserver keyserver.ubuntu.com --recv-keys 3F32EE77E331692F \ @@ -41,7 +41,7 @@ RUN apt-get update --fix-missing \ && dpkg-sig --verify rstudio-pm_${RSPM_VERSION}_amd64.deb \ && RSTUDIO_INSTALL_NO_LICENSE_INITIALIZATION=1 gdebi -n rstudio-pm_${RSPM_VERSION}_amd64.deb \ && rm rstudio-pm_${RSPM_VERSION}_amd64.deb \ - && apt-get purge -y gdebi-core dpkg-sig \ + && apt-get purge -y gdebi-core dpkg-sig gpg \ && apt-get autoremove -y \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ diff --git a/package-manager/Dockerfile.ubuntu2204 b/package-manager/Dockerfile.ubuntu2204 index 4e55936e..b7d44a41 100644 --- a/package-manager/Dockerfile.ubuntu2204 +++ b/package-manager/Dockerfile.ubuntu2204 @@ -32,7 +32,7 @@ RUN apt-get update -qq && \ ARG RSPM_VERSION=2023.04.0-6 ARG RSPM_DOWNLOAD_URL=https://cdn.rstudio.com/package-manager/ubuntu22/amd64 RUN apt-get update --fix-missing \ - && apt-get install -y --no-install-recommends gdebi-core dpkg-sig \ + && apt-get install -y --no-install-recommends ca-certificates gdebi-core gpg dpkg-sig \ && curl -O ${RSPM_DOWNLOAD_URL}/rstudio-pm_${RSPM_VERSION}_amd64.deb \ # Pre 7/25/23 packages && gpg --keyserver keyserver.ubuntu.com --recv-keys 3F32EE77E331692F \ @@ -41,7 +41,7 @@ RUN apt-get update --fix-missing \ && dpkg-sig --verify rstudio-pm_${RSPM_VERSION}_amd64.deb \ && RSTUDIO_INSTALL_NO_LICENSE_INITIALIZATION=1 gdebi -n rstudio-pm_${RSPM_VERSION}_amd64.deb \ && rm rstudio-pm_${RSPM_VERSION}_amd64.deb \ - && apt-get purge -y gdebi-core dpkg-sig \ + && apt-get purge -y gdebi-core dpkg-sig gpg \ && apt-get autoremove -y \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ From 7935496f88ec01443d4c526e7b78f5e504a90b52 Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Mon, 7 Aug 2023 13:50:11 -0700 Subject: [PATCH 05/17] Remove ubuntu1804 base image (#611) * Revert "Fix GPG call in Ubuntu 18.04 base" This reverts commit 600181272c6217d9866d4a8ddaa67125df4d2ad7. * Remove Ubuntu 18.04 base image - Removes product/base/Dockerfile.ubuntu1804 and product/pro/Dockerfile.ubuntu1804 as neither are in use. - Change defaults and example commands across all project Justfiles to ubuntu2204. - Remove Dockerfile.*.draft from package-manager, would have to be rewritten if we decide to switch PPM to the repo product base image. - Remove 18.04 builds from workflows. - Add NEWS.md entry. * Update product/pro/Justfile Co-authored-by: Benjamin R. J. Schwedler --------- Co-authored-by: Benjamin R. J. Schwedler --- .github/workflows/build-release.yaml | 4 - .github/workflows/lint.yaml | 2 - Justfile | 6 +- NEWS.md | 4 + content/base/Justfile | 4 +- content/pro/Justfile | 4 +- package-manager/Dockerfile.ubuntu1804.draft | 41 ------ package-manager/Dockerfile.ubuntu2204.draft | 41 ------ package-manager/Justfile | 10 +- product/base/Dockerfile.ubuntu1804 | 148 -------------------- product/base/Justfile | 8 +- product/pro/Dockerfile.ubuntu1804 | 29 ---- product/pro/Justfile | 8 +- r-session-complete/Justfile | 8 +- workbench-for-microsoft-azure-ml/Justfile | 8 +- workbench/Justfile | 8 +- 16 files changed, 36 insertions(+), 297 deletions(-) delete mode 100644 package-manager/Dockerfile.ubuntu1804.draft delete mode 100644 package-manager/Dockerfile.ubuntu2204.draft delete mode 100644 product/base/Dockerfile.ubuntu1804 delete mode 100644 product/pro/Dockerfile.ubuntu1804 diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index ba28125a..205c4f72 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -22,8 +22,6 @@ jobs: config: - {os: 'centos7', r-primary: "4.2.0", r-alternate: "3.6.2", py-primary: "3.9.5", py-alternate: "3.8.10"} - {os: 'centos7', r-primary: "4.2.3", r-alternate: "4.1.3", py-primary: "3.9.14", py-alternate: "3.8.15"} - - {os: 'ubuntu1804', r-primary: "4.2.0", r-alternate: "3.6.2", py-primary: "3.9.5", py-alternate: "3.8.10"} - - {os: 'ubuntu1804', r-primary: "4.2.3", r-alternate: "4.1.3", py-primary: "3.9.17", py-alternate: "3.8.17"} - {os: 'ubuntu2204', r-primary: "4.2.0", r-alternate: "3.6.2", py-primary: "3.9.5", py-alternate: "3.8.10"} - {os: 'ubuntu2204', r-primary: "4.2.3", r-alternate: "4.1.3", py-primary: "3.9.14", py-alternate: "3.8.15"} - {os: 'ubuntu2204', r-primary: "4.2.3", r-alternate: "4.1.3", py-primary: "3.9.17", py-alternate: "3.8.17"} @@ -119,8 +117,6 @@ jobs: config: - {os: 'centos7', r-primary: "4.2.0", r-alternate: "3.6.2", py-primary: "3.9.5", py-alternate: "3.8.10"} - {os: 'centos7', r-primary: "4.2.3", r-alternate: "4.1.3", py-primary: "3.9.14", py-alternate: "3.8.15"} - - {os: 'ubuntu1804', r-primary: "4.2.0", r-alternate: "3.6.2", py-primary: "3.9.5", py-alternate: "3.8.10"} - - {os: 'ubuntu1804', r-primary: "4.2.3", r-alternate: "4.1.3", py-primary: "3.9.17", py-alternate: "3.8.17"} - {os: 'ubuntu2204', r-primary: "4.2.0", r-alternate: "3.6.2", py-primary: "3.9.5", py-alternate: "3.8.10"} - {os: 'ubuntu2204', r-primary: "4.2.3", r-alternate: "4.1.3", py-primary: "3.9.14", py-alternate: "3.8.15"} - {os: 'ubuntu2204', r-primary: "4.2.3", r-alternate: "4.1.3", py-primary: "3.9.17", py-alternate: "3.8.17"} diff --git a/.github/workflows/lint.yaml b/.github/workflows/lint.yaml index 15f71f3e..7877099c 100644 --- a/.github/workflows/lint.yaml +++ b/.github/workflows/lint.yaml @@ -16,10 +16,8 @@ jobs: fail-fast: false matrix: config: - - {product: 'product/base', os: 'ubuntu1804'} - {product: 'product/base', os: 'ubuntu2204'} - {product: 'product/base', os: 'centos7'} - - {product: 'product/pro', os: 'ubuntu1804'} - {product: 'product/pro', os: 'ubuntu2204'} - {product: 'product/pro', os: 'centos7'} - {product: 'workbench', os: 'ubuntu2204'} diff --git a/Justfile b/Justfile index c35b05a9..d728145d 100644 --- a/Justfile +++ b/Justfile @@ -33,7 +33,7 @@ _get-clean-version $VERSION: #!/usr/bin/env bash echo -n "$VERSION" | sed 's/[+|-].*//g' -# just _parse-os bionic +# just _parse-os jammy _parse-os OS: #!/usr/bin/env bash if [[ "{{OS}}" == "bionic" ]]; then @@ -44,7 +44,7 @@ _parse-os OS: echo "{{OS}}" fi -# just _rev-parse-os ubuntu1804 +# just _rev-parse-os ubuntu2204 _rev-parse-os OS: #!/usr/bin/env bash if [[ "{{OS}}" == "ubuntu1804" ]]; then @@ -299,7 +299,7 @@ test-image $PRODUCT $VERSION +IMAGES: PYTHON_VERSION_ALT={{PYTHON_VERSION_ALT}} \ $PRODUCT/test "${IMAGE_ARRAY[0]}" "$VERSION" -# just lint workbench ubuntu1804 +# just lint workbench ubuntu2204 lint $PRODUCT $OS: #!/usr/bin/env bash docker run --rm -i -v $PWD/hadolint.yaml:/.config/hadolint.yaml ghcr.io/hadolint/hadolint < $PRODUCT/Dockerfile.$(just _parse-os {{OS}}) diff --git a/NEWS.md b/NEWS.md index ed07f5ff..d4235cc1 100644 --- a/NEWS.md +++ b/NEWS.md @@ -5,6 +5,10 @@ changed in each image. This file only captures pervasive, repository-wide changes. +# 2023-08-07 + +- Removed base image Ubuntu 18.04 builds. + # 2023-08-01 - Overhauled the workflows for this repository to use official Github Actions over `just` targets for building, testing, scanning, and pushing images. diff --git a/content/base/Justfile b/content/base/Justfile index 7744929a..a1defbf8 100755 --- a/content/base/Justfile +++ b/content/base/Justfile @@ -4,7 +4,7 @@ BUILDX_PATH := "" IMAGE_PREFIX := "rstudio/" PRODUCT := "content-base" -IMAGE_OS := "ubuntu1804" +IMAGE_OS := "ubuntu2204" R_VERSION := "3.6.3" @@ -14,7 +14,7 @@ QUARTO_VERSION := "1.3.340" DEFAULT_TAG := IMAGE_PREFIX + PRODUCT + ":r" + R_VERSION + "-py" + PYTHON_VERSION + "-" + IMAGE_OS -# Build content base image - just build ubuntu1804 3.6.3 3.9.5 rstudio/content-base:r3.6.3-py3.9.5-bionic +# Build content base image - just build ubuntu2204 3.6.3 3.9.5 rstudio/content-base:r3.6.3-py3.9.5-bionic build OS=IMAGE_OS _R_VERSION=R_VERSION _PYTHON_VERSION=PYTHON_VERSION +TAGS="": #!/usr/bin/env bash set -euxo pipefail diff --git a/content/pro/Justfile b/content/pro/Justfile index 472e849d..710d6509 100755 --- a/content/pro/Justfile +++ b/content/pro/Justfile @@ -4,7 +4,7 @@ BUILDX_PATH := "" IMAGE_PREFIX := "rstudio/" PRODUCT := "content-pro" -IMAGE_OS := "ubuntu1804" +IMAGE_OS := "ubuntu2204" R_VERSION := "3.6.3" @@ -15,7 +15,7 @@ DRIVERS_VERSION_RHEL := DRIVERS_VERSION + "-1" DEFAULT_TAG := IMAGE_PREFIX + PRODUCT + ":r" + R_VERSION + "-py" + PYTHON_VERSION + "-" + IMAGE_OS -# Build content pro image - just build ubuntu1804 3.6.3 3.9.5 rstudio/content-pro:r3.6.3-py3.9.5-bionic +# Build content pro image - just build ubuntu2204 3.6.3 3.9.5 rstudio/content-pro:r3.6.3-py3.9.5-bionic build OS=IMAGE_OS _R_VERSION=R_VERSION _PYTHON_VERSION=PYTHON_VERSION +TAGS=DEFAULT_TAG: #!/usr/bin/env bash set -euxo pipefail diff --git a/package-manager/Dockerfile.ubuntu1804.draft b/package-manager/Dockerfile.ubuntu1804.draft deleted file mode 100644 index 88507a1d..00000000 --- a/package-manager/Dockerfile.ubuntu1804.draft +++ /dev/null @@ -1,41 +0,0 @@ -ARG R_VERSION=4.2.3 -ARG R_VERSION_ALT=4.1.3 -ARG PYTHON_VERSION=3.9.17 -ARG PYTHON_VERSION_ALT=3.8.10 -ARG SRC_IMAGE_NAME=product-base -ARG REGISTRY=ghcr.io -FROM ${REGISTRY}/rstudio/${SRC_IMAGE_NAME}:ubuntu1804-r${R_VERSION}_${R_VERSION_ALT}-py${PYTHON_VERSION}_${PYTHON_VERSION_ALT} -LABEL maintainer="RStudio Docker " - -ARG DEBIAN_FRONTEND=noninteractive - -ENV PATH /opt/rstudio-pm/bin:$PATH -ARG RSPM_VERSION=2022.07.2-11 -ARG RSPM_DOWNLOAD_URL=https://cdn.rstudio.com/package-manager/ubuntu/amd64 -COPY --chmod=0775 startup.sh /usr/local/bin/startup.sh -RUN apt-get update --fix-missing \ - && curl -O ${RSPM_DOWNLOAD_URL}/rstudio-pm_${RSPM_VERSION}_amd64.deb \ - && gpg --keyserver keyserver.ubuntu.com --recv-keys 3F32EE77E331692F \ - && dpkg-sig --verify ./rstudio-pm_${RSPM_VERSION}_amd64.deb \ - && RSTUDIO_INSTALL_NO_LICENSE_INITIALIZATION=1 apt-get install -yq --no-install-recommends ./rstudio-pm_${RSPM_VERSION}_amd64.deb \ - && rm ./rstudio-pm_${RSPM_VERSION}_amd64.deb \ - && apt-get autoremove -y \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && ln -s /opt/rstudio-pm/bin/rspm /usr/local/bin/rspm \ - && mkdir -p /var/run/rstudio-pm \ - && chmod +x /usr/local/bin/startup.sh \ - && chown rstudio-pm:rstudio-pm /usr/local/bin/startup.sh \ - && chown -R rstudio-pm:rstudio-pm /var/run/rstudio-pm - -USER rstudio-pm -COPY rstudio-pm.gcfg /etc/rstudio-pm/rstudio-pm.gcfg - -# Set up licensing to work in userspace mode. This will not prevent activating a -# license as root, but it is required to activate one as the non-root user at -# runtime. It's possible for this to fail and the trail will be considered over, -# in which case we can ignore it anyway. -RUN license-manager initialize --userspace || true - -ENTRYPOINT ["tini", "--"] -CMD ["/usr/local/bin/startup.sh"] diff --git a/package-manager/Dockerfile.ubuntu2204.draft b/package-manager/Dockerfile.ubuntu2204.draft deleted file mode 100644 index 67b63c97..00000000 --- a/package-manager/Dockerfile.ubuntu2204.draft +++ /dev/null @@ -1,41 +0,0 @@ -ARG R_VERSION=4.2.3 -ARG R_VERSION_ALT=4.1.3 -ARG PYTHON_VERSION=3.9.17 -ARG PYTHON_VERSION_ALT=3.8.10 -ARG SRC_IMAGE_NAME=product-base -ARG REGISTRY=ghcr.io -FROM ${REGISTRY}/rstudio/${SRC_IMAGE_NAME}:ubuntu2204-r${R_VERSION}_${R_VERSION_ALT}-py${PYTHON_VERSION}_${PYTHON_VERSION_ALT} -LABEL maintainer="RStudio Docker " - -ARG DEBIAN_FRONTEND=noninteractive - -ENV PATH /opt/rstudio-pm/bin:$PATH -ARG RSPM_VERSION=2022.07.2-11 -ARG RSPM_DOWNLOAD_URL=https://cdn.rstudio.com/package-manager/ubuntu22/amd64 -COPY --chmod=0775 startup.sh /usr/local/bin/startup.sh -RUN apt-get update --fix-missing \ - && curl -O ${RSPM_DOWNLOAD_URL}/rstudio-pm_${RSPM_VERSION}_amd64.deb \ - && gpg --keyserver keyserver.ubuntu.com --recv-keys 3F32EE77E331692F \ - && dpkg-sig --verify ./rstudio-pm_${RSPM_VERSION}_amd64.deb \ - && RSTUDIO_INSTALL_NO_LICENSE_INITIALIZATION=1 apt-get install -yq --no-install-recommends ./rstudio-pm_${RSPM_VERSION}_amd64.deb \ - && rm ./rstudio-pm_${RSPM_VERSION}_amd64.deb \ - && apt-get autoremove -y \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* \ - && ln -s /opt/rstudio-pm/bin/rspm /usr/local/bin/rspm \ - && mkdir -p /var/run/rstudio-pm \ - && chmod +x /usr/local/bin/startup.sh \ - && chown rstudio-pm:rstudio-pm /usr/local/bin/startup.sh \ - && chown -R rstudio-pm:rstudio-pm /var/run/rstudio-pm - -USER rstudio-pm -COPY rstudio-pm.gcfg /etc/rstudio-pm/rstudio-pm.gcfg - -# Set up licensing to work in userspace mode. This will not prevent activating a -# license as root, but it is required to activate one as the non-root user at -# runtime. It's possible for this to fail and the trail will be considered over, -# in which case we can ignore it anyway. -RUN license-manager initialize --userspace || true - -ENTRYPOINT ["tini", "--"] -CMD ["/usr/local/bin/startup.sh"] diff --git a/package-manager/Justfile b/package-manager/Justfile index 4df263ed..4cab639b 100644 --- a/package-manager/Justfile +++ b/package-manager/Justfile @@ -4,7 +4,7 @@ BUILDX_PATH := "" IMAGE_PREFIX := "rstudio-" PRODUCT := "package-manager" -IMAGE_OS := "ubuntu1804" +IMAGE_OS := "ubuntu2204" RSPM_VERSION := "2023.04.0-6" RSPM_LICENSE := "" @@ -22,7 +22,7 @@ PERSIST_LICENSE_DIR := join(justfile_directory(), "tmp-lic") _make-default-tag OS=IMAGE_OS: echo "{{IMAGE_PREFIX}}{{PRODUCT}}:{{OS}}-$(just -f ../Justfile _get-tag-safe-version {{RSPM_VERSION}})" -# Build Package Manager image - just build ubuntu1804 2022.07.2-11 rstudio/rstudio-package-manager:ubuntu1804-2022.07.2-11 +# Build Package Manager image - just build ubuntu2204 2022.07.2-11 rstudio/rstudio-package-manager:ubuntu2204-2022.07.2-11 build OS=IMAGE_OS VERSION=RSPM_VERSION *TAGS="": #!/usr/bin/env bash set -euxo pipefail @@ -50,7 +50,7 @@ build OS=IMAGE_OS VERSION=RSPM_VERSION *TAGS="": --build-arg R_VERSION_ALT="{{ R_VERSION_ALT }}" \ --file=./Dockerfile.$(just -f ../Justfile _parse-os {{OS}}) . -# Test Package Manager image - just test rstudio/rstudio-package-manager:ubuntu1804-2022.07.2-11 2022.07.2-11 +# Test Package Manager image - just test rstudio/rstudio-package-manager:ubuntu2204-2022.07.2-11 2022.07.2-11 test TAG=`just _make-default-tag` VERSION=RSPM_VERSION CMD="": #!/usr/bin/env bash set -euxo pipefail @@ -62,11 +62,11 @@ test TAG=`just _make-default-tag` VERSION=RSPM_VERSION CMD="": R_VERSION_ALT="{{ R_VERSION_ALT }}" \ docker-compose -f ./docker-compose.test.yml run sut {{ CMD }} -# Test Package Manager image interactively - just test-i rstudio/rstudio-package-manager:ubuntu1804-2022.07.2-11 2022.07.2-11 +# Test Package Manager image interactively - just test-i rstudio/rstudio-package-manager:ubuntu2204-2022.07.2-11 2022.07.2-11 test-i TAG=`just _make-default-tag` VERSION=RSPM_VERSION: just test {{ TAG }} {{ VERSION }} bash -# Run Package Manager - just RSPM_LICENSE="" run rstudio/rstudio-package-manager:ubuntu1804-2022.07.2-11 +# Run Package Manager - just RSPM_LICENSE="" run rstudio/rstudio-package-manager:ubuntu2204-2022.07.2-11 run TAG=`just _make-default-tag` CMD="": #!/usr/bin/env bash set -euxo pipefail diff --git a/product/base/Dockerfile.ubuntu1804 b/product/base/Dockerfile.ubuntu1804 deleted file mode 100644 index 6fb30a9a..00000000 --- a/product/base/Dockerfile.ubuntu1804 +++ /dev/null @@ -1,148 +0,0 @@ -FROM ubuntu:18.04 -LABEL maintainer="Posit Docker " - -### ARG declarations ### -ARG DEBIAN_FRONTEND=noninteractive -ARG R_VERSION=4.2.3 -ARG R_VERSION_ALT=4.1.3 -ARG PYTHON_VERSION=3.9.17 -ARG PYTHON_VERSION_ALT=3.8.17 -ARG TINI_VERSION=0.19.0 -ARG QUARTO_VERSION=1.3.340 - -### Update/upgrade system packages ### -RUN apt-get update --fix-missing \ - && apt-get upgrade -yq \ - && apt-get install -yq --no-install-recommends \ - apt-transport-https \ - ca-certificates \ - cmake \ - cracklib-runtime \ - curl \ - default-jdk \ - dirmngr \ - dpkg-sig \ - g++ \ - gcc \ - gdal-bin \ - gfortran \ - git \ - gpg \ - gpg-agent \ - gsfonts \ - imagemagick \ - libcairo2-dev \ - libcurl4-openssl-dev \ - libev-dev \ - libfontconfig1-dev \ - libfreetype6-dev \ - libfribidi-dev \ - libgdal-dev \ - libgeos-dev \ - libgl1-mesa-dev \ - libglpk-dev \ - libglu1-mesa-dev \ - libgmp3-dev \ - libharfbuzz-dev \ - libicu-dev \ - libjpeg-dev \ - libmagick++-dev \ - libmysqlclient-dev \ - libopenblas-dev \ - libpaper-utils \ - libpcre2-dev \ - libpng-dev \ - libproj-dev \ - libsodium-dev \ - libssh2-1-dev \ - libssl-dev \ - libtiff-dev \ - libudunits2-dev \ - libv8-dev \ - libxml2-dev \ - locales \ - make \ - openssh-client \ - pandoc \ - perl \ - sudo \ - tcl \ - tk \ - tk-dev \ - tk-table \ - tzdata \ - unixodbc-dev \ - unzip \ - wget \ - zip \ - zlib1g-dev \ - && rm -rf /var/lib/apt/lists/* - -### Install tini ### -ADD https://cdn.rstudio.com/platform/tini/v${TINI_VERSION}/tini-amd64 /tini -ADD https://cdn.rstudio.com/platform/tini/v${TINI_VERSION}/tini-amd64.asc /tini.asc -RUN gpg --keyserver keyserver.ubuntu.com --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \ - && gpg --batch --verify /tini.asc /tini \ - && chmod +x /tini \ - && ln -s /tini /usr/local/bin/tini - -### Install TinyTeX ### -SHELL ["/bin/bash", "-o", "pipefail", "-c"] -RUN curl -sL "https://yihui.org/tinytex/install-bin-unix.sh" | sh \ - && /root/.TinyTeX/bin/*/tlmgr path remove \ - && mv /root/.TinyTeX/ /opt/TinyTeX \ - && /opt/TinyTeX/bin/*/tlmgr option sys_bin /usr/local/bin \ - && /opt/TinyTeX/bin/*/tlmgr path add - -### Install Quarto ### -RUN curl -o quarto.tar.gz -L https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.tar.gz \ - && mkdir -p /opt/quarto/${QUARTO_VERSION} \ - && tar -zxvf quarto.tar.gz -C "/opt/quarto/${QUARTO_VERSION}" --strip-components=1 \ - && rm -f quarto.tar.gz \ - && ln -s /opt/quarto/${QUARTO_VERSION}/bin/quarto /usr/local/bin/quarto - -### Install R versions ### -RUN curl -O https://cdn.rstudio.com/r/ubuntu-1804/pkgs/r-${R_VERSION}_1_amd64.deb \ - && curl -O https://cdn.rstudio.com/r/ubuntu-1804/pkgs/r-${R_VERSION_ALT}_1_amd64.deb \ - && apt-get install -yq --no-install-recommends ./r-${R_VERSION}_1_amd64.deb \ - && apt-get install -yq --no-install-recommends ./r-${R_VERSION_ALT}_1_amd64.deb \ - && rm -f ./r-${R_VERSION}_1_amd64.deb \ - && rm -f ./r-${R_VERSION_ALT}_1_amd64.deb \ - && ln -s /opt/R/${R_VERSION} /opt/R/default \ - && ln -s /opt/R/default/bin/R /usr/local/bin/R \ - && ln -s /opt/R/default/bin/Rscript /usr/local/bin/Rscript - -### Install Python versions ### -RUN curl -O https://cdn.rstudio.com/python/ubuntu-1804/pkgs/python-${PYTHON_VERSION}_1_amd64.deb \ - && curl -O https://cdn.rstudio.com/python/ubuntu-1804/pkgs/python-${PYTHON_VERSION_ALT}_1_amd64.deb \ - && apt-get install -yq --no-install-recommends ./python-${PYTHON_VERSION}_1_amd64.deb \ - && apt-get install -yq --no-install-recommends ./python-${PYTHON_VERSION_ALT}_1_amd64.deb \ - && rm -rf python-${PYTHON_VERSION}_1_amd64.deb \ - && rm -rf python-${PYTHON_VERSION_ALT}_1_amd64.deb \ - && /opt/python/${PYTHON_VERSION}/bin/python3 -m pip install 'virtualenv<20' \ - && /opt/python/${PYTHON_VERSION}/bin/python3 -m pip install --upgrade setuptools \ - && /opt/python/${PYTHON_VERSION_ALT}/bin/python3 -m pip install 'virtualenv<20' \ - && /opt/python/${PYTHON_VERSION_ALT}/bin/python3 -m pip install --upgrade setuptools \ - && ln -s /opt/python/${PYTHON_VERSION} /opt/python/default - -### Locale configuration ### -RUN localedef -i en_US -f UTF-8 en_US.UTF-8 -ENV LANG en_US.UTF-8 -ENV LANGUAGE en_US:en -ENV LC_ALL en_US.UTF-8 - -### Clean up ### -RUN apt-get install -yqf --no-install-recommends \ - && apt-get autoremove \ - && apt-get clean \ - && rm -rf /var/lib/apt/lists/* - - -LABEL posit.r.version="${R_VERSION}" \ - posit.r.version_alt="${R_VERSION_ALT}" \ - posit.python.version="${PYTHON_VERSION}" \ - posit.python.version_alt="${PYTHON_VERSION_ALT}" \ - posit.tini.version="${TINI_VERSION}" \ - posit.quarto.version="${QUARTO_VERSION}" - -ENTRYPOINT ["/tini", "--"] diff --git a/product/base/Justfile b/product/base/Justfile index b011a4ce..00c60378 100755 --- a/product/base/Justfile +++ b/product/base/Justfile @@ -3,7 +3,7 @@ set positional-arguments BUILDX_PATH := "" PRODUCT := "product-base" -IMAGE_OS := "ubuntu1804" +IMAGE_OS := "ubuntu2204" IMAGE_REGISTRY := "rstudio" @@ -19,7 +19,7 @@ QUARTO_VERSION := "1.3.340" _make-default-tag OS=IMAGE_OS: echo "{{IMAGE_REGISTRY}}/{{PRODUCT}}:{{OS}}-r{{R_VERSION}}_{{R_VERSION_ALT}}-py{{PYTHON_VERSION}}_{{PYTHON_VERSION_ALT}}" -# Build base image - just build ubuntu1804 rstudio/product-base:ubuntu1804 +# Build base image - just build ubuntu2204 rstudio/product-base:ubuntu2204 build OS=IMAGE_OS *TAGS="": #!/usr/bin/env bash set -euxo pipefail @@ -50,7 +50,7 @@ build OS=IMAGE_OS *TAGS="": --build-arg QUARTO_VERSION="{{ QUARTO_VERSION }}" \ --file=./Dockerfile.$(just -f ../../Justfile _parse-os {{OS}}) . -# Test base image - just test rstudio/product-base:ubuntu1804 +# Test base image - just test rstudio/product-base:ubuntu2204 test TAG=`just _make-default-tag` CMD="": #!/usr/bin/env bash set -euxo pipefail @@ -64,6 +64,6 @@ test TAG=`just _make-default-tag` CMD="": OS="{{ IMAGE_OS }}" \ docker-compose -f ./docker-compose.test.yml run sut {{ CMD }} -# Test base image interactively - just test-i rstudio/product-base:ubuntu1804 +# Test base image interactively - just test-i rstudio/product-base:ubuntu2204 test-i TAG=`just _make-default-tag`: just test {{ TAG }} bash diff --git a/product/pro/Dockerfile.ubuntu1804 b/product/pro/Dockerfile.ubuntu1804 deleted file mode 100644 index cca5be57..00000000 --- a/product/pro/Dockerfile.ubuntu1804 +++ /dev/null @@ -1,29 +0,0 @@ -ARG R_VERSION=4.2.3 -ARG R_VERSION_ALT=4.1.3 -ARG PYTHON_VERSION=3.9.17 -ARG PYTHON_VERSION_ALT=3.8.17 -ARG SRC_IMAGE_NAME=product-base -ARG REGISTRY=ghcr.io -FROM ${REGISTRY}/rstudio/${SRC_IMAGE_NAME}:ubuntu1804-r${R_VERSION}_${R_VERSION_ALT}-py${PYTHON_VERSION}_${PYTHON_VERSION_ALT} -LABEL maintainer="Posit Docker " - -ARG DEBIAN_FRONTEND=noninteractive -ARG R_VERSION=4.2.3 -ARG R_VERSION_ALT=4.1.3 -ARG PYTHON_VERSION=3.9.17 -ARG PYTHON_VERSION_ALT=3.8.17 -ARG DRIVERS_VERSION=2023.05.0 - -RUN apt-get update \ - && apt-get install -yq --no-install-recommends unixodbc unixodbc-dev \ - && curl -O https://cdn.rstudio.com/drivers/7C152C12/installer/rstudio-drivers_${DRIVERS_VERSION}_amd64.deb \ - && apt-get update \ - && apt-get install -yq --no-install-recommends ./rstudio-drivers_${DRIVERS_VERSION}_amd64.deb \ - && rm -f ./rstudio-drivers_${DRIVERS_VERSION}_amd64.deb \ - && rm -rf /var/lib/apt/lists/* \ - && cp /opt/rstudio-drivers/odbcinst.ini.sample /etc/odbcinst.ini \ - && /opt/R/${R_VERSION}/bin/R -e 'install.packages("odbc", repos="https://packagemanager.rstudio.com/cran/__linux__/bionic/latest")' - -LABEL rstudio.pro-drivers.version="${DRIVERS_VERSION}" - -ENTRYPOINT ["/tini", "--"] diff --git a/product/pro/Justfile b/product/pro/Justfile index f67f5ef1..354c6546 100644 --- a/product/pro/Justfile +++ b/product/pro/Justfile @@ -3,7 +3,7 @@ set positional-arguments BUILDX_PATH := "" PRODUCT := "product-base-pro" -IMAGE_OS := "ubuntu1804" +IMAGE_OS := "ubuntu2204" IMAGE_REGISTRY := "rstudio" @@ -22,7 +22,7 @@ DRIVERS_VERSION_RHEL := DRIVERS_VERSION + "-1" _make-default-tag OS=IMAGE_OS: echo "{{IMAGE_REGISTRY}}/{{PRODUCT}}:{{OS}}-r{{R_VERSION}}_{{R_VERSION_ALT}}-py{{PYTHON_VERSION}}_{{PYTHON_VERSION_ALT}}" -# Build base pro image - just build ubuntu1804 rstudio/product-base-pro:ubuntu1804 +# Build base pro image - just build ubuntu2204 rstudio/product-base-pro:ubuntu2204 build OS=IMAGE_OS *TAGS="": #!/usr/bin/env bash set -euxo pipefail @@ -58,7 +58,7 @@ build OS=IMAGE_OS *TAGS="": --build-arg DRIVERS_VERSION="${_DRIVERS_VERSION}" \ --file=./Dockerfile.$(just -f ../../Justfile _parse-os {{OS}}) . -# Test base image - just test rstudio/product-base-pro:ubuntu1804 +# Test base image - just test rstudio/product-base-pro:ubuntu2204 test TAG=`just _make-default-tag` CMD="": #!/usr/bin/env bash set -euxo pipefail @@ -74,6 +74,6 @@ test TAG=`just _make-default-tag` CMD="": OS="{{ IMAGE_OS }}" \ docker-compose -f ./docker-compose.test.yml run sut {{ CMD }} -# Test base image interactively - just test-i rstudio/product-base-pro:ubuntu1804 +# Test base image interactively - just test-i rstudio/product-base-pro:ubuntu2204 test-i TAG=`just _make-default-tag`: just test {{ TAG }} bash diff --git a/r-session-complete/Justfile b/r-session-complete/Justfile index 2a7bc6db..ebbbba83 100755 --- a/r-session-complete/Justfile +++ b/r-session-complete/Justfile @@ -21,7 +21,7 @@ PYTHON_VERSION_ALT := "3.8.15" _make-default-tag OS=IMAGE_OS: echo "{{IMAGE_PREFIX}}{{PRODUCT}}:{{OS}}-$(just -f ../Justfile _get-tag-safe-version {{RSW_VERSION}})" -# Build r-session-complete image - just build ubuntu1804 2022.07.2+576.pro12 rstudio/r-session-complete:ubuntu1804-2022.07.2-576.pro12 +# Build r-session-complete image - just build ubuntu2204 2022.07.2+576.pro12 rstudio/r-session-complete:ubuntu2204-2022.07.2-576.pro12 build OS=IMAGE_OS VERSION=RSW_VERSION *TAGS="": #!/usr/bin/env bash set -euxo pipefail @@ -57,7 +57,7 @@ build OS=IMAGE_OS VERSION=RSW_VERSION *TAGS="": --build-arg PYTHON_VERSION_ALT="{{ PYTHON_VERSION_ALT }}" \ --file=./Dockerfile.$(just -f ../Justfile _parse-os {{OS}}) . -# Test r-session-complete image - just test rstudio/r-session-complete:ubuntu1804-2022.07.2-576.pro12 2022.07.2+576.pro12 +# Test r-session-complete image - just test rstudio/r-session-complete:ubuntu2204-2022.07.2-576.pro12 2022.07.2+576.pro12 test TAG=`just _make-default-tag` VERSION=RSW_VERSION CMD="": #!/usr/bin/env bash set -euxo pipefail @@ -69,11 +69,11 @@ test TAG=`just _make-default-tag` VERSION=RSW_VERSION CMD="": PYTHON_VERSION_ALT="{{ PYTHON_VERSION_ALT }}" \ docker-compose -f ./docker-compose.test.yml run sut {{ CMD }} -# Test r-session-complete image interactively - just test-i rstudio/r-session-complete:ubuntu1804-2022.07.2-576.pro12 2022.07.2+576.pro12 +# Test r-session-complete image interactively - just test-i rstudio/r-session-complete:ubuntu2204-2022.07.2-576.pro12 2022.07.2+576.pro12 test-i TAG=`just _make-default-tag` VERSION=RSW_VERSION: just test {{ TAG }} {{ VERSION }} bash -# Run r-session-complete - just run rstudio/r-session-complete:ubuntu1804-2022.07.2-576.pro12 +# Run r-session-complete - just run rstudio/r-session-complete:ubuntu2204-2022.07.2-576.pro12 run TAG=`just _make-default-tag` CMD="": #!/usr/bin/env bash set -euxo pipefail diff --git a/workbench-for-microsoft-azure-ml/Justfile b/workbench-for-microsoft-azure-ml/Justfile index 56232d54..1ea62bfd 100644 --- a/workbench-for-microsoft-azure-ml/Justfile +++ b/workbench-for-microsoft-azure-ml/Justfile @@ -18,7 +18,7 @@ PYTHON_VERSION_ALT := "3.8.17" _make-default-tag OS=IMAGE_OS: echo "{{IMAGE_PREFIX}}{{PRODUCT}}:{{OS}}-$(just -f ../Justfile _get-tag-safe-version {{RSW_VERSION}})" -# Build Workbench for Azure ML image - just build ubuntu1804 2022.07.2+576.pro12 rstudio/rstudio-workbench:ubuntu1804-2022.07.2-576.pro12 +# Build Workbench for Azure ML image - just build ubuntu2204 2022.07.2+576.pro12 rstudio/rstudio-workbench:ubuntu2204-2022.07.2-576.pro12 build OS=IMAGE_OS VERSION=RSW_VERSION *TAGS="": #!/usr/bin/env bash set -euxo pipefail @@ -48,7 +48,7 @@ build OS=IMAGE_OS VERSION=RSW_VERSION *TAGS="": --build-arg PYTHON_VERSION_ALT="{{ PYTHON_VERSION_ALT }}" \ --file=./Dockerfile.$(just -f ../Justfile _parse-os {{OS}}) . -# Test Workbench for Azure ML image - just test rstudio/rstudio-workbench:ubuntu1804-2022.07.2-576.pro12 2022.07.2+576.pro12 +# Test Workbench for Azure ML image - just test rstudio/rstudio-workbench:ubuntu2204-2022.07.2-576.pro12 2022.07.2+576.pro12 test TAG=`just _make-default-tag` VERSION=RSW_VERSION CMD="": #!/usr/bin/env bash set -euxo pipefail @@ -60,11 +60,11 @@ test TAG=`just _make-default-tag` VERSION=RSW_VERSION CMD="": PYTHON_VERSION_ALT="{{ PYTHON_VERSION_ALT }}" \ docker-compose -f ./docker-compose.test.yml run sut {{ CMD }} -# Test Workbench for Azure ML image interactively - just test-i rstudio/rstudio-workbench:ubuntu1804-2022.07.2-576.pro12 2022.07.2+576.pro12 +# Test Workbench for Azure ML image interactively - just test-i rstudio/rstudio-workbench:ubuntu2204-2022.07.2-576.pro12 2022.07.2+576.pro12 test-i TAG=`just _make-default-tag` VERSION=RSW_VERSION: just test {{ TAG }} {{ VERSION }} bash -# Run Workbench for Azure ML - just RSW_LICENSE="" run rstudio/r-session-complete:ubuntu1804-2022.07.2-576.pro12 +# Run Workbench for Azure ML - just RSW_LICENSE="" run rstudio/r-session-complete:ubuntu2204-2022.07.2-576.pro12 run TAG=`just _make-default-tag` CMD="": #!/usr/bin/env bash set -euxo pipefail diff --git a/workbench/Justfile b/workbench/Justfile index 4937dc9d..61e8cb97 100644 --- a/workbench/Justfile +++ b/workbench/Justfile @@ -25,7 +25,7 @@ _get-download-url OS=IMAGE_OS: _make-default-tag OS=IMAGE_OS: echo "{{IMAGE_PREFIX}}{{PRODUCT}}:{{OS}}-$(just -f ../Justfile _get-tag-safe-version {{RSW_VERSION}})" -# Build Workbench image - just build ubuntu1804 2022.07.2+576.pro12 rstudio/rstudio-workbench:ubuntu1804-2022.07.2-576.pro12 +# Build Workbench image - just build ubuntu2204 2022.07.2+576.pro12 rstudio/rstudio-workbench:ubuntu2204-2022.07.2-576.pro12 build OS=IMAGE_OS VERSION=RSW_VERSION *TAGS="": #!/usr/bin/env bash set -euxo pipefail @@ -56,7 +56,7 @@ build OS=IMAGE_OS VERSION=RSW_VERSION *TAGS="": --build-arg RSW_DOWNLOAD_URL="$(just _get-download-url {{OS}})" \ --file=./Dockerfile.$(just -f ../Justfile _parse-os {{OS}}) . -# Test Workbench image - just test rstudio/rstudio-workbench:ubuntu1804-2022.07.2-576.pro12 2022.07.2+576.pro12 +# Test Workbench image - just test rstudio/rstudio-workbench:ubuntu2204-2022.07.2-576.pro12 2022.07.2+576.pro12 test TAG=`just _make-default-tag` VERSION=RSW_VERSION CMD="": #!/usr/bin/env bash set -euxo pipefail @@ -70,11 +70,11 @@ test TAG=`just _make-default-tag` VERSION=RSW_VERSION CMD="": PYTHON_VERSION_ALT="{{ PYTHON_VERSION_ALT }}" \ docker-compose -f ./docker-compose.test.yml run sut {{ CMD }} -# Test Workbench image interactively - just test-i rstudio/rstudio-workbench:ubuntu1804-2022.07.2-576.pro12 2022.07.2+576.pro12 +# Test Workbench image interactively - just test-i rstudio/rstudio-workbench:ubuntu2204-2022.07.2-576.pro12 2022.07.2+576.pro12 test-i TAG=`just _make-default-tag` VERSION=RSW_VERSION: just test {{ TAG }} {{ VERSION }} bash -# Run Workbench - just RSW_LICENSE="" run rstudio/r-session-complete:ubuntu1804-2022.07.2-576.pro12 +# Run Workbench - just RSW_LICENSE="" run rstudio/r-session-complete:ubuntu2204-2022.07.2-576.pro12 run TAG=`just _make-default-tag` CMD="": #!/usr/bin/env bash set -euxo pipefail From e33a7711a509d5e5185e4afe46f0b2ebb9a67fee Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Tue, 8 Aug 2023 10:22:25 -0700 Subject: [PATCH 06/17] Run `apt-get upgrade` on PPM image (#612) * Revert "Fix GPG call in Ubuntu 18.04 base" This reverts commit 600181272c6217d9866d4a8ddaa67125df4d2ad7. * Run apt upgrade on PPM image * Revert "Revert "Fix GPG call in Ubuntu 18.04 base"" This reverts commit 40e1b6d0f177bfb4c18e9bce1f28258f8c1e3ae2. * Update PPM tini to 0.19.0 * Install gpg earlier in Dockerfile.ubuntu1804 * Install gpg earlier in Dockerfile.ubuntu2204 * Add `dirmngr` and `gpg-agent` to dependency installs * Update trust DB before acquiring keys Install ALL recommended packages for dependencies in 18.04 * Curl all our keys because `gpg` on bionic is now unreliable * Comment the issue --- package-manager/Dockerfile.ubuntu1804 | 39 +++++++++++++++++++++------ package-manager/Dockerfile.ubuntu2204 | 24 +++++++++++++---- 2 files changed, 50 insertions(+), 13 deletions(-) diff --git a/package-manager/Dockerfile.ubuntu1804 b/package-manager/Dockerfile.ubuntu1804 index d9d57a90..fdf081e0 100644 --- a/package-manager/Dockerfile.ubuntu1804 +++ b/package-manager/Dockerfile.ubuntu1804 @@ -10,16 +10,34 @@ ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 ARG DEBIAN_FRONTEND=noninteractive +ARG TINI_VERSION=0.19.0 ENV PATH /opt/rstudio-pm/bin:$PATH +# Upgrade/install packages ----------------------------------------------------# +RUN apt-get update --fix-missing \ + && apt-get upgrade -yq \ + && apt-get install -yq --no-install-recommends \ + ca-certificates \ + curl \ + dirmngr \ + gpg \ + gpg-agent \ + && rm -rf /var/lib/apt/lists/* + # Runtime settings ------------------------------------------------------------# -ARG TINI_VERSION=0.18.0 -RUN curl -L -o /usr/local/bin/tini https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini && \ - chmod +x /usr/local/bin/tini +ADD https://cdn.rstudio.com/platform/tini/v${TINI_VERSION}/tini-amd64 /tini +ADD https://cdn.rstudio.com/platform/tini/v${TINI_VERSION}/tini-amd64.asc /tini.asc +# Keys must be pulled using curl, gpg calls intermittently fail on 18.04 with "gpg: keyserver receive failed: Cannot assign requested address" +RUN gpg --update-trustdb \ + && curl -sL -o /tmp/tini-key.asc "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x6380dc428747f6c393feaca59a84159d7001a4e5" \ + && gpg --import /tmp/tini-key.asc \ + && rm /tmp/tini-key.asc \ + && gpg --batch --verify /tini.asc /tini \ + && chmod +x /tini \ + && ln -s /tini /usr/local/bin/tini # Add another R version -------------------------------------------------------# - ARG R_VERSION_ALT=3.6.2 RUN apt-get update -qq && \ curl -O https://cdn.rstudio.com/r/ubuntu-1804/pkgs/r-${R_VERSION_ALT}_1_amd64.deb && \ @@ -31,17 +49,22 @@ RUN apt-get update -qq && \ # Download RStudio Package Manager ---------------------------------------------# ARG RSPM_VERSION=2023.04.0-6 ARG RSPM_DOWNLOAD_URL=https://cdn.rstudio.com/package-manager/ubuntu/amd64 +# Keys must be pulled using curl, gpg calls intermittently fail on 18.04 with "gpg: keyserver receive failed: Cannot assign requested address" RUN apt-get update --fix-missing \ - && apt-get install -y --no-install-recommends ca-certificates gdebi-core gpg dpkg-sig \ + && apt-get install -y --no-install-recommends gdebi-core gpg dpkg-sig \ && curl -O ${RSPM_DOWNLOAD_URL}/rstudio-pm_${RSPM_VERSION}_amd64.deb \ # Pre 7/25/23 packages - && gpg --keyserver keyserver.ubuntu.com --recv-keys 3F32EE77E331692F \ + && curl -sL -o /tmp/rstudio-key.asc "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xfe8564cff1ab93f1728645193f32ee77e331692f" \ + && gpg --import /tmp/rstudio-key.asc \ + && rm /tmp/rstudio-key.asc \ # Post 7/25 packages - && gpg --keyserver keys.openpgp.org --recv-keys 51C0B5BB19F92D60 \ + && curl -sL -o /tmp/posit-key.asc "https://keys.openpgp.org/vks/v1/by-fingerprint/8B65E5A107BBEFE3BA99C59751C0B5BB19F92D60" \ + && gpg --import /tmp/posit-key.asc \ + && rm /tmp/posit-key.asc \ && dpkg-sig --verify rstudio-pm_${RSPM_VERSION}_amd64.deb \ && RSTUDIO_INSTALL_NO_LICENSE_INITIALIZATION=1 gdebi -n rstudio-pm_${RSPM_VERSION}_amd64.deb \ && rm rstudio-pm_${RSPM_VERSION}_amd64.deb \ - && apt-get purge -y gdebi-core dpkg-sig gpg \ + && apt-get purge -y gdebi-core dpkg-sig gpg gpg-agent \ && apt-get autoremove -y \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ diff --git a/package-manager/Dockerfile.ubuntu2204 b/package-manager/Dockerfile.ubuntu2204 index b7d44a41..964c3e50 100644 --- a/package-manager/Dockerfile.ubuntu2204 +++ b/package-manager/Dockerfile.ubuntu2204 @@ -10,16 +10,30 @@ ENV LANG en_US.UTF-8 ENV LANGUAGE en_US:en ENV LC_ALL en_US.UTF-8 ARG DEBIAN_FRONTEND=noninteractive +ARG TINI_VERSION=0.19.0 ENV PATH /opt/rstudio-pm/bin:$PATH +# Upgrade/install packages ----------------------------------------------------# +RUN apt-get update --fix-missing \ + && apt-get upgrade -yq \ + && apt-get install -yq --no-install-recommends \ + ca-certificates \ + dirmngr \ + gpg \ + gpg-agent \ + && rm -rf /var/lib/apt/lists/* + # Runtime settings ------------------------------------------------------------# -ARG TINI_VERSION=0.18.0 -RUN curl -L -o /usr/local/bin/tini https://github.com/krallin/tini/releases/download/v${TINI_VERSION}/tini && \ - chmod +x /usr/local/bin/tini +ADD https://cdn.rstudio.com/platform/tini/v${TINI_VERSION}/tini-amd64 /tini +ADD https://cdn.rstudio.com/platform/tini/v${TINI_VERSION}/tini-amd64.asc /tini.asc +RUN gpg --update-trustdb \ + && gpg --batch --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 595E85A6B1B4779EA4DAAEC70B588DFF0527A9B7 \ + && gpg --batch --verify /tini.asc /tini \ + && chmod +x /tini \ + && ln -s /tini /usr/local/bin/tini # Add another R version -------------------------------------------------------# - ARG R_VERSION_ALT=3.6.2 RUN apt-get update -qq && \ curl -O https://cdn.rstudio.com/r/ubuntu-2204/pkgs/r-${R_VERSION_ALT}_1_amd64.deb && \ @@ -41,7 +55,7 @@ RUN apt-get update --fix-missing \ && dpkg-sig --verify rstudio-pm_${RSPM_VERSION}_amd64.deb \ && RSTUDIO_INSTALL_NO_LICENSE_INITIALIZATION=1 gdebi -n rstudio-pm_${RSPM_VERSION}_amd64.deb \ && rm rstudio-pm_${RSPM_VERSION}_amd64.deb \ - && apt-get purge -y gdebi-core dpkg-sig gpg \ + && apt-get purge -y gdebi-core dpkg-sig gpg gpg-agent \ && apt-get autoremove -y \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ From 9f6f8b24ddceabf8f6aad5253c8eb2b60701920a Mon Sep 17 00:00:00 2001 From: "Benjamin R. J. Schwedler" Date: Wed, 9 Aug 2023 10:27:27 -0500 Subject: [PATCH 07/17] Update PYTHON_VERSION_JUPYTER to match PYTHON_VERSION_ALT Closes #613 The current `just` automation to update python versions does not currently apply to `PYTHON_VERSION_JUPYTER`. This is a one-off fix until we address this fully in #590 --- workbench/.env | 2 +- workbench/Dockerfile.ubuntu2204 | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/workbench/.env b/workbench/.env index 9459434a..61c06486 100644 --- a/workbench/.env +++ b/workbench/.env @@ -3,6 +3,6 @@ RSW_DOWNLOAD_URL=https://download2.rstudio.org/server/bionic/amd64 RSW_NAME=rstudio-workbench PYTHON_VERSION=3.9.17 PYTHON_VERSION_ALT=3.8.17 -PYTHON_VERSION_JUPYTER=3.8.15 +PYTHON_VERSION_JUPYTER=3.8.17 R_VERSION_ALT=4.1.3 R_VERSION=4.2.3 diff --git a/workbench/Dockerfile.ubuntu2204 b/workbench/Dockerfile.ubuntu2204 index 512e3df5..c2655830 100644 --- a/workbench/Dockerfile.ubuntu2204 +++ b/workbench/Dockerfile.ubuntu2204 @@ -12,7 +12,7 @@ ARG R_VERSION=4.2.3 ARG R_VERSION_ALT=4.1.3 ARG PYTHON_VERSION=3.9.17 ARG PYTHON_VERSION_ALT=3.8.17 -ARG PYTHON_VERSION_JUPYTER=3.8.15 +ARG PYTHON_VERSION_JUPYTER=3.8.17 ARG RSW_VERSION=2023.06.1+524.pro1 ARG RSW_NAME=rstudio-workbench ARG RSW_DOWNLOAD_URL=https://download2.rstudio.org/server/jammy/amd64 From 3350fa5258a8b1444bf9f27ff1c0e872a49ceee8 Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Wed, 9 Aug 2023 09:31:31 -0700 Subject: [PATCH 08/17] Add Workbench for Google Cloud Workstations image (#564) * Fork the Workbench image for Google Cloud Workstations * Add changes pulled from Cole's alpha image * Changes necessary for working image * Add VS Code "cloudcode" plugin * Upgrade to Workbench 2023.03.0 * Build workflow and Jupyter improvements * Pipeline syntax fix * Fix build-args syntax * One-line tags * Use dumb docker list format * Add just setup * Trim double quotes * Fix + in tag version * Adapt Dockerfile to Ubuntu 20.04 base * Fix env var references * Fix odbc install OS * Fix download URL * Disable build tests for now until I get Goss working again * Quiet flag on gcloud auth * Merge push action into build step * Add configure script step for jupyter notebook * Add jupyter notebook config to fix jupyter terminal bug * Add a variety of basic data science packages into the image * Add lab-args * Fix allow_origin arg * Revert jupyter.conf changes * Add Quarto and temporarily add args to Jupyter Lab for debugging * Fix goss tests * Add PYTHON_VERSION_JUPYTER in workflow * Fixes to build from daily with JupyterLab fix * Replace tagged version variable * Update r_packages.txt with R Package Dependencies list * Update test and push blocks in workflow * Fix test path * Specify tag for test * Use just for build pipeline * Add tags to build step * Quote tags * Last fix for pushing tags * Use just command for pushing * Fixes after push failure * Implement cache inflation bug workaround * Push all tags * Run docker image ls to see why images aren't found * Package and dependency updates * Just retag the image and forget about this problem for now * Update registry name to release registry * Temporarily continue on error for tests * Improve Goss tests based on #490 Add missing R package system library dependencies Change CRAN repos to use posit.co address Upgrade Goss to 0.3.22 * Update VSCode Extensions * Disable pipeline caching * Disable pipeline caching * Update RSW_VERSION var * Update launcher-env PATH * Upgrade R and Python versions Add patch to rserver.conf to fix libR.so not found bug * License manager implementation for WGCW * Update env var * Comment out exec logging * Maximize build space for GCW GHA * Change buildx caching to a mounted directory with actual space * Dynamically set buildx caching path from var * Upgrade Workbench for GCW * Use build-push-action in GHA Revert version upgrade Update patch versions for Python Upgrade Pro Drivers * Remove maximize build space, may not be necessary * Rollback python version upgrade, not yet released * Fix missed version * Upgrade Workbench to 2023.06.0 and tick donwload url to focal * Explicitly define download url in build workflow Add .env file * Upgrade workflow to 2023.06.0 * Increase timeout for R lib goss tests Use RSW version for test tag * Remove "load" from push action * Rollback to 2023.03.2 * Remove unnecessary launcher keys * Update workbench-for-google-cloud-workstations/Justfile Co-authored-by: Benjamin R. J. Schwedler * Use .env file for Justfile and GHA workflow * Fix test step in workflow * Revise README.md from original copy to GCW specific copy * Clean up caching - Purge pip caches after install steps - Purge apt caches where missing - Consolidate COPY steps * Remove `-x` flag from `just run` target * Update versions for bug fixes * Rebase and merge WGCW workflow into release workflow * Fix missing shell * Fix bash logic * Do not trace licensing in startup.sh * Update patch in launcher-env * Move apt package list to deps/apt_packages.txt --------- Co-authored-by: Benjamin R. J. Schwedler --- .../actions/build-test-scan-push/action.yaml | 17 ++ .github/workflows/build-release.yaml | 83 +++++++ workbench-for-google-cloud-workstations/.env | 12 + .../.gitignore | 2 + .../Dockerfile.ubuntu2004 | 175 +++++++++++++ .../Justfile | 109 ++++++++ .../README.md | 89 +++++++ .../TurboActivate.dat | Bin 0 -> 4054 bytes .../conf/jupyter.conf | 7 + .../conf/launcher-env | 6 + .../conf/launcher.conf | 11 + .../conf/launcher.local.conf | 1 + .../conf/logging.conf | 3 + .../conf/nginx.site.conf | 2 + .../conf/repos.conf | 2 + .../conf/rserver-float.conf | 1 + .../conf/rserver.conf | 19 ++ .../conf/vscode-user-settings.json | 5 + .../conf/vscode.conf | 4 + .../conf/vscode.extensions.conf | 4 + .../deps/apt_packages.txt | 32 +++ .../deps/install_r_packages.sh | 10 + .../deps/py_packages.txt | 4 + .../deps/r_packages.txt | 67 +++++ .../docker-compose.test.yml | 24 ++ .../jupyter/jupyter_notebook_config.json | 15 ++ .../license-manager-shim | 7 + .../pam/rstudio | 14 ++ .../pam/rstudio-session | 26 ++ .../sssd.conf | 9 + .../startup-launcher/rstudio-launcher.conf | 8 + .../startup-user-provisioning/sssd.conf | 11 + .../startup.sh | 72 ++++++ .../startup/rstudio-workbench.conf | 8 + .../supervisord.conf | 47 ++++ .../test/goss.yaml | 233 ++++++++++++++++++ .../test/run_tests.sh | 33 +++ .../workstation-startup/110_config-jupyter.sh | 8 + .../120_start-workbench.sh | 5 + 39 files changed, 1185 insertions(+) create mode 100644 workbench-for-google-cloud-workstations/.env create mode 100644 workbench-for-google-cloud-workstations/.gitignore create mode 100644 workbench-for-google-cloud-workstations/Dockerfile.ubuntu2004 create mode 100644 workbench-for-google-cloud-workstations/Justfile create mode 100644 workbench-for-google-cloud-workstations/README.md create mode 100644 workbench-for-google-cloud-workstations/TurboActivate.dat create mode 100644 workbench-for-google-cloud-workstations/conf/jupyter.conf create mode 100644 workbench-for-google-cloud-workstations/conf/launcher-env create mode 100644 workbench-for-google-cloud-workstations/conf/launcher.conf create mode 100644 workbench-for-google-cloud-workstations/conf/launcher.local.conf create mode 100644 workbench-for-google-cloud-workstations/conf/logging.conf create mode 100644 workbench-for-google-cloud-workstations/conf/nginx.site.conf create mode 100644 workbench-for-google-cloud-workstations/conf/repos.conf create mode 100644 workbench-for-google-cloud-workstations/conf/rserver-float.conf create mode 100644 workbench-for-google-cloud-workstations/conf/rserver.conf create mode 100644 workbench-for-google-cloud-workstations/conf/vscode-user-settings.json create mode 100644 workbench-for-google-cloud-workstations/conf/vscode.conf create mode 100644 workbench-for-google-cloud-workstations/conf/vscode.extensions.conf create mode 100644 workbench-for-google-cloud-workstations/deps/apt_packages.txt create mode 100755 workbench-for-google-cloud-workstations/deps/install_r_packages.sh create mode 100644 workbench-for-google-cloud-workstations/deps/py_packages.txt create mode 100644 workbench-for-google-cloud-workstations/deps/r_packages.txt create mode 100644 workbench-for-google-cloud-workstations/docker-compose.test.yml create mode 100644 workbench-for-google-cloud-workstations/jupyter/jupyter_notebook_config.json create mode 100755 workbench-for-google-cloud-workstations/license-manager-shim create mode 100644 workbench-for-google-cloud-workstations/pam/rstudio create mode 100644 workbench-for-google-cloud-workstations/pam/rstudio-session create mode 100644 workbench-for-google-cloud-workstations/sssd.conf create mode 100644 workbench-for-google-cloud-workstations/startup-launcher/rstudio-launcher.conf create mode 100644 workbench-for-google-cloud-workstations/startup-user-provisioning/sssd.conf create mode 100644 workbench-for-google-cloud-workstations/startup.sh create mode 100644 workbench-for-google-cloud-workstations/startup/rstudio-workbench.conf create mode 100644 workbench-for-google-cloud-workstations/supervisord.conf create mode 100644 workbench-for-google-cloud-workstations/test/goss.yaml create mode 100755 workbench-for-google-cloud-workstations/test/run_tests.sh create mode 100755 workbench-for-google-cloud-workstations/workstation-startup/110_config-jupyter.sh create mode 100755 workbench-for-google-cloud-workstations/workstation-startup/120_start-workbench.sh diff --git a/.github/actions/build-test-scan-push/action.yaml b/.github/actions/build-test-scan-push/action.yaml index 333344b4..55d64603 100644 --- a/.github/actions/build-test-scan-push/action.yaml +++ b/.github/actions/build-test-scan-push/action.yaml @@ -45,6 +45,10 @@ inputs: description: Username for authentication with DockerHub required: true type: string + gcp-json: + description: JSON for authenticating Google Cloud Platform + default: "" + type: string runs: using: "composite" @@ -71,6 +75,19 @@ runs: username: ${{ inputs.dockerhub-username }} password: ${{ inputs.dockerhub-token }} + - name: Authenticate to Google Cloud + continue-on-error: true + uses: google-github-actions/auth@v1 + with: + credentials_json: '${{ inputs.gcp-json }}' + + - name: Authenticate GCAR + shell: bash + run: | + if [ ! -z "${{ inputs.gcp-json }}" ]; then + gcloud auth configure-docker -q us-central1-docker.pkg.dev + fi + - name: Build id: image-build uses: docker/build-push-action@v4 diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 205c4f72..13295850 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -318,3 +318,86 @@ jobs: dockerhub-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} # End retry logic + + build-workbench-for-google-cloud-workstations: + needs: [ build-base, build-base-pro ] + runs-on: ubuntu-latest + name: build-workbench-for-google-cloud-workstations + + concurrency: + group: build-products-${{ matrix.config.product }}-${{ matrix.config.os }}-${{ github.ref }} + cancel-in-progress: true + + steps: + - name: Check Out Repo + uses: actions/checkout@v3 + + - name: Set up Just + uses: extractions/setup-just@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: Get Version + id: get-version + run: | + VERSION=$(just workbench-for-google-cloud-workstations/get-version) + echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + + - name: Get build args + id: get-build-args + run: | + EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64) + BUILD_ARGS=$(just workbench-for-google-cloud-workstations/get-build-args) + echo "BUILD_ARGS<<$EOF" >> $GITHUB_OUTPUT + echo "$BUILD_ARGS" >> $GITHUB_OUTPUT + echo "$EOF" >> $GITHUB_OUTPUT + + - name: Get tags + id: get-tags + run: | + IMAGE_TAGS=$(just workbench-for-google-cloud-workstations/get-build-tags) + echo "IMAGE_TAGS=$IMAGE_TAGS" >> $GITHUB_OUTPUT + + - name: Build/Test/Scan/Push base pro image + id: build1 + uses: ./.github/actions/build-test-scan-push + continue-on-error: true + with: + context: ./workbench-for-google-cloud-workstations + os: ubuntu2004 + product: workbench-for-google-cloud-workstations + image-tags: ${{ steps.get-tags.outputs.IMAGE_TAGS }} + build-args: ${{ steps.get-build-args.outputs.BUILD_ARGS }} + push-image: ${{ github.ref == 'refs/heads/main' }} + snyk-token: ${{ secrets.SNYK_TOKEN }} + snyk-org-id: ${{ secrets.SNYK_ORG_ID }} + ghcr-token: ${{ secrets.BUILD_PAT }} + dockerhub-username: ${{ secrets.DOCKER_HUB_USERNAME }} + dockerhub-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + gcp-json: '${{ secrets.GCP_ARTIFACT_REGISTRY_JSON }}' + + # Begin retry logic + + - name: Wait 60s on failure before retrying + if: steps.build1.outcome == 'failure' + run: sleep 60 + + - name: Retry - Build/Test/Scan/Push base pro image + id: build2 + if: steps.build1.outcome == 'failure' + uses: ./.github/actions/build-test-scan-push + with: + context: ./workbench-for-google-cloud-workstations + os: ubuntu2004 + product: workbench-for-google-cloud-workstations + image-tags: ${{ steps.get-tags.outputs.IMAGE_TAGS }} + build-args: ${{ steps.get-build-args.outputs.BUILD_ARGS }} + push-image: ${{ github.ref == 'refs/heads/main' }} + snyk-token: ${{ secrets.SNYK_TOKEN }} + snyk-org-id: ${{ secrets.SNYK_ORG_ID }} + ghcr-token: ${{ secrets.BUILD_PAT }} + dockerhub-username: ${{ secrets.DOCKER_HUB_USERNAME }} + dockerhub-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + gcp-json: '${{ secrets.GCP_ARTIFACT_REGISTRY_JSON }}' + + # End retry logic diff --git a/workbench-for-google-cloud-workstations/.env b/workbench-for-google-cloud-workstations/.env new file mode 100644 index 00000000..1a28dfba --- /dev/null +++ b/workbench-for-google-cloud-workstations/.env @@ -0,0 +1,12 @@ +RSW_VERSION=2023.03.2+454.pro2 +RSW_TAG_VERSION=2023.03.2-454.pro2 +RSW_DOWNLOAD_URL=https://download2.rstudio.org/server/bionic/amd64 +RSW_NAME=rstudio-workbench +PYTHON_VERSION=3.10.12 +PYTHON_VERSION_ALT=3.9.17 +PYTHON_VERSION_JUPYTER=3.10.12 +R_VERSION=4.2.3 +R_VERSION_ALT=4.1.3 +DRIVERS_VERSION=2023.05.0 +QUARTO_VERSION=1.3.340 +IMAGE_REGISTRY_NAME=us-central1-docker.pkg.dev/posit-images/cloud-workstations/workbench diff --git a/workbench-for-google-cloud-workstations/.gitignore b/workbench-for-google-cloud-workstations/.gitignore new file mode 100644 index 00000000..1bdfee60 --- /dev/null +++ b/workbench-for-google-cloud-workstations/.gitignore @@ -0,0 +1,2 @@ +conf/launcher.pem +conf/launcher.pub diff --git a/workbench-for-google-cloud-workstations/Dockerfile.ubuntu2004 b/workbench-for-google-cloud-workstations/Dockerfile.ubuntu2004 new file mode 100644 index 00000000..23c8c64c --- /dev/null +++ b/workbench-for-google-cloud-workstations/Dockerfile.ubuntu2004 @@ -0,0 +1,175 @@ +FROM us-central1-docker.pkg.dev/cloud-workstations-images/predefined/base:public-image-current + +### ARG declarations ### +ARG DEBIAN_FRONTEND=noninteractive +ARG R_VERSION=4.2.3 +ARG R_VERSION_ALT=4.1.3 +ARG PYTHON_VERSION=3.10.12 +ARG PYTHON_VERSION_ALT=3.9.17 +ARG PYTHON_VERSION_JUPYTER=3.10.12 +ARG QUARTO_VERSION=1.3.340 +ARG DRIVERS_VERSION=2023.05.0 +ARG RSW_VERSION=2023.03.2+454.pro2 +ARG RSW_NAME=rstudio-workbench +ARG RSW_DOWNLOAD_URL=https://download2.rstudio.org/server/bionic/amd64 + +ENV RSW_LICENSE "" +ENV RSW_LICENSE_SERVER "" +ENV RSW_TESTUSER user +ENV RSW_TESTUSER_PASSWD rstudio +ENV RSW_TESTUSER_UID 10000 +ENV RSW_LAUNCHER true +ENV RSW_LAUNCHER_TIMEOUT 10 +ENV DIAGNOSTIC_DIR /var/log/rstudio +ENV DIAGNOSTIC_ENABLE false +ENV DIAGNOSTIC_ONLY false +ENV LICENSE_MANAGER_PATH /opt/rstudio-license +ENV WORKBENCH_JUPYTER_PATH=/usr/local/bin/jupyter + +### Copy package lists and install scripts ### +COPY deps/* / + +### Update/upgrade system packages ### +RUN apt-get update --fix-missing \ + && apt-get upgrade -yq \ + && xargs -a /apt_packages.txt apt-get install -yq --no-install-recommends \ + && rm /apt_packages.txt \ + && rm -rf /var/lib/apt/lists/* + +### Install R versions ### +RUN curl -O https://cdn.rstudio.com/r/ubuntu-2004/pkgs/r-${R_VERSION}_1_amd64.deb \ + && curl -O https://cdn.rstudio.com/r/ubuntu-2004/pkgs/r-${R_VERSION_ALT}_1_amd64.deb \ + && apt-get update \ + && apt-get install -yq --no-install-recommends ./r-${R_VERSION}_1_amd64.deb \ + && apt-get install -yq --no-install-recommends ./r-${R_VERSION_ALT}_1_amd64.deb \ + && rm -f ./r-${R_VERSION}_1_amd64.deb \ + && rm -f ./r-${R_VERSION_ALT}_1_amd64.deb \ + && ln -s /opt/R/${R_VERSION}/bin/R /usr/local/bin/R \ + && ln -s /opt/R/${R_VERSION}/bin/Rscript /usr/local/bin/Rscript \ + && rm -rf /var/lib/apt/lists/* + +### Install Python versions ### +RUN curl -O https://cdn.rstudio.com/python/ubuntu-2004/pkgs/python-${PYTHON_VERSION}_1_amd64.deb \ + && curl -O https://cdn.rstudio.com/python/ubuntu-2004/pkgs/python-${PYTHON_VERSION_ALT}_1_amd64.deb \ + && apt-get update \ + && apt-get install -yq --no-install-recommends ./python-${PYTHON_VERSION}_1_amd64.deb \ + && apt-get install -yq --no-install-recommends ./python-${PYTHON_VERSION_ALT}_1_amd64.deb \ + && rm -rf python-${PYTHON_VERSION}_1_amd64.deb \ + && rm -rf python-${PYTHON_VERSION_ALT}_1_amd64.deb \ + && /opt/python/${PYTHON_VERSION}/bin/python3 -m pip install 'virtualenv<20' \ + && /opt/python/${PYTHON_VERSION}/bin/python3 -m pip install --upgrade setuptools \ + && /opt/python/${PYTHON_VERSION}/bin/python3 -m pip install --upgrade pip \ + && /opt/python/${PYTHON_VERSION}/bin/python3 -m pip cache purge \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python3 -m pip install 'virtualenv<20' \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python3 -m pip install --upgrade setuptools \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python3 -m pip install --upgrade pip \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python3 -m pip cache purge \ + && rm -rf /var/lib/apt/lists/* + +### Install basic data science packages for Python and R ### +RUN /opt/python/${PYTHON_VERSION}/bin/python3 -m pip install -r /py_packages.txt \ + && /opt/python/${PYTHON_VERSION}/bin/python3 -m pip cache purge \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python3 -m pip install -r /py_packages.txt \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python3 -m pip cache purge \ + && ./install_r_packages.sh \ + && rm install_r_packages.sh py_packages.txt r_packages.txt + +### Locale configuration ### +RUN localedef -i en_US -f UTF-8 en_US.UTF-8 +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US:en +ENV LC_ALL en_US.UTF-8 + +### Install Quarto ### +RUN curl -o quarto-linux-amd64.deb -L https://github.com/quarto-dev/quarto-cli/releases/download/v${QUARTO_VERSION}/quarto-${QUARTO_VERSION}-linux-amd64.deb \ + && apt-get update \ + && apt-get install -yq ./quarto-linux-amd64.deb \ + && rm -rf /var/lib/apt/lists/* \ + && rm quarto-linux-amd64.deb + +### Install Pro Drivers ### +RUN apt-get update \ + && apt-get install -yq --no-install-recommends unixodbc unixodbc-dev \ + && curl -O https://cdn.rstudio.com/drivers/7C152C12/installer/rstudio-drivers_${DRIVERS_VERSION}_amd64.deb \ + && apt-get update \ + && apt-get install -yq --no-install-recommends ./rstudio-drivers_${DRIVERS_VERSION}_amd64.deb \ + && rm -f ./rstudio-drivers_${DRIVERS_VERSION}_amd64.deb \ + && rm -rf /var/lib/apt/lists/* \ + && cp /opt/rstudio-drivers/odbcinst.ini.sample /etc/odbcinst.ini \ + && /opt/R/${R_VERSION}/bin/R -e 'install.packages("odbc", repos="https://packagemanager.rstudio.com/cran/__linux__/focal/latest")' + +### Install Workbench ### +SHELL ["/bin/bash", "-o", "pipefail", "-c"] +RUN curl -o rstudio-workbench.deb "${RSW_DOWNLOAD_URL}/${RSW_NAME}-${RSW_VERSION//+/-}-amd64.deb" \ + && gpg --keyserver keyserver.ubuntu.com --recv-keys 3F32EE77E331692F \ + && dpkg-sig --verify ./rstudio-workbench.deb \ + && apt-get update \ + && apt-get install -y --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 GCW License Manager ### +# TODO(ianpittwood): Replace monitor download with $RSW_VERSION after upgrading to 2023.06.0 +RUN mkdir -p /opt/rstudio-license/ \ + && mkdir -p /var/lib/rstudio-workbench \ + && curl -sL "https://s3.amazonaws.com/rstudio-ide-build/monitor/focal/rsp-monitor-workbench-gcpw-amd64-2023.06.0-419.pro1.tar.gz" | \ + tar xzvf - --strip 2 -C /opt/rstudio-license/ \ + && chmod 0755 /opt/rstudio-license/license-manager \ + && mv /opt/rstudio-license/license-manager /opt/rstudio-license/license-manager-orig \ + && rm -f /usr/lib/rstudio-server/bin/license-manager + +### Install Jupyter and extensions ### +RUN /opt/python/"${PYTHON_VERSION_JUPYTER}"/bin/python -m venv /opt/python/jupyter \ + && /opt/python/jupyter/bin/pip install \ + jupyter \ + jupyterlab \ + rsconnect_jupyter \ + rsconnect_python \ + rsp_jupyter \ + workbench_jupyterlab \ + && ln -s /opt/python/jupyter/bin/jupyter /usr/local/bin/jupyter \ + && /opt/python/jupyter/bin/jupyter-nbextension install --sys-prefix --py rsp_jupyter \ + && /opt/python/jupyter/bin/jupyter-nbextension enable --sys-prefix --py rsp_jupyter \ + && /opt/python/jupyter/bin/jupyter-nbextension install --sys-prefix --py rsconnect_jupyter \ + && /opt/python/jupyter/bin/jupyter-nbextension enable --sys-prefix --py rsconnect_jupyter \ + && /opt/python/jupyter/bin/jupyter-serverextension enable --sys-prefix --py rsconnect_jupyter \ + && /opt/python/jupyter/bin/python -m ipykernel install --name py${PYTHON_VERSION} --display-name "Python ${PYTHON_VERSION}" \ + && /opt/python/jupyter/bin/python -m ipykernel install --name py${PYTHON_VERSION_ALT} --display-name "Python ${PYTHON_VERSION_ALT}" \ + && /opt/python/${PYTHON_VERSION}/bin/python3 -m pip cache purge \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python3 -m pip cache purge + +RUN curl -L -o /usr/local/bin/wait-for-it.sh https://raw.githubusercontent.com/rstudio/wait-for-it/master/wait-for-it.sh \ + && chmod +x /usr/local/bin/wait-for-it.sh + +RUN mkdir -p /var/lib/rstudio-server/monitor/log \ + && chown -R rstudio-server:rstudio-server /var/lib/rstudio-server/monitor \ + && mkdir -p /startup/custom/ \ + && printf '\n# allow home directory creation\nsession required pam_mkhomedir.so skel=/etc/skel umask=0022' >> /etc/pam.d/common-session + +COPY --chmod=755 TurboActivate.dat /opt/rstudio-license/license-manager.conf +COPY --chmod=755 license-manager-shim /opt/rstudio-license/license-manager +COPY --chmod=0775 startup.sh /usr/local/bin/startup.sh +COPY startup-launcher/* /startup/launcher/ +COPY startup-user-provisioning/* /startup/user-provisioning/ +COPY startup/* /startup/base/ +COPY supervisord.conf /etc/supervisor/supervisord.conf +COPY --chmod=600 sssd.conf /etc/sssd/sssd.conf +COPY conf/* /etc/rstudio/ +COPY --chmod=600 conf/launcher.p* /etc/rstudio + +# GCW specific +COPY --chmod=755 workstation-startup/* /etc/workstation-startup.d/ +COPY --chmod=644 jupyter/jupyter_notebook_config.json /opt/python/jupyter/etc/jupyter/jupyter_notebook_config.json + +### Clean up ### +RUN apt-get remove -yq dpkg-sig \ + && apt-get install -yqf --no-install-recommends \ + && apt-get autoremove -yq \ + && apt-get clean -yq \ + && rm -rf /var/lib/apt/lists/* + +EXPOSE 80/tcp +EXPOSE 5559/tcp diff --git a/workbench-for-google-cloud-workstations/Justfile b/workbench-for-google-cloud-workstations/Justfile new file mode 100644 index 00000000..060f4f47 --- /dev/null +++ b/workbench-for-google-cloud-workstations/Justfile @@ -0,0 +1,109 @@ +set dotenv-load +set positional-arguments + +BUILDX_PATH := "" + +PRODUCT := "workbench" +IMAGE_OS := "ubuntu2004" + +RSW_LICENSE := "" +RSW_LICENSE_SERVER := "" + +_make-default-tag: + echo "${IMAGE_REGISTRY_NAME}:$(just -f ../Justfile _get-tag-safe-version "${RSW_VERSION}")" + +get-version: + echo "${RSW_VERSION}" + +get-build-args: + #!/usr/bin/env bash + printf "RSW_VERSION=${RSW_VERSION} + R_VERSION=${R_VERSION} + R_VERSION_ALT=${R_VERSION_ALT} + PYTHON_VERSION=${PYTHON_VERSION} + PYTHON_VERSION_ALT=${PYTHON_VERSION_ALT} + PYTHON_VERSION_JUPYTER=${PYTHON_VERSION_JUPYTER} + QUARTO_VERSION=${QUARTO_VERSION} + DRIVERS_VERSION=${DRIVERS_VERSION} + SRC_IMAGE_NAME=${SRC_IMAGE_NAME} + RSW_DOWNLOAD_URL=${RSW_DOWNLOAD_URL}" + +get-build-tags: + #!/usr/bin/env bash + echo ${IMAGE_REGISTRY_NAME}:${RSW_TAG_VERSION},\ + ${IMAGE_REGISTRY_NAME}:latest + +# Build Workbench image - just build 2022.07.2+576.pro12 rstudio/rstudio-workbench-gcw:2022.07.2 +build *TAGS="": + #!/usr/bin/env bash + set -euxo pipefail + CACHE_PATH=${GITHUB_WORKSPACE:-/tmp} + BUILDX_ARGS="" + if [[ "{{BUILDX_PATH}}" != "" ]]; then + BUILDX_ARGS="--cache-from=type=local,src=${CACHE_PATH}/.buildx-cache --cache-to=type=local,dest=${CACHE_PATH}/.buildx-cache-new,mode=max" + fi + + if [[ "{{TAGS}}" == "" ]]; then + raw_tag_array=($(just _make-default-tag)) + else + raw_tag_array=("{{TAGS}}") + fi + + tag_array=() + for tag in ${raw_tag_array[@]}; + do + tag_array+=("-t" $tag) + done + + docker buildx --builder="{{ BUILDX_PATH }}" build --load ${BUILDX_ARGS} \ + ${tag_array[@]} \ + --build-arg RSW_VERSION="${RSW_VERSION}" \ + --build-arg R_VERSION="${R_VERSION}" \ + --build-arg R_VERSION_ALT="${R_VERSION_ALT}" \ + --build-arg PYTHON_VERSION="${PYTHON_VERSION}" \ + --build-arg PYTHON_VERSION_ALT="${PYTHON_VERSION_ALT}" \ + --build-arg PYTHON_VERSION_JUPYTER="${PYTHON_VERSION_JUPYTER}" \ + --build-arg QUARTO_VERSION="${QUARTO_VERSION}" \ + --build-arg DRIVERS_VERSION="${DRIVERS_VERSION}" \ + --build-arg RSW_DOWNLOAD_URL="${RSW_DOWNLOAD_URL}" \ + --file=./Dockerfile.ubuntu2004 . + + echo ${raw_tag_array[@]} + +# Test Workbench image - just test rstudio/rstudio-workbench:ubuntu1804-2022.07.2-576.pro12 2022.07.2+576.pro12 +test TAG=`just _make-default-tag` CMD="": + #!/usr/bin/env bash + set -euxo pipefail + RSW_VERSION_CLEAN=$(sed "s/daily-/daily+/" <<<"${RSW_VERSION}") + IMAGE_NAME="{{ TAG }}" \ + RSW_VERSION="${RSW_VERSION_CLEAN}" \ + RSW_LICENSE="{{ RSW_LICENSE }}" \ + RSW_LICENSE_SERVER="{{ RSW_LICENSE_SERVER }}" \ + DRIVERS_VERSION="${DRIVERS_VERSION}" \ + R_VERSION="${R_VERSION}" \ + R_VERSION_ALT="${R_VERSION_ALT}" \ + PYTHON_VERSION="${PYTHON_VERSION}" \ + PYTHON_VERSION_ALT="${PYTHON_VERSION_ALT}" \ + PYTHON_VERSION_JUPYTER="${PYTHON_VERSION_JUPYTER}" \ + QUARTO_VERSION="${QUARTO_VERSION}" \ + docker-compose -f ./docker-compose.test.yml run sut {{ CMD }} + +# Test Workbench image interactively - just test-i rstudio/rstudio-workbench:ubuntu1804-2022.07.2-576.pro12 2022.07.2+576.pro12 +test-i TAG=`just _make-default-tag`: + just test {{ TAG }} bash + +# Run Workbench - just RSW_LICENSE="" run rstudio/r-session-complete:ubuntu1804-2022.07.2-576.pro12 +run TAG=`just _make-default-tag` CMD="": + #!/usr/bin/env bash + set -euo pipefail + if [ -z "{{ RSW_LICENSE }}" ] && [ -z "{{ RSW_LICENSE_SERVER }}" ]; then + echo "Please set RSW_LICENSE or RSW_LICENSE_SERVER before running." + exit 1 + fi + + docker run -it --privileged \ + ${volume_opts[@]} \ + -p 8787:80 \ + -e RSW_LICENSE="{{ RSW_LICENSE }}" \ + -e RSW_LICENSE_SERVER="{{ RSW_LICENSE_SERVER }}" \ + "{{ TAG }}" {{ CMD }} diff --git a/workbench-for-google-cloud-workstations/README.md b/workbench-for-google-cloud-workstations/README.md new file mode 100644 index 00000000..55eb644a --- /dev/null +++ b/workbench-for-google-cloud-workstations/README.md @@ -0,0 +1,89 @@ +_# 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) +* Registry for this image: [Posit's Google Cloud Artifact Registry](https://console.cloud.google.com/artifacts/docker/posit-images/us-central1/cloud-workstations/workbench) + +# What is RStudio Workbench? + +Posit Workbench, formerly RStudio Workbench, is the preferred data analysis and integrated development experience for +professional R users and data science teams who use R and Python. Posit Workbench enables the collaboration, +centralized management, metrics, security, and commercial support that professional data science teams need to operate +at scale. + +Some of the functionality that Workbench provides is: + +* The ability to develop in Workbench and Jupyter +* Load balancing +* Tutorial API +* Data connectivity and Posit Professional Drivers (formerly RStudio Professional Drivers) +* Collaboration and project sharing +* Scale with Kubernetes and SLURM +* Authentication, access, & security +* Run multiple concurrent R and Python sessions +* Remote execution with Launcher +* Auditing and monitoring +* Advanced R and Python session management + +For more information on running RStudio Workbench in your organization please visit +https://www.rstudio.com/products/workbench/. + +# Notice for support + +1. This image is still in early development. Some bugs may be present, and we may introduce **BREAKING** changes in + order to improve your user experience; as such we recommend: + - Always read through the [NEWS](./NEWS.md) to understand the changes before updating or when encountering a bug. + - Use the `latest` or "version" tags. Avoid using `daily` tagged images unless advised to by Posit staff. +1. Outdated images will be removed periodically from GCAR as product version updates are made. Please make plans to + update at times, use the `latest` or version tag, or use your own build of the images. + +# How to use this image + +This image is designed for exclusive use with [Google Cloud Workstations](https://cloud.google.com/workstations). For +the generalized version of the Workbench image, go [here](../workbench). + +Using Google Cloud Workstations requires a Google Cloud Platform account. Click +[here](https://console.cloud.google.com/workstations/overview) to navigate to the Cloud Workstations console. Posit +Workbench is provided in the default list of "Code editors on base images" when creating a workstation configuration. +Alternatively, administrators can use the "Custom container image" option to reference a specific tag from +[Posit's public Google Cloud Artifact Registry](https://console.cloud.google.com/artifacts/docker/posit-images/us-central1/cloud-workstations/workbench). + +For more information, please see +[Cloud Workstation's official documentation](https://cloud.google.com/workstations/docs/develop-code-using-posit-workbench-rstudio). + +## Overview + +Note that running the RStudio Workbench Docker image requires a valid RStudio Workbench license for Google Cloud +Workstations. Licenses can be obtained by emailing sales@posit.co. + +This container includes: + +1. Two versions of R +2. Two versions of Python +3. RStudio Workbench + +### Licensing + +The RStudio Workbench Docker image requires a valid license, which can be set using the `RSW_LICENSE` environment +variable to a valid license key inside the container. + +### Environment variables + +| Variable | Description | Default | +|-----|---|-----------| +| `RSW_LICENSE` | License key for RStudio Workbench, format should be: `XXXX-XXXX-XXXX-XXXX-XXXX-XXXX-XXXX` | None | +| `RSW_LAUNCHER` | Whether or not to use launcher locally / start the launcher process | true | +| `RSW_LAUNCHER_TIMEOUT` | The timeout, in seconds, to wait for launcher to start listening on the expected port before failing startup | 10 | + +# 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-for-google-cloud-workstations/TurboActivate.dat b/workbench-for-google-cloud-workstations/TurboActivate.dat new file mode 100644 index 0000000000000000000000000000000000000000..d1b139fdafa4119532ded686ca9dfad365dcb29e GIT binary patch literal 4054 zcmV;{4=M0eK~O|SRxts;1ONaqf&{w)0RS)!1_>&LNQUrr7(g7p#lK_ z0)hbn0EXLHPcJJSCSGR+n+bHt!YIxF+9TWwCEM^_an$s?RQdEpe&^%D;iTuI#Fd(y zQr{P3iXX<|hs(^9^9rK0QVVQsFCKTE#%KT$S=X)meDI~z`WioHu6vx1lFv>OK5yX( zWGx3Re|#4#_UV+cDoSJqhTQQ1`&oH?6G0VGhefB-Z-5y$a|K%O3^WWZrPRP0?Rc0L+qBx!}ouVG&apre$6pZb1L65)g_sSLz?c} z4FUlX0)hbmH-~>9n)9NUR18g;F%kGr@~=e4o(OU~7T({fB4Gv>Po?VnxEu-CHZ@@aVc8^uIvOo5r8``DE# zJNd~07ie=U)JG2=8SqjmTA8Mc_y4Am@Z3FiVq}n#$_}4@X6ptaRFC-?>&BGjVyXb1 zcGql`NeEnf3L$7=nno;<@jxzS81y`2J|A`uClJg<;tpP>SO?wwyJhuSR0)#cb{K=m z41QNN0)c@5x$+@L`M?DruizoUiH^8(v1%s;B@!M|^-yaa2Y5WQ&T#X|*A@i?dqq#n z2P&XdOW9mmVq=P;}NK!O`FxHsBu++bh`tB36CUx#-AElc-Vo{vpyd%Ew(xZU^|9uy22kZiST z%BAtxPw=3#t?hyg)%BX8j%JW1#gz}+?LUQ2r$r8Gy1ig3T>e(WRsL#+yp7-ZzRg@t z6fl!BVHHwU^FkJ?*k!=7aYOwQ_ThuCxeWCiXbHof1UNJpK)U)xs0(99`qBrX*{o^O z0`pLt`M>f*0)c=`kl=?5d_GvfYMoG$6Kraa|XXAu1bo7~h%$?+9#s%b}c;cjUa=AW+Z1G~4=1cf86xb5gZvI(7IX3X09AeKhEJa%wrsqmyPQI1 zcbI;3?#XiMNTbwIpFh^?qJaVc3IG6P4F?YISR?1t zL6-r<_q-*|=NK8$R7yV%7pG#IciY1lf|`r=eY)=>CCM6+LJJZyO|V68c1yygp~^%u zMs!eaMT}gzmi?}`~LRln1s1E6eQiF`S~Y);5T%p5&tT!#<uzlNMVmhdqmiybMV0{f9oC-Dz&&ig>brrwOhFdxzt2}^N?5#j2 zr*>Ud+%o6s5+w`UC6xqMivQ}K-V1Cqj0~zkPlONvxpkuWr~*QN379}4<;B+D>PZo+l=jdhMSnSr%V4fMT}M%LrT z{Cs*Gwz%OnB7}=T>(#r{Xp9??t&vsUy$*SZpt*?Q8F$4_G=>C16`_b6vDkQuM}RSo7wlxnO}nNW@)I zsGgaw^Qr%Fqdz}PLhQF}HwfLek1m?oKV>1O$={N|07Gd;$z%LvP$k6`BFNmRN?zuV zbkG9rYuz}McQDZi7fRvmV>9^|L|eAdWDkpniptq6mPLHqQ!Vq3c};sG3VriK-H^G! zktm?M(BdY)J>C2#v=u=J4gJ&bLMZHqF69!cBjtRC;fIrfya5+Ym{J!N27}1agX$fS zzHwAGCKCrkmmu1icY6Trz1tKA9j-PMs^o{T;tLmZ-CImvjg$|=sMX_F`DaK-E>05M zpaGvJHRBbJ9xlM0MqV$NPg7Fq9#Nmw3AQ~L#-(vu03LnX?#*CX5~lUo9-+3v&EZKyj2w42Dxwu&D|&zJ9F3dcBr{;(p`fWz=RmX@mF zq=7BjyU%j|(U)fy@#4Rmv+=Iy`kZ0TAiD(?635lh@1)vFWaupJOXvsAF%K*JJl_3n zX%O62wbFc{;-eN@QtvqWMPM;yC!8Bu?Ib(r+z+%pmVmDn3V|o>%hz)1ZKGZnzXuD} zu-J^^x%~Er(X}lz9A#WlW}4j!e&e?XOOVzDvRXb-4D-{VT|T*nTuK#&8FO8Eb@G5V zksf&A5(f5(v9%#Bnu|aMw8zEg(^ZO!K9n#;FbEAB?+nTrT zAY7zK8I6fjzAH&gYK;Dy+*$WaS?Aar+LwiT!wPV$XT;ZtjX_FpjzE!7V+ui=&)2(i z$F^6CDePTo{38xBX+($iQhLd#+gmA-glxOs%3DBIFqlI-P4AXSVQ`1_q=SfPGZc8a ze}^X#T;q4!aHP#_{j68Xa8J~M(S39j?!Ms^qRB!}pW2hy7aS@WYs6<9Ds_VTrl%1x z>Z5P7Uw@%!;;r9F1IT5;k@PI~UB?J%oq4hh3m)YPs3)enE+?tFz@mH+Jjq8X9&`M= zJE!VRI8CY;P$T~UlHgloAo~8%Nj>CT^rbI;TW>PeNk6BjT~nLIrGN5jk|FE!A=KJvQZz#>yCAfrENj!K~r}{%=EjD!;iDtUou_Fr13S><{t?&*{;Pfpbuxsj1%e$+4c~&rXTt zvW_E)7GN2V{k{D~(}@z=J3=0f#Uf%gFGrb^gg5e3U22XYoANfzL@TpH1;=8xCiD%K zsVykh4mExvV_RC%@qP2Yu3ZF@>hGygVud#e3e5E91CkKpuh~JRO(mNck%5Z3L%GLvu}pG&Jx$h z!N}I-QXPBH(44aalIq>&mso>A1Lz;fpWE!m1WNj~#!~AY6>$_!8bCpv`gR75hDzVz z7*&IXMO!qFY9M0mgWMkW1d+-s#K|eftKrtuh8|+8ZXWKgzJ_eLYD1!Qz8~~Z2}wuU zBT=Y+KdBp$;br3S)A-pgHFY482rf(aHwaIfeZ!}BAQXbRHx}aSm(9u*)4?blgaq7f zx9Wtn%yxb5bJAH?K)J@~Z}2NsoQ`5glz4-F=M(CQV*k}bE7t_subqjFvUK86e+z`Z zvX^7Vpw%@S-jkVWg{F6JJ4a4s9xvTMKu`JapTt&A>VwF>P?YsCs*TP6=!T22&G1rl zP-1?H&$vif1sEl`4`zB<5!|Dn<6-u#vY$j`W+{h21Q;ib^gk--X0KU2{DC|N+ig3P z4Z$8oYTUJ@Z$=d6`}ot+Ge1u?J3@%2+c&qulT%@hklO8|>$rBeR2=~jIdsqBfEr;XDpZCcqx{F39Os%)HoST{}u={2~fuNxskZ33jDPWIaiPd<~ zNxF2v^yQ*x%x5@mMH$$cV3@phqZ7z87n%40v#aTasj3U`Co;HGCV0fejx%-CFA5>rl^lvZ}K-4sjK39c;|6$lqs8na(8c>Sk|HHev0h ztR&L|00961Z~??{JFgBQL5BGisd#5!Apy#B_?wkI??`HvP}+g#e4yv?8U(1ui)WMu z4|?CMF(r6&fAh7klB1S{dj~>{TAZz>7hq$w3UE_VGItoQQc6FVO~cqAy8G=~YsE%k zn*TUi`XCS(l_T+Fp~Eu+ed{rdu8Ea;QF>02vs5y}r{&D2g>4Rpbz!N)-ru|IVtEXO zdVI&2u~?Y{9Y41CkgtkU&O!9Z(^v%h)Nr>aUM~zG?o>m3%aD#}3XocGuw3+hJ`_|1 zaT)CI$DjzeS;;+pSlwB4oc7YVui^wa= II1gs9|AP9@yZ`_I literal 0 HcmV?d00001 diff --git a/workbench-for-google-cloud-workstations/conf/jupyter.conf b/workbench-for-google-cloud-workstations/conf/jupyter.conf new file mode 100644 index 00000000..c38488e4 --- /dev/null +++ b/workbench-for-google-cloud-workstations/conf/jupyter.conf @@ -0,0 +1,7 @@ +notebooks-enabled=1 +labs-enabled=1 + +jupyter-exe=/usr/local/bin/jupyter +lab-args=--no-browser --allow-root --ip=0.0.0.0 --ServerApp.allow_origin="*" --ServerApp.allow_remote_access=True --LabApp.token="" --debug + +default-session-cluster=Local diff --git a/workbench-for-google-cloud-workstations/conf/launcher-env b/workbench-for-google-cloud-workstations/conf/launcher-env new file mode 100644 index 00000000..4a53e727 --- /dev/null +++ b/workbench-for-google-cloud-workstations/conf/launcher-env @@ -0,0 +1,6 @@ +JobType: session +Environment: LANG=en_US.UTF-8 + LANGUAGE=en_US:en + LC_ALL=en_US.UTF-8 +JobType: any +Environment: PATH=/opt/python/3.9.17/bin:$PATH diff --git a/workbench-for-google-cloud-workstations/conf/launcher.conf b/workbench-for-google-cloud-workstations/conf/launcher.conf new file mode 100644 index 00000000..dc48bd19 --- /dev/null +++ b/workbench-for-google-cloud-workstations/conf/launcher.conf @@ -0,0 +1,11 @@ +[server] +address=127.0.0.1 +port=5559 +server-user=rstudio-server +admin-group=rstudio-server +authorization-enabled=1 +enable-debug-logging=1 + +[cluster] +name=Local +type=Local diff --git a/workbench-for-google-cloud-workstations/conf/launcher.local.conf b/workbench-for-google-cloud-workstations/conf/launcher.local.conf new file mode 100644 index 00000000..051857e1 --- /dev/null +++ b/workbench-for-google-cloud-workstations/conf/launcher.local.conf @@ -0,0 +1 @@ +unprivileged=1 diff --git a/workbench-for-google-cloud-workstations/conf/logging.conf b/workbench-for-google-cloud-workstations/conf/logging.conf new file mode 100644 index 00000000..08a09174 --- /dev/null +++ b/workbench-for-google-cloud-workstations/conf/logging.conf @@ -0,0 +1,3 @@ +[*] +logger-type=stderr +log-level=info diff --git a/workbench-for-google-cloud-workstations/conf/nginx.site.conf b/workbench-for-google-cloud-workstations/conf/nginx.site.conf new file mode 100644 index 00000000..2d302a7d --- /dev/null +++ b/workbench-for-google-cloud-workstations/conf/nginx.site.conf @@ -0,0 +1,2 @@ +proxy_set_header X-CUSTOM-USER-NAME user/google; +proxy_set_header Host $http_x_forwarded_host; \ No newline at end of file diff --git a/workbench-for-google-cloud-workstations/conf/repos.conf b/workbench-for-google-cloud-workstations/conf/repos.conf new file mode 100644 index 00000000..de4785ea --- /dev/null +++ b/workbench-for-google-cloud-workstations/conf/repos.conf @@ -0,0 +1,2 @@ +CRAN=https://packagemanager.posit.co/cran/__linux__/focal/latest +RSPM=https://packagemanager.posit.co/cran/__linux__/focal/latest diff --git a/workbench-for-google-cloud-workstations/conf/rserver-float.conf b/workbench-for-google-cloud-workstations/conf/rserver-float.conf new file mode 100644 index 00000000..f04dd8c8 --- /dev/null +++ b/workbench-for-google-cloud-workstations/conf/rserver-float.conf @@ -0,0 +1 @@ +server-license-type=remote diff --git a/workbench-for-google-cloud-workstations/conf/rserver.conf b/workbench-for-google-cloud-workstations/conf/rserver.conf new file mode 100644 index 00000000..2bd60929 --- /dev/null +++ b/workbench-for-google-cloud-workstations/conf/rserver.conf @@ -0,0 +1,19 @@ +server-health-check-enabled=1 +admin-enabled=1 + +www-port=80 +server-project-sharing=0 +auth-pam-sessions-enabled=1 +rsession-no-profile=1 + +server-license-manager-path=/opt/rstudio-license/license-manager + +# Launcher Config +launcher-address=127.0.0.1 +launcher-port=5559 +launcher-sessions-enabled=1 +launcher-default-cluster=Local +launcher-sessions-callback-address=http://0.0.0.0:80 +auth-proxy=1 +auth-proxy-sign-in-url=http://localhost:80/ +auth-proxy-user-header=x-custom-user-name diff --git a/workbench-for-google-cloud-workstations/conf/vscode-user-settings.json b/workbench-for-google-cloud-workstations/conf/vscode-user-settings.json new file mode 100644 index 00000000..144b8c2a --- /dev/null +++ b/workbench-for-google-cloud-workstations/conf/vscode-user-settings.json @@ -0,0 +1,5 @@ +{ + "terminal.integrated.shell.linux": "/bin/bash", + "extensions.autoUpdate": false, + "extensions.autoCheckUpdates": false +} diff --git a/workbench-for-google-cloud-workstations/conf/vscode.conf b/workbench-for-google-cloud-workstations/conf/vscode.conf new file mode 100644 index 00000000..405ff90e --- /dev/null +++ b/workbench-for-google-cloud-workstations/conf/vscode.conf @@ -0,0 +1,4 @@ +enabled=1 +args=--verbose --host=0.0.0.0 + +# exe=/usr/lib/rstudio-server/bin/code-server/bin/code-server diff --git a/workbench-for-google-cloud-workstations/conf/vscode.extensions.conf b/workbench-for-google-cloud-workstations/conf/vscode.extensions.conf new file mode 100644 index 00000000..15f24f1f --- /dev/null +++ b/workbench-for-google-cloud-workstations/conf/vscode.extensions.conf @@ -0,0 +1,4 @@ +quarto.quarto +GoogleCloudTools.cloudcode +REditorSupport.r +ms-python.python diff --git a/workbench-for-google-cloud-workstations/deps/apt_packages.txt b/workbench-for-google-cloud-workstations/deps/apt_packages.txt new file mode 100644 index 00000000..bf6d9c10 --- /dev/null +++ b/workbench-for-google-cloud-workstations/deps/apt_packages.txt @@ -0,0 +1,32 @@ +apt-transport-https +build-essential +ca-certificates +default-jdk +dirmngr +dpkg-sig +gnupg +krb5-user +libcap2 +libcurl4-gnutls-dev +libglib2.0-0 +libicu-dev +libnss-sss +libpam-sss +libpq-dev +libpq5 +libsecret-1-dev +libsm6 +libssl-dev +libuser +libuser1-dev +libxext6 +libxrender1 +locales +oddjob-mkhomedir +rrdtool +sssd +supervisor +tcl +tk +tk-dev +tk-table diff --git a/workbench-for-google-cloud-workstations/deps/install_r_packages.sh b/workbench-for-google-cloud-workstations/deps/install_r_packages.sh new file mode 100755 index 00000000..885ee27f --- /dev/null +++ b/workbench-for-google-cloud-workstations/deps/install_r_packages.sh @@ -0,0 +1,10 @@ +#!/bin/bash + +set -ex + +UBUNTU_CODENAME=$(lsb_release -cs) +CRAN_REPO="https://packagemanager.posit.co/cran/__linux__/${UBUNTU_CODENAME}/latest" + +r_packages=$(awk '{print "\"" $0 "\""}' r_packages.txt | paste -d',' -s -) +/opt/R/${R_VERSION}/bin/R --slave -e "install.packages(c(${r_packages}), repos = \"${CRAN_REPO}\")" +/opt/R/${R_VERSION_ALT}/bin/R --slave -e "install.packages(c(${r_packages}), repos = \"${CRAN_REPO}\")" diff --git a/workbench-for-google-cloud-workstations/deps/py_packages.txt b/workbench-for-google-cloud-workstations/deps/py_packages.txt new file mode 100644 index 00000000..cf9726a1 --- /dev/null +++ b/workbench-for-google-cloud-workstations/deps/py_packages.txt @@ -0,0 +1,4 @@ +numpy +scipy +pandas +matplotlib \ No newline at end of file diff --git a/workbench-for-google-cloud-workstations/deps/r_packages.txt b/workbench-for-google-cloud-workstations/deps/r_packages.txt new file mode 100644 index 00000000..401fa223 --- /dev/null +++ b/workbench-for-google-cloud-workstations/deps/r_packages.txt @@ -0,0 +1,67 @@ +DBI +R6 +RJDBC +RODBC +RSQLite +Rcpp +base64enc +checkmate +crayon +curl +devtools +digest +ellipsis +evaluate +fastmap +glue +haven +highr +htmltools +htmlwidgets +httpuv +jsonlite +keyring +knitr +later +learnr +magrittr +markdown +mime +miniUI +mongolite +odbc +openssl +packrat +plumber +png +profvis +promises +r2d3 +ragg +rappdirs +rJava +readr +readxl +renv +reticulate +rlang +rmarkdown +roxygen2 +rprojroot +rsconnect +rstan +rstudioapi +shiny +shinytest +sourcetools +stringi +stringr +testthat +tidyverse +tidymodels +tinytex +withr +xfun +xml2 +xtable +yaml diff --git a/workbench-for-google-cloud-workstations/docker-compose.test.yml b/workbench-for-google-cloud-workstations/docker-compose.test.yml new file mode 100644 index 00000000..8de098c6 --- /dev/null +++ b/workbench-for-google-cloud-workstations/docker-compose.test.yml @@ -0,0 +1,24 @@ +version: '2.3' +services: + + sut: + image: $IMAGE_NAME + command: /run_tests.sh + entrypoint: [] + environment: + # uses .env by default + - RSW_VERSION + - R_VERSION + - R_VERSION_ALT + - PYTHON_VERSION + - PYTHON_VERSION_ALT + - PYTHON_VERSION_JUPYTER + - QUARTO_VERSION + - DRIVERS_VERSION + - RSW_LICENSE + - RSW_LICENSE_SERVER + volumes: + - "./test/run_tests.sh:/run_tests.sh" + - "./test/goss.yaml:/tmp/goss.yaml" + - "./deps/py_packages.txt:/tmp/py_packages.txt" + - "./deps/r_packages.txt:/tmp/r_packages.txt" diff --git a/workbench-for-google-cloud-workstations/jupyter/jupyter_notebook_config.json b/workbench-for-google-cloud-workstations/jupyter/jupyter_notebook_config.json new file mode 100644 index 00000000..aec0a83e --- /dev/null +++ b/workbench-for-google-cloud-workstations/jupyter/jupyter_notebook_config.json @@ -0,0 +1,15 @@ +{ + "NotebookApp": { + "nbserver_extensions":{ + "rsconnect_jupyter": true + }, + "terminado_settings": { + "shell_command": ["/bin/bash"] + } + }, + "ServerApp": { + "terminado_settings": { + "shell_command": ["/bin/bash"] + } + } +} \ No newline at end of file diff --git a/workbench-for-google-cloud-workstations/license-manager-shim b/workbench-for-google-cloud-workstations/license-manager-shim new file mode 100755 index 00000000..4ad2633d --- /dev/null +++ b/workbench-for-google-cloud-workstations/license-manager-shim @@ -0,0 +1,7 @@ +#!/bin/sh + +# Copyright (C) 2023 by Posit, PBC. + +dir=$(dirname "$0") +export LD_LIBRARY_PATH="$LD_LIBRARY_PATH:/opt/rstudio-license" +exec "$dir/license-manager-orig" "$@" diff --git a/workbench-for-google-cloud-workstations/pam/rstudio b/workbench-for-google-cloud-workstations/pam/rstudio new file mode 100644 index 00000000..cf173d6d --- /dev/null +++ b/workbench-for-google-cloud-workstations/pam/rstudio @@ -0,0 +1,14 @@ +#%PAM-1.0 +auth sufficient pam_sss.so forward_pass +auth required pam_unix.so try_first_pass nullok +auth optional pam_permit.so +auth required pam_env.so + +account [default=bad success=ok user_unknown=ignore authinfo_unavail=ignore] pam_sss.so +account required pam_unix.so +account optional pam_permit.so +account required pam_time.so + +password sufficient pam_sss.so use_authtok +password required pam_unix.so try_first_pass nullok sha512 shadow +password optional pam_permit.so diff --git a/workbench-for-google-cloud-workstations/pam/rstudio-session b/workbench-for-google-cloud-workstations/pam/rstudio-session new file mode 100644 index 00000000..05894708 --- /dev/null +++ b/workbench-for-google-cloud-workstations/pam/rstudio-session @@ -0,0 +1,26 @@ +#%PAM-1.0 + +# This allows root to su without passwords (this is required) +# DO NOT use in the "rstudio" profile +auth sufficient pam_rootok.so +auth sufficient pam_sss.so forward_pass +auth required pam_unix.so try_first_pass nullok +auth optional pam_permit.so +auth required pam_env.so + +account [default=bad success=ok user_unknown=ignore authinfo_unavail=ignore] pam_sss.so +account required pam_unix.so +account optional pam_permit.so +account required pam_time.so + +password sufficient pam_sss.so use_authtok +password required pam_unix.so try_first_pass nullok sha512 shadow +password optional pam_permit.so + +session required pam_mkhomedir.so skel=/etc/skel umask=0022 +session required pam_env.so readenv=1 +session required pam_env.so readenv=1 envfile=/etc/default/locale +session required pam_limits.so +session required pam_unix.so +session optional pam_sss.so +session optional pam_permit.so diff --git a/workbench-for-google-cloud-workstations/sssd.conf b/workbench-for-google-cloud-workstations/sssd.conf new file mode 100644 index 00000000..7bbba4ab --- /dev/null +++ b/workbench-for-google-cloud-workstations/sssd.conf @@ -0,0 +1,9 @@ +[sssd] +config_file_version = 2 +domains = placeholder + +[domain/placeholder] +id_provider = none +auth_provider = none +chpass_provider = none +sudo_provider = none diff --git a/workbench-for-google-cloud-workstations/startup-launcher/rstudio-launcher.conf b/workbench-for-google-cloud-workstations/startup-launcher/rstudio-launcher.conf new file mode 100644 index 00000000..5fd8540d --- /dev/null +++ b/workbench-for-google-cloud-workstations/startup-launcher/rstudio-launcher.conf @@ -0,0 +1,8 @@ +[program:rstudio-launcher] +command=/usr/lib/rstudio-server/bin/rstudio-launcher +autorestart=false +numprocs=1 +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/workbench-for-google-cloud-workstations/startup-user-provisioning/sssd.conf b/workbench-for-google-cloud-workstations/startup-user-provisioning/sssd.conf new file mode 100644 index 00000000..387913e5 --- /dev/null +++ b/workbench-for-google-cloud-workstations/startup-user-provisioning/sssd.conf @@ -0,0 +1,11 @@ +[program:sssd] +# TODO: a way to disable this easily...? +command=/usr/sbin/sssd -i -c /etc/sssd/sssd.conf --logger=stderr +autorestart=false +numprocs=1 +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stdout_logfile_backups=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 +stderr_logfile_backups=0 diff --git a/workbench-for-google-cloud-workstations/startup.sh b/workbench-for-google-cloud-workstations/startup.sh new file mode 100644 index 00000000..21fb32ce --- /dev/null +++ b/workbench-for-google-cloud-workstations/startup.sh @@ -0,0 +1,72 @@ +#!/bin/bash + +export LICENSE_MANAGER_PATH=${LICENSE_MANAGER_PATH:-/opt/rstudio-license} + +set -ex + +# Uncomment to get a log for this script +#exec >/startup.log 2>&1 + +# Deactivate license when the process exits +deactivate() { + echo "== Exiting ==" + rstudio-server stop + echo "Deactivating license ..." + ${LICENSE_MANAGER_PATH}/license-manager deactivate >/dev/null 2>&1 + + echo "== Done ==" +} +trap deactivate EXIT + +verify_installation(){ + echo "==VERIFY INSTALLATION=="; + mkdir -p $DIAGNOSTIC_DIR + chmod 777 $DIAGNOSTIC_DIR + rstudio-server verify-installation --verify-user=$RSW_TESTUSER | tee $DIAGNOSTIC_DIR/verify.log +} + +set +x + +# Support RSP_ or RSW_ prefix +RSP_LICENSE=${RSP_LICENSE:-${RSW_LICENSE}} +RSP_LICENSE_SERVER=${RSP_LICENSE_SERVER:-${RSW_LICENSE_SERVER}} + +# Activate License +RSW_LICENSE_FILE_PATH=${RSW_LICENSE_FILE_PATH:-/etc/rstudio-server/license.lic} +if [ -n "$RSP_LICENSE" ]; then + ${LICENSE_MANAGER_PATH}/license-manager activate $RSP_LICENSE || true +elif [ -n "$RSP_LICENSE_SERVER" ]; then + ${LICENSE_MANAGER_PATH}/license-manager license-server $RSP_LICENSE_SERVER || true +elif test -f "$RSW_LICENSE_FILE_PATH"; then + ${LICENSE_MANAGER_PATH}/license-manager activate-file $RSW_LICENSE_FILE_PATH || true +fi + +# ensure these cannot be inherited by child processes +unset RSP_LICENSE +unset RSP_LICENSE_SERVER +unset RSW_LICENSE +unset RSW_LICENSE_SERVER + +set -x + +# Start Launcher +if [ "$RSW_LAUNCHER" == "true" ]; then + echo "Waiting for launcher to startup... to disable set RSW_LAUNCHER=false" + wait-for-it.sh localhost:5559 -t $RSW_LAUNCHER_TIMEOUT +fi + +# Check diagnostic configurations +if [ "$DIAGNOSTIC_ENABLE" == "true" ]; then + verify_installation + if [ "$DIAGNOSTIC_ONLY" == "true" ]; then + echo $(<$DIAGNOSTIC_DIR/verify.log); + echo "Exiting script because DIAGNOSTIC_ONLY=${DIAGNOSTIC_ONLY}"; + exit 0 + fi; +else + echo "not running verify installation because DIAGNOSTIC_ENABLE=${DIAGNOSTIC_ENABLE}"; +fi + +# the main container process +# cannot use "exec" or the "trap" will be lost +/usr/lib/rstudio-server/bin/rserver --server-daemonize 0 > /dev/stderr diff --git a/workbench-for-google-cloud-workstations/startup/rstudio-workbench.conf b/workbench-for-google-cloud-workstations/startup/rstudio-workbench.conf new file mode 100644 index 00000000..0acac704 --- /dev/null +++ b/workbench-for-google-cloud-workstations/startup/rstudio-workbench.conf @@ -0,0 +1,8 @@ +[program:rstudio-workbench] +command=/usr/local/bin/startup.sh +autorestart=false +numprocs=1 +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 diff --git a/workbench-for-google-cloud-workstations/supervisord.conf b/workbench-for-google-cloud-workstations/supervisord.conf new file mode 100644 index 00000000..7180a826 --- /dev/null +++ b/workbench-for-google-cloud-workstations/supervisord.conf @@ -0,0 +1,47 @@ +; supervisor config file + +[unix_http_server] +file=/var/run/supervisor.sock ; (the path to the socket file) +chmod=0700 ; sockef file mode (default 0700) + +[supervisord] +logfile=/dev/stdout ; (main log file;default $CWD/supervisord.log) +user=root +pidfile=/var/run/supervisord.pid ; (supervisord pidfile;default supervisord.pid) +; should configure each program to use stdout/stderr +; childlogdir=/var/log/supervisor ; ('AUTO' child log dir, default $TEMP) +logfile_maxbytes=0 +logfile_backups=0 +loglevel=info +nodaemon=true + +; the below section must remain in the config file for RPC +; (supervisorctl/web interface) to work, additional interfaces may be +; added by defining them in separate rpcinterface: sections +[rpcinterface:supervisor] +supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface + +[supervisorctl] +serverurl=unix:///var/run/supervisor.sock ; use a unix:// URL for a unix socket + +; The [include] section can just contain the "files" setting. This +; setting can list multiple files (separated by whitespace or +; newlines). It can also contain wildcards. The filenames are +; interpreted as relative to this file. Included files *cannot* +; include files themselves. + +[eventlistener:process-monitor] +command=bash -c "printf 'READY\n' && while read line; do kill -SIGQUIT $PPID; done < /dev/stdin" +events=PROCESS_STATE_STOPPED,PROCESS_STATE_EXITED,PROCESS_STATE_FATAL +stdout_logfile=/dev/stdout +stdout_logfile_maxbytes=0 +stdout_logfile_backups=0 +stderr_logfile=/dev/stderr +stderr_logfile_maxbytes=0 +stderr_logfile_backups=0 + +; beware possible race condition +; if one of these services exit before the process-monitor is up + +[include] +files = /startup/base/*.conf /startup/launcher/*.conf /startup/user-provisioning/*.conf /startup/custom/*.conf diff --git a/workbench-for-google-cloud-workstations/test/goss.yaml b/workbench-for-google-cloud-workstations/test/goss.yaml new file mode 100644 index 00000000..674665ef --- /dev/null +++ b/workbench-for-google-cloud-workstations/test/goss.yaml @@ -0,0 +1,233 @@ +user: + rstudio-server: + exists: true + uid: 999 + gid: 998 + +group: + rstudio-server: + exists: true + gid: 998 + +package: + rstudio-server: + installed: true + versions: + - {{ .Env.RSW_VERSION }} + r-{{.Env.R_VERSION}}: + installed: true + r-{{.Env.R_VERSION_ALT}}: + installed: true + python-{{.Env.PYTHON_VERSION}}: + installed: true + python-{{.Env.PYTHON_VERSION_ALT}}: + installed: true + quarto: + installed: true + versions: + - {{.Env.QUARTO_VERSION}} + rstudio-drivers: + installed: true + versions: + - {{.Env.DRIVERS_VERSION}} + +port: + tcp:80: + listening: true + ip: + - 0.0.0.0 + skip: false + tcp:5559: + listening: true + ip: + - 127.0.0.1 + skip: false + +process: + rserver: + running: true + skip: false + rstudio-launche: + running: true + skip: false + +file: + /etc/rstudio-server/license.lic: + exists: false + /usr/lib/rstudio-server: + exists: true + /opt/R/{{.Env.R_VERSION_ALT}}/bin/R: + exists: true + filetype: file + /opt/python/{{.Env.PYTHON_VERSION}}/bin/python: + exists: true + filetype: symlink + /opt/python/{{.Env.PYTHON_VERSION_ALT}}/bin/python: + exists: true + filetype: symlink + /opt/python/jupyter/bin/python: + exists: true + filetype: symlink + /opt/python/jupyter/bin/jupyter: + exists: true + /usr/local/bin/jupyter: + exists: true + /usr/lib/rstudio-server/bin/rserver: + exists: true + /usr/lib/rstudio-server/bin/rstudio-server: + exists: true + /usr/lib/rstudio-server/bin/rstudio-launcher: + exists: true + /var/lib/rstudio-server/monitor/log: + exists: true + owner: rstudio-server + group: rstudio-server + /usr/lib/rstudio-server/bin/code-server/bin/code-server: + exists: true + /etc/rstudio/vscode.conf: + exists: true + /etc/rstudio/jupyter.conf: + exists: true + contains: + - --LabApp.token="" + - --no-browser + - --allow-root + - --ip=0.0.0.0 + /etc/rstudio/rserver.conf: + exists: true + contains: + - www-port=80 + - launcher-sessions-callback-address=http://0.0.0.0:80 + - auth-proxy=1 + - auth-proxy-sign-in-url=http://localhost:80/ + - auth-proxy-user-header=x-custom-user-name + /etc/rstudio/nginx.site.conf: + exists: true + contains: + - proxy_set_header X-CUSTOM-USER-NAME user/google; + - proxy_set_header Host $http_x_forwarded_host; + /etc/rstudio/vscode.extensions.conf: + exists: true + contains: + - quarto.quarto + - GoogleCloudTools.cloudcode + /tmp/startup.log: + exists: true + contains: + - "!Error reading /etc/rstudio/rserver.conf:" + /etc/pam.d/common-session: + exists: true + contains: + - "/^session required pam_mkhomedir.so skel=/etc/skel umask=0022$/" + /etc/sssd/sssd.conf: + exists: true + owner: root + group: root + mode: "0600" + /usr/local/bin/wait-for-it.sh: + exists: true + owner: root + group: root + mode: "0755" + /etc/workstation-startup.d/010_add-user.sh: + exists: true + owner: root + group: root + mode: "0755" + filetype: file + contains: [ + "useradd -m user" + ] + /etc/workstation-startup.d/110_config-jupyter.sh: + exists: true + owner: root + group: root + mode: "0755" + filetype: file + contains: [ + # Checks that we're setting the Jupyter shell to /bin/bash + "echo \"c.ServerApp.terminado_settings = {'shell_command': ['/bin/bash']}\" > /home/user/.jupyter/jupyter_notebook_config.py" + ] + /etc/workstation-startup.d/120_start-workbench.sh: + exists: true + owner: root + group: root + mode: "0755" + filetype: file + contains: [ + "/usr/bin/supervisord -c /etc/supervisor/supervisord.conf" + ] + + +command: + # Check OS release version (early heads up in case the base image is modified) + Check OS version is "focal": + exec: "lsb_release -cs" + exit-status: 0 + stdout: [ + "focal" + ] + Test Workbench Monitor rstudio-server.log creation: + exec: su rstudio-server -c 'touch /var/lib/rstudio-server/monitor/log/rstudio-server.log' + exit-status: 0 + Test rstudio-server.log creation: + exec: touch /var/log/rstudio-server.log + exit-status: 0 + Check RStudio Workbench version is {{ .Env.RSW_VERSION }}: + exec: rstudio-server version + exit-status: 0 + stdout: [ + "{{ .Env.RSW_VERSION }}", + "Workbench" + ] + Test Jupyter works: + exec: "echo '{ \"cells\": [], \"metadata\": {}, \"nbformat\": 4, \"nbformat_minor\": 2}' | /opt/python/jupyter/bin/jupyter nbconvert --to notebook --stdin --stdout" + exit-status: 0 + Check primary Python is version {{.Env.PYTHON_VERSION}}: + exec: /opt/python/{{.Env.PYTHON_VERSION}}/bin/python --version + exit-status: 0 + stdout: [ + "{{.Env.PYTHON_VERSION}}" + ] + Check alternate Python is version {{.Env.PYTHON_VERSION_ALT}}: + exec: /opt/python/{{.Env.PYTHON_VERSION_ALT}}/bin/python --version + exit-status: 0 + stdout: [ + "{{.Env.PYTHON_VERSION_ALT}}" + ] + Check Jupyter venv uses Python {{.Env.PYTHON_VERSION_JUPYTER}}: + exec: /opt/python/jupyter/bin/python --version + exit-status: 0 + stdout: [ + "{{.Env.PYTHON_VERSION_JUPYTER}}" + ] + Check for OpenSSL: + exec: which openssl + exit-status: 0 + stdout: [ + "/usr/bin/openssl" + ] + {{ $python_version := .Env.PYTHON_VERSION }} + {{ $python_version_alt := .Env.PYTHON_VERSION_ALT }} + {{ $py_package_list := readFile "/tmp/py_packages.txt" | splitList "\n" }} + {{- range $py_package_list }} + Check Python {{ $python_version }} has "{{.}}" installed: + exec: /opt/python/{{$python_version}}/bin/pip show {{.}} + exit-status: 0 + Check Python {{ $python_version_alt }} has "{{.}}" installed: + exec: /opt/python/{{$python_version_alt}}/bin/pip show {{.}} + exit-status: 0 + {{end}} + {{ $r_version := .Env.R_VERSION }} + {{ $r_version_alt := .Env.R_VERSION_ALT }} + {{ $r_package_list := readFile "/tmp/r_packages.txt" | splitList "\n" }} + {{- range $r_package_list }} + Check R {{ $r_version }} has "{{.}}" installed: + exec: /opt/R/{{$r_version}}/bin/R --slave -e "library(\"{{.}}\")" + timeout: 60000 + exit-status: 0 + Check R {{ $r_version_alt }} has "{{.}}" installed: + exec: /opt/R/{{$r_version_alt}}/bin/R --slave -e "library(\"{{.}}\")" + timeout: 60000 + exit-status: 0 + {{end}} \ No newline at end of file diff --git a/workbench-for-google-cloud-workstations/test/run_tests.sh b/workbench-for-google-cloud-workstations/test/run_tests.sh new file mode 100755 index 00000000..02c2cd04 --- /dev/null +++ b/workbench-for-google-cloud-workstations/test/run_tests.sh @@ -0,0 +1,33 @@ +#!/bin/bash +set -xe + +RSW_TIMEOUT=${RSW_TIMEOUT:-60} + +touch /tmp/startup.log +trap 'err=$?; echo >&2 "run_tests.sh encountered an error: $err"; cat /tmp/startup.log; exit $err' ERR + +# start rstudio-server +echo "--> Starting RStudio Workbench" +/usr/bin/supervisord -c /etc/supervisor/supervisord.conf > /tmp/startup.log 2>&1 & + +echo "--> Waiting for workbench to startup... with RSW_TIMEOUT: $RSW_TIMEOUT" +wait-for-it.sh localhost:80 -t $RSW_TIMEOUT +wait-for-it.sh localhost:5559 -t $RSW_TIMEOUT +echo "--> Startup complete" + +GOSS_FILE=${GOSS_FILE:-/tmp/goss.yaml} +GOSS_VARS=${GOSS_VARS:-/tmp/goss_vars.yaml} +GOSS_VERSION=${GOSS_VERSION:-0.3.22} +GOSS_MAX_CONCURRENT=${GOSS_MAX_CONCURRENT:-50} + +# default to empty var file (since vars are not necessary) +if [ ! -f "$GOSS_VARS" ]; then + touch $GOSS_VARS +fi + +# install goss to tmp location and make executable +curl -sL https://github.com/aelsabbahy/goss/releases/download/v$GOSS_VERSION/goss-linux-amd64 -o /tmp/goss \ + && chmod +x /tmp/goss \ + && GOSS=/tmp/goss + +GOSS_FILE=$GOSS_FILE GOSS_VARS=$GOSS_VARS $GOSS v --format documentation --max-concurrent $GOSS_MAX_CONCURRENT diff --git a/workbench-for-google-cloud-workstations/workstation-startup/110_config-jupyter.sh b/workbench-for-google-cloud-workstations/workstation-startup/110_config-jupyter.sh new file mode 100755 index 00000000..6f97b81a --- /dev/null +++ b/workbench-for-google-cloud-workstations/workstation-startup/110_config-jupyter.sh @@ -0,0 +1,8 @@ +#!/bin/bash + +set -ex + +mkdir -p /home/user/.jupyter +echo "c.ServerApp.terminado_settings = {'shell_command': ['/bin/bash']}" > /home/user/.jupyter/jupyter_notebook_config.py +chown -R user:user /home/user/.jupyter +chmod 644 /home/user/.jupyter/jupyter_notebook_config.py diff --git a/workbench-for-google-cloud-workstations/workstation-startup/120_start-workbench.sh b/workbench-for-google-cloud-workstations/workstation-startup/120_start-workbench.sh new file mode 100755 index 00000000..ad889455 --- /dev/null +++ b/workbench-for-google-cloud-workstations/workstation-startup/120_start-workbench.sh @@ -0,0 +1,5 @@ +#!/bin/bash + +set -ex + +/usr/bin/supervisord -c /etc/supervisor/supervisord.conf From b0263f66b9c1edfe68af72f8102f92be1c30027e Mon Sep 17 00:00:00 2001 From: Cole Arendt Date: Thu, 10 Aug 2023 11:32:47 -0400 Subject: [PATCH 09/17] remove the buildkitsandbox file that is left over from our build (#551) Also add a server test to ensure that the file does not get left over in builds. Close #550 Co-authored-by: Ian Pittwood --- workbench/Dockerfile.ubuntu2204 | 3 ++- workbench/test/goss.yaml | 2 ++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/workbench/Dockerfile.ubuntu2204 b/workbench/Dockerfile.ubuntu2204 index c2655830..095097db 100644 --- a/workbench/Dockerfile.ubuntu2204 +++ b/workbench/Dockerfile.ubuntu2204 @@ -62,7 +62,8 @@ RUN apt-get update \ && apt-get autoremove -y \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* \ - && rm -rf /var/lib/rstudio-server/r-versions + && rm -rf /var/lib/rstudio-server/r-versions \ + && rm -rf /var/lib/rstudio-launcher/Local/jobs/buildkitsandbox COPY --chmod=0775 startup.sh /usr/local/bin/startup.sh COPY startup-launcher/* /startup/launcher/ diff --git a/workbench/test/goss.yaml b/workbench/test/goss.yaml index ccce2166..eb8fa5d7 100644 --- a/workbench/test/goss.yaml +++ b/workbench/test/goss.yaml @@ -71,6 +71,8 @@ file: group: rstudio-server /usr/lib/rstudio-server/bin/code-server/bin/code-server: exists: true + /var/lib/rstudio-launcher/Local/jobs/buildkitsandbox: + exists: false /etc/rstudio/vscode.conf: exists: true /tmp/startup.log: From 535d3361dfe5cdad4161f65192a65b7b119ed9d8 Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Thu, 10 Aug 2023 09:30:22 -0700 Subject: [PATCH 10/17] Disable token authentication for Jupyter in WAML --- workbench-for-microsoft-azure-ml/conf/jupyter.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/workbench-for-microsoft-azure-ml/conf/jupyter.conf b/workbench-for-microsoft-azure-ml/conf/jupyter.conf index f90168e2..c38488e4 100644 --- a/workbench-for-microsoft-azure-ml/conf/jupyter.conf +++ b/workbench-for-microsoft-azure-ml/conf/jupyter.conf @@ -1,5 +1,7 @@ -jupyter-exe=/usr/local/bin/jupyter notebooks-enabled=1 labs-enabled=1 +jupyter-exe=/usr/local/bin/jupyter +lab-args=--no-browser --allow-root --ip=0.0.0.0 --ServerApp.allow_origin="*" --ServerApp.allow_remote_access=True --LabApp.token="" --debug + default-session-cluster=Local From 927ccc73c549c023dc1759ed36ce4af26bd6b21b Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Thu, 10 Aug 2023 09:37:55 -0700 Subject: [PATCH 11/17] Revert "Disable token authentication for Jupyter in WAML" This reverts commit 535d3361dfe5cdad4161f65192a65b7b119ed9d8. --- workbench-for-microsoft-azure-ml/conf/jupyter.conf | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/workbench-for-microsoft-azure-ml/conf/jupyter.conf b/workbench-for-microsoft-azure-ml/conf/jupyter.conf index c38488e4..f90168e2 100644 --- a/workbench-for-microsoft-azure-ml/conf/jupyter.conf +++ b/workbench-for-microsoft-azure-ml/conf/jupyter.conf @@ -1,7 +1,5 @@ +jupyter-exe=/usr/local/bin/jupyter notebooks-enabled=1 labs-enabled=1 -jupyter-exe=/usr/local/bin/jupyter -lab-args=--no-browser --allow-root --ip=0.0.0.0 --ServerApp.allow_origin="*" --ServerApp.allow_remote_access=True --LabApp.token="" --debug - default-session-cluster=Local From f4dd8f97d86b5f40ad8e9f7ca9f6c164ed9fcf42 Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Thu, 10 Aug 2023 10:59:55 -0700 Subject: [PATCH 12/17] Disable token authentication for Jupyter in WAML (#620) --- workbench-for-microsoft-azure-ml/conf/jupyter.conf | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/workbench-for-microsoft-azure-ml/conf/jupyter.conf b/workbench-for-microsoft-azure-ml/conf/jupyter.conf index f90168e2..c38488e4 100644 --- a/workbench-for-microsoft-azure-ml/conf/jupyter.conf +++ b/workbench-for-microsoft-azure-ml/conf/jupyter.conf @@ -1,5 +1,7 @@ -jupyter-exe=/usr/local/bin/jupyter notebooks-enabled=1 labs-enabled=1 +jupyter-exe=/usr/local/bin/jupyter +lab-args=--no-browser --allow-root --ip=0.0.0.0 --ServerApp.allow_origin="*" --ServerApp.allow_remote_access=True --LabApp.token="" --debug + default-session-cluster=Local From 1c04f3454076604a95278d3b992202f1576d3d46 Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Mon, 14 Aug 2023 08:26:58 -0700 Subject: [PATCH 13/17] Expand default R and Python package lists for Workbench for Azure ML (#619) * Expand default lang package lists * Move dependency scripts and lists back into `/tmp` remove `local UBUNTU_CODENAME` --- .../Dockerfile.ubuntu2204 | 45 ++++++------ .../deps/apt_packages.txt | 18 +++++ .../{ => deps}/install-r.sh | 12 ++-- .../deps/py_packages.txt | 8 +++ .../deps/r_packages.txt | 71 +++++++++++++++++++ .../package-list.txt | 12 ---- .../test/goss.yaml | 2 - 7 files changed, 122 insertions(+), 46 deletions(-) create mode 100644 workbench-for-microsoft-azure-ml/deps/apt_packages.txt rename workbench-for-microsoft-azure-ml/{ => deps}/install-r.sh (85%) create mode 100644 workbench-for-microsoft-azure-ml/deps/py_packages.txt create mode 100644 workbench-for-microsoft-azure-ml/deps/r_packages.txt delete mode 100644 workbench-for-microsoft-azure-ml/package-list.txt diff --git a/workbench-for-microsoft-azure-ml/Dockerfile.ubuntu2204 b/workbench-for-microsoft-azure-ml/Dockerfile.ubuntu2204 index 75b3416a..f41c43ed 100644 --- a/workbench-for-microsoft-azure-ml/Dockerfile.ubuntu2204 +++ b/workbench-for-microsoft-azure-ml/Dockerfile.ubuntu2204 @@ -34,28 +34,16 @@ ENV DIAGNOSTIC_ONLY false ENV WORKBENCH_JUPYTER_PATH=/usr/local/bin/jupyter COPY --chmod=0644 TurboActivate.dat /opt/rstudio-license/license-manager.conf +COPY deps/* /tmp SHELL ["/bin/bash", "-o", "pipefail", "-c"] +RUN apt-get update --fix-missing \ + && apt-get upgrade -yq \ + && xargs -a /tmp/apt_packages.txt apt-get install -yq --no-install-recommends \ + && rm /tmp/apt_packages.txt \ + && rm -rf /var/lib/apt/lists/* + RUN apt-get update \ - && apt-get install --no-install-recommends -y \ - krb5-user \ - libcap2 \ - libcurl4-gnutls-dev \ - libglib2.0-0 \ - libnss-sss \ - libpam-sss \ - libpq-dev \ - libpq5 \ - libsm6 \ - libuser \ - libuser1-dev \ - libxext6 \ - libxrender1 \ - oddjob-mkhomedir \ - openssh-client \ - rrdtool \ - sssd \ - supervisor \ && curl -o rstudio-workbench.deb "${RSW_DOWNLOAD_URL}/${RSW_NAME}-${RSW_VERSION//+/-}-amd64.deb" \ # Pre 7/25/23 packages && gpg --keyserver keyserver.ubuntu.com --recv-keys 3F32EE77E331692F \ @@ -66,8 +54,8 @@ RUN apt-get update \ && rm ./rstudio-workbench.deb \ && mkdir -p /opt/rstudio-license/ \ && mkdir -p /var/lib/rstudio-workbench/ \ - && curl -sL "https://s3.amazonaws.com/rstudio-ide-build/monitor/jammy/rsp-monitor-workbench-azureml-amd64-${RSW_VERSION//+/-}.tar.gz" | \ - tar xzvf - --strip 2 -C /opt/rstudio-license/ \ + && curl -sL "https://s3.amazonaws.com/rstudio-ide-build/monitor/jammy/rsp-monitor-workbench-azureml-amd64-${RSW_VERSION//+/-}.tar.gz" \ + | tar xzvf - --strip 2 -C /opt/rstudio-license/ \ && chmod 0755 /opt/rstudio-license/license-manager \ && mv /opt/rstudio-license/license-manager /opt/rstudio-license/license-manager-orig \ && rm -f /usr/lib/rstudio-server/bin/license-manager \ @@ -83,14 +71,15 @@ COPY startup-launcher/* /startup/launcher/ COPY startup/* /startup/base/ COPY supervisord.conf /etc/supervisor/supervisord.conf -# Install R and R Packages -COPY package-list.txt /tmp/package-list.txt -COPY install-r.sh /tmp/install-r.sh +### Install R and R Packages ### RUN apt-get update --fix-missing -qq \ && /tmp/install-r.sh \ + && rm /tmp/install-r.sh \ + && rm /tmp/r_packages.txt \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* +### Install Jupyter and extensions ### RUN /opt/python/"${PYTHON_VERSION_JUPYTER}"/bin/python -m venv /opt/python/jupyter \ && /opt/python/jupyter/bin/pip install \ jupyter \ @@ -116,6 +105,14 @@ RUN /opt/python/"${PYTHON_VERSION_JUPYTER}"/bin/python -m venv /opt/python/jupyt virtualenv \ && /opt/python/${PYTHON_VERSION_ALT}/bin/python -m ipykernel install --name py${PYTHON_VERSION_ALT} --display-name "Python ${PYTHON_VERSION_ALT}" +### Install basic data science packages for Python and R ### +COPY deps/* / +RUN /opt/python/${PYTHON_VERSION}/bin/python3 -m pip install -r /tmp/py_packages.txt \ + && /opt/python/${PYTHON_VERSION}/bin/python3 -m pip cache purge \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python3 -m pip install -r /tmp/py_packages.txt \ + && /opt/python/${PYTHON_VERSION_ALT}/bin/python3 -m pip cache purge \ + && rm /tmp/py_packages.txt + RUN curl -L -o /usr/local/bin/wait-for-it.sh https://raw.githubusercontent.com/rstudio/wait-for-it/master/wait-for-it.sh \ && chmod +x /usr/local/bin/wait-for-it.sh diff --git a/workbench-for-microsoft-azure-ml/deps/apt_packages.txt b/workbench-for-microsoft-azure-ml/deps/apt_packages.txt new file mode 100644 index 00000000..e66a2020 --- /dev/null +++ b/workbench-for-microsoft-azure-ml/deps/apt_packages.txt @@ -0,0 +1,18 @@ +krb5-user +libcap2 +libcurl4-gnutls-dev +libglib2.0-0 +libnss-sss +libpam-sss +libpq-dev +libpq5 +libsm6 +libuser +libuser1-dev +libxext6 +libxrender1 +oddjob-mkhomedir +openssh-client +rrdtool +sssd +supervisor \ No newline at end of file diff --git a/workbench-for-microsoft-azure-ml/install-r.sh b/workbench-for-microsoft-azure-ml/deps/install-r.sh similarity index 85% rename from workbench-for-microsoft-azure-ml/install-r.sh rename to workbench-for-microsoft-azure-ml/deps/install-r.sh index a85870a5..5765a06a 100755 --- a/workbench-for-microsoft-azure-ml/install-r.sh +++ b/workbench-for-microsoft-azure-ml/deps/install-r.sh @@ -1,5 +1,7 @@ #!/bin/bash -set -xe -o pipefail +set -euxo pipefail + +UBUNTU_CODENAME=$(lsb_release -cs) # quick way to call out specific logging lines in packer stdout pp() { @@ -10,10 +12,6 @@ install_r_packages() { # given a one-per-line file of R packages, parses the file and installs those R # packages to the provided (or default) R installation. - set -xe - - local UBUNTU_CODENAME=$(lsb_release -cs) - # passing a r binary as second arg will install with that R version local R_BIN=${2:-"/usr/lib/R/bin/R"} @@ -38,7 +36,5 @@ for rvers in 3.6.3 4.0.5 4.1.3 4.2.3 4.3.1; do rm -f ./r-${rvers}_1_amd64.deb # install packages - install_r_packages /tmp/package-list.txt /opt/R/${rvers}/bin/R https://packagemanager.rstudio.com/cran/__linux__/bionic/latest + install_r_packages /tmp/r_packages.txt /opt/R/${rvers}/bin/R https://packagemanager.rstudio.com/cran/__linux__/${UBUNTU_CODENAME}/latest done - -rm -f /tmp/package_list.txt diff --git a/workbench-for-microsoft-azure-ml/deps/py_packages.txt b/workbench-for-microsoft-azure-ml/deps/py_packages.txt new file mode 100644 index 00000000..14a2b945 --- /dev/null +++ b/workbench-for-microsoft-azure-ml/deps/py_packages.txt @@ -0,0 +1,8 @@ +azureml +azureml-core +azureml-dataset-runtime +azure-ai-ml +numpy +scipy +pandas +matplotlib diff --git a/workbench-for-microsoft-azure-ml/deps/r_packages.txt b/workbench-for-microsoft-azure-ml/deps/r_packages.txt new file mode 100644 index 00000000..64fe3f36 --- /dev/null +++ b/workbench-for-microsoft-azure-ml/deps/r_packages.txt @@ -0,0 +1,71 @@ +DBI +R6 +RJDBC +RODBC +RSQLite +Rcpp +base64enc +checkmate +crayon +curl +devtools +digest +ellipsis +evaluate +fastmap +ggplot2 +glue +haven +highr +htmltools +htmlwidgets +httpuv +jsonlite +keyring +knitr +later +learnr +magrittr +markdown +mime +miniUI +mlflow +mongolite +odbc +openssl +packrat +plumber +png +profvis +promises +r2d3 +ragg +rappdirs +rJava +readr +readxl +renv +reticulate +rgdal +rlang +rmarkdown +roxygen2 +rprojroot +rsconnect +rstan +rstudioapi +sf +shiny +shinytest +sourcetools +stringi +stringr +testthat +tidyverse +tidymodels +tinytex +withr +xfun +xml2 +xtable +yaml diff --git a/workbench-for-microsoft-azure-ml/package-list.txt b/workbench-for-microsoft-azure-ml/package-list.txt deleted file mode 100644 index 8f200e0c..00000000 --- a/workbench-for-microsoft-azure-ml/package-list.txt +++ /dev/null @@ -1,12 +0,0 @@ -rgdal -ggplot2 -mlflow -odbc -packrat -renv -rmarkdown -rsconnect -sf -shiny -tidymodels -tidyverse diff --git a/workbench-for-microsoft-azure-ml/test/goss.yaml b/workbench-for-microsoft-azure-ml/test/goss.yaml index 3b61f925..fea15bcc 100644 --- a/workbench-for-microsoft-azure-ml/test/goss.yaml +++ b/workbench-for-microsoft-azure-ml/test/goss.yaml @@ -140,8 +140,6 @@ command: exit-status: 0 stdout: {{range $pkg := $pkgs}} - {{ if not (and (eq $pkg "tidymodels") (eq $rver "/opt/R/3.5.3/bin/R")) }} - {{ $pkg }} - {{end}} {{end}} {{end}} From fde39b768631c97325cf10fe6f4d7bf61457ee9b Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Tue, 15 Aug 2023 10:28:13 -0700 Subject: [PATCH 14/17] Add note to update all references when updating cron --- .github/workflows/build-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 13295850..f75d5855 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -1,6 +1,6 @@ on: schedule: - - cron: '0 12 * * 1' + - cron: '0 12 * * 1' # If updating this value, be sure to update logic for all `push-image` arguments! push: branches: - main From 9e7ff971122e07452d686d138839df5e3377880f Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Tue, 15 Aug 2023 10:28:48 -0700 Subject: [PATCH 15/17] Revert "Add note to update all references when updating cron" This reverts commit fde39b768631c97325cf10fe6f4d7bf61457ee9b. --- .github/workflows/build-release.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index f75d5855..13295850 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -1,6 +1,6 @@ on: schedule: - - cron: '0 12 * * 1' # If updating this value, be sure to update logic for all `push-image` arguments! + - cron: '0 12 * * 1' push: branches: - main From 091a5c3a3033a6081bbe127cd580433701d8d867 Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Tue, 15 Aug 2023 13:20:41 -0700 Subject: [PATCH 16/17] Push release pipeline on cron trigger (#622) * Push release pipeline on cron trigger * Add note to update all references when updating cron --- .github/workflows/build-release.yaml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 13295850..5488d9e5 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -1,6 +1,6 @@ on: schedule: - - cron: '0 12 * * 1' + - cron: '0 12 * * 1' # If updating this value, be sure to update logic for all `push-image` arguments! push: branches: - main @@ -74,7 +74,7 @@ jobs: product: product-base image-tags: ${{ steps.get-tags.outputs.IMAGE_TAGS }} build-args: ${{ steps.get-build-args.outputs.BUILD_ARGS }} - push-image: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' }} + push-image: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || github.event.schedule == '0 12 * * 1' }} snyk-token: ${{ secrets.SNYK_TOKEN }} snyk-org-id: ${{ secrets.SNYK_ORG_ID }} ghcr-token: ${{ secrets.BUILD_PAT }} @@ -97,7 +97,7 @@ jobs: product: product-base image-tags: ${{ steps.get-tags.outputs.IMAGE_TAGS }} build-args: ${{ steps.get-build-args.outputs.BUILD_ARGS }} - push-image: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' }} + push-image: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || github.event.schedule == '0 12 * * 1' }} snyk-token: ${{ secrets.SNYK_TOKEN }} snyk-org-id: ${{ secrets.SNYK_ORG_ID }} ghcr-token: ${{ secrets.BUILD_PAT }} @@ -173,7 +173,7 @@ jobs: product: product-base-pro image-tags: ${{ steps.get-tags.outputs.IMAGE_TAGS }} build-args: ${{ steps.get-build-args.outputs.BUILD_ARGS }} - push-image: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' }} + push-image: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || github.event.schedule == '0 12 * * 1' }} snyk-token: ${{ secrets.SNYK_TOKEN }} snyk-org-id: ${{ secrets.SNYK_ORG_ID }} ghcr-token: ${{ secrets.BUILD_PAT }} @@ -196,7 +196,7 @@ jobs: product: product-base-pro image-tags: ${{ steps.get-tags.outputs.IMAGE_TAGS }} build-args: ${{ steps.get-build-args.outputs.BUILD_ARGS }} - push-image: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' }} + push-image: ${{ github.ref == 'refs/heads/main' || github.ref == 'refs/heads/dev' || github.event.schedule == '0 12 * * 1' }} snyk-token: ${{ secrets.SNYK_TOKEN }} snyk-org-id: ${{ secrets.SNYK_ORG_ID }} ghcr-token: ${{ secrets.BUILD_PAT }} @@ -287,7 +287,7 @@ jobs: product: ${{ matrix.config.product }} image-tags: ${{ steps.get-tags.outputs.IMAGE_TAGS }} build-args: ${{ steps.get-build-args.outputs.BUILD_ARGS }} - push-image: ${{ github.ref == 'refs/heads/main' }} + push-image: ${{ github.ref == 'refs/heads/main' || github.event.schedule == '0 12 * * 1' }} snyk-token: ${{ secrets.SNYK_TOKEN }} snyk-org-id: ${{ secrets.SNYK_ORG_ID }} ghcr-token: ${{ secrets.BUILD_PAT }} @@ -310,7 +310,7 @@ jobs: product: ${{ matrix.config.product }} image-tags: ${{ steps.get-tags.outputs.IMAGE_TAGS }} build-args: ${{ steps.get-build-args.outputs.BUILD_ARGS }} - push-image: ${{ github.ref == 'refs/heads/main' }} + push-image: ${{ github.ref == 'refs/heads/main' || github.event.schedule == '0 12 * * 1' }} snyk-token: ${{ secrets.SNYK_TOKEN }} snyk-org-id: ${{ secrets.SNYK_ORG_ID }} ghcr-token: ${{ secrets.BUILD_PAT }} @@ -368,7 +368,7 @@ jobs: product: workbench-for-google-cloud-workstations image-tags: ${{ steps.get-tags.outputs.IMAGE_TAGS }} build-args: ${{ steps.get-build-args.outputs.BUILD_ARGS }} - push-image: ${{ github.ref == 'refs/heads/main' }} + push-image: ${{ github.ref == 'refs/heads/main' || github.event.schedule == '0 12 * * 1' }} snyk-token: ${{ secrets.SNYK_TOKEN }} snyk-org-id: ${{ secrets.SNYK_ORG_ID }} ghcr-token: ${{ secrets.BUILD_PAT }} @@ -392,7 +392,7 @@ jobs: product: workbench-for-google-cloud-workstations image-tags: ${{ steps.get-tags.outputs.IMAGE_TAGS }} build-args: ${{ steps.get-build-args.outputs.BUILD_ARGS }} - push-image: ${{ github.ref == 'refs/heads/main' }} + push-image: ${{ github.ref == 'refs/heads/main' || github.event.schedule == '0 12 * * 1' }} snyk-token: ${{ secrets.SNYK_TOKEN }} snyk-org-id: ${{ secrets.SNYK_ORG_ID }} ghcr-token: ${{ secrets.BUILD_PAT }} From 9bcc0702cddfeb324f89793fc2c72237b45bf585 Mon Sep 17 00:00:00 2001 From: Ian Pittwood Date: Fri, 18 Aug 2023 06:56:17 -0700 Subject: [PATCH 17/17] Use main branch for scheduled release rebuild (#627) --- .github/workflows/build-release.yaml | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) diff --git a/.github/workflows/build-release.yaml b/.github/workflows/build-release.yaml index 5488d9e5..08c23ab9 100644 --- a/.github/workflows/build-release.yaml +++ b/.github/workflows/build-release.yaml @@ -27,7 +27,14 @@ jobs: - {os: 'ubuntu2204', r-primary: "4.2.3", r-alternate: "4.1.3", py-primary: "3.9.17", py-alternate: "3.8.17"} steps: + - name: Check Out Repo - cron main + if: github.event.schedule == '0 12 * * 1' + uses: actions/checkout@v3 + with: + ref: main + - name: Check Out Repo + if: github.event.schedule != '0 12 * * 1' uses: actions/checkout@v3 - name: Set up Just @@ -126,7 +133,14 @@ jobs: cancel-in-progress: true steps: + - name: Check Out Repo - cron main + if: github.event.schedule == '0 12 * * 1' + uses: actions/checkout@v3 + with: + ref: main + - name: Check Out Repo + if: github.event.schedule != '0 12 * * 1' uses: actions/checkout@v3 - name: Set up Just @@ -228,7 +242,14 @@ jobs: cancel-in-progress: true steps: + - name: Check Out Repo - cron main + if: github.event.schedule == '0 12 * * 1' + uses: actions/checkout@v3 + with: + ref: main + - name: Check Out Repo + if: github.event.schedule != '0 12 * * 1' uses: actions/checkout@v3 - name: Set up Just @@ -329,7 +350,14 @@ jobs: cancel-in-progress: true steps: + - name: Check Out Repo - cron main + if: github.event.schedule == '0 12 * * 1' + uses: actions/checkout@v3 + with: + ref: main + - name: Check Out Repo + if: github.event.schedule != '0 12 * * 1' uses: actions/checkout@v3 - name: Set up Just