diff --git a/.github/workflows/build-manual.yaml b/.github/workflows/build-manual.yaml index 3f3af6ac..7e0fd5da 100644 --- a/.github/workflows/build-manual.yaml +++ b/.github/workflows/build-manual.yaml @@ -16,7 +16,6 @@ on: options: - connect - connect-content-init - - content-images - package-manager - r-session-complete - workbench @@ -48,12 +47,9 @@ jobs: name: Setup runs-on: ubuntu-latest - concurrency: - group: bake-setup-${{ github.ref }} - cancel-in-progress: true - outputs: - GIT_SHA: ${{ steps.checkout.outputs.sha }} + GIT_SHA: ${{ steps.get-git-sha.outputs.GIT_SHA }} + BAKE_FILE: ${{ steps.bake-file.outputs.BAKE_FILE }} steps: - name: Checkout @@ -63,9 +59,22 @@ jobs: id: get-git-sha run: | GIT_SHA=$(git rev-parse --short HEAD) + echo "Setting GIT_SHA=$GIT_SHA" echo "GIT_SHA=$GIT_SHA" >> $GITHUB_OUTPUT + - name: Set BAKE_FILE + id: bake-file + run: | + if [[ "${{ inputs.type }}" == "release" ]]; then + BAKE_FILE="docker-bake.hcl" + else + BAKE_FILE="docker-bake.preview.hcl" + fi + echo "Using $BAKE_FILE" + echo "BAKE_FILE=$BAKE_FILE" >> $GITHUB_OUTPUT + build: + needs: [setup] runs-on: ubuntu-latest-4x name: manual-build @@ -95,15 +104,48 @@ jobs: run: | pip install requests + - name: Get Target + id: get-target + shell: bash + run: | + # Append suffix if necessary + target="${{ inputs.product }}" + if [[ "${{ inputs.type }}" != "release" ]]; then + target="${{ inputs.product }}-${{ inputs.type }}" + fi + echo "Setting TARGET=$target" + echo "TARGET=$target" >> $GITHUB_OUTPUT + - name: Get Version id: get-version + shell: bash run: | + # Determine how to set the version if [[ "${{ inputs.version }}" == "auto" ]]; then VERSION=`just -f ci.Justfile get-version ${{ inputs.product }} --type=${{ inputs.type }} --local` else VERSION="${{ inputs.version }}" fi - echo "VERSION=$VERSION" >> $GITHUB_OUTPUT + + # Set the appropriate env var + suffix="_VERSION" + if [[ "${{ inputs.type }}" == "preview" ]]; then + suffix="_PREVIEW_VERSION" + elif [[ "${{ inputs.type }}" == "daily" ]]; then + suffix="_DAILY_VERSION" + fi + + product="${{ inputs.product }}" + if [[ "$product" == "connect" ]] || [[ "$product" == "connect-content-init" ]] || [[ "$product" == "content-images" ]]; then + product="CONNECT" + elif [[ "$product" == "package-manager" ]]; then + product="PACKAGE_MANAGER" + else + product="WORKBENCH" + fi + + echo "Setting $product$suffix=$VERSION" + echo "$product$suffix=$VERSION" >> $GITHUB_ENV - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 @@ -114,10 +156,10 @@ jobs: - name: Build/Test/Push manual build image uses: ./.github/actions/bake-test-push with: - target: ${{ inputs.product }} + target: ${{ steps.get-target.outputs.TARGET }} + bakefile: ${{ needs.setup.outputs.BAKE_FILE }} push-image: ${{ inputs.push }} ghcr-token: ${{ secrets.GITHUB_TOKEN }} dockerhub-username: ${{ secrets.DOCKER_HUB_USERNAME }} dockerhub-token: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} gcp-json: '${{ secrets.GCP_ARTIFACT_REGISTRY_JSON }}' - diff --git a/docker-bake.hcl b/docker-bake.hcl index 6b8ca379..11f07f1e 100644 --- a/docker-bake.hcl +++ b/docker-bake.hcl @@ -100,6 +100,7 @@ variable BASE_BUILD_MATRIX { {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"}, ] } } @@ -166,7 +167,7 @@ variable CONTENT_BUILD_MATRIX { variable R_SESSION_COMPLETE_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.4.0", r_alternate = "4.3.3", py_primary = "3.12.1", py_alternate = "3.11.7"}, ] } } @@ -174,7 +175,7 @@ variable R_SESSION_COMPLETE_BUILD_MATRIX { variable WORKBENCH_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.4.0", r_alternate = "4.3.3", py_primary = "3.12.1", py_alternate = "3.11.7"}, ] } } diff --git a/docker-bake.preview.hcl b/docker-bake.preview.hcl index a229e1e4..f61f07b5 100644 --- a/docker-bake.preview.hcl +++ b/docker-bake.preview.hcl @@ -4,23 +4,23 @@ variable BRANCH { } variable CONNECT_DAILY_VERSION { - default = null + default = "" } variable PACKAGE_MANAGER_PREVIEW_VERSION { - default = null + default = "" } variable PACKAGE_MANAGER_DAILY_VERSION { - default = null + default = "" } variable WORKBENCH_DAILY_VERSION { - default = null + default = "" } variable WORKBENCH_PREVIEW_VERSION { - default = null + default = "" } variable DRIVERS_VERSION { @@ -116,6 +116,7 @@ variable BASE_BUILD_MATRIX { 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"}, ] } } @@ -127,7 +128,7 @@ variable PRO_BUILD_MATRIX { variable PACKAGE_MANAGER_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.4.0", r_alternate = "4.3.3", py_primary = "3.11.9", py_alternate = "3.10.14"}, ] } } @@ -135,7 +136,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", quarto = DEFAULT_QUARTO_VERSION}, + {os = "ubuntu2204", r_primary = "4.4.0", r_alternate = "4.3.3", py_primary = "3.11.9", py_alternate = "3.10.14", quarto = DEFAULT_QUARTO_VERSION}, ] } } @@ -151,7 +152,7 @@ variable CONNECT_CONTENT_INIT_BUILD_MATRIX { variable R_SESSION_COMPLETE_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.4.0", r_alternate = "4.3.3", py_primary = "3.11.9", py_alternate = "3.10.14"}, ] } } @@ -159,7 +160,7 @@ variable R_SESSION_COMPLETE_BUILD_MATRIX { variable WORKBENCH_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.4.0", r_alternate = "4.3.3", py_primary = "3.11.9", py_alternate = "3.10.14"}, ] } } diff --git a/product/base/Dockerfile.centos7 b/product/base/Dockerfile.centos7 index 9faf3e6b..dfd13ed9 100644 --- a/product/base/Dockerfile.centos7 +++ b/product/base/Dockerfile.centos7 @@ -1,8 +1,8 @@ FROM centos:7 as build ### ARG declarations ### -ARG R_VERSION=4.2.0 -ARG R_VERSION_ALT=3.6.2 +ARG R_VERSION=4.4.0 +ARG R_VERSION_ALT=4.3.3 ARG PYTHON_VERSION=3.9.14 ARG PYTHON_VERSION_ALT=3.8.15 ARG TINI_VERSION=0.19.0 diff --git a/product/base/Dockerfile.ubuntu2204 b/product/base/Dockerfile.ubuntu2204 index 850245e8..649dabbf 100644 --- a/product/base/Dockerfile.ubuntu2204 +++ b/product/base/Dockerfile.ubuntu2204 @@ -2,8 +2,8 @@ FROM ubuntu:22.04 as build ### ARG declarations ### ARG DEBIAN_FRONTEND=noninteractive -ARG R_VERSION=4.2.3 -ARG R_VERSION_ALT=4.1.3 +ARG R_VERSION=4.4.0 +ARG R_VERSION_ALT=4.3.3 ARG PYTHON_VERSION=3.9.17 ARG PYTHON_VERSION_ALT=3.8.17 ARG TINI_VERSION=0.19.0 diff --git a/product/base/deps/ubuntu2204_packages.txt b/product/base/deps/ubuntu2204_packages.txt index 3a836e5c..59422223 100644 --- a/product/base/deps/ubuntu2204_packages.txt +++ b/product/base/deps/ubuntu2204_packages.txt @@ -18,7 +18,10 @@ gpg-agent gsfonts imagemagick libarchive-dev +libblas3 +libbz2-dev libcairo2-dev +libcurl4 libcurl4-openssl-dev libev-dev libfontconfig1-dev @@ -27,26 +30,37 @@ libfribidi-dev libgdal-dev libgeos-dev libgl1-mesa-dev +libglib2.0-0 libglpk-dev libglu1-mesa-dev libgmp3-dev libharfbuzz-dev libicu-dev libjpeg-dev +liblapack-dev +liblzma-dev libmagick++-dev libmysqlclient-dev +libncurses5-dev libopenblas-dev +libpango-1.0-0 +libpangocairo-1.0-0 libpaper-utils libpcre2-dev libpng-dev libproj-dev +libreadline-dev libsodium-dev libssh2-1-dev libssl-dev +libtcl8.6 libtiff-dev +libtirpc3 libudunits2-dev libv8-dev libxml2-dev +libx11-6 +libxt6 locales lsb-release make diff --git a/product/base/scripts/ubuntu/apt.sh b/product/base/scripts/ubuntu/apt.sh index e67877d6..38dab76a 100755 --- a/product/base/scripts/ubuntu/apt.sh +++ b/product/base/scripts/ubuntu/apt.sh @@ -21,7 +21,7 @@ usage() { } # Set defaults -APT_ARGS="-o DPkg::Lock::Timeout=60 -y -qq" +APT_ARGS="-o DPkg::Lock::Timeout=60 -y -qq --no-install-recommends" CLEAN=0 UPDATE=0 diff --git a/product/base/scripts/ubuntu/install_python.sh b/product/base/scripts/ubuntu/install_python.sh index 10566024..f96d783a 100755 --- a/product/base/scripts/ubuntu/install_python.sh +++ b/product/base/scripts/ubuntu/install_python.sh @@ -29,7 +29,6 @@ usage() { # Set defaults -APT_ARGS="-o DPkg::Lock::Timeout=60 -y -qq" PREFIX="/opt/python" OPTIONS=$(getopt -o hdr: --long help,debug,prefix:,requirement: -- "$@") @@ -73,7 +72,7 @@ fi PYTHON_BIN="${PREFIX}/${PYTHON_VERSION}/bin/python" # Set apt options -APT_ARGS="-o DPkg::Lock::Timeout=60 -y -qq" +APT_ARGS="-o DPkg::Lock::Timeout=60 -y -qq --no-install-recommends" # Set ubuntu version UBUNTU_VERSION=$(lsb_release -rs) diff --git a/product/base/scripts/ubuntu/install_r.sh b/product/base/scripts/ubuntu/install_r.sh index 401eac65..03284b61 100755 --- a/product/base/scripts/ubuntu/install_r.sh +++ b/product/base/scripts/ubuntu/install_r.sh @@ -31,7 +31,6 @@ usage() { # Set defaults -APT_ARGS="-o DPkg::Lock::Timeout=60 -y -qq" PREFIX="/opt/R" R_EXISTS=0 WITH_SOURCE=0 @@ -85,7 +84,7 @@ fi R_BIN="${PREFIX}/${R_VERSION}/bin/R" # Set apt options -APT_ARGS="-o DPkg::Lock::Timeout=60 -y -qq" +APT_ARGS="-o DPkg::Lock::Timeout=60 -y -qq --no-install-recommends" APT_KEY="0x51716619e084dab9" APT_KEY_FILE="/usr/share/keyrings/cran-rstudio-keyring.gpg" APT_FILE="/etc/apt/sources.list.d/cran-rstudio.list" @@ -130,29 +129,6 @@ install_r() { rm "/tmp/r-${R_VERSION}.deb" } -install_r_dependencies() { - # There are many dependencies that R users may rely on that we want to - # include in the images. These include things like a functional X server, - # fonts, and other libraries that are commonly used by R packages. - local r_deps="r-base-core r-base-dev" - - # Check whether dependencies are already installed - # shellcheck disable=2086 - if dpkg -s $r_deps >/dev/null 2>&1 ; then - echo "$d R dependencies already installed $d" - return - fi - - echo "$d$d Installng R depencencies $d$d" - # Ensure we have apt-transport-https installed - # shellcheck disable=SC2086 - apt-get install $APT_ARGS apt-transport-https - - # Install R dependencies - # shellcheck disable=2086 - apt-get install $APT_ARGS $r_deps -} - install_r_packages() { if [ ! -f "$R_PKG_FILE" ]; then echo "$d R package file $R_PKG_FILE does not exist $d" @@ -180,10 +156,9 @@ get_r_source() { } -# Only add the CRAN apt source & dependencies if we don't expect R to exist +# Only add the CRAN apt source if we don't expect R to exist if [ "$R_EXISTS" -eq 0 ]; then add_cran_apt_source - install_r_dependencies fi # Check if R is already installed diff --git a/product/base/test/goss.yaml b/product/base/test/goss.yaml index d15aa828..5247d6f2 100644 --- a/product/base/test/goss.yaml +++ b/product/base/test/goss.yaml @@ -6,6 +6,8 @@ package: installed: true cracklib-runtime: installed: true + r-recommended: + installed: false {{end}} {{if .Env.OS | regexMatch "centos.*"}} epel-release: @@ -45,6 +47,8 @@ file: exists: true /opt/python/{{.Env.PYTHON_VERSION_ALT}}/bin/python3: exists: true + /usr/lib/R/bin/R: + exists: false /tini: exists: true {{if .Env.OS | regexMatch "ubuntu.*"}} diff --git a/r-session-complete/Dockerfile.ubuntu2204 b/r-session-complete/Dockerfile.ubuntu2204 index 55ed31ad..582e0aeb 100644 --- a/r-session-complete/Dockerfile.ubuntu2204 +++ b/r-session-complete/Dockerfile.ubuntu2204 @@ -1,8 +1,8 @@ FROM product-base-pro as build ARG DEBIAN_FRONTEND=noninteractive -ARG R_VERSION=4.2.3 -ARG R_VERSION_ALT=4.1.3 +ARG R_VERSION=4.4.0 +ARG R_VERSION_ALT=4.3.3 ARG PYTHON_VERSION=3.9.17 ARG PYTHON_VERSION_ALT=3.8.17 ARG JUPYTERLAB_VERSION=3.6.5 diff --git a/tools/get-version.py b/tools/get-version.py index 8f22eb6a..6c73fd72 100755 --- a/tools/get-version.py +++ b/tools/get-version.py @@ -108,7 +108,7 @@ def download_json(url): def get_downloads_json(): - return download_json("https://rstudio.com/wp-content/downloads.json") + return download_json("https://www.rstudio.com/wp-content/downloads.json") def rstudio_workbench_preview(): @@ -136,7 +136,7 @@ def get_local_release_version(product): with open('Justfile', 'r') as f: content = f.read() - vers = re.compile(f'{prefix}_VERSION := (.*)') + vers = re.compile(f'{prefix}_VERSION := "(.*)"') res = vers.search(content) # from the first capture group output_version = res[1] diff --git a/workbench/Dockerfile.ubuntu2204 b/workbench/Dockerfile.ubuntu2204 index 37217661..74d74fa0 100644 --- a/workbench/Dockerfile.ubuntu2204 +++ b/workbench/Dockerfile.ubuntu2204 @@ -1,8 +1,8 @@ FROM product-base-pro as build ARG DEBIAN_FRONTEND=noninteractive -ARG R_VERSION=4.2.3 -ARG R_VERSION_ALT=4.1.3 +ARG R_VERSION=4.4.0 +ARG R_VERSION_ALT=4.3.3 ARG PYTHON_VERSION=3.9.17 ARG PYTHON_VERSION_ALT=3.8.17 ARG PYTHON_VERSION_JUPYTER=3.8.17