From 3a1b8a2a10fdcbeb43c1941d39d48a9522609484 Mon Sep 17 00:00:00 2001 From: Greg Lin Date: Thu, 21 Oct 2021 08:47:27 -0500 Subject: [PATCH] Add builds for Debian 11 --- Makefile | 2 +- README.md | 3 ++ builder/Dockerfile.debian-11 | 24 +++++++++++++++ builder/docker-compose.yml | 11 +++++++ builder/package.debian-11 | 59 ++++++++++++++++++++++++++++++++++++ handler.py | 1 + serverless-resources.yml | 14 +++++++++ serverless.yml | 4 ++- 8 files changed, 116 insertions(+), 2 deletions(-) create mode 100644 builder/Dockerfile.debian-11 create mode 100644 builder/package.debian-11 diff --git a/Makefile b/Makefile index dbf4696..716919d 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PLATFORMS := ubuntu-1804 ubuntu-2004 ubuntu-2204 debian-9 debian-10 centos-7 centos-8 opensuse-42 opensuse-152 opensuse-153 +PLATFORMS := ubuntu-1804 ubuntu-2004 ubuntu-2204 debian-9 debian-10 debian-11 centos-7 centos-8 opensuse-42 opensuse-152 opensuse-153 SLS_BINARY ?= ./node_modules/serverless/bin/serverless deps: diff --git a/README.md b/README.md index 9affd91..b20597b 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,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 + +# Debian 11 +wget https://cdn.rstudio.com/r/debian-11/pkgs/r-${R_VERSION}_1_amd64.deb ``` Then install the package: diff --git a/builder/Dockerfile.debian-11 b/builder/Dockerfile.debian-11 new file mode 100644 index 0000000..02e5c23 --- /dev/null +++ b/builder/Dockerfile.debian-11 @@ -0,0 +1,24 @@ +FROM debian:bullseye + +ENV OS_IDENTIFIER debian-11 + +RUN set -x \ + && export DEBIAN_FRONTEND=noninteractive \ + && echo 'deb-src http://deb.debian.org/debian bullseye 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-11 /package.sh +COPY build.sh . +ENTRYPOINT ./build.sh diff --git a/builder/docker-compose.yml b/builder/docker-compose.yml index 9cdcdb4..c1335ef 100644 --- a/builder/docker-compose.yml +++ b/builder/docker-compose.yml @@ -56,6 +56,17 @@ services: image: r-builds:debian-10 volumes: - ./integration/tmp:/tmp/output + debian-11: + command: ./build.sh + environment: + - R_VERSION=${R_VERSION} + - LOCAL_STORE=/tmp/output + build: + context: . + dockerfile: Dockerfile.debian-11 + image: r-builds:debian-11 + volumes: + - ./integration/tmp:/tmp/output centos-7: command: ./build.sh environment: diff --git a/builder/package.debian-11 b/builder/package.debian-11 new file mode 100644 index 0000000..93ce643 --- /dev/null +++ b/builder/package.debian-11 @@ -0,0 +1,59 @@ +#!/bin/bash + +if [[ ! -d /tmp/output/debian-11 ]]; then + mkdir -p /tmp/output/debian-11 +fi + +# R 3.x requires PCRE1 +pcre_lib='libpcre2-dev' +if [[ "${R_VERSION}" =~ ^3 ]]; then + pcre_lib='libpcre3-dev' +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-11/ \ + -d ca-certificates \ + -d g++ \ + -d gcc \ + -d gfortran \ + -d libbz2-dev \ + -d libc6 \ + -d libcairo2 \ + -d libcurl4-openssl-dev \ + -d libglib2.0-0 \ + -d libgomp1 \ + -d libicu-dev \ + -d liblzma-dev \ + -d libopenblas-dev \ + -d libpango-1.0-0 \ + -d libpangocairo-1.0-0 \ + -d libpaper-utils \ + -d ${pcre_lib} \ + -d libpng16-16 \ + -d libreadline8 \ + -d libtcl8.6 \ + -d libtiff5 \ + -d libtk8.6 \ + -d libx11-6 \ + -d libxt6 \ + -d make \ + -d ucf \ + -d unzip \ + -d zip \ + -d zlib1g-dev \ + /opt/R/${R_VERSION} + +shopt -s extglob +export PKG_FILE=$(ls /tmp/output/debian-11/[rR]-${R_VERSION}*.@(deb|rpm) | head -1) + diff --git a/handler.py b/handler.py index 34d0b51..56969cc 100644 --- a/handler.py +++ b/handler.py @@ -136,6 +136,7 @@ def queue_builds(event, context): 'opensuse-153', 'centos-8', 'debian-10', + 'debian-11', ] and version in ['3.3.0', '3.3.1', '3.3.2']: continue job_ids.append(_submit_job(version, platform)) diff --git a/serverless-resources.yml b/serverless-resources.yml index 6496b39..9fae387 100644 --- a/serverless-resources.yml +++ b/serverless-resources.yml @@ -201,6 +201,20 @@ rBuildsBatchJobDefinitionDebian10: Image: "#{AWS::AccountId}.dkr.ecr.#{AWS::Region}.amazonaws.com/r-builds:debian-10" Timeout: AttemptDurationSeconds: 7200 +rBuildsBatchJobDefinitionDebian11: + 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-11" + Timeout: + AttemptDurationSeconds: 7200 rBuildsBatchJobDefinitionCentos7: Type: AWS::Batch::JobDefinition Properties: diff --git a/serverless.yml b/serverless.yml index fdb9bab..400f18c 100644 --- a/serverless.yml +++ b/serverless.yml @@ -45,6 +45,8 @@ provider: Ref: rBuildsBatchJobDefinitionDebian9 JOB_DEFINITION_ARN_debian_10: Ref: rBuildsBatchJobDefinitionDebian10 + JOB_DEFINITION_ARN_debian_11: + Ref: rBuildsBatchJobDefinitionDebian11 JOB_DEFINITION_ARN_centos_7: Ref: rBuildsBatchJobDefinitionCentos7 JOB_DEFINITION_ARN_centos_8: @@ -55,7 +57,7 @@ provider: Ref: rBuildsBatchJobDefinitionOpensuse152 JOB_DEFINITION_ARN_opensuse_153: Ref: rBuildsBatchJobDefinitionOpensuse153 - SUPPORTED_PLATFORMS: ubuntu-1804,ubuntu-2004,ubuntu-2204,debian-9,debian-10,centos-7,centos-8,opensuse-42,opensuse-152,opensuse-153 + SUPPORTED_PLATFORMS: ubuntu-1804,ubuntu-2004,ubuntu-2204,debian-9,debian-10,debian-11,centos-7,centos-8,opensuse-42,opensuse-152,opensuse-153 functions: queueBuilds: