Skip to content

Commit

Permalink
Merge pull request #166 from rstudio/feature/debian-12
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborcsardi authored Jun 26, 2023
2 parents af8b2e5 + 2058bd6 commit c97f0cc
Show file tree
Hide file tree
Showing 8 changed files with 141 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
PLATFORMS := ubuntu-1804 ubuntu-2004 ubuntu-2204 debian-10 debian-11 centos-7 centos-8 rhel-9 opensuse-153 opensuse-154
PLATFORMS := ubuntu-1804 ubuntu-2004 ubuntu-2204 debian-10 debian-11 debian-12 centos-7 centos-8 rhel-9 opensuse-153 opensuse-154
SLS_BINARY ?= ./node_modules/serverless/bin/serverless.js

deps:
Expand Down
5 changes: 4 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ bug, or ask questions on [Posit Community](https://community.rstudio.com).
R binaries are built for the following Linux operating systems:

- Ubuntu 18.04, 20.04, 22.04
- Debian 10, 11
- Debian 10, 11, 12
- CentOS 7
- Red Hat Enterprise Linux 7, 8, 9
- openSUSE 15.3, 15.4
Expand Down Expand Up @@ -70,6 +70,9 @@ curl -O https://cdn.posit.co/r/debian-10/pkgs/r-${R_VERSION}_1_amd64.deb

# Debian 11
curl -O https://cdn.posit.co/r/debian-11/pkgs/r-${R_VERSION}_1_amd64.deb

# Debian 12
curl -O https://cdn.posit.co/r/debian-12/pkgs/r-${R_VERSION}_1_amd64.deb
```

Then install the package:
Expand Down
29 changes: 29 additions & 0 deletions builder/Dockerfile.debian-12
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
FROM debian:bookworm

ENV OS_IDENTIFIER debian-12

RUN set -x \
&& export DEBIAN_FRONTEND=noninteractive \
&& echo 'deb-src http://deb.debian.org/debian bookworm main' >> /etc/apt/sources.list \
&& apt-get update \
&& apt-get install -y curl gcc libcurl4-openssl-dev libicu-dev \
libopenblas0 libpcre2-dev make pipx wget \
&& apt-get build-dep -y r-base

RUN pipx install awscli && pipx ensurepath

RUN chmod 0777 /opt

RUN curl -LO "https://github.com/goreleaser/nfpm/releases/download/v2.18.1/nfpm_$(dpkg --print-architecture).deb" && \
apt install -y "./nfpm_$(dpkg --print-architecture).deb" && \
rm "nfpm_$(dpkg --print-architecture).deb"

# Override the default pager used by R
ENV PAGER /usr/bin/pager

# R 3.x requires PCRE2 for Pango support on Debian 12
ENV INCLUDE_PCRE2_IN_R_3 yes

COPY package.debian-12 /package.sh
COPY build.sh .
ENTRYPOINT ./build.sh
12 changes: 12 additions & 0 deletions builder/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,18 @@ services:
image: r-builds:debian-11
volumes:
- ./integration/tmp:/tmp/output
debian-12:
command: ./build.sh
environment:
- R_VERSION=${R_VERSION}
- R_INSTALL_PATH=${R_INSTALL_PATH}
- LOCAL_STORE=/tmp/output
build:
context: .
dockerfile: Dockerfile.debian-12
image: r-builds:debian-12
volumes:
- ./integration/tmp:/tmp/output
centos-7:
command: ./build.sh
environment:
Expand Down
70 changes: 70 additions & 0 deletions builder/package.debian-12
Original file line number Diff line number Diff line change
@@ -0,0 +1,70 @@
#!/bin/bash

if [[ ! -d /tmp/output/${OS_IDENTIFIER} ]]; then
mkdir -p "/tmp/output/${OS_IDENTIFIER}"
fi

# R 3.x requires PCRE1. On Debian 12, R 3.x also requires PCRE2 for Pango support.
pcre_libs='- libpcre2-dev'
if [[ "${R_VERSION}" =~ ^3 ]]; then
pcre_libs='- libpcre2-dev
- libpcre3-dev'
fi

cat <<EOF > /tmp/nfpm.yml
name: r-${R_VERSION}
version: 1
version_schema: none
section: gnu-r
arch: $(dpkg --print-architecture)
priority: optional
maintainer: Posit Software, PBC <https://github.com/rstudio/r-builds>
description: |
GNU R statistical computation and graphics system
vendor: Posit Software, PBC
homepage: https://www.r-project.org
license: GPL-2
deb:
fields:
Bugs: https://github.com/rstudio/r-builds/issues
depends:
- ca-certificates
- g++
- gcc
- gfortran
- libbz2-dev
- libc6
- libcairo2
- libcurl4-openssl-dev
- libglib2.0-0
- libgomp1
- libicu-dev
- liblzma-dev
- libopenblas-dev
- libpango-1.0-0
- libpangocairo-1.0-0
- libpaper-utils
${pcre_libs}
- libpng16-16
- libreadline8
- libtcl8.6
- libtiff6
- libtk8.6
- libx11-6
- libxt6
- make
- ucf
- unzip
- zip
- zlib1g-dev
contents:
- src: ${R_INSTALL_PATH}
dst: ${R_INSTALL_PATH}
EOF

nfpm package \
-f /tmp/nfpm.yml \
-p deb \
-t "/tmp/output/${OS_IDENTIFIER}"

export PKG_FILE=$(ls /tmp/output/${OS_IDENTIFIER}/r-${R_VERSION}*.deb | head -1)
14 changes: 14 additions & 0 deletions serverless-resources.yml
Original file line number Diff line number Diff line change
Expand Up @@ -201,6 +201,20 @@ rBuildsBatchJobDefinitionDebian11:
Image: "#{AWS::AccountId}.dkr.ecr.#{AWS::Region}.amazonaws.com/r-builds:debian-11"
Timeout:
AttemptDurationSeconds: 7200
rBuildsBatchJobDefinitionDebian12:
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-12"
Timeout:
AttemptDurationSeconds: 7200
rBuildsBatchJobDefinitionCentos7:
Type: AWS::Batch::JobDefinition
Properties:
Expand Down
4 changes: 3 additions & 1 deletion serverless.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@ provider:
Ref: rBuildsBatchJobDefinitionDebian10
JOB_DEFINITION_ARN_debian_11:
Ref: rBuildsBatchJobDefinitionDebian11
JOB_DEFINITION_ARN_debian_12:
Ref: rBuildsBatchJobDefinitionDebian12
JOB_DEFINITION_ARN_centos_7:
Ref: rBuildsBatchJobDefinitionCentos7
JOB_DEFINITION_ARN_centos_8:
Expand All @@ -62,7 +64,7 @@ provider:
Ref: rBuildsBatchJobDefinitionOpensuse153
JOB_DEFINITION_ARN_opensuse_154:
Ref: rBuildsBatchJobDefinitionOpensuse154
SUPPORTED_PLATFORMS: ubuntu-1804,ubuntu-2004,ubuntu-2204,debian-10,debian-11,centos-7,centos-8,rhel-9,opensuse-153,opensuse-154
SUPPORTED_PLATFORMS: ubuntu-1804,ubuntu-2004,ubuntu-2204,debian-10,debian-11,debian-12,centos-7,centos-8,rhel-9,opensuse-153,opensuse-154

functions:
queueBuilds:
Expand Down
8 changes: 8 additions & 0 deletions test/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,14 @@ services:
- R_VERSION=${R_VERSION}
volumes:
- ../:/r-builds
debian-12:
image: debian:bookworm
command: /r-builds/test/test-apt.sh
environment:
- OS_IDENTIFIER=debian-12
- R_VERSION=${R_VERSION}
volumes:
- ../:/r-builds
debian-11:
image: debian:bullseye
command: /r-builds/test/test-apt.sh
Expand Down

0 comments on commit c97f0cc

Please sign in to comment.