rstudio / shiny-server

Host Shiny applications over the web.
https://rstudio.com/shiny/server
Other
712 stars 291 forks source link

Upgrade to Node 18 #556

Closed jcheng5 closed 10 months ago

jcheng5 commented 10 months ago

Notes

  1. .nvmrc specifies the Node.js version number that should be downloaded by external/install-node.sh. We also have to update the SHASUM in external/install-node.sh. (I don't know if this provides any extra security, but I've always done it this way)
  2. I updated all of the outdated npm dependencies, one of which was the TypeScript compiler. Hence the slightly tweaked .js files--those are compiled outputs from TypeScript.
  3. I "tested" by merely running the tests and making sure the welcome page comes up with its two embedded apps.
dskard commented 10 months ago

I ran into problems building this branch on Ubuntu 18 and CentOS 7. We may run into similar problems when merging.

Compiling with Ubuntu 18.04 failed with:

...
Extracting node-v18.17.1-linux-x64.tar.xz
+ ./bin/npm install
./bin/../ext/node/bin/node: /lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.28' not found (required by ./bin/../ext/node/ bin/node)
make: *** [Makefile:53: packages-ubuntu] Error 1

Ubuntu 18's libc supports up to GLIBC 2.27:

$ docker run --rm -it rstudio/shiny-server:ubuntu-18.04-x86_64 bash
root@c02e728f27d1:/# strings /lib/x86_64-linux-gnu/libc.so.6 | grep GLIBC
GLIBC_2.2.5
GLIBC_2.2.6
GLIBC_2.3
GLIBC_2.3.2
GLIBC_2.3.3
GLIBC_2.3.4
GLIBC_2.4
GLIBC_2.5
GLIBC_2.6
GLIBC_2.7
GLIBC_2.8
GLIBC_2.9
GLIBC_2.10
GLIBC_2.11
GLIBC_2.12
GLIBC_2.13
GLIBC_2.14
GLIBC_2.15
GLIBC_2.16
GLIBC_2.17
GLIBC_2.18
GLIBC_2.22
GLIBC_2.23
GLIBC_2.24
GLIBC_2.25
GLIBC_2.26
GLIBC_2.27
GLIBC_PRIVATE
GNU C Library (Ubuntu GLIBC 2.27-3ubuntu1.6) stable release version 2.27.
root@c02e728f27d1:/#

Building the rpm package on CentOS 7 gave a similar result:

Extracting node-v18.17.1-linux-x64.tar.xz
+ ./bin/npm install
./bin/../ext/node/bin/node: /lib64/libm.so.6: version `GLIBC_2.27' not found (required by ./bin/../ext/node/bin/node)
./bin/../ext/node/bin/node: /lib64/libc.so.6: version `GLIBC_2.25' not found (required by ./bin/../ext/node/bin/node)
./bin/../ext/node/bin/node: /lib64/libc.so.6: version `GLIBC_2.28' not found (required by ./bin/../ext/node/bin/node)
./bin/../ext/node/bin/node: /lib64/libstdc++.so.6: version `CXXABI_1.3.9' not found (required by ./bin/../ext/node/bin/node)
./bin/../ext/node/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.20' not found (required by ./bin/../ext/node/bin/node)
./bin/../ext/node/bin/node: /lib64/libstdc++.so.6: version `GLIBCXX_3.4.21' not found (required by ./bin/../ext/node/bin/node)
make: *** [Makefile:43: packages-centos] Error 1

I was able to build the binaries using Ubuntu 20 and Rocky Linux 8 environments. I created a fork of this branch at https://github.com/dskard/shiny-server/tree/node-18 with a Makefile to help reproduce the errors I was seeing above and reproduce the Ubuntu 20 and Rocky Linux 8 build environments.

To reproduce the GLIBC errors:

git clone git@github.com:dskard/shiny-server.git
cd shiny-server
git checkout node-18

# build all of the docker images for build environments
# might need to force docker's default platform with:
# export DOCKER_DEFAULT_PLATFORM=linux/amd64
make build

# build a deb package using Ubuntu 18 build environment
make dist-clean packages-ubuntu

# build an rpm package using CentOS 7 build environment
make dist-clean packages-centos

To build packages with the Ubuntu 20 and Rocky Linux 8 build environments:

# build a deb package using Ubuntu 20 build environment
make dist-clean packages-ubuntu-20

# build an rpm package using Rocky Linux 8 build environment
make dist-clean packages-rocky-8

The packages built with the Ubuntu 20 and Rocky Linux 8 environments did install and launch applications without any new errors in Ubuntu 20 and Rocky Linux 8 test environments. I still need to try:

jcheng5 commented 10 months ago

@dskard This should fix CentOS 7. It replaces the Node.js official binary (for all build flavors) with one from https://github.com/jcheng5/node-centos7.

dskard commented 10 months ago

Building .rpm package on CentOS 7 and .deb package on Ubuntu 18 worked using the new version of Node.

Tested installation of packages, loading R applications, and loading Python applications on the following platforms: