Skip to content

Commit

Permalink
Move Quarto installation/configuration to downstream images (#727)
Browse files Browse the repository at this point in the history
* Fix/exclude goss tests for buildx bake

* Implement separate test for Connect

* Implement bake preview builds

* Provision buildx in preview

* Do not cache or output tests for preview

Provide a buildx config for GHA

Unify test sleep behavior of Workbench images

* Remove test targets

* Remove test layers from Dockerfiles

* Change test running to be orchestrated by a Python script

* Update preview builds for new test script

* Create common use scripts in base image for Ubuntu 22.04 images

* Create common use scripts in base image for CentOS 7 images

* Move deps to subdirectory

Fix hadolint issues

* Ignore hadolint issue

* Remove build.justfile

* Remove unnecessary buildx setup from build-bake-preview.yaml

* Move Quarto installation downstream

Upgrade Connect and WGCW to 1.4.552

Pin remaining products back to 1.3.340 or lower

* Add SCRIPTS_DIR to downstream Dockerfiles

* Leave original Quarto install for WGCW

* Fix hardcoded QUARTO_VERSION in rstudio-connect.gcfg

* Remove unnecessary Quarto tests from base-pro tests

* Symlink bundled Quarto for Workbench installations

* Fix quarto config replacement in Connect

* Remove QUARTO_VERSION arg from base in bake definition

* Add quarto check command to Connect goss tests

* Remove Quarto build arg from Workbench and r-session-complete

* Update preview Connect build matrix with Quarto version

* Remove Quarto install from CentOS 7 r-session-complete

* Remove package check for Quarto in WGCW

* Use DEFAULT_QUARTO_VERSION for Connect matrix

* Use DEFAULT_QUARTO_VERSION for Connect matrix

* Revert Quarto to 1.3.340 for Connect
  • Loading branch information
ianpittwood authored Apr 19, 2024
1 parent 5fed7b9 commit 4bef135
Show file tree
Hide file tree
Showing 20 changed files with 108 additions and 138 deletions.
13 changes: 12 additions & 1 deletion connect/Dockerfile.ubuntu2204
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,14 @@ ARG R_VERSION_ALT=4.1.3
ARG PYTHON_VERSION=3.9.17
ARG PYTHON_VERSION_ALT=3.8.17
ARG RSC_VERSION=2024.03.0
ARG QUARTO_VERSION=1.3.340
ARG SCRIPTS_DIR=/opt/positscripts

### Install Quarto ###
RUN QUARTO_VERSION=${QUARTO_VERSION} ${SCRIPTS_DIR}/install_quarto.sh \
&& ln -s /opt/quarto/${QUARTO_VERSION}/bin/quarto /usr/local/bin/quarto

### Install Connect and additional dependencies ###
SHELL [ "/bin/bash", "-o", "pipefail", "-c"]
RUN apt-get update --fix-missing \
&& apt-get install -yq --no-install-recommends \
Expand All @@ -27,13 +35,16 @@ RUN apt-get update --fix-missing \
&& apt-get clean \
&& rm -rf /var/lib/apt/lists/*


### Configure Connect ###
EXPOSE 3939/tcp
ENV RSC_LICENSE ""
ENV RSC_LICENSE_SERVER ""
ENV STARTUP_DEBUG_MODE 0
COPY rstudio-connect.gcfg /etc/rstudio-connect/rstudio-connect.gcfg
RUN sed -i "s/{{PYTHON_VERSION}}/${PYTHON_VERSION}/g" /etc/rstudio-connect/rstudio-connect.gcfg \
&& sed -i "s/{{PYTHON_VERSION_ALT}}/${PYTHON_VERSION_ALT}/g" /etc/rstudio-connect/rstudio-connect.gcfg
&& sed -i "s/{{PYTHON_VERSION_ALT}}/${PYTHON_VERSION_ALT}/g" /etc/rstudio-connect/rstudio-connect.gcfg \
&& sed -i "s/{{QUARTO_VERSION}}/${QUARTO_VERSION}/g" /etc/rstudio-connect/rstudio-connect.gcfg
VOLUME ["/data"]

ENTRYPOINT ["tini", "--"]
Expand Down
7 changes: 6 additions & 1 deletion connect/rstudio-connect-float.gcfg
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,12 @@ Provider = password

[Python]
Enabled = true
Executable = /opt/python/3.6.5/bin/python
Executable = /opt/python/{{PYTHON_VERSION}}/bin/python
Executable = /opt/python/{{PYTHON_VERSION_ALT}}/bin/python

[Quarto]
Enabled = true
Executable = /opt/quarto/{{QUARTO_VERSION}}/bin/quarto

;[RPackageRepository "CRAN"]
;URL = https://demo.rstudiopm.com/all/__linux__/jammy/latest
Expand Down
2 changes: 1 addition & 1 deletion connect/rstudio-connect.gcfg
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ Executable = /opt/python/{{PYTHON_VERSION_ALT}}/bin/python

[Quarto]
Enabled = true
Executable = /opt/quarto/1.3.340/bin/quarto
Executable = /opt/quarto/{{QUARTO_VERSION}}/bin/quarto

[RPackageRepository "CRAN"]
URL = https://packagemanager.rstudio.com/cran/__linux__/jammy/latest
Expand Down
27 changes: 27 additions & 0 deletions connect/test/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,11 @@ file:
exists: true
/opt/python/{{.Env.PYTHON_VERSION_ALT}}/bin/python:
exists: true
/opt/quarto/{{.Env.QUARTO_VERSION}}/bin/quarto:
exists: true
/usr/local/bin/quarto:
exists: true
filetype: symlink
/tmp/startup.log:
exists: true
contents:
Expand Down Expand Up @@ -87,3 +92,25 @@ command:
stdout: [
"{{ .Env.PYTHON_VERSION_ALT }}"
]

# Ensure correct Quarto version
"/opt/quarto/{{ .Env.QUARTO_VERSION }}/bin/quarto --version":
title: quarto_version_matches
exit-status: 0
stdout: [
"{{ .Env.QUARTO_VERSION }}"
]
"/usr/local/bin/quarto --version":
title: quarto_symlink_version_matches
exit-status: 0
stdout: [
"{{ .Env.QUARTO_VERSION }}"
]

# Ensure Quarto works
"/opt/quarto/{{ .Env.QUARTO_VERSION }}/bin/quarto check --quiet":
title: quarto_check
exit-status: 0
"/usr/local/bin/quarto check --quiet":
title: quarto_check
exit-status: 0
82 changes: 0 additions & 82 deletions content/docker-bake.hcl

This file was deleted.

12 changes: 5 additions & 7 deletions docker-bake.hcl
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
### Variable definitions ###
variable CONNECT_VERSION {
default = "2024.02.0"
default = "2024.03.0"
}

variable PACKAGE_MANAGER_VERSION {
Expand All @@ -16,7 +16,7 @@ variable DRIVERS_VERSION {
}

variable DEFAULT_QUARTO_VERSION {
default = "1.4.553"
default = "1.4.552"
}

variable DEFAULT_JUPYTERLAB_VERSION {
Expand Down Expand Up @@ -101,7 +101,7 @@ variable PACKAGE_MANAGER_BUILD_MATRIX {
variable CONNECT_BUILD_MATRIX {
default = {
builds = [
{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.9.17", py_alternate = "3.8.17", quarto = "1.3.340"},
]
}
}
Expand Down Expand Up @@ -240,7 +240,6 @@ target "product-base" {
PYTHON_VERSION = builds.py_primary
PYTHON_VERSION_ALT = builds.py_alternate
TINI_VERSION = "0.19.0"
QUARTO_VERSION = "1.3.340"
}
}

Expand Down Expand Up @@ -268,8 +267,7 @@ target "product-base-pro" {
PYTHON_VERSION_ALT = builds.py_alternate
DRIVERS_VERSION = get_drivers_version(builds.os)
TINI_VERSION = "0.19.0"
QUARTO_VERSION = "1.3.340"
}
}
}

### Package Manager targets ###
Expand Down Expand Up @@ -317,6 +315,7 @@ target "connect" {
PYTHON_VERSION = builds.py_primary
PYTHON_VERSION_ALT = builds.py_alternate
RSC_VERSION = CONNECT_VERSION
QUARTO_VERSION = builds.quarto
}
}

Expand Down Expand Up @@ -472,7 +471,6 @@ target "workbench-for-google-cloud-workstations" {
}

### Workbench for Microsoft Azure ML targets ###

target "build-workbench-for-microsoft-azure-ml" {
inherits = ["base"]
target = "build"
Expand Down
5 changes: 3 additions & 2 deletions docker-bake.preview.hcl
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ variable DRIVERS_VERSION {
}

variable DEFAULT_QUARTO_VERSION {
default = "1.4.553"
default = "1.4.552"
}

variable DEFAULT_JUPYTERLAB_VERSION {
Expand Down Expand Up @@ -126,7 +126,7 @@ variable PACKAGE_MANAGER_BUILD_MATRIX {
variable CONNECT_BUILD_MATRIX {
default = {
builds = [
{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.2.3", r_alternate = "4.1.3", py_primary = "3.11.9", py_alternate = "3.10.14", quarto = "1.3.340"},
]
}
}
Expand Down Expand Up @@ -297,6 +297,7 @@ target "connect-daily" {
PYTHON_VERSION = builds.py_primary
PYTHON_VERSION_ALT = builds.py_alternate
RSC_VERSION = CONNECT_DAILY_VERSION
QUARTO_VERSION = builds.quarto
}
}

Expand Down
5 changes: 0 additions & 5 deletions product/base/Dockerfile.centos7
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ ARG PYTHON_VERSION=3.9.14
ARG PYTHON_VERSION_ALT=3.8.15
ARG TINI_VERSION=0.19.0
ARG QUARTO_VERSION=1.3.340

ARG SCRIPTS_DIR=/opt/positscripts

COPY --chmod=0755 scripts/rhel/* ${SCRIPTS_DIR}/
Expand Down Expand Up @@ -36,10 +35,6 @@ RUN curl -sL "https://yihui.org/tinytex/install-bin-unix.sh" | sh \
&& /opt/TinyTeX/bin/*/tlmgr option sys_bin /usr/local/bin \
&& /opt/TinyTeX/bin/*/tlmgr path add

### Install Quarto ###
RUN QUARTO_VERSION=${QUARTO_VERSION} ${SCRIPTS_DIR}/install_quarto.sh \
&& ln -s /opt/quarto/${QUARTO_VERSION}/bin/quarto /usr/local/bin/quarto

### Install R versions ###
RUN R_VERSION=${R_VERSION} ${SCRIPTS_DIR}/install_r.sh \
&& R_VERSION=${R_VERSION_ALT} ${SCRIPTS_DIR}/install_r.sh \
Expand Down
4 changes: 0 additions & 4 deletions product/base/Dockerfile.ubuntu2204
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,6 @@ RUN curl -sL "https://yihui.org/tinytex/install-bin-unix.sh" | sh \
&& /opt/TinyTeX/bin/*/tlmgr option sys_bin /usr/local/bin \
&& /opt/TinyTeX/bin/*/tlmgr path add

### Install Quarto ###
RUN QUARTO_VERSION=${QUARTO_VERSION} ${SCRIPTS_DIR}/install_quarto.sh \
&& ln -s /opt/quarto/${QUARTO_VERSION}/bin/quarto /usr/local/bin/quarto

### Install R versions ###
RUN R_VERSION=${R_VERSION} ${SCRIPTS_DIR}/install_r.sh \
&& R_VERSION=${R_VERSION_ALT} ${SCRIPTS_DIR}/install_r.sh \
Expand Down
10 changes: 0 additions & 10 deletions product/base/test/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -47,8 +47,6 @@ file:
exists: true
/tini:
exists: true
/opt/quarto/{{.Env.QUARTO_VERSION}}/bin/quarto:
exists: true
{{if .Env.OS | regexMatch "ubuntu.*"}}
# Check that `cracklib-runtime` is present so `chpasswd` works
/var/cache/cracklib/cracklib_dict.pwd:
Expand Down Expand Up @@ -83,11 +81,3 @@ command:
stdout: [
"{{ .Env.PYTHON_VERSION_ALT }}"
]

# Ensure correct Quarto version
"/opt/quarto/{{ .Env.QUARTO_VERSION }}/bin/quarto --version":
title: quarto_version_matches
exit-status: 0
stdout: [
"{{ .Env.QUARTO_VERSION }}"
]
10 changes: 0 additions & 10 deletions product/pro/test/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,6 @@ file:
exists: true
/tini:
exists: true
/opt/quarto/{{.Env.QUARTO_VERSION}}/bin/quarto:
exists: true


command:
Expand Down Expand Up @@ -72,11 +70,3 @@ command:
stdout: [
"{{ .Env.PYTHON_VERSION_ALT }}"
]

# Ensure correct Quarto version
"/opt/quarto/{{ .Env.QUARTO_VERSION }}/bin/quarto --version":
title: quarto_version_matches
exit-status: 0
stdout: [
"{{ .Env.QUARTO_VERSION }}"
]
4 changes: 4 additions & 0 deletions r-session-complete/Dockerfile.centos7
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ ARG JUPYTERLAB_VERSION=3.6.7
ARG RSW_VERSION=2023.12.1+402.pro1
ARG RSW_NAME=rstudio-workbench-rhel
ARG RSW_DOWNLOAD_URL=https://s3.amazonaws.com/rstudio-ide-build/server/centos7/x86_64
ARG SCRIPTS_DIR=/opt/positscripts

SHELL ["/bin/bash", "-o", "pipefail", "-c"]
RUN yum install -y subversion \
Expand All @@ -27,6 +28,9 @@ RUN yum install -y subversion \
&& yum clean all \
&& rm -rf /var/lib/rstudio-server/r-versions

### Install Quarto to PATH ###
RUN ln -s /lib/rstudio-server/bin/quarto/bin/quarto /usr/local/bin/quarto

COPY maybe_install_vs_code.sh /tmp/maybe_install_vs_code.sh
RUN /tmp/maybe_install_vs_code.sh \
&& rm /tmp/maybe_install_vs_code.sh
Expand Down
4 changes: 4 additions & 0 deletions r-session-complete/Dockerfile.ubuntu2204
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ ARG JUPYTERLAB_VERSION=3.6.5
ARG RSW_VERSION=2023.12.1+402.pro1
ARG RSW_NAME=rstudio-workbench
ARG RSW_DOWNLOAD_URL=https://download2.rstudio.org/server/jammy/amd64
ARG SCRIPTS_DIR=/opt/positscripts

ENV WORKBENCH_JUPYTER_PATH=/usr/local/bin/jupyter

Expand Down Expand Up @@ -36,6 +37,9 @@ RUN apt-get update \
&& rm -rf /var/lib/apt/lists/* \
&& rm -rf /var/lib/rstudio-server/r-versions

### Install Quarto to PATH ###
RUN ln -s /lib/rstudio-server/bin/quarto/bin/quarto /usr/local/bin/quarto

COPY maybe_install_vs_code.sh /tmp/maybe_install_vs_code.sh
RUN /tmp/maybe_install_vs_code.sh \
&& rm /tmp/maybe_install_vs_code.sh
Expand Down
12 changes: 10 additions & 2 deletions r-session-complete/test/goss.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,13 @@ file:
exists: true
{{ end }}
/opt/rstudio-drivers:
exists: true
filetype: directory
exists: true
filetype: directory
/var/lib/rstudio-server/r-versions:
exists: false
/usr/local/bin/quarto:
exists: true
filetype: symlink

command:
"echo '{ \"cells\": [], \"metadata\": {}, \"nbformat\": 4, \"nbformat_minor\": 2}' | /opt/python/{{.Env.PYTHON_VERSION}}/bin/jupyter nbconvert --to notebook --stdin --stdout":
Expand Down Expand Up @@ -52,3 +55,8 @@ command:
title: jupyter_in_path_var
timeout: 60000
exit-status: 0

# Ensure Quarto works
"/usr/local/bin/quarto check --quiet":
title: quarto_check
exit-status: 0
Loading

0 comments on commit 4bef135

Please sign in to comment.