From 87c9ed44b0ba16016422d4007af2940c2ac703a0 Mon Sep 17 00:00:00 2001 From: Dan Buch Date: Thu, 30 Apr 2020 15:10:14 -0400 Subject: [PATCH] Add support for Debian 10 (buster) Closes #58 --- Makefile | 2 +- README.md | 7 +++-- builder/Dockerfile.debian-10 | 24 ++++++++++++++++ builder/docker-compose.yml | 11 ++++++++ builder/package.debian-10 | 54 ++++++++++++++++++++++++++++++++++++ install.sh | 2 +- serverless-resources.yml | 12 ++++++++ serverless.yml | 4 ++- 8 files changed, 111 insertions(+), 5 deletions(-) create mode 100644 builder/Dockerfile.debian-10 create mode 100644 builder/package.debian-10 diff --git a/Makefile b/Makefile index 329addf..64f39c1 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PLATFORMS := ubuntu-1604 ubuntu-1804 ubuntu-2004 debian-9 centos-6 centos-7 centos-8 opensuse-42 opensuse-15 +PLATFORMS := ubuntu-1604 ubuntu-1804 ubuntu-2004 debian-9 debian-10 centos-6 centos-7 centos-8 opensuse-42 opensuse-15 SLS_BINARY ?= ./node_modules/serverless/bin/serverless deps: diff --git a/README.md b/README.md index 95c1168..1a4ac9c 100644 --- a/README.md +++ b/README.md @@ -19,7 +19,7 @@ bug, or ask questions on [RStudio Community](https://community.rstudio.com). R binaries are built for the following Linux operating systems: - Ubuntu 16.04, 18.04, 20.04 -- Debian 9 +- Debian 9, 10 - CentOS / Red Hat Enterprise Linux 6, 7, 8 - openSUSE 42.3, 15.0 - SUSE Linux Enterprise 12, 15 @@ -60,6 +60,9 @@ wget https://cdn.rstudio.com/r/ubuntu-2004/pkgs/r-${R_VERSION}_1_amd64.deb # Debian 9 wget https://cdn.rstudio.com/r/debian-9/pkgs/r-${R_VERSION}_1_amd64.deb + +# Debian 10 +wget https://cdn.rstudio.com/r/debian-10/pkgs/r-${R_VERSION}_1_amd64.deb ``` Then install the package: @@ -225,7 +228,7 @@ environment: # snip JOB_DEFINITION_ARN_debian_9: Ref: rBuildsBatchJobDefinitionDebian9 - SUPPORTED_PLATFORMS: ubuntu-1604,ubuntu-1804,debian-9,centos-6,centos-7,centos-8,opensuse-42,opensuse-15 + SUPPORTED_PLATFORMS: ubuntu-1604,ubuntu-1804,debian-9,debian-10,centos-6,centos-7,centos-8,opensuse-42,opensuse-15 ``` ### Makefile diff --git a/builder/Dockerfile.debian-10 b/builder/Dockerfile.debian-10 new file mode 100644 index 0000000..077c7b4 --- /dev/null +++ b/builder/Dockerfile.debian-10 @@ -0,0 +1,24 @@ +FROM debian:buster + +ENV OS_IDENTIFIER debian-10 + +RUN set -x \ + && export DEBIAN_FRONTEND=noninteractive \ + && echo 'deb-src http://deb.debian.org/debian buster main' >> /etc/apt/sources.list \ + && apt-get update \ + && apt-get install -y gcc libcurl4-openssl-dev libicu-dev \ + libopenblas-base libpcre2-dev make python3-pip ruby ruby-dev wget \ + && apt-get build-dep -y r-base + +RUN pip3 install awscli + +RUN chmod 0777 /opt + +RUN gem install fpm + +# Override the default pager used by R +ENV PAGER /usr/bin/pager + +COPY package.debian-10 /package.sh +COPY build.sh . +ENTRYPOINT ./build.sh diff --git a/builder/docker-compose.yml b/builder/docker-compose.yml index 82ad921..36dce71 100644 --- a/builder/docker-compose.yml +++ b/builder/docker-compose.yml @@ -45,6 +45,17 @@ services: image: r-builds:debian-9 volumes: - ./integration/tmp:/tmp/output + debian-10: + command: ./build.sh + environment: + - R_VERSION=${R_VERSION} + - LOCAL_STORE=/tmp/output + build: + context: . + dockerfile: Dockerfile.debian-10 + image: r-builds:debian-10 + volumes: + - ./integration/tmp:/tmp/output centos-6: command: ./build.sh environment: diff --git a/builder/package.debian-10 b/builder/package.debian-10 new file mode 100644 index 0000000..afacab5 --- /dev/null +++ b/builder/package.debian-10 @@ -0,0 +1,54 @@ +#!/bin/bash + +if [[ ! -d /tmp/output/debian-10 ]]; then + mkdir -p /tmp/output/debian-10 +fi + +fpm \ + -s dir \ + -t deb \ + -v 1 \ + -n R-${R_VERSION} \ + --vendor "RStudio, PBC" \ + --deb-priority "optional" \ + --deb-field 'Bugs: https://github.com/rstudio/r-builds/issues' \ + --url "http://www.r-project.org/" \ + --description "GNU R statistical computation and graphics system" \ + --maintainer "RStudio, PBC https://github.com/rstudio/r-builds" \ + --license "GPL-2" \ + -p /tmp/output/debian-10/ \ + -d ca-certificates \ + -d g++ \ + -d gcc \ + -d gfortran \ + -d libbz2-1.0 \ + -d libc6 \ + -d libcairo2 \ + -d libcurl4-openssl-dev \ + -d libglib2.0-0 \ + -d libgomp1 \ + -d libicu63 \ + -d liblzma5 \ + -d libopenblas-dev \ + -d libpango-1.0-0 \ + -d libpangocairo-1.0-0 \ + -d libpaper-utils \ + -d libpcre2-8-0 \ + -d libpcre3 \ + -d libpng16-16 \ + -d libreadline7 \ + -d libtcl8.6 \ + -d libtiff5 \ + -d libtk8.6 \ + -d libx11-6 \ + -d libxt6 \ + -d make \ + -d ucf \ + -d unzip \ + -d zip \ + -d zlib1g \ + /opt/R/${R_VERSION} + +shopt -s extglob +export PKG_FILE=$(ls /tmp/output/debian-10/[rR]-${R_VERSION}*.@(deb|rpm) | head -1) + diff --git a/install.sh b/install.sh index 7de8dd7..72b1cb0 100755 --- a/install.sh +++ b/install.sh @@ -168,7 +168,7 @@ download_url () { echo "${CDN_URL}/ubuntu-${ver}/pkgs/${name}" ;; "Debian") - echo "${CDN_URL}/debian-9/pkgs/${name}" + echo "${CDN_URL}/debian-${ver:-9}/pkgs/${name}" ;; "LEAP12" | "SLES12") echo "${CDN_URL}/opensuse-42/pkgs/${name}" diff --git a/serverless-resources.yml b/serverless-resources.yml index dcca0fa..900e3a2 100644 --- a/serverless-resources.yml +++ b/serverless-resources.yml @@ -179,6 +179,18 @@ rBuildsBatchJobDefinitionDebian9: JobRoleArn: "Fn::GetAtt": [ rBuildsEcsTaskIamRole, Arn ] Image: "#{AWS::AccountId}.dkr.ecr.#{AWS::Region}.amazonaws.com/r-builds:debian-9" +rBuildsBatchJobDefinitionDebian10: + Type: AWS::Batch::JobDefinition + Properties: + Type: container + ContainerProperties: + Command: + - ./build.sh + Vcpus: 4 + Memory: 4096 + JobRoleArn: + "Fn::GetAtt": [ rBuildsEcsTaskIamRole, Arn ] + Image: "#{AWS::AccountId}.dkr.ecr.#{AWS::Region}.amazonaws.com/r-builds:debian-10" rBuildsBatchJobDefinitionCentos6: Type: AWS::Batch::JobDefinition Properties: diff --git a/serverless.yml b/serverless.yml index cf75280..a007524 100644 --- a/serverless.yml +++ b/serverless.yml @@ -43,6 +43,8 @@ provider: Ref: rBuildsBatchJobDefinitionUbuntu2004 JOB_DEFINITION_ARN_debian_9: Ref: rBuildsBatchJobDefinitionDebian9 + JOB_DEFINITION_ARN_debian_10: + Ref: rBuildsBatchJobDefinitionDebian10 JOB_DEFINITION_ARN_centos_6: Ref: rBuildsBatchJobDefinitionCentos6 JOB_DEFINITION_ARN_centos_7: @@ -53,7 +55,7 @@ provider: Ref: rBuildsBatchJobDefinitionOpensuse42 JOB_DEFINITION_ARN_opensuse_15: Ref: rBuildsBatchJobDefinitionOpensuse15 - SUPPORTED_PLATFORMS: ubuntu-1604,ubuntu-1804,ubuntu-2004,debian-9,centos-6,centos-7,centos-8,opensuse-42,opensuse-15 + SUPPORTED_PLATFORMS: ubuntu-1604,ubuntu-1804,ubuntu-2004,debian-9,debian-10,centos-6,centos-7,centos-8,opensuse-42,opensuse-15 functions: queueBuilds: