Skip to content
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

MAPREDUCE-7449: Add add-opens flag to container launch commands on JDK17 nodes #5935

Merged
merged 3 commits into from Aug 10, 2023

Conversation

brumi1024
Copy link
Member

@brumi1024 brumi1024 commented Aug 9, 2023

Description of PR

To allow containers to launch on JDK17 nodes the add-opens flag should be added to the container launch commands if the node has JDK17+, and it shouldn't on previous JDKs. This behaviour should be configurable.

How was this patch tested?

Tested on a JDK17 cluster.

For code changes:

  • Does the title or this PR starts with the corresponding JIRA issue id (e.g. 'HADOOP-17799. Your PR title ...')?
  • Object storage: have the integration tests been executed and the endpoint declared according to the connector-specific documentation?
  • If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under ASF 2.0?
  • If applicable, have you updated the LICENSE, LICENSE-binary, NOTICE-binary files?

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 35s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 xmllint 0m 0s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 2 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 1s Maven dependency ordering for branch
+1 💚 mvninstall 20m 18s trunk passed
+1 💚 compile 10m 31s trunk passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04
+1 💚 compile 9m 47s trunk passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
+1 💚 checkstyle 2m 28s trunk passed
+1 💚 mvnsite 4m 18s trunk passed
+1 💚 javadoc 3m 59s trunk passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04
+1 💚 javadoc 3m 47s trunk passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
+1 💚 spotbugs 6m 12s trunk passed
+1 💚 shadedclient 21m 33s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 24s Maven dependency ordering for patch
+1 💚 mvninstall 2m 13s the patch passed
+1 💚 compile 9m 59s the patch passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04
+1 💚 javac 9m 59s the patch passed
+1 💚 compile 9m 48s the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
+1 💚 javac 9m 48s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 2m 24s /results-checkstyle-root.txt root: The patch generated 7 new + 731 unchanged - 1 fixed = 738 total (was 732)
+1 💚 mvnsite 4m 15s the patch passed
+1 💚 javadoc 3m 55s the patch passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04
+1 💚 javadoc 3m 47s the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
+1 💚 spotbugs 6m 59s the patch passed
+1 💚 shadedclient 21m 33s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 0m 59s hadoop-yarn-api in the patch passed.
+1 💚 unit 22m 1s hadoop-yarn-server-nodemanager in the patch passed.
+1 💚 unit 6m 1s hadoop-mapreduce-client-core in the patch passed.
+1 💚 unit 7m 8s hadoop-mapreduce-client-app in the patch passed.
-1 ❌ unit 128m 6s /patch-unit-hadoop-mapreduce-project_hadoop-mapreduce-client_hadoop-mapreduce-client-jobclient.txt hadoop-mapreduce-client-jobclient in the patch passed.
+1 💚 unit 21m 44s hadoop-yarn-applications-distributedshell in the patch passed.
+1 💚 asflicense 0m 57s The patch does not generate ASF License warnings.
355m 50s
Reason Tests
Failed junit tests hadoop.mapreduce.v2.TestMRJobs
hadoop.mapreduce.v2.TestUberAM
hadoop.mapreduce.v2.TestMRJobsWithProfiler
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5935/1/artifact/out/Dockerfile
GITHUB PR #5935
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets xmllint
uname Linux 89f96d331ba7 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / ff1bd30
Default Java Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5935/1/testReport/
Max. process+thread count 1618 (vs. ulimit of 5500)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5935/1/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@slfan1989
Copy link
Contributor

LGTM.

@@ -170,6 +170,13 @@ public static String expandEnvironment(String var,
var = var.replace(ApplicationConstants.CLASS_PATH_SEPARATOR,
File.pathSeparator);

if (Shell.isJavaVersionAtLeast(17)) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just wondering about this. Wouldn't a node-manager config be easer to reason about?

Implementing like this is a bit strange, currently MR jobs can be configured (default=true) and the distributed shell app sets this regardless of the configuration. During the job submission/config time it's not clear if container will be launched on a Java>=17 node so that's the reason for the placeholder, later ContainerLaunch replaces it to the arg or an empty string. Maybe non MR apps would also require this option to run properly - which they could specify at the job config - but non-homogenous nodes (where nodes have different Java installs) can't be handled easily (maybe with node labels or some other trick).

I think this should be a node-manager config instead. The ContainerLaunch could just simply add the arg when the java version is at least 17 and the config option is set (if we can detect that the container is a java app, not sure about that).

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since it is not trivial to detect when and where to add this argument, I think the current solution is OK as is.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Had an offline discussion with @tomicooler, the issue with not using a placeholder is the way commands is contructed: in contrast to it's name and type it's a String list containing one element only, the command that is to be executed. In case of Java apps we must add this parameter before the main class, hence I see two options here: add the placeholder right after -Xmx (so that we know it'll be in the correct place) or I can deconstruct the first element of the commands array and add the add-opens flag to the correct place. I think the former is a cleaner, less error-prone solution.

@brumi1024
Copy link
Member Author

Unit tests are failing on trunk as well, MAPREDUCE-7436 was opened because of them.

@brumi1024
Copy link
Member Author

Uploaded a checkstyle fix. I've resolved most of them, however I've left the indentation issues as is, where the rest of the file is similarly indented.

" 0" +
" 1><LOG_DIR>/stdout" +
" 2><LOG_DIR>/stderr ]", app.launchCmdList.get(0));
" -Djava.net.preferIPv4Stack=true" +
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

avoid space

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed, thanks.

Copy link
Contributor

@tomicooler tomicooler left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, LGTM.

@slfan1989
Copy link
Contributor

@brumi1024 Thank you very much for your contribution! I have a question to ask. Do you compile Hadoop using JDK17 in your production environment, or do you use JDK8 to compile and run it under JDK17?

@brumi1024
Copy link
Member Author

brumi1024 commented Aug 10, 2023

@brumi1024 Thank you very much for your contribution! I have a question to ask. Do you compile Hadoop using JDK17 in your production environment, or do you use JDK8 to compile and run it under JDK17?

@slfan1989 The latter. I did compile the code using JDK8 and run it on a JDK17 cluster.

@slfan1989
Copy link
Contributor

@brumi1024 Thank you very much for your contribution! I have a question to ask. Do you compile Hadoop using JDK17 in your production environment, or do you use JDK8 to compile and run it under JDK17?

@slfan1989 The latter. I did compile the code using JDK8 and run it on a JDK17 cluster.

@brumi1024 Thank you very much for your explanation!

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 30s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 0s codespell was not available.
+0 🆗 detsecrets 0m 0s detect-secrets was not available.
+0 🆗 xmllint 0m 0s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 2 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 13m 59s Maven dependency ordering for branch
+1 💚 mvninstall 24m 51s trunk passed
+1 💚 compile 11m 36s trunk passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04
+1 💚 compile 10m 3s trunk passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
+1 💚 checkstyle 2m 28s trunk passed
+1 💚 mvnsite 4m 18s trunk passed
+1 💚 javadoc 3m 59s trunk passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04
+1 💚 javadoc 3m 46s trunk passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
+1 💚 spotbugs 6m 26s trunk passed
+1 💚 shadedclient 23m 32s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 23s Maven dependency ordering for patch
+1 💚 mvninstall 2m 17s the patch passed
+1 💚 compile 10m 56s the patch passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04
+1 💚 javac 10m 56s the patch passed
+1 💚 compile 10m 57s the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
+1 💚 javac 10m 57s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 2m 32s /results-checkstyle-root.txt root: The patch generated 3 new + 719 unchanged - 13 fixed = 722 total (was 732)
+1 💚 mvnsite 4m 14s the patch passed
+1 💚 javadoc 3m 55s the patch passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04
+1 💚 javadoc 3m 47s the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
+1 💚 spotbugs 6m 57s the patch passed
+1 💚 shadedclient 21m 39s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 0m 58s hadoop-yarn-api in the patch passed.
+1 💚 unit 22m 4s hadoop-yarn-server-nodemanager in the patch passed.
+1 💚 unit 6m 2s hadoop-mapreduce-client-core in the patch passed.
+1 💚 unit 7m 4s hadoop-mapreduce-client-app in the patch passed.
-1 ❌ unit 128m 30s /patch-unit-hadoop-mapreduce-project_hadoop-mapreduce-client_hadoop-mapreduce-client-jobclient.txt hadoop-mapreduce-client-jobclient in the patch passed.
+1 💚 unit 21m 44s hadoop-yarn-applications-distributedshell in the patch passed.
+1 💚 asflicense 0m 57s The patch does not generate ASF License warnings.
366m 14s
Reason Tests
Failed junit tests hadoop.mapreduce.v2.TestMRJobs
hadoop.mapreduce.v2.TestUberAM
hadoop.mapreduce.v2.TestMRJobsWithProfiler
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5935/2/artifact/out/Dockerfile
GITHUB PR #5935
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets xmllint
uname Linux ff50c7240bb9 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 30b25c7
Default Java Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5935/2/testReport/
Max. process+thread count 1618 (vs. ulimit of 5500)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5935/2/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@brumi1024 brumi1024 merged commit 85b3ea6 into apache:trunk Aug 10, 2023
1 of 2 checks passed
@brumi1024 brumi1024 deleted the MAPREDUCE-7449 branch August 10, 2023 20:47
@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 42s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+0 🆗 codespell 0m 1s codespell was not available.
+0 🆗 detsecrets 0m 1s detect-secrets was not available.
+0 🆗 xmllint 0m 1s xmllint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 2 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 50s Maven dependency ordering for branch
+1 💚 mvninstall 31m 39s trunk passed
+1 💚 compile 17m 35s trunk passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04
+1 💚 compile 15m 56s trunk passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
+1 💚 checkstyle 4m 41s trunk passed
+1 💚 mvnsite 6m 4s trunk passed
+1 💚 javadoc 5m 40s trunk passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04
+1 💚 javadoc 5m 20s trunk passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
+1 💚 spotbugs 9m 17s trunk passed
+1 💚 shadedclient 34m 31s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 31s Maven dependency ordering for patch
+1 💚 mvninstall 3m 13s the patch passed
+1 💚 compile 16m 19s the patch passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04
+1 💚 javac 16m 19s the patch passed
+1 💚 compile 16m 26s the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
+1 💚 javac 16m 26s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 4m 27s /results-checkstyle-root.txt root: The patch generated 4 new + 732 unchanged - 1 fixed = 736 total (was 733)
+1 💚 mvnsite 6m 5s the patch passed
+1 💚 javadoc 5m 34s the patch passed with JDK Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04
+1 💚 javadoc 5m 15s the patch passed with JDK Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
+1 💚 spotbugs 10m 16s the patch passed
+1 💚 shadedclient 34m 47s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 1m 23s hadoop-yarn-api in the patch passed.
+1 💚 unit 24m 39s hadoop-yarn-server-nodemanager in the patch passed.
+1 💚 unit 7m 46s hadoop-mapreduce-client-core in the patch passed.
+1 💚 unit 8m 52s hadoop-mapreduce-client-app in the patch passed.
-1 ❌ unit 141m 33s /patch-unit-hadoop-mapreduce-project_hadoop-mapreduce-client_hadoop-mapreduce-client-jobclient.txt hadoop-mapreduce-client-jobclient in the patch passed.
+1 💚 unit 22m 56s hadoop-yarn-applications-distributedshell in the patch passed.
+1 💚 asflicense 1m 26s The patch does not generate ASF License warnings.
466m 27s
Reason Tests
Failed junit tests hadoop.mapreduce.v2.TestUberAM
hadoop.mapreduce.v2.TestMRJobsWithProfiler
hadoop.mapreduce.v2.TestMRJobs
Subsystem Report/Notes
Docker ClientAPI=1.43 ServerAPI=1.43 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5935/3/artifact/out/Dockerfile
GITHUB PR #5935
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient spotbugs checkstyle codespell detsecrets xmllint
uname Linux 14279c839f9a 4.15.0-213-generic #224-Ubuntu SMP Mon Jun 19 13:30:12 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 0aeb444
Default Java Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.20+8-post-Ubuntu-1ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_382-8u382-ga-1~20.04.1-b05
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5935/3/testReport/
Max. process+thread count 1609 (vs. ulimit of 5500)
modules C: hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-nodemanager hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-core hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-app hadoop-mapreduce-project/hadoop-mapreduce-client/hadoop-mapreduce-client-jobclient hadoop-yarn-project/hadoop-yarn/hadoop-yarn-applications/hadoop-yarn-applications-distributedshell U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-5935/3/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

brumi1024 added a commit to brumi1024/hadoop that referenced this pull request Oct 19, 2023
steveloughran pushed a commit that referenced this pull request Oct 20, 2023
jiajunmao pushed a commit to jiajunmao/hadoop-MLEC that referenced this pull request Feb 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants