-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
update builder (Docker and package files for better java support) #113
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,6 +17,9 @@ RUN chmod 0777 /opt | |
# Pin fpm to avoid git dependency in 1.12.0 | ||
RUN gem install fpm:1.11.0 | ||
|
||
# Make sure that patching the OS does not break Java | ||
ENV JAVA_HOME=/usr/lib/jvm/java-11-openjdk-amd64/ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. On Ubuntu/Debian, the R builds here appear to already use this major-versioned location: R CMD config JAVA_HOME
# /usr/lib/jvm/java-11-openjdk-amd64 Checking the default Ubuntu/Debian R packages, they appear to all use R CMD config JAVA_HOME
# /usr/lib/jvm/default-java Unfortunately it doesn't look like you can control the JRE location using the alternatives system in Ubuntu/Debian. ls /usr/lib/jvm -la
# lrwxrwxrwx 1 root root 25 Jul 17 2019 default-java -> java-1.11.0-openjdk-amd64
# lrwxrwxrwx 1 root root 21 Jul 20 22:37 java-1.11.0-openjdk-amd64 -> java-11-openjdk-amd64
# lrwxrwxrwx 1 root root 21 Jul 22 21:02 java-1.17.0-openjdk-amd64 -> java-17-openjdk-amd64
# drwxr-xr-x 9 root root 4096 Aug 8 23:34 java-11-openjdk-amd64
# drwxr-xr-x 9 root root 4096 Aug 8 23:34 java-17-openjdk-amd64
# drwxr-xr-x 2 root root 4096 Aug 8 23:34 openjdk-11
# drwxr-xr-x 2 root root 4096 Aug 8 23:34 openjdk-17 But still, maybe it's better to use |
||
|
||
# Override the default pager used by R | ||
ENV PAGER /usr/bin/pager | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,6 +59,7 @@ fpm \ | |
-d xz-devel \ | ||
-d zip \ | ||
-d zlib-devel \ | ||
-d java-11-openjdk-devel \ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Since Java is often an optional dependency and somewhat heavy, could we leave it out of the DEB/RPM package dependencies? That would better support users who want to switch between Java 8, 11, 17, etc. as well. I think the default R packages from the various distros also leave Java as an optional dependency. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We can leave java out but why do we then spend effort on configuring Java in the first place ? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure if there was a specific reason for configuring Java in the first place, and would guess that it was just borrowed from how Debian and Fedora packaged R. It is nice to be able to just install Java and have it work out of the box without There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, I definitely agree with your sentiment about the size of the R build if we go with the Java integration. So far I only thought that this was an "opinionated R build" but not a "minimal build". Once probably could segregate the Java related things into a separate DEB/RPM but then the installation process becomes too complex again. For now we can always refer to https://solutions.rstudio.com/r/using-rjava/ as a reference document for users wishing to use Java with R. The idea of the PR was to make our R builds a bit more holistic and consistent but based on the arguments made above I agree it may be one or two steps too much in the wrong direction. Let's make sure we can get OpenBLAS into Ubuntu 20.04 R builds and then we should close this PR. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yeah, it's kind of both opinionated and minimal. We do some opinionated things that aren't completely minimal, like including OpenBLAS and the Do you still want to explicitly set There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, setting |
||
/opt/R/${R_VERSION} | ||
|
||
shopt -s extglob | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,7 @@ fpm \ | |
-d unzip \ | ||
-d zip \ | ||
-d zlib1g-dev \ | ||
-d openjdk-11-jdk \ | ||
/opt/R/${R_VERSION} | ||
|
||
shopt -s extglob | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,7 @@ fpm \ | |
-d unzip \ | ||
-d zip \ | ||
-d zlib1g-dev \ | ||
-d openjdk-8-jdk \ | ||
/opt/R/${R_VERSION} | ||
|
||
shopt -s extglob | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,7 @@ fpm \ | |
-d unzip \ | ||
-d zip \ | ||
-d zlib1g-dev \ | ||
-d openjdk-11-jdk \ | ||
/opt/R/${R_VERSION} | ||
|
||
shopt -s extglob | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -53,6 +53,7 @@ fpm \ | |
-d unzip \ | ||
-d zip \ | ||
-d zlib1g-dev \ | ||
-d openjdk-11-jdk \ | ||
/opt/R/${R_VERSION} | ||
|
||
shopt -s extglob | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -52,6 +52,7 @@ fpm \ | |
-d unzip \ | ||
-d zip \ | ||
-d zlib1g-dev \ | ||
-d openjdk-11-jdk \ | ||
/opt/R/${R_VERSION} | ||
|
||
shopt -s extglob | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While working on RHEL 9 support and trying to incorporate these improvements there, I learned that the default R from EPEL/Fedora uses a completely unversioned path that's managed by the alternatives system:
From quick testing, using
JAVA_HOME=/usr/lib/jvm/jre
seems to support even major Java version switches without having to runR CMD javareconf
. Switching from Java 11 to 17 seemed to just work, although switching from Java 11/17 to 8 still required aR CMD javareconf
since some paths changed from 8 to 11:What do you think of using this completely unversioned alternatives path? It doesn't work for all major version switches, but would at least accommodate users going from 11 to 17. And would also match EPEL/Fedora R's behavior.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I found similar behavior with the Java packages on openSUSE/SLES 15.3. The path they use there is
/usr/lib64/jvm
:There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would suggest we keep the version number encoded in
JAVA_HOME
, e.g./usr/lib/jvm/jre-11-openjdk
. As you point out, moving between java 11 and 17 seem to work but not when moving to 8 (not without ajavareconf
).The idea of this PR is to make Java integration a bit more seamless. I am not sure if we are creating more issues by moving to the extremely generic path compared to the issues that we are trying to solve.