diff --git a/connect/.env b/connect/.env index 4b537f067..f64f4543c 100644 --- a/connect/.env +++ b/connect/.env @@ -1 +1,3 @@ RSC_VERSION=1.8.8.2 +R_VERSION=3.6.2 +PYTHON_VERSION=3.6.5 diff --git a/connect/docker-compose.test.yml b/connect/docker-compose.test.yml index 40f1cb705..9c8204bfc 100644 --- a/connect/docker-compose.test.yml +++ b/connect/docker-compose.test.yml @@ -9,6 +9,8 @@ services: environment: # uses .env by default - RSC_VERSION + - R_VERSION + - PYTHON_VERSION volumes: - "./test/run_tests.sh:/run_tests.sh" - "./test/goss.yaml:/tmp/goss.yaml" diff --git a/connect/test/goss.yaml b/connect/test/goss.yaml index 674871c76..c0eb7642a 100644 --- a/connect/test/goss.yaml +++ b/connect/test/goss.yaml @@ -15,35 +15,54 @@ package: file: /etc/rstudio-connect/license.lic: - # currently does not exist - # be sure it is NOT a directory + # Currently does not exist + # Be sure it is NOT a directory exists: false /opt/rstudio-connect/: exists: true /opt/rstudio-connect/bin/connect: exists: true + /usr/local/bin/tini: + exists: true +# Ensure startup file exists + /usr/local/bin/startup.sh: + exists: true + owner: root + group: root + filetype: file +# Ensure log files exist + /var/log/rstudio-connect.log: + exists: true + /opt/python/{{.Env.PYTHON_VERSION}}/bin/python: + exists: true -# check product version +# Check product version command: "/opt/rstudio-connect/bin/connect --version": - title: connect_version_matches - exit-status: 0 - stdout: [ + title: connect_version_matches + exit-status: 0 + stdout: [ "/{{ .Env.RSC_VERSION }}/" - ] - # goss times out after 10 seconds + ] + +# Goss times out after 10 seconds "timeout --signal=SIGINT 7 /opt/rstudio-connect/bin/connect --config /etc/rstudio-connect/rstudio-connect.gcfg": title: connect_starts - # the timeout should stop connect, not a failure + # The timeout should stop connect, not a failure exit-status: 124 - # maybe optimistic that Connect finishes starting... - #stderr: [ - # "Starting HTTP listener on :3939" - #] - "/opt/R/3.6.2/bin/R --version": + +# Ensure correct R version + "/opt/R/{{ .Env.R_VERSION }}/bin/R --version": title: r_version_match exit-status: 0 stdout: [ - "/3.6.2/" + "/{{ .Env.R_VERSION }}/" ] +# Ensure correct python version + "/opt/python/{{ .Env.PYTHON_VERSION }}/bin/python --version": + title: python_version_matches + exit-status: 0 + stderr: [ + "/{{ .Env.PYTHON_VERSION }}/" + ] diff --git a/package-manager/.env b/package-manager/.env index bff087a5f..7d61bf69d 100644 --- a/package-manager/.env +++ b/package-manager/.env @@ -1 +1,2 @@ RSPM_VERSION=1.2.2.1-17 +R_VERSION=3.6.2 diff --git a/package-manager/docker-compose.test.yml b/package-manager/docker-compose.test.yml index 6b3c5f11b..22970f357 100644 --- a/package-manager/docker-compose.test.yml +++ b/package-manager/docker-compose.test.yml @@ -8,6 +8,7 @@ services: environment: # uses .env by default - RSPM_VERSION + - R_VERSION volumes: - "./test/run_tests.sh:/run_tests.sh" - "./test/goss.yaml:/tmp/goss.yaml" diff --git a/package-manager/test/goss.yaml b/package-manager/test/goss.yaml index 7a1719132..392ad2eec 100644 --- a/package-manager/test/goss.yaml +++ b/package-manager/test/goss.yaml @@ -15,8 +15,8 @@ package: file: /etc/rstudio-pm/license.lic: - # currently does not exist - # be sure it is NOT a directory +# Currently does not exist +# Be sure it is NOT a directory exists: false /opt/rstudio-pm/: exists: true @@ -26,8 +26,14 @@ file: exists: true /usr/local/bin/rspm: exists: true + /usr/local/bin/tini: + exists: true + /var/log/rstudio-pm.log: + exists: true + filetype: file -# check product version + +# Check product version command: "/opt/rstudio-pm/bin/rstudio-pm --version": title: package-manager_version_matches @@ -35,3 +41,15 @@ command: stdout: [ "/{{ .Env.RSPM_VERSION }}/" ] +# Ensure package manager is running + "/opt/rstudio-pm/bin/rstudio-pm --config /etc/rstudio-pm/rstudio-pm.gcfg": + title: rspm_start + exit-status: 0 + +# Ensure correct R version + "/opt/R/{{ .Env.R_VERSION }}/bin/R --version": + title: r_version_match + exit-status: 0 + stdout: [ + "/{{ .Env.R_VERSION }}/" + ] diff --git a/r-session-complete/bionic/.env b/r-session-complete/bionic/.env new file mode 100644 index 000000000..87f5e5796 --- /dev/null +++ b/r-session-complete/bionic/.env @@ -0,0 +1,4 @@ +R_VERSION=4.0.2 +PYTHON_VERSION=3.7.7 +DRIVERS_VERSION=1.7.0 +RSP_VERSION=1.4.1717-3 diff --git a/r-session-complete/bionic/docker-compose.test.yml b/r-session-complete/bionic/docker-compose.test.yml index d7df72404..8cf1a18d4 100644 --- a/r-session-complete/bionic/docker-compose.test.yml +++ b/r-session-complete/bionic/docker-compose.test.yml @@ -8,6 +8,9 @@ services: environment: # uses .env by default - RSP_VERSION + - R_VERSION + - PYTHON_VERSION volumes: - "./test/run_tests.sh:/run_tests.sh" - "./test/goss.yaml:/tmp/goss.yaml" + - "./test/goss_vars.yaml:/tmp/goss_vars.yaml" diff --git a/r-session-complete/bionic/test/goss.yaml b/r-session-complete/bionic/test/goss.yaml index 3481757f8..ce2b45279 100644 --- a/r-session-complete/bionic/test/goss.yaml +++ b/r-session-complete/bionic/test/goss.yaml @@ -3,8 +3,39 @@ file: exists: true /usr/lib/rstudio-server/bin/rsession: exists: true + /opt/code-server/: + exists: true + filetype: directory + /opt/rstudio-drivers: + exists: true + filetype: directory command: "echo '{ \"cells\": [], \"metadata\": {}, \"nbformat\": 4, \"nbformat_minor\": 2}' | /opt/python/3.7.7/bin/jupyter nbconvert --to notebook --stdin --stdout": title: jupyter_works exit-status: 0 + +# Ensure all R Packages are installed + {{ $pkgs := .Vars.RPackages }} + /opt/R/{{ .Env.R_VERSION }}/bin/R --slave -e 'library()' | cut -f 1 -d ' ' | grep -v '^Packages$' | grep -v '^$': + exit-status: 0 + stdout: + {{ range $pkg := $pkgs }} + - {{ $pkg }} + {{end}} + +# Ensure correct R version + "/opt/R/{{.Env.R_VERSION}}/bin/R --version": + title: r_version_match + exit-status: 0 + stdout: [ + "/{{.Env.R_VERSION}}/" + ] + +# Ensure correct python version + "/opt/python/{{.Env.PYTHON_VERSION}}/bin/python --version": + title: python_version_matches + exit-status: 0 + stdout: [ + "/{{ .Env.PYTHON_VERSION }}/" + ] diff --git a/r-session-complete/bionic/test/goss_vars.yaml b/r-session-complete/bionic/test/goss_vars.yaml new file mode 100644 index 000000000..9618c6a53 --- /dev/null +++ b/r-session-complete/bionic/test/goss_vars.yaml @@ -0,0 +1,7 @@ +RPackages: + - "odbc" + - "devtools" + - "shiny" + - "rmarkdown" + - "plumber" + diff --git a/r-session-complete/centos7/.env b/r-session-complete/centos7/.env new file mode 100644 index 000000000..87f5e5796 --- /dev/null +++ b/r-session-complete/centos7/.env @@ -0,0 +1,4 @@ +R_VERSION=4.0.2 +PYTHON_VERSION=3.7.7 +DRIVERS_VERSION=1.7.0 +RSP_VERSION=1.4.1717-3 diff --git a/r-session-complete/centos7/docker-compose.test.yml b/r-session-complete/centos7/docker-compose.test.yml index d7df72404..8cf1a18d4 100644 --- a/r-session-complete/centos7/docker-compose.test.yml +++ b/r-session-complete/centos7/docker-compose.test.yml @@ -8,6 +8,9 @@ services: environment: # uses .env by default - RSP_VERSION + - R_VERSION + - PYTHON_VERSION volumes: - "./test/run_tests.sh:/run_tests.sh" - "./test/goss.yaml:/tmp/goss.yaml" + - "./test/goss_vars.yaml:/tmp/goss_vars.yaml" diff --git a/r-session-complete/centos7/test/goss.yaml b/r-session-complete/centos7/test/goss.yaml index 3481757f8..ce2b45279 100644 --- a/r-session-complete/centos7/test/goss.yaml +++ b/r-session-complete/centos7/test/goss.yaml @@ -3,8 +3,39 @@ file: exists: true /usr/lib/rstudio-server/bin/rsession: exists: true + /opt/code-server/: + exists: true + filetype: directory + /opt/rstudio-drivers: + exists: true + filetype: directory command: "echo '{ \"cells\": [], \"metadata\": {}, \"nbformat\": 4, \"nbformat_minor\": 2}' | /opt/python/3.7.7/bin/jupyter nbconvert --to notebook --stdin --stdout": title: jupyter_works exit-status: 0 + +# Ensure all R Packages are installed + {{ $pkgs := .Vars.RPackages }} + /opt/R/{{ .Env.R_VERSION }}/bin/R --slave -e 'library()' | cut -f 1 -d ' ' | grep -v '^Packages$' | grep -v '^$': + exit-status: 0 + stdout: + {{ range $pkg := $pkgs }} + - {{ $pkg }} + {{end}} + +# Ensure correct R version + "/opt/R/{{.Env.R_VERSION}}/bin/R --version": + title: r_version_match + exit-status: 0 + stdout: [ + "/{{.Env.R_VERSION}}/" + ] + +# Ensure correct python version + "/opt/python/{{.Env.PYTHON_VERSION}}/bin/python --version": + title: python_version_matches + exit-status: 0 + stdout: [ + "/{{ .Env.PYTHON_VERSION }}/" + ] diff --git a/r-session-complete/centos7/test/goss_vars.yaml b/r-session-complete/centos7/test/goss_vars.yaml new file mode 100644 index 000000000..4c0fff8a4 --- /dev/null +++ b/r-session-complete/centos7/test/goss_vars.yaml @@ -0,0 +1,6 @@ +RPackages: + - "odbc" + - "devtools" + - "shiny" + - "rmarkdown" + - "plumber" diff --git a/server-pro/.env b/server-pro/.env index 954617921..04ac9ce61 100644 --- a/server-pro/.env +++ b/server-pro/.env @@ -1,3 +1,8 @@ RSP_VERSION=1.4.1717-3 RSP_DOWNLOAD_URL=https://download2.rstudio.org/server/bionic/amd64 RSP_NAME=rstudio-workbench +PYTHON_VERSION=3.9.5 +PYTHON_VERSION_ALT=3.8.10 +JUPYTER_PYTHON_VERSION=3.8.10 +R_VERSION_ALT=4.1.0 +R_VERSION=3.6.2 diff --git a/server-pro/Dockerfile b/server-pro/Dockerfile index 358617b70..3aa2cbcfa 100644 --- a/server-pro/Dockerfile +++ b/server-pro/Dockerfile @@ -81,16 +81,16 @@ RUN curl -O https://repo.anaconda.com/miniconda/Miniconda3-4.7.12.1-Linux-x86_64 # Install another Python --------------------------------------------------------------# -ARG ALT_PYTHON_VERSION=3.8.10 +ARG PYTHON_VERSION_ALT=3.8.10 RUN curl -O https://repo.anaconda.com/miniconda/Miniconda3-4.7.12.1-Linux-x86_64.sh && \ - bash Miniconda3-4.7.12.1-Linux-x86_64.sh -bp /opt/python/${ALT_PYTHON_VERSION} && \ - /opt/python/${ALT_PYTHON_VERSION}/bin/conda install -y python==${ALT_PYTHON_VERSION} && \ - /opt/python/${ALT_PYTHON_VERSION}/bin/pip install \ + bash Miniconda3-4.7.12.1-Linux-x86_64.sh -bp /opt/python/${PYTHON_VERSION_ALT} && \ + /opt/python/${PYTHON_VERSION_ALT}/bin/conda install -y python==${PYTHON_VERSION_ALT} && \ + /opt/python/${PYTHON_VERSION_ALT}/bin/pip install \ ipykernel \ virtualenv \ && \ rm -rf Miniconda3-*-Linux-x86_64.sh && \ - /opt/python/${ALT_PYTHON_VERSION}/bin/python -m ipykernel install --name py${ALT_PYTHON_VERSION} --display-name "Python ${ALT_PYTHON_VERSION}" + /opt/python/${PYTHON_VERSION_ALT}/bin/python -m ipykernel install --name py${PYTHON_VERSION_ALT} --display-name "Python ${PYTHON_VERSION_ALT}" # Runtime settings ------------------------------------------------------------# ARG TINI_VERSION=0.18.0 diff --git a/server-pro/docker-compose.test.yml b/server-pro/docker-compose.test.yml index d7df72404..772b6b735 100644 --- a/server-pro/docker-compose.test.yml +++ b/server-pro/docker-compose.test.yml @@ -8,6 +8,11 @@ services: environment: # uses .env by default - RSP_VERSION + - R_VERSION + - PYTHON_VERSION + - PYTHON_VERSION_ALT + - JUPYTER_PYTHON_VERSION + - R_VERSION_ALT volumes: - "./test/run_tests.sh:/run_tests.sh" - "./test/goss.yaml:/tmp/goss.yaml" diff --git a/server-pro/test/goss.yaml b/server-pro/test/goss.yaml index 92ef3a5b4..35b444faf 100644 --- a/server-pro/test/goss.yaml +++ b/server-pro/test/goss.yaml @@ -20,16 +20,13 @@ file: exists: false /usr/lib/rstudio-server: exists: true - /opt/R/3.6.3/bin/R: + /opt/R/{{.Env.R_VERSION_ALT}}/bin/R: exists: true filetype: file - /opt/R/4.1.0/bin/R: - exists: true - filetype: file - /opt/python/3.9.5/bin/python: + /opt/python/{{.Env.PYTHON_VERSION}}/bin/python: exists: true filetype: symlink - /opt/python/3.8.10/bin/python: + /opt/python/{{.Env.PYTHON_VERSION_ALT}}/bin/python: exists: true filetype: symlink /opt/python/jupyter/bin/python: @@ -50,6 +47,7 @@ file: owner: rstudio-server group: rstudio-server + command: "su rstudio-server -c 'touch /var/lib/rstudio-server/monitor/log/rstudio-server.log'": title: server-pro_monitor_log_file_creates @@ -57,34 +55,36 @@ command: "touch /var/log/rstudio-server.log": title: server-pro_server_log_creates exit-status: 0 - # check product version - #"rstudio-server version": - # title: server-pro_version_matches - # exit-status: 0 - # stdout: [ - # "/{{ .Env.RSP_VERSION }}/", - # "/Pro/" # this will switch to Workbench when we release the preview build - # ] +# Check product version + "rstudio-server version": + title: server-pro_version_matches + exit-status: 0 + stdout: [ + "/{{ .Env.RSP_VERSION }}/", + "/Workbench/" + ] "echo '{ \"cells\": [], \"metadata\": {}, \"nbformat\": 4, \"nbformat_minor\": 2}' | /opt/python/jupyter/bin/jupyter nbconvert --to notebook --stdin --stdout": title: jupyter_works exit-status: 0 +# Ensure correct python version "/opt/python/3.8.10/bin/python --version": - title: python_version_matches + title: alternate_python_version_matches exit-status: 0 stdout: [ - "/3.8.10/" + "/{{.Env.PYTHON_VERSION_ALT}}/" ] +# Ensure correct python version "/opt/python/3.9.5/bin/python --version": title: python_version_matches exit-status: 0 stdout: [ - "/3.9.5/" + "/{{.Env.PYTHON_VERSION}}/" ] "/opt/python/jupyter/bin/python --version": title: jupyter_python_version_matches exit-status: 0 stdout: [ - "/3.8.10/" + "/{{.Env.JUPYTER_PYTHON_VERSION}}/" ] "which openssl": title: uses_system_openssl