Skip to content

Commit

Permalink
Merge pull request #783 from rstudio/dev
Browse files Browse the repository at this point in the history
Merge Workbench image fixes
  • Loading branch information
ianpittwood authored May 29, 2024
2 parents ef6e52a + c69133c commit bcac2d5
Show file tree
Hide file tree
Showing 10 changed files with 36 additions and 36 deletions.
3 changes: 2 additions & 1 deletion Justfile
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ preview-plan branch="$(git branch --show-current)":

# just test workbench
test target="default" file="docker-bake.hcl":
python3 {{justfile_directory()}}/tools/test_bake_artifacts.py --target "{{target}}" --file "{{file}}"
GIT_SHA=$(git rev-parse --short HEAD) \
python3 {{justfile_directory()}}/tools/test_bake_artifacts.py --target "{{target}}" --file "{{file}}"

# just preview-test connect dev
preview-test target="default" branch="$(git branch --show-current)":
Expand Down
8 changes: 3 additions & 5 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,6 @@ function get_tags {
variable BASE_BUILD_MATRIX {
default = {
builds = [
{os = "centos7", 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.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"},
{os = "ubuntu2204", r_primary = "4.2.3", r_alternate = "4.1.3", py_primary = "3.12.1", py_alternate = "3.11.7"},
{os = "ubuntu2204", r_primary = "4.4.0", r_alternate = "4.3.3", py_primary = "3.12.1", py_alternate = "3.11.7"},
Expand Down Expand Up @@ -183,15 +181,15 @@ variable WORKBENCH_BUILD_MATRIX {
variable WORKBENCH_GOOGLE_CLOUD_WORKSTATION_BUILD_MATRIX {
default = {
builds = [
{os = "ubuntu2004", r_primary = "4.2.3", r_alternate = "4.1.3", py_primary = "3.11.7", py_alternate = "3.10.13"},
{os = "ubuntu2204", r_primary = "4.4.0", r_alternate = "4.3.3", py_primary = "3.11.9", py_alternate = "3.10.14"},
]
}
}

variable WORKBENCH_MICROSOFT_AZURE_ML_BUILD_MATRIX {
default = {
builds = [
{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"},
]
}
}
Expand Down Expand Up @@ -479,7 +477,7 @@ target "workbench-for-google-cloud-workstations" {
DRIVERS_VERSION = get_drivers_version(builds.os)
RSW_VERSION = WORKBENCH_VERSION
RSW_NAME = "rstudio-workbench"
RSW_DOWNLOAD_URL = "https://download2.rstudio.org/server/focal/amd64"
RSW_DOWNLOAD_URL = "https://download2.rstudio.org/server/jammy/amd64"
}
}

Expand Down
2 changes: 0 additions & 2 deletions docker-bake.preview.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -114,8 +114,6 @@ function get_tags {
variable BASE_BUILD_MATRIX {
default = {
builds = [
{os = "centos7", r_primary = "4.2.3", r_alternate = "4.1.3", py_primary = "3.11.9", py_alternate = "3.10.14"},
{os = "ubuntu2204", r_primary = "4.2.3", r_alternate = "4.1.3", py_primary = "3.11.9", py_alternate = "3.10.14"},
{os = "ubuntu2204", r_primary = "4.4.0", r_alternate = "4.3.3", py_primary = "3.11.9", py_alternate = "3.10.14"},
]
}
Expand Down
1 change: 1 addition & 0 deletions product/base/scripts/ubuntu/install_python.sh
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,7 @@ install_python() {
apt-get install $APT_ARGS "/tmp/python-${PYTHON_VERSION}.deb"
rm "/tmp/python-${PYTHON_VERSION}.deb"
# Upgrade pip and setuptools to latest version
$PYTHON_BIN -m ensurepip --upgrade
$PYTHON_BIN -m pip install -U setuptools
$PYTHON_BIN -m pip install -U pip
}
Expand Down
12 changes: 6 additions & 6 deletions workbench-for-google-cloud-workstations/.env
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
RSW_VERSION=2024.04.1+748.pro2
RSW_TAG_VERSION=2024.04.1-748.pro2
RSW_DOWNLOAD_URL=https://download2.rstudio.org/server/focal/amd64
RSW_DOWNLOAD_URL=https://download2.rstudio.org/server/jammy/amd64
RSW_NAME=rstudio-workbench
PYTHON_VERSION=3.10.13
PYTHON_VERSION_ALT=3.9.18
PYTHON_VERSION_JUPYTER=3.10.13
R_VERSION=4.2.3
R_VERSION_ALT=4.1.3
PYTHON_VERSION=3.11.9
PYTHON_VERSION_ALT=3.10.14
PYTHON_VERSION_JUPYTER=3.10.14
R_VERSION=4.4.0
R_VERSION_ALT=4.3.3
DRIVERS_VERSION=2023.05.0
QUARTO_VERSION=1.3.340
IMAGE_REGISTRY_NAME=us-central1-docker.pkg.dev/posit-images/cloud-workstations/workbench
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
FROM us-central1-docker.pkg.dev/cloud-workstations-images/predefined/base:last-ubuntu2004 as build
FROM us-central1-docker.pkg.dev/cloud-workstations-images/predefined/base:latest as build

### ARG declarations ###
ARG DEBIAN_FRONTEND=noninteractive
ARG R_VERSION=4.2.3
ARG R_VERSION_ALT=4.1.3
ARG PYTHON_VERSION=3.11.7
ARG PYTHON_VERSION_ALT=3.10.13
ARG PYTHON_VERSION_JUPYTER=3.10.13
ARG R_VERSION=4.4.0
ARG R_VERSION_ALT=4.3.3
ARG PYTHON_VERSION=3.11.9
ARG PYTHON_VERSION_ALT=3.10.14
ARG PYTHON_VERSION_JUPYTER=3.10.14
ARG JUPYTERLAB_VERSION=3.6.7
ARG DRIVERS_VERSION=2023.05.0
ARG RSW_VERSION=2024.04.1+748.pro2
ARG RSW_NAME=rstudio-workbench
ARG RSW_DOWNLOAD_URL=https://download2.rstudio.org/server/focal/amd64
ARG RSW_DOWNLOAD_URL=https://download2.rstudio.org/server/jammy/amd64
ARG SCRIPTS_DIR=/opt/positscripts

ENV STARTUP_DEBUG_MODE 0
Expand Down Expand Up @@ -40,8 +40,8 @@ RUN curl https://packages.cloud.google.com/apt/doc/apt-key.gpg | apt-key --keyri
&& 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 \
RUN curl -O https://cdn.rstudio.com/r/ubuntu-2204/pkgs/r-${R_VERSION}_1_amd64.deb \
&& curl -O https://cdn.rstudio.com/r/ubuntu-2204/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 \
Expand All @@ -52,17 +52,19 @@ RUN curl -O https://cdn.rstudio.com/r/ubuntu-2004/pkgs/r-${R_VERSION}_1_amd64.de
&& 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 \
RUN curl -O https://cdn.rstudio.com/python/ubuntu-2204/pkgs/python-${PYTHON_VERSION}_1_amd64.deb \
&& curl -O https://cdn.rstudio.com/python/ubuntu-2204/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 ensurepip --upgrade \
&& /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 ensurepip --upgrade \
&& /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 \
Expand Down Expand Up @@ -95,7 +97,7 @@ RUN apt-get update \
&& 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")'
&& /opt/R/${R_VERSION}/bin/R -e 'install.packages("odbc", repos="https://packagemanager.rstudio.com/cran/__linux__/jammy/latest")'

### Install Workbench ###
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
Expand All @@ -117,7 +119,7 @@ RUN curl -o rstudio-workbench.deb "${RSW_DOWNLOAD_URL}/${RSW_NAME}-${RSW_VERSION
# 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" | \
&& curl -sL "https://s3.amazonaws.com/rstudio-ide-build/monitor/jammy/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 \
Expand Down
2 changes: 1 addition & 1 deletion workbench-for-google-cloud-workstations/conf/launcher-env
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ 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
Environment: PATH=/opt/python/3.10.14/bin:$PATH
4 changes: 2 additions & 2 deletions workbench-for-google-cloud-workstations/conf/repos.conf
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
CRAN=https://packagemanager.posit.co/cran/__linux__/focal/latest
RSPM=https://packagemanager.posit.co/cran/__linux__/focal/latest
CRAN=https://packagemanager.posit.co/cran/__linux__/jammy/latest
RSPM=https://packagemanager.posit.co/cran/__linux__/jammy/latest
7 changes: 2 additions & 5 deletions workbench-for-google-cloud-workstations/test/goss.yaml
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
user:
rstudio-server:
exists: true
uid: 999
gid: 998

group:
rstudio-server:
exists: true
gid: 998

package:
rstudio-server:
Expand Down Expand Up @@ -155,11 +152,11 @@ file:

command:
# Check OS release version (early heads up in case the base image is modified)
Check OS version is "focal":
Check OS version is "jammy":
exec: "lsb_release -cs"
exit-status: 0
stdout: [
"focal"
"jammy"
]
Test Workbench Monitor rstudio-server.log creation:
exec: su rstudio-server -c 'touch /var/lib/rstudio-server/monitor/log/rstudio-server.log'
Expand Down
5 changes: 4 additions & 1 deletion workbench/startup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,10 @@ else
if [ -z "$RSW_TESTUSER" ]; then
echo "Empty 'RSW_TESTUSER' variables, not creating test user";
else
useradd -m -s /bin/bash -N -u $RSW_TESTUSER_UID $RSW_TESTUSER
if [ -z "$RSW_TESTUSER_UID" ]; then
RSW_TESTUSER_UID=10000
fi
useradd -m -s /bin/bash -u $RSW_TESTUSER_UID -U $RSW_TESTUSER
echo "$RSW_TESTUSER:$RSW_TESTUSER_PASSWD" | sudo chpasswd
fi
fi
Expand Down

0 comments on commit bcac2d5

Please sign in to comment.