From 4ef223954c61d545c4e992068b529b886d61e35c Mon Sep 17 00:00:00 2001 From: Toni Noble Date: Thu, 21 Oct 2021 10:46:56 -0400 Subject: [PATCH 1/3] build on opensuse15.3 --- Makefile | 2 +- builder/Dockerfile.opensuse-153 | 88 +++++++++++++++++++++++++++++++++ builder/docker-compose.yml | 11 +++++ serverless-resources.yml | 14 ++++++ serverless.yml | 4 +- 5 files changed, 117 insertions(+), 2 deletions(-) create mode 100644 builder/Dockerfile.opensuse-153 diff --git a/Makefile b/Makefile index 255ac7d..e800203 100644 --- a/Makefile +++ b/Makefile @@ -1,4 +1,4 @@ -PLATFORMS := ubuntu-1604 ubuntu-1804 ubuntu-2004 debian-9 debian-10 centos-7 centos-8 opensuse-42 opensuse-15 opensuse-152 +PLATFORMS := ubuntu-1604 ubuntu-1804 ubuntu-2004 debian-9 debian-10 centos-7 centos-8 opensuse-42 opensuse-15 opensuse-152 opensuse-153 SLS_BINARY ?= ./node_modules/serverless/bin/serverless deps: diff --git a/builder/Dockerfile.opensuse-153 b/builder/Dockerfile.opensuse-153 new file mode 100644 index 0000000..a0734c2 --- /dev/null +++ b/builder/Dockerfile.opensuse-153 @@ -0,0 +1,88 @@ +FROM opensuse/leap:15.3 + +ENV OS_IDENTIFIER opensuse-153 + +# Most of these packages, and also the configure options that follow were determined +# by reviewing "R-base.spec" from the following OpenSUSE RPM: +# https://download.opensuse.org/repositories/devel:/languages:/R:/released/openSUSE_Leap_42.3/src/R-base-3.5.3-103.1.src.rpm + +RUN zypper --non-interactive update +RUN zypper --non-interactive --gpg-auto-import-keys -n install \ + bzip2 \ + cairo-devel \ + fdupes \ + gcc \ + gcc-c++ \ + gcc-fortran \ + glib2-devel \ + glibc-locale \ + help2man \ + java-1_8_0-openjdk-devel \ + libX11-devel \ + libXScrnSaver-devel \ + libXmu-devel \ + libXt-devel \ + libbz2-devel \ + libcurl-devel \ + libicu-devel \ + libjpeg-devel \ + libpng-devel \ + libtiff-devel \ + make \ + pango-devel \ + pcre-devel \ + pcre2-devel \ + perl \ + perl-macros \ + python \ + python-pip \ + readline-devel \ + rpm-build \ + ruby \ + ruby-devel \ + shadow \ + tcl-devel \ + texinfo \ + texlive-ae \ + texlive-bibtex \ + texlive-cm-super \ + texlive-dvips \ + texlive-fancyvrb \ + texlive-helvetic \ + texlive-inconsolata \ + texlive-latex \ + texlive-makeindex \ + texlive-metafont \ + texlive-psnfss \ + texlive-tex \ + texlive-times \ + tk-devel \ + unzip \ + wget \ + xdg-utils \ + xorg-x11-devel \ + xz-devel \ + zip \ + zlib-devel \ + && zypper clean + +RUN pip install awscli + +# Pin fpm to avoid git dependency in 1.12.0 +RUN gem install fpm:1.11.0 && \ + ln -s /usr/bin/fpm.ruby2.5 /usr/local/bin/fpm + +RUN chmod 0777 /opt + +# Configure flags for SUSE that don't use the defaults in build.sh +ENV CONFIGURE_OPTIONS="\ + --enable-R-shlib \ + --with-tcltk \ + --with-x \ + --enable-memory-profiling \ + --with-tcl-config=/usr/lib64/tclConfig.sh \ + --with-tk-config=/usr/lib64/tkConfig.sh" + +COPY package.opensuse-153 /package.sh +COPY build.sh . +ENTRYPOINT ./build.sh diff --git a/builder/docker-compose.yml b/builder/docker-compose.yml index 137008e..ac9fc22 100644 --- a/builder/docker-compose.yml +++ b/builder/docker-compose.yml @@ -111,3 +111,14 @@ services: image: r-builds:opensuse-152 volumes: - ./integration/tmp:/tmp/output + opensuse-153: + command: ./build.sh + environment: + - R_VERSION=${R_VERSION} + - LOCAL_STORE=/tmp/output + build: + context: . + dockerfile: Dockerfile.opensuse-153 + image: r-builds:opensuse-153 + volumes: + - ./integration/tmp:/tmp/output diff --git a/serverless-resources.yml b/serverless-resources.yml index e4b0020..9507498 100644 --- a/serverless-resources.yml +++ b/serverless-resources.yml @@ -271,6 +271,20 @@ rBuildsBatchJobDefinitionOpensuse152: Image: "#{AWS::AccountId}.dkr.ecr.#{AWS::Region}.amazonaws.com/r-builds:opensuse-152" Timeout: AttemptDurationSeconds: 7200 +rBuildsBatchJobDefinitionOpensuse153: + 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:opensuse-153" + Timeout: + AttemptDurationSeconds: 7200 # step function cloudwatch event trigger resources rBuildsEventRuleIamRole: diff --git a/serverless.yml b/serverless.yml index 0f07ec2..87e1e5a 100644 --- a/serverless.yml +++ b/serverless.yml @@ -55,7 +55,9 @@ provider: Ref: rBuildsBatchJobDefinitionOpensuse15 JOB_DEFINITION_ARN_opensuse_152: Ref: rBuildsBatchJobDefinitionOpensuse152 - SUPPORTED_PLATFORMS: ubuntu-1604,ubuntu-1804,ubuntu-2004,debian-9,debian-10,centos-7,centos-8,opensuse-42,opensuse-15,opensuse-152 + JOB_DEFINITION_ARN_opensuse_153: + Ref: rBuildsBatchJobDefinitionOpensuse153 + SUPPORTED_PLATFORMS: ubuntu-1604,ubuntu-1804,ubuntu-2004,debian-9,debian-10,centos-7,centos-8,opensuse-42,opensuse-15,opensuse-152,opensuse-153 functions: queueBuilds: From 4cb58f5fe2455aff0eeac60d7bffd264c52d037f Mon Sep 17 00:00:00 2001 From: Toni Noble Date: Thu, 21 Oct 2021 12:39:46 -0400 Subject: [PATCH 2/3] add builder/package.opensuse-153 --- builder/package.opensuse-153 | 74 ++++++++++++++++++++++++++++++++++++ 1 file changed, 74 insertions(+) create mode 100644 builder/package.opensuse-153 diff --git a/builder/package.opensuse-153 b/builder/package.opensuse-153 new file mode 100644 index 0000000..1999d51 --- /dev/null +++ b/builder/package.opensuse-153 @@ -0,0 +1,74 @@ +#!/bin/bash + +if [[ ! -d /tmp/output/opensuse-153 ]]; then + mkdir -p /tmp/output/opensuse-153 +fi + +# R 3.x requires PCRE1 +pcre_lib='pcre2-devel' +if [[ "${R_VERSION}" =~ ^3 ]]; then + pcre_lib='pcre-devel' +fi + +# create post-install script required for openblas +cat <> /post-install.sh +mv /opt/R/${R_VERSION}/lib/R/lib/libRblas.so /opt/R/${R_VERSION}/lib/R/lib/libRblas.so.keep +ln -s /usr/lib64/libopenblas.so /opt/R/${R_VERSION}/lib/R/lib/libRblas.so +EOF + +# create after-remove script to remove internal blas +cat <> /before-remove.sh +if [ -d /opt/R/${R_VERSION} ]; then + rm -r /opt/R/${R_VERSION} +fi +EOF + +fpm \ + -s dir \ + -t rpm \ + -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" \ + --after-install /post-install.sh \ + --after-remove /before-remove.sh \ + -p /tmp/output/opensuse-153/ \ + -d fontconfig \ + -d gcc \ + -d gcc-c++ \ + -d gcc-fortran \ + -d glibc-locale \ + -d gzip \ + -d libbz2-devel \ + -d libcairo2 \ + -d libcurl-devel \ + -d libfreetype6 \ + -d libgomp1 \ + -d libicu-devel \ + -d libjpeg62 \ + -d libpango-1_0-0 \ + -d libreadline7 \ + -d libtiff5 \ + -d make \ + -d openblas-devel \ + -d ${pcre_lib} \ + -d tar \ + -d tcl \ + -d tk \ + -d unzip \ + -d which \ + -d xorg-x11 \ + -d xorg-x11-fonts-100dpi \ + -d xorg-x11-fonts-75dpi \ + -d xz-devel \ + -d zip \ + -d zlib-devel \ + /opt/R/${R_VERSION} + +shopt -s extglob +export PKG_FILE=$(ls /tmp/output/opensuse-153/[rR]-${R_VERSION}*.@(deb|rpm) | head -1) From 7090b371b5dcca6447c4bab9d29a8eca86306903 Mon Sep 17 00:00:00 2001 From: Toni Noble Date: Tue, 26 Oct 2021 10:52:27 -0400 Subject: [PATCH 3/3] addressing feedback --- README.md | 2 +- handler.py | 1 + install.sh | 4 +++- 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 518f329..e9457b8 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ R binaries are built for the following Linux operating systems: - Ubuntu 16.04, 18.04, 20.04 - Debian 9, 10 - CentOS / Red Hat Enterprise Linux 7, 8 -- openSUSE 42.3, 15 +- openSUSE 42.3, 15, 15.3 - SUSE Linux Enterprise 12, 15 ## Quick Installation diff --git a/handler.py b/handler.py index 82c0603..1973986 100644 --- a/handler.py +++ b/handler.py @@ -133,6 +133,7 @@ def queue_builds(event, context): 'ubuntu-1804', 'opensuse-15', 'opensuse-152', + 'opensuse-153', 'centos-8', 'debian-10', ] and version in ['3.3.0', '3.3.1', '3.3.2']: diff --git a/install.sh b/install.sh index 502ac1b..a039bfb 100755 --- a/install.sh +++ b/install.sh @@ -177,7 +177,9 @@ download_url () { echo "${CDN_URL}/opensuse-42/pkgs/${name}" ;; "LEAP15" | "SLES15") - if [ "${ver}" -ge 152 ]; then + if [ "${ver}" -ge 153 ]; then + echo "${CDN_URL}/opensuse-153/pkgs/${name}" + elif [ "${ver} -eq 152 ]; then echo "${CDN_URL}/opensuse-152/pkgs/${name}" else echo "${CDN_URL}/opensuse-15/pkgs/${name}"