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

HADOOP-19050. SDK Add Support for AWS S3 Access Grants #6507

Closed
wants to merge 13 commits into from

Conversation

jxhan3
Copy link

@jxhan3 jxhan3 commented Jan 27, 2024

Description of PR

Add support for AWS S3 Access Grants(https://aws.amazon.com/s3/features/access-grants/)

How was this patch tested?

Run all integration tests with scale, assume role and KMS.

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 32s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s 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.
+0 🆗 shelldocs 0m 0s Shelldocs was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 34s Maven dependency ordering for branch
+1 💚 mvninstall 30m 46s trunk passed
+1 💚 compile 16m 17s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 compile 14m 54s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 checkstyle 4m 13s trunk passed
+1 💚 mvnsite 18m 58s trunk passed
+1 💚 javadoc 8m 59s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 7m 28s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+0 🆗 spotbugs 0m 19s branch/hadoop-project no spotbugs output file (spotbugsXml.xml)
+1 💚 shadedclient 60m 57s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 1m 33s Maven dependency ordering for patch
-1 ❌ mvninstall 0m 20s /patch-mvninstall-hadoop-tools_hadoop-aws.txt hadoop-aws in the patch failed.
-1 ❌ mvninstall 28m 39s /patch-mvninstall-root.txt root in the patch failed.
-1 ❌ compile 15m 23s /patch-compile-root-jdkUbuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04.txt root in the patch failed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04.
-1 ❌ javac 15m 23s /patch-compile-root-jdkUbuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04.txt root in the patch failed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04.
-1 ❌ compile 14m 45s /patch-compile-root-jdkPrivateBuild-1.8.0_392-8u392-ga-1~20.04-b08.txt root in the patch failed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08.
-1 ❌ javac 14m 45s /patch-compile-root-jdkPrivateBuild-1.8.0_392-8u392-ga-1~20.04-b08.txt root in the patch failed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08.
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 4m 58s the patch passed
-1 ❌ mvnsite 4m 50s /patch-mvnsite-root.txt root in the patch failed.
+1 💚 shellcheck 0m 0s No new issues.
+1 💚 javadoc 8m 38s the patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 7m 51s the patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+0 🆗 spotbugs 0m 18s hadoop-project has no data from spotbugs
-1 ❌ spotbugs 0m 23s /patch-spotbugs-hadoop-tools_hadoop-aws.txt hadoop-aws in the patch failed.
-1 ❌ spotbugs 29m 17s /patch-spotbugs-root.txt root in the patch failed.
+1 💚 shadedclient 35m 46s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 749m 22s /patch-unit-root.txt root in the patch failed.
+1 💚 asflicense 1m 28s The patch does not generate ASF License warnings.
1090m 19s
Reason Tests
Failed junit tests hadoop.yarn.server.timelineservice.security.TestTimelineAuthFilterForV2
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/1/artifact/out/Dockerfile
GITHUB PR #6507
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient codespell detsecrets xmllint spotbugs checkstyle shellcheck shelldocs
uname Linux 4f63f73bb90a 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 2152287
Default Java Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/1/testReport/
Max. process+thread count 3991 (vs. ulimit of 5500)
modules C: hadoop-project hadoop-tools/hadoop-aws . U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/1/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2 shellcheck=0.7.0
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@jxhan3
Copy link
Author

jxhan3 commented Jan 30, 2024

The failed junit test is not related to this change. (hadoop.yarn.server.timelineservice.security.TestTimelineAuthFilterForV2)

[INFO] Running org.apache.hadoop.yarn.server.timelineservice.security.TestTimelineAuthFilterForV2
[ERROR] Tests run: 4, Failures: 1, Errors: 0, Skipped: 0, Time elapsed: 21.274 s <<< FAILURE! - in org.apache.hadoop.yarn.server.timelineservice.security.TestTimelineAuthFilterForV2
[ERROR] testPutTimelineEntities{boolean, boolean}[3]  Time elapsed: 6.539 s  <<< FAILURE!
org.opentest4j.AssertionFailedError: expected: <true> but was: <false>
	at org.junit.jupiter.api.AssertionUtils.fail(AssertionUtils.java:55)
	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:40)
	at org.junit.jupiter.api.AssertTrue.assertTrue(AssertTrue.java:35)
	at org.junit.jupiter.api.Assertions.assertTrue(Assertions.java:179)
	at org.apache.hadoop.yarn.server.timelineservice.security.TestTimelineAuthFilterForV2.verifyEntity(TestTimelineAuthFilterForV2.java:295)
	at org.apache.hadoop.yarn.server.timelineservice.security.TestTimelineAuthFilterForV2.testPutTimelineEntities(TestTimelineAuthFilterForV2.java:442)
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:498)
	at org.junit.platform.commons.util.ReflectionUtils.invokeMethod(ReflectionUtils.java:725)
	at org.junit.jupiter.engine.execution.MethodInvocation.proceed(MethodInvocation.java:60)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$ValidatingInvocation.proceed(InvocationInterceptorChain.java:131)
	at org.junit.jupiter.engine.extension.TimeoutExtension.intercept(TimeoutExtension.java:149)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestableMethod(TimeoutExtension.java:140)
	at org.junit.jupiter.engine.extension.TimeoutExtension.interceptTestTemplateMethod(TimeoutExtension.java:92)
	at org.junit.jupiter.engine.execution.ExecutableInvoker$ReflectiveInterceptorCall.lambda$ofVoidMethod$0(ExecutableInvoker.java:115)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.lambda$invoke$0(ExecutableInvoker.java:105)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain$InterceptedInvocation.proceed(InvocationInterceptorChain.java:106)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.proceed(InvocationInterceptorChain.java:64)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.chainAndInvoke(InvocationInterceptorChain.java:45)
	at org.junit.jupiter.engine.execution.InvocationInterceptorChain.invoke(InvocationInterceptorChain.java:37)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:104)
	at org.junit.jupiter.engine.execution.ExecutableInvoker.invoke(ExecutableInvoker.java:98)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.lambda$invokeTestMethod$7(TestMethodTestDescriptor.java:214)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.invokeTestMethod(TestMethodTestDescriptor.java:210)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:135)
	at org.junit.jupiter.engine.descriptor.TestMethodTestDescriptor.execute(TestMethodTestDescriptor.java:66)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask$DefaultDynamicTestExecutor.execute(NodeTestTask.java:226)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask$DefaultDynamicTestExecutor.execute(NodeTestTask.java:204)
	at org.junit.jupiter.engine.descriptor.TestTemplateTestDescriptor.execute(TestTemplateTestDescriptor.java:139)
	at org.junit.jupiter.engine.descriptor.TestTemplateTestDescriptor.lambda$execute$2(TestTemplateTestDescriptor.java:107)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.stream.ReferencePipeline$2$1.accept(ReferencePipeline.java:175)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.accept(ForEachOps.java:183)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.util.stream.ReferencePipeline$Head.forEach(ReferencePipeline.java:647)
	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:272)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485)
	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:272)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485)
	at java.util.stream.ReferencePipeline$7$1.accept(ReferencePipeline.java:272)
	at java.util.ArrayList$ArrayListSpliterator.forEachRemaining(ArrayList.java:1384)
	at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:482)
	at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:472)
	at java.util.stream.ForEachOps$ForEachOp.evaluateSequential(ForEachOps.java:150)
	at java.util.stream.ForEachOps$ForEachOp$OfRef.evaluateSequential(ForEachOps.java:173)
	at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
	at java.util.stream.ReferencePipeline.forEach(ReferencePipeline.java:485)
	at org.junit.jupiter.engine.descriptor.TestTemplateTestDescriptor.execute(TestTemplateTestDescriptor.java:107)
	at org.junit.jupiter.engine.descriptor.TestTemplateTestDescriptor.execute(TestTemplateTestDescriptor.java:42)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:151)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at java.util.ArrayList.forEach(ArrayList.java:1259)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at java.util.ArrayList.forEach(ArrayList.java:1259)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.invokeAll(SameThreadHierarchicalTestExecutorService.java:41)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$6(NodeTestTask.java:155)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$8(NodeTestTask.java:141)
	at org.junit.platform.engine.support.hierarchical.Node.around(Node.java:137)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.lambda$executeRecursively$9(NodeTestTask.java:139)
	at org.junit.platform.engine.support.hierarchical.ThrowableCollector.execute(ThrowableCollector.java:73)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.executeRecursively(NodeTestTask.java:138)
	at org.junit.platform.engine.support.hierarchical.NodeTestTask.execute(NodeTestTask.java:95)
	at org.junit.platform.engine.support.hierarchical.SameThreadHierarchicalTestExecutorService.submit(SameThreadHierarchicalTestExecutorService.java:35)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestExecutor.execute(HierarchicalTestExecutor.java:57)
	at org.junit.platform.engine.support.hierarchical.HierarchicalTestEngine.execute(HierarchicalTestEngine.java:54)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:107)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:88)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.lambda$execute$0(EngineExecutionOrchestrator.java:54)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.withInterceptedStreams(EngineExecutionOrchestrator.java:67)
	at org.junit.platform.launcher.core.EngineExecutionOrchestrator.execute(EngineExecutionOrchestrator.java:52)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:114)
	at org.junit.platform.launcher.core.DefaultLauncher.execute(DefaultLauncher.java:86)
	at org.junit.platform.launcher.core.DefaultLauncherSession$DelegatingLauncher.execute(DefaultLauncherSession.java:86)
	at org.junit.platform.launcher.core.SessionPerRequestLauncher.execute(SessionPerRequestLauncher.java:53)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invokeAllTests(JUnitPlatformProvider.java:142)
	at org.apache.maven.surefire.junitplatform.JUnitPlatformProvider.invoke(JUnitPlatformProvider.java:113)
	at org.apache.maven.surefire.booter.ForkedBooter.invokeProviderInSameClassLoader(ForkedBooter.java:384)
	at org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:345)
	at org.apache.maven.surefire.booter.ForkedBooter.execute(ForkedBooter.java:126)
	at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:418)

@jxhan3
Copy link
Author

jxhan3 commented Jan 30, 2024

Trunk compile tests all passed, but some of the patch compile tests failed. Could someone help to give some pointer how to fix this? Thanks.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 34s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s 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.
+0 🆗 shelldocs 0m 0s Shelldocs was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 29s Maven dependency ordering for branch
+1 💚 mvninstall 30m 39s trunk passed
+1 💚 compile 16m 0s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 compile 14m 52s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 checkstyle 4m 18s trunk passed
+1 💚 mvnsite 18m 38s trunk passed
+1 💚 javadoc 9m 12s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 7m 42s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+0 🆗 spotbugs 0m 18s branch/hadoop-project no spotbugs output file (spotbugsXml.xml)
+1 💚 shadedclient 65m 26s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 10s Maven dependency ordering for patch
-1 ❌ mvninstall 0m 12s /patch-mvninstall-root.txt root in the patch failed.
-1 ❌ mvninstall 0m 11s /patch-mvninstall-hadoop-tools_hadoop-aws.txt hadoop-aws in the patch failed.
-1 ❌ compile 0m 12s /patch-compile-root-jdkUbuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04.txt root in the patch failed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04.
-1 ❌ javac 0m 12s /patch-compile-root-jdkUbuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04.txt root in the patch failed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04.
-1 ❌ compile 0m 11s /patch-compile-root-jdkPrivateBuild-1.8.0_392-8u392-ga-1~20.04-b08.txt root in the patch failed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08.
-1 ❌ javac 0m 11s /patch-compile-root-jdkPrivateBuild-1.8.0_392-8u392-ga-1~20.04-b08.txt root in the patch failed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08.
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 0m 11s /buildtool-patch-checkstyle-root.txt The patch fails to run checkstyle in root
-1 ❌ mvnsite 0m 12s /patch-mvnsite-root.txt root in the patch failed.
+1 💚 shellcheck 0m 0s No new issues.
-1 ❌ javadoc 0m 12s /patch-javadoc-root-jdkUbuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04.txt root in the patch failed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04.
-1 ❌ javadoc 0m 12s /patch-javadoc-root-jdkPrivateBuild-1.8.0_392-8u392-ga-1~20.04-b08.txt root in the patch failed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08.
-1 ❌ spotbugs 0m 12s /patch-spotbugs-root.txt root in the patch failed.
+0 🆗 spotbugs 0m 14s hadoop-project has no data from spotbugs
-1 ❌ spotbugs 0m 11s /patch-spotbugs-hadoop-tools_hadoop-aws.txt hadoop-aws in the patch failed.
-1 ❌ shadedclient 0m 33s patch has errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 0m 11s /patch-unit-root.txt root in the patch failed.
+0 🆗 asflicense 0m 13s ASF License check generated no output?
192m 41s
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/2/artifact/out/Dockerfile
GITHUB PR #6507
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient codespell detsecrets xmllint spotbugs checkstyle shellcheck shelldocs
uname Linux 23daa49c834c 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / c81a92d
Default Java Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/2/testReport/
Max. process+thread count 553 (vs. ulimit of 5500)
modules C: . hadoop-project hadoop-tools/hadoop-aws U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/2/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2 shellcheck=0.7.0
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@adnanhemani
Copy link
Contributor

We realized the failures are likely due to the dependencies being brought in by the S3 Access Grants plugin. We've removed them, as users will be using their own S3 Access Grants plugin JAR in their environments if they'd like this functionality (we should not be shading this plugin with Hadoop).

Local builds are passing after making the dependency exclusions.

@adnanhemani
Copy link
Contributor

@jxhan3 - BTW we have the wrong ticket number here. Correct ticket is HADOOP-19050. Please update this, as the updates from this PR are not making it to the correct ticket.

@jxhan3 jxhan3 changed the title HADOOP-17351, Add Support for AWS S3 Access Grants HADOOP-19050, Add Support for AWS S3 Access Grants Jan 31, 2024
Copy link
Contributor

@ahmarsuhail ahmarsuhail left a comment

Choose a reason for hiding this comment

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

Thanks, suggested some changes. the code changes are simple enough, but I believe this should be separated from the DefaultS3ClientFactory. Would be good know @steveloughran's opinion.

Took a quick look at unit test, looks ok but still need to review that properly. Wondering if we need an ITest, but the only change we're making in S3A is a configuration one..so maybe not.

LICENSE-binary Outdated
@@ -363,7 +363,7 @@ org.objenesis:objenesis:2.6
org.xerial.snappy:snappy-java:1.1.10.4
org.yaml:snakeyaml:2.0
org.wildfly.openssl:wildfly-openssl:1.1.3.Final
software.amazon.awssdk:bundle:jar:2.23.5
Copy link
Contributor

Choose a reason for hiding this comment

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

this shouldn't be here. it's already part of your SDK upgrade PR so cut from here

Copy link
Author

Choose a reason for hiding this comment

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

reverted in the next version

@@ -187,7 +187,7 @@
<make-maven-plugin.version>1.0-beta-1</make-maven-plugin.version>
<surefire.fork.timeout>900</surefire.fork.timeout>
<aws-java-sdk.version>1.12.599</aws-java-sdk.version>
<aws-java-sdk-v2.version>2.23.5</aws-java-sdk-v2.version>
Copy link
Contributor

Choose a reason for hiding this comment

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

cut, SDK upgrade needs to happen separately

Copy link
Author

Choose a reason for hiding this comment

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

revert this as well

@@ -508,6 +508,29 @@
<artifactId>bundle</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
Copy link
Contributor

Choose a reason for hiding this comment

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

this should go in hadoop-project, and then set the dependency here. We should probably also use provided scope, so the jar is optional.

See this PR, which added the client side encryption for example #6164 and this class which checks if the class exists

Copy link
Contributor

Choose a reason for hiding this comment

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

@steveloughran do you have any advice here? I think we should do what we did for Client Side Encryption, have this S3 access grants jar as optional, and create a new client factory which will add the S3 access grants plugin.

If there are other plugins that we want to add in the future, this new client factory can be generalised for that.

Copy link
Contributor

Choose a reason for hiding this comment

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

the plugin should go in bundle.jar. it's meant to be a bundle.

Copy link
Contributor

Choose a reason for hiding this comment

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

these should all be moved into the pom.xml in hadoop-project as that where we define dependencies. look at how we import the sdk dependency in this pom.xml for example.

Copy link
Contributor

@steveloughran steveloughran left a comment

Choose a reason for hiding this comment

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

Commented.

We cannot have any more unshaded aws sdk jars as required on our classpath; removing s3 select in #6144 has simplified our life by removing another optional one.

Do you have a timetable for incorporating this plugging into bundle.jar?

Otherwise, it is critical that if the jar is not on the cross path normal S3 clients can be constructed and used.

This will need documentation. Either in connecting.md or a new file in the same directory src/site/markdown/tools/hadoop-aws

I do not see any integration tests. What is the story here? Is it possible to run the whole mvn verify test run with access grants? if so, adding a paragraph in testing.md would be good, and particular: how to set it up. I am particularly curious about how well the delegation tokens worked...are session credentials supported?

The feature probably also needs an extra line in the "qualifying an SDK" section.

I have not played with S3 access grants and so cannot suggest test cases myself. Given its purpose, it would be good to have tests which not only verify that the cooler can access data, but that in some places they cannot.

@@ -187,7 +187,7 @@
<make-maven-plugin.version>1.0-beta-1</make-maven-plugin.version>
<surefire.fork.timeout>900</surefire.fork.timeout>
<aws-java-sdk.version>1.12.599</aws-java-sdk.version>
<aws-java-sdk-v2.version>2.23.5</aws-java-sdk-v2.version>
<aws-java-sdk-v2.version>2.23.7</aws-java-sdk-v2.version>
Copy link
Contributor

Choose a reason for hiding this comment

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

SDK updates need to be self contained PRs for isolated cherrypick and revert. section in testing.md on the process. Yes, you do have to follow it, including looking at accidental dependency exports and new error messages in the text output.

Copy link
Author

Choose a reason for hiding this comment

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

removed in next version

@@ -508,6 +508,29 @@
<artifactId>bundle</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>software.amazon.s3.accessgrants</groupId>
Copy link
Contributor

Choose a reason for hiding this comment

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

why isn't this in bundle.jar?

  • if it is: it's not needed.
  • If it isn't, why not?

is this new jar going to be mandatory, or optional?

Copy link
Contributor

Choose a reason for hiding this comment

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

This new JAR should be optional - and as per the original instructions the AWS S3 Access Grants team was given by the AWS Java SDK team, this plugin should not be part of the AWS Java SDK nor the SDK bundle. The reasoning behind this was that Java SDKv2 Plugins should be considered as "open source" for the most part as they are only interfaces that anyone can implement and then use wherever they'd like. In other words, the S3 Access Grants plugin should be, in theory, treated as any other open source dependency that we would be utilizing if a customer explicitly enables this in S3A.

So, to further answer the question, we need to find a way to optionally load these classes if a user specifies that they'd like to use the plugin AND provides the JAR on the classpath. That is missing from this PR as of now and @jxhan3 and I will work on it. I think @ahmarsuhail's link above has a good call pattern for doing this - we'll follow this unless you have any other suggestion.

One interesting thing to note - I've seen the S3ExpressPlugin being merged into the AWS Java SDK (which was explicitly not the recommended option by the AWS Java SDK team, per my understanding). I've started further inquiries to find why that's the case - and how this is different than S3 Access Grants. Will report my findings here.

Copy link
Contributor

Choose a reason for hiding this comment

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

@ahmarsuhail put in the work to get s3 express in

* https://github.com/aws/aws-s3-accessgrants-plugin-java-v2/
*/
public static final String AWS_S3_ACCESS_GRANTS_FALLBACK_TO_IAM_ENABLED =
"fs.s3a.access-grants.fallback-to-iam";
Copy link
Contributor

Choose a reason for hiding this comment

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

nit; can you use "." over "-"

S3AccessGrantsPlugin accessGrantsPlugin =
S3AccessGrantsPlugin.builder().enableFallback(s3agFallbackEnabled).build();
builder.addPlugin(accessGrantsPlugin);
LOG.info("s3ag plugin is added to s3 client with fallback: {}", s3agFallbackEnabled);
Copy link
Contributor

Choose a reason for hiding this comment

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

use a LogExactlyOnce. this will get oververbose in processes which create/destroy fs instances

Copy link
Author

Choose a reason for hiding this comment

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

changed in next version


package org.apache.hadoop.fs.s3a;

import org.apache.hadoop.conf.Configuration;
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: review import ordering

/**
* Test S3 Access Grants configurations.
*/
public class TestS3AccessGrantConfiguration {
Copy link
Contributor

Choose a reason for hiding this comment

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

extends AbstractHadoopTestBase


@Test
public void testS3AccessGrantsEnabled() {
Configuration conf = new Configuration();
Copy link
Contributor

Choose a reason for hiding this comment

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

use new Configuration(false) to avoid loading any default values -this avoids integration test settings breaking unit tests. even better: make it a final field

@Test
public void testS3AccessGrantsEnabled() {
Configuration conf = new Configuration();
conf.set(AWS_S3_ACCESS_GRANTS_ENABLED, "true");
Copy link
Contributor

Choose a reason for hiding this comment

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

setBoolean(.., true)

Copy link
Author

Choose a reason for hiding this comment

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

changed in next version

* Flag to enable S3 Access Grants to control authorization to S3 data. More information:
* https://aws.amazon.com/s3/features/access-grants/
* and
* https://github.com/aws/aws-s3-accessgrants-plugin-java-v2/
Copy link
Contributor

Choose a reason for hiding this comment

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

use {@value} in the comments so ides will show the value

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 31s 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.
+0 🆗 shelldocs 0m 1s Shelldocs was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 15m 5s Maven dependency ordering for branch
+1 💚 mvninstall 30m 55s trunk passed
+1 💚 compile 16m 15s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 compile 14m 52s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 checkstyle 4m 13s trunk passed
+1 💚 mvnsite 18m 22s trunk passed
+1 💚 javadoc 8m 29s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 7m 29s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+0 🆗 spotbugs 0m 19s branch/hadoop-project no spotbugs output file (spotbugsXml.xml)
+1 💚 shadedclient 60m 46s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 1m 35s Maven dependency ordering for patch
-1 ❌ mvninstall 0m 20s /patch-mvninstall-hadoop-tools_hadoop-aws.txt hadoop-aws in the patch failed.
-1 ❌ mvninstall 28m 12s /patch-mvninstall-root.txt root in the patch failed.
-1 ❌ compile 15m 13s /patch-compile-root-jdkUbuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04.txt root in the patch failed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04.
-1 ❌ javac 15m 13s /patch-compile-root-jdkUbuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04.txt root in the patch failed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04.
-1 ❌ compile 14m 31s /patch-compile-root-jdkPrivateBuild-1.8.0_392-8u392-ga-1~20.04-b08.txt root in the patch failed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08.
-1 ❌ javac 14m 31s /patch-compile-root-jdkPrivateBuild-1.8.0_392-8u392-ga-1~20.04-b08.txt root in the patch failed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08.
+1 💚 blanks 0m 1s The patch has no blanks issues.
+1 💚 checkstyle 4m 6s the patch passed
-1 ❌ mvnsite 4m 36s /patch-mvnsite-root.txt root in the patch failed.
+1 💚 shellcheck 0m 0s No new issues.
+1 💚 javadoc 8m 30s the patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 7m 29s the patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+0 🆗 spotbugs 0m 19s hadoop-project has no data from spotbugs
-1 ❌ spotbugs 0m 24s /patch-spotbugs-hadoop-tools_hadoop-aws.txt hadoop-aws in the patch failed.
-1 ❌ spotbugs 26m 34s /patch-spotbugs-root.txt root in the patch failed.
+1 💚 shadedclient 31m 43s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 740m 5s /patch-unit-root.txt root in the patch failed.
+1 💚 asflicense 1m 32s The patch does not generate ASF License warnings.
1071m 24s
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/3/artifact/out/Dockerfile
GITHUB PR #6507
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient codespell detsecrets xmllint spotbugs checkstyle shellcheck shelldocs
uname Linux 5c8a8be24ec9 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / a35a0f8
Default Java Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/3/testReport/
Max. process+thread count 4504 (vs. ulimit of 5500)
modules C: hadoop-project hadoop-tools/hadoop-aws . U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/3/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2 shellcheck=0.7.0
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 45s 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.
+0 🆗 shelldocs 0m 0s Shelldocs was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 31s Maven dependency ordering for branch
+1 💚 mvninstall 35m 9s trunk passed
+1 💚 compile 18m 9s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 compile 16m 28s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 checkstyle 4m 38s trunk passed
+1 💚 mvnsite 19m 28s trunk passed
+1 💚 javadoc 8m 46s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 7m 31s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+0 🆗 spotbugs 0m 18s branch/hadoop-project no spotbugs output file (spotbugsXml.xml)
+1 💚 shadedclient 68m 9s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 51s Maven dependency ordering for patch
+1 💚 mvninstall 34m 53s the patch passed
+1 💚 compile 23m 16s the patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javac 23m 16s the patch passed
+1 💚 compile 17m 32s the patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 javac 17m 32s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
+1 💚 checkstyle 4m 39s the patch passed
+1 💚 mvnsite 14m 54s the patch passed
+1 💚 shellcheck 0m 1s No new issues.
+1 💚 javadoc 8m 50s the patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 7m 58s the patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+0 🆗 spotbugs 0m 17s hadoop-project has no data from spotbugs
+1 💚 shadedclient 73m 39s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 784m 55s /patch-unit-root.txt root in the patch passed.
+1 💚 asflicense 1m 28s The patch does not generate ASF License warnings.
1177m 11s
Reason Tests
Failed junit tests hadoop.hdfs.server.datanode.TestDirectoryScanner
hadoop.yarn.webapp.TestWebApp
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/4/artifact/out/Dockerfile
GITHUB PR #6507
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient codespell detsecrets xmllint spotbugs checkstyle shellcheck shelldocs
uname Linux 143e26d5ad39 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / eaa7edc
Default Java Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/4/testReport/
Max. process+thread count 3961 (vs. ulimit of 5500)
modules C: hadoop-project hadoop-tools/hadoop-aws . U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/4/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2 shellcheck=0.7.0
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@adnanhemani
Copy link
Contributor

adnanhemani commented Feb 1, 2024

Hi @steveloughran - thanks for your time on this. We appreciate it a lot. I've responded to your comments inline below:

We cannot have any more unshaded aws sdk jars as required on our classpath; removing s3 select in #6144 has simplified our life by removing another optional one.
Do you have a timetable for incorporating this plugging into bundle.jar?
Otherwise, it is critical that if the jar is not on the cross path normal S3 clients can be constructed and used.

Totally agreed with you on this. @jxhan3 and I will work to make sure this is optional as we do not have any timeline (or known plans) for getting the plugin incorporated into the AWS Java SDKv2 bundle.jar. (More on this in my comment here). If this changes in the future, we'd be glad to reverse any classloading code we may need for now.

This will need documentation. Either in connecting.md or a new file in the same directory src/site/markdown/tools/hadoop-aws

Noted. @jxhan3 will work on this in the next PR revision.

I do not see any integration tests. What is the story here? Is it possible to run the whole mvn verify test run with access grants? if so, adding a paragraph in testing.md would be good, and particular: how to set it up. I am particularly curious about how well the delegation tokens worked...are session credentials supported?

The story currently is, if we treat the plugin as yet another third-party (and optional) dependency, then this PR is only going to be providing the bare minimum code for users to be able to enable the plugin if they explicitly choose to do so. Any issues with the actual functionality of the plugin should be addressed by the plugin itself at their open source GitHub. So then, the only testing that we'd require would be to ensure that if users are explicitly enabling this feature, that S3A is ensuring its S3 clients have the plugin attached. Other open-source contributions (e.g. Iceberg) have accepted this testing model - and I'd also recommend it to reduce the need for redundant test coverage between S3A and the S3 Access Grants plugin.

If you don't agree with this testing model, we can surely try to add additional ITest cases that will both setup and tear down the S3 Access Grants instance, locations, and required grants (to be noted: S3 Access Grants APIs are not free) - and then test both when users should and should not be able to receive access. However, running all existing test cases under this model will be a heavy task that will likely require lots of test case refactoring, as Access Grants are defined on a location-by-location basis. In order to test both when users should and should not have access for each test case will require both additional setup and test code to ensure that those situations can be adequately tested with multiple data locations. I'm not sure that the ROI on making such a large change will be there. Please let me know your thoughts on this.

As for how the feature works, S3 Access Grants will authenticate the credentials to find the IAM user associated with it - then use that identity for the authorization before returning a new set of scoped credentials to actually access the data (in other words, the credentials that are inputted to the S3 client will not be the credentials used to actually access the data). The S3 Access Grants plugin is the mechanism that will do the entire credential vending process and using the vended credentials properly in any calls made from the attached S3 client. As such, session credentials and delegation tokens will work given that the credentials that are passed to the S3 client (using any mechanism) are valid and can be authenticated properly.

The feature probably also needs an extra line in the "qualifying an SDK" section.

Noted. @jxhan3 will work on this in the next PR revision.

@jxhan3
Copy link
Author

jxhan3 commented Feb 1, 2024

Some tests done in EMR cluster: (all successful with expected behavior)

  1. set up AWS IAM roles with S3 Access Grants: read prefix, write prefix, read/write prefix
  2. test on us-east-1 and us-east-2 bucket/prefix
  3. with and without fallback options
  4. hadoop CLI tests: ls, put, get, rm
  5. Spark tests: create table, insert data, select, drop table

Some sample test results:

Hadoop CLI

Disable s3ag:

User can only access prefixes allowed by IAM role. User can not access prefixes through S3 Access Grants.

[hadoop@ip-172-31-12-188 ~]$ hadoop fs -ls s3a://s3ag-pentests-us-east-1/s3ag-test/no-permission/call_center/part-00000-c27cc4b4-c109-4663-89f0-e299e110e266-c000.snappy.parquet
2024-01-04 23:45:35,316 INFO impl.MetricsConfig: Loaded properties from hadoop-metrics2.properties
2024-01-04 23:45:35,389 INFO impl.MetricsSystemImpl: Scheduled Metric snapshot period at 300 second(s).
2024-01-04 23:45:35,389 INFO impl.MetricsSystemImpl: s3a-file-system metrics system started
ls: s3a://s3ag-pentests-us-east-1/s3ag-test/no-permission/call_center/part-00000-c27cc4b4-c109-4663-89f0-e299e110e266-c000.snappy.parquet: getFileStatus on s3a://s3ag-pentests-us-east-1/s3ag-test/no-permission/call_center/part-00000-c27cc4b4-c109-4663-89f0-e299e110e266-c000.snappy.parquet: software.amazon.awssdk.services.s3.model.S3Exception: null (Service: S3, Status Code: 403, Request ID: QFYEZ3KC3MEW4AY8, Extended Request ID: gGebfy8KceHKlMS7WNJ1UXhfwJ9X5bSP5yCZjQu9W1zHkImzPtwHeC/OrwBS4+dcgA3Hq/lvO3WKkIbTkYFgG0nstlCRucsFI+UMffNQZhE=):null
2024-01-04 23:45:38,690 INFO impl.MetricsSystemImpl: Stopping s3a-file-system metrics system...
2024-01-04 23:45:38,691 INFO impl.MetricsSystemImpl: s3a-file-system metrics system stopped.
2024-01-04 23:45:38,691 INFO impl.MetricsSystemImpl: s3a-file-system metrics system shutdown complete.
[hadoop@ip-172-31-12-188 ~]$ hadoop fs -ls s3a://s3ag-pentests-us-east-1/s3ag-test/read-only/call_center/part-00000-c27cc4b4-c109-4663-89f0-e299e110e266-c000.snappy.parquet
2024-01-04 23:45:53,819 INFO impl.MetricsConfig: Loaded properties from hadoop-metrics2.properties
2024-01-04 23:45:53,894 INFO impl.MetricsSystemImpl: Scheduled Metric snapshot period at 300 second(s).
2024-01-04 23:45:53,894 INFO impl.MetricsSystemImpl: s3a-file-system metrics system started
ls: s3a://s3ag-pentests-us-east-1/s3ag-test/read-only/call_center/part-00000-c27cc4b4-c109-4663-89f0-e299e110e266-c000.snappy.parquet: getFileStatus on s3a://s3ag-pentests-us-east-1/s3ag-test/read-only/call_center/part-00000-c27cc4b4-c109-4663-89f0-e299e110e266-c000.snappy.parquet: software.amazon.awssdk.services.s3.model.S3Exception: null (Service: S3, Status Code: 403, Request ID: 9TVV42PQPJZC3KWY, Extended Request ID: eWcoDc2KL7yY9erhwO3x3MEhCVZnNY4zEei52d54xv6AqadNAi9dVYO5xsumIU5uCcKjj03UiiM=):null
2024-01-04 23:45:57,255 INFO impl.MetricsSystemImpl: Stopping s3a-file-system metrics system...
2024-01-04 23:45:57,256 INFO impl.MetricsSystemImpl: s3a-file-system metrics system stopped.
2024-01-04 23:45:57,256 INFO impl.MetricsSystemImpl: s3a-file-system metrics system shutdown complete.
[hadoop@ip-172-31-12-188 ~]$ hadoop fs -ls s3a://s3ag-pentests-public-us-east-1/public-data/student
2024-01-04 23:46:03,094 INFO impl.MetricsConfig: Loaded properties from hadoop-metrics2.properties
2024-01-04 23:46:03,182 INFO impl.MetricsSystemImpl: Scheduled Metric snapshot period at 300 second(s).
2024-01-04 23:46:03,182 INFO impl.MetricsSystemImpl: s3a-file-system metrics system started
Found 3 items
-rw-rw-rw-   1 hadoop hadoop          0 2023-12-16 01:53 s3a://s3ag-pentests-public-us-east-1/public-data/student/_SUCCESS
-rw-rw-rw-   1 hadoop hadoop        923 2023-12-16 01:53 s3a://s3ag-pentests-public-us-east-1/public-data/student/part-00000-f9c0fdd5-9280-4714-906c-74ac1ce34396-c000.snappy.parquet
-rw-rw-rw-   1 hadoop hadoop        958 2023-12-16 01:53 s3a://s3ag-pentests-public-us-east-1/public-data/student/part-00001-f9c0fdd5-9280-4714-906c-74ac1ce34396-c000.snappy.parquet
2024-01-04 23:46:06,616 INFO impl.MetricsSystemImpl: Stopping s3a-file-system metrics system...
2024-01-04 23:46:06,617 INFO impl.MetricsSystemImpl: s3a-file-system metrics system stopped.
2024-01-04 23:46:06,617 INFO impl.MetricsSystemImpl: s3a-file-system metrics system shutdown complete.
s3ag enabled without fallback:
User can only access prefixes through s3ag, no access through IAM role policy.

[hadoop@ip-172-31-12-188 ~]$ hadoop fs -ls s3a://s3ag-pentests-us-east-1/s3ag-test/no-permission/call_center/part-00000-c27cc4b4-c109-4663-89f0-e299e110e266-c000.snappy.parquet
2024-01-04 23:49:06,683 INFO impl.MetricsConfig: Loaded properties from hadoop-metrics2.properties
2024-01-04 23:49:06,758 INFO impl.MetricsSystemImpl: Scheduled Metric snapshot period at 300 second(s).
2024-01-04 23:49:06,758 INFO impl.MetricsSystemImpl: s3a-file-system metrics system started
2024-01-04 23:49:06,982 INFO s3a.DefaultS3ClientFactory: s3ag plugin is added to s3 client with fallback: false
2024-01-04 23:49:07,350 INFO awssdk.s3accessgrants: Configuring S3 Clients to use S3 Access Grants as a permission layer!
2024-01-04 23:49:07,351 INFO awssdk.s3accessgrants: Running the S3 Access grants plugin with fallback setting enabled : false
2024-01-04 23:49:07,351 WARN awssdk.s3accessgrants: Fallback not opted in! S3 Client will not fall back to evaluate policies if permissions are not provided through S3 Access Grants!
2024-01-04 23:49:07,703 INFO s3a.DefaultS3ClientFactory: s3ag plugin is added to s3 client with fallback: false
2024-01-04 23:49:07,708 INFO awssdk.s3accessgrants: Configuring S3 Clients to use S3 Access Grants as a permission layer!
2024-01-04 23:49:07,708 INFO awssdk.s3accessgrants: Running the S3 Access grants plugin with fallback setting enabled : false
2024-01-04 23:49:07,708 WARN awssdk.s3accessgrants: Fallback not opted in! S3 Client will not fall back to evaluate policies if permissions are not provided through S3 Access Grants!
2024-01-04 23:49:08,607 ERROR awssdk.s3accessgrants:  Fall back not enabled! An attempt will not be made to evaluate permissions through policies! You do not have READ permissions to the requested S3 Prefix: s3://s3ag-pentests-us-east-1/s3ag-test/no-permission/call_center/part-00000-c27cc4b4-c109-4663-89f0-e299e110e266-c000.snappy.parquet (Service: S3Control, Status Code: 403, Request ID: Z1BX4G3KXP5N57FQ, Extended Request ID: 0Cd6I4pJN3kjMGkWJLYJ9DpSub7LF8qV7npVc+AVAEkrrvavxqHrH6M7F3RcSjJ0d4SGbQ0gMgI=)
2024-01-04 23:49:10,005 ERROR awssdk.s3accessgrants:  Fall back not enabled! An attempt will not be made to evaluate permissions through policies! You do not have READ permissions to the requested S3 Prefix: s3://s3ag-pentests-us-east-1/s3ag-test/no-permission/call_center/part-00000-c27cc4b4-c109-4663-89f0-e299e110e266-c000.snappy.parquet (Service: S3Control, Status Code: 403, Request ID: WYDP6Y4RS5JHXZH0, Extended Request ID: ZVHmHxGdwt1gcf+XvPxcG1Q6wKW+NoWQjPEOH1bQ0rw1vXEHOxf2He7BqKrATpyPM9qKhijfldE=)
2024-01-04 23:49:11,119 ERROR awssdk.s3accessgrants:  Fall back not enabled! An attempt will not be made to evaluate permissions through policies! You do not have READ permissions to the requested S3 Prefix: s3://s3ag-pentests-us-east-1/s3ag-test/no-permission/call_center/part-00000-c27cc4b4-c109-4663-89f0-e299e110e266-c000.snappy.parquet (Service: S3Control, Status Code: 403, Request ID: Q6YWP5BMJH3EMJ5E, Extended Request ID: ED0WOerUKT6sIA6pJkSHLjBuNHtb3A+YLwJSmPPtLr9RnMR8RMGwNth/gp96atFxFqu5tw5RQrc=)
^C2024-01-04 23:49:12,289 INFO impl.MetricsSystemImpl: Stopping s3a-file-system metrics system...
2024-01-04 23:49:12,290 INFO impl.MetricsSystemImpl: s3a-file-system metrics system stopped.
2024-01-04 23:49:12,290 INFO impl.MetricsSystemImpl: s3a-file-system metrics system shutdown complete.
[hadoop@ip-172-31-12-188 ~]$ hadoop fs -ls s3a://s3ag-pentests-us-east-1/s3ag-test/read-only/call_center/part-00000-c27cc4b4-c109-4663-89f0-e299e110e266-c000.snappy.parquet
2024-01-04 23:49:21,415 INFO impl.MetricsConfig: Loaded properties from hadoop-metrics2.properties
2024-01-04 23:49:21,484 INFO impl.MetricsSystemImpl: Scheduled Metric snapshot period at 300 second(s).
2024-01-04 23:49:21,484 INFO impl.MetricsSystemImpl: s3a-file-system metrics system started
2024-01-04 23:49:21,746 INFO s3a.DefaultS3ClientFactory: s3ag plugin is added to s3 client with fallback: false
2024-01-04 23:49:22,150 INFO awssdk.s3accessgrants: Configuring S3 Clients to use S3 Access Grants as a permission layer!
2024-01-04 23:49:22,150 INFO awssdk.s3accessgrants: Running the S3 Access grants plugin with fallback setting enabled : false
2024-01-04 23:49:22,150 WARN awssdk.s3accessgrants: Fallback not opted in! S3 Client will not fall back to evaluate policies if permissions are not provided through S3 Access Grants!
2024-01-04 23:49:22,519 INFO s3a.DefaultS3ClientFactory: s3ag plugin is added to s3 client with fallback: false
2024-01-04 23:49:22,524 INFO awssdk.s3accessgrants: Configuring S3 Clients to use S3 Access Grants as a permission layer!
2024-01-04 23:49:22,525 INFO awssdk.s3accessgrants: Running the S3 Access grants plugin with fallback setting enabled : false
2024-01-04 23:49:22,525 WARN awssdk.s3accessgrants: Fallback not opted in! S3 Client will not fall back to evaluate policies if permissions are not provided through S3 Access Grants!
-rw-rw-rw-   1 hadoop hadoop      16171 2023-09-28 22:40 s3a://s3ag-pentests-us-east-1/s3ag-test/read-only/call_center/part-00000-c27cc4b4-c109-4663-89f0-e299e110e266-c000.snappy.parquet
2024-01-04 23:49:23,518 INFO impl.MetricsSystemImpl: Stopping s3a-file-system metrics system...
2024-01-04 23:49:23,519 INFO impl.MetricsSystemImpl: s3a-file-system metrics system stopped.
2024-01-04 23:49:23,519 INFO impl.MetricsSystemImpl: s3a-file-system metrics system shutdown complete.
[hadoop@ip-172-31-12-188 ~]$ hadoop fs -ls s3a://s3ag-pentests-public-us-east-1/public-data/student
2024-01-04 23:49:32,856 INFO impl.MetricsConfig: Loaded properties from hadoop-metrics2.properties
2024-01-04 23:49:32,931 INFO impl.MetricsSystemImpl: Scheduled Metric snapshot period at 300 second(s).
2024-01-04 23:49:32,931 INFO impl.MetricsSystemImpl: s3a-file-system metrics system started
2024-01-04 23:49:33,150 INFO s3a.DefaultS3ClientFactory: s3ag plugin is added to s3 client with fallback: false
2024-01-04 23:49:33,502 INFO awssdk.s3accessgrants: Configuring S3 Clients to use S3 Access Grants as a permission layer!
2024-01-04 23:49:33,503 INFO awssdk.s3accessgrants: Running the S3 Access grants plugin with fallback setting enabled : false
2024-01-04 23:49:33,503 WARN awssdk.s3accessgrants: Fallback not opted in! S3 Client will not fall back to evaluate policies if permissions are not provided through S3 Access Grants!
2024-01-04 23:49:33,884 INFO s3a.DefaultS3ClientFactory: s3ag plugin is added to s3 client with fallback: false
2024-01-04 23:49:33,890 INFO awssdk.s3accessgrants: Configuring S3 Clients to use S3 Access Grants as a permission layer!
2024-01-04 23:49:33,890 INFO awssdk.s3accessgrants: Running the S3 Access grants plugin with fallback setting enabled : false
2024-01-04 23:49:33,890 WARN awssdk.s3accessgrants: Fallback not opted in! S3 Client will not fall back to evaluate policies if permissions are not provided through S3 Access Grants!
2024-01-04 23:49:34,768 ERROR awssdk.s3accessgrants:  Fall back not enabled! An attempt will not be made to evaluate permissions through policies! You do not have READ permissions to the requested S3 Prefix: s3://s3ag-pentests-public-us-east-1/public-data/student (Service: S3Control, Status Code: 403, Request ID: ZDAJDP6V0D3NZQ0M, Extended Request ID: 55bTDN5MiE1PuFke4i/usBbBNaLs/YfTjY5HozvO2UuUOWk53Y7dSHBUF2HSkRnQ5Moz8QyapZE=)
2024-01-04 23:49:35,875 ERROR awssdk.s3accessgrants:  Fall back not enabled! An attempt will not be made to evaluate permissions through policies! You do not have READ permissions to the requested S3 Prefix: s3://s3ag-pentests-public-us-east-1/public-data/student (Service: S3Control, Status Code: 403, Request ID: XX1BX2A8466G9HR4, Extended Request ID: HAWcKBUCFfrxPQxQ1OlJ+efo5Mm+cEQwGTAHbDPBf0IlxT08aS9VKJ2qztY2oijyoWrjaoBuA8c=)
2024-01-04 23:49:38,554 ERROR awssdk.s3accessgrants:  Fall back not enabled! An attempt will not be made to evaluate permissions through policies! You do not have READ permissions to the requested S3 Prefix: s3://s3ag-pentests-public-us-east-1/public-data/student (Service: S3Control, Status Code: 403, Request ID: A2CED63V79H2N1H5, Extended Request ID: wbVQnvVmgP2z0yH8LICndPLJEKqLo9QCD3r9j0aA8j+8exOQ8rFhibfxqoTwElNesM7xkPuEU1o=)
^C2024-01-04 23:49:43,256 INFO impl.MetricsSystemImpl: Stopping s3a-file-system metrics system...
2024-01-04 23:49:43,256 INFO impl.MetricsSystemImpl: s3a-file-system metrics system stopped.
2024-01-04 23:49:43,256 INFO impl.MetricsSystemImpl: s3a-file-system metrics system shutdown complete.

s3ag is enabled with fallback:

User can access prefixes through s3ag. If s3ag failed to give credentials, user can access prefixes through IAM role policy.

[hadoop@ip-172-31-12-188 ~]$ hadoop fs -ls s3a://s3ag-pentests-us-east-1/s3ag-test/no-permission/call_center/part-00000-c27cc4b4-c109-4663-89f0-e299e110e266-c000.snappy.parquet
2024-01-04 23:47:50,869 INFO impl.MetricsConfig: Loaded properties from hadoop-metrics2.properties
2024-01-04 23:47:50,944 INFO impl.MetricsSystemImpl: Scheduled Metric snapshot period at 300 second(s).
2024-01-04 23:47:50,944 INFO impl.MetricsSystemImpl: s3a-file-system metrics system started
2024-01-04 23:47:51,167 INFO s3a.DefaultS3ClientFactory: s3ag plugin is added to s3 client with fallback: true
2024-01-04 23:47:51,532 INFO awssdk.s3accessgrants: Configuring S3 Clients to use S3 Access Grants as a permission layer!
2024-01-04 23:47:51,533 INFO awssdk.s3accessgrants: Running the S3 Access grants plugin with fallback setting enabled : true
2024-01-04 23:47:51,904 INFO s3a.DefaultS3ClientFactory: s3ag plugin is added to s3 client with fallback: true
2024-01-04 23:47:51,910 INFO awssdk.s3accessgrants: Configuring S3 Clients to use S3 Access Grants as a permission layer!
2024-01-04 23:47:51,910 INFO awssdk.s3accessgrants: Running the S3 Access grants plugin with fallback setting enabled : true
ls: s3a://s3ag-pentests-us-east-1/s3ag-test/no-permission/call_center/part-00000-c27cc4b4-c109-4663-89f0-e299e110e266-c000.snappy.parquet: getFileStatus on s3a://s3ag-pentests-us-east-1/s3ag-test/no-permission/call_center/part-00000-c27cc4b4-c109-4663-89f0-e299e110e266-c000.snappy.parquet: software.amazon.awssdk.services.s3.model.S3Exception: null (Service: S3, Status Code: 403, Request ID: CQ1TDZ06A5KJRG4S, Extended Request ID: HxoeE1vhbHCx0ujsdUj9GmA9xPMIP8e0nraPHXaVERhpf+Fsg1jKVPXlAwOZ8AMW+Zl9OJVY20o=):null
2024-01-04 23:47:52,893 INFO impl.MetricsSystemImpl: Stopping s3a-file-system metrics system...
2024-01-04 23:47:52,894 INFO impl.MetricsSystemImpl: s3a-file-system metrics system stopped.
2024-01-04 23:47:52,894 INFO impl.MetricsSystemImpl: s3a-file-system metrics system shutdown complete.
[hadoop@ip-172-31-12-188 ~]$ hadoop fs -ls s3a://s3ag-pentests-us-east-1/s3ag-test/read-only/call_center/part-00000-c27cc4b4-c109-4663-89f0-e299e110e266-c000.snappy.parquet
2024-01-04 23:48:08,137 INFO impl.MetricsConfig: Loaded properties from hadoop-metrics2.properties
2024-01-04 23:48:08,218 INFO impl.MetricsSystemImpl: Scheduled Metric snapshot period at 300 second(s).
2024-01-04 23:48:08,218 INFO impl.MetricsSystemImpl: s3a-file-system metrics system started
2024-01-04 23:48:08,467 INFO s3a.DefaultS3ClientFactory: s3ag plugin is added to s3 client with fallback: true
2024-01-04 23:48:08,818 INFO awssdk.s3accessgrants: Configuring S3 Clients to use S3 Access Grants as a permission layer!
2024-01-04 23:48:08,818 INFO awssdk.s3accessgrants: Running the S3 Access grants plugin with fallback setting enabled : true
2024-01-04 23:48:09,181 INFO s3a.DefaultS3ClientFactory: s3ag plugin is added to s3 client with fallback: true
2024-01-04 23:48:09,186 INFO awssdk.s3accessgrants: Configuring S3 Clients to use S3 Access Grants as a permission layer!
2024-01-04 23:48:09,186 INFO awssdk.s3accessgrants: Running the S3 Access grants plugin with fallback setting enabled : true
-rw-rw-rw-   1 hadoop hadoop      16171 2023-09-28 22:40 s3a://s3ag-pentests-us-east-1/s3ag-test/read-only/call_center/part-00000-c27cc4b4-c109-4663-89f0-e299e110e266-c000.snappy.parquet
2024-01-04 23:48:10,243 INFO impl.MetricsSystemImpl: Stopping s3a-file-system metrics system...
2024-01-04 23:48:10,243 INFO impl.MetricsSystemImpl: s3a-file-system metrics system stopped.
2024-01-04 23:48:10,243 INFO impl.MetricsSystemImpl: s3a-file-system metrics system shutdown complete.
[hadoop@ip-172-31-12-188 ~]$ hadoop fs -ls s3a://s3ag-pentests-public-us-east-1/public-data/student
2024-01-04 23:48:15,733 INFO impl.MetricsConfig: Loaded properties from hadoop-metrics2.properties
2024-01-04 23:48:15,801 INFO impl.MetricsSystemImpl: Scheduled Metric snapshot period at 300 second(s).
2024-01-04 23:48:15,801 INFO impl.MetricsSystemImpl: s3a-file-system metrics system started
2024-01-04 23:48:16,015 INFO s3a.DefaultS3ClientFactory: s3ag plugin is added to s3 client with fallback: true
2024-01-04 23:48:16,400 INFO awssdk.s3accessgrants: Configuring S3 Clients to use S3 Access Grants as a permission layer!
2024-01-04 23:48:16,400 INFO awssdk.s3accessgrants: Running the S3 Access grants plugin with fallback setting enabled : true
2024-01-04 23:48:16,770 INFO s3a.DefaultS3ClientFactory: s3ag plugin is added to s3 client with fallback: true
2024-01-04 23:48:16,776 INFO awssdk.s3accessgrants: Configuring S3 Clients to use S3 Access Grants as a permission layer!
2024-01-04 23:48:16,776 INFO awssdk.s3accessgrants: Running the S3 Access grants plugin with fallback setting enabled : true
Found 3 items
-rw-rw-rw-   1 hadoop hadoop          0 2023-12-16 01:53 s3a://s3ag-pentests-public-us-east-1/public-data/student/_SUCCESS
-rw-rw-rw-   1 hadoop hadoop        923 2023-12-16 01:53 s3a://s3ag-pentests-public-us-east-1/public-data/student/part-00000-f9c0fdd5-9280-4714-906c-74ac1ce34396-c000.snappy.parquet
-rw-rw-rw-   1 hadoop hadoop        958 2023-12-16 01:53 s3a://s3ag-pentests-public-us-east-1/public-data/student/part-00001-f9c0fdd5-9280-4714-906c-74ac1ce34396-c000.snappy.parquet
2024-01-04 23:48:17,994 INFO impl.MetricsSystemImpl: Stopping s3a-file-system metrics system...
2024-01-04 23:48:17,994 INFO impl.MetricsSystemImpl: s3a-file-system metrics system stopped.
2024-01-04 23:48:17,994 INFO impl.MetricsSystemImpl: s3a-file-system metrics system shutdown complete.

Spark

s3ag is enabled without fallback:

User can only access prefixes through s3ag, not IAM role policy.

spark-sql (default)> CREATE EXTERNAL TABLE student1 (id INT, name STRING, age INT) STORED AS PARQUET LOCATION 's3a://s3ag-pentests-us-east-1/s3ag-test/no-permission/student';
01:15:06.595 [main] INFO  software.amazon.awssdk.s3accessgrants - Configuring S3 Clients to use S3 Access Grants as a permission layer!
01:15:06.599 [main] INFO  software.amazon.awssdk.s3accessgrants - Running the S3 Access grants plugin with fallback setting enabled : false
01:15:06.599 [main] WARN  software.amazon.awssdk.s3accessgrants - Fallback not opted in! S3 Client will not fall back to evaluate policies if permissions are not provided through S3 Access Grants!
01:15:06.855 [main] INFO  software.amazon.awssdk.s3accessgrants - Configuring S3 Clients to use S3 Access Grants as a permission layer!
01:15:06.855 [main] INFO  software.amazon.awssdk.s3accessgrants - Running the S3 Access grants plugin with fallback setting enabled : false
01:15:06.855 [main] WARN  software.amazon.awssdk.s3accessgrants - Fallback not opted in! S3 Client will not fall back to evaluate policies if permissions are not provided through S3 Access Grants!
01:15:07.548 [sdk-async-response-4-1] ERROR software.amazon.awssdk.s3accessgrants -  Fall back not enabled! An attempt will not be made to evaluate permissions through policies! You do not have READ permissions to the requested S3 Prefix: s3://s3ag-pentests-us-east-1/s3ag-test/no-permission/student (Service: S3Control, Status Code: 403, Request ID: F3554YCBFFXHSTQP, Extended Request ID: +jQxJC+veSefVVKr5tngBk5+0QtVQc+A8q2o7wmiHS8GW2GsoiyYZ61+kLr2wtjjwJV3qucHqHc=)

spark-sql (default)> CREATE EXTERNAL TABLE student1 (id INT, name STRING, age INT) STORED AS PARQUET LOCATION 's3a://s3ag-pentests-us-east-1/s3ag-test/read-write/student';
23:54:02.661 [main] INFO  software.amazon.awssdk.s3accessgrants - Configuring S3 Clients to use S3 Access Grants as a permission layer!
23:54:02.665 [main] INFO  software.amazon.awssdk.s3accessgrants - Running the S3 Access grants plugin with fallback setting enabled : false
23:54:02.666 [main] WARN  software.amazon.awssdk.s3accessgrants - Fallback not opted in! S3 Client will not fall back to evaluate policies if permissions are not provided through S3 Access Grants!
23:54:02.917 [main] INFO  software.amazon.awssdk.s3accessgrants - Configuring S3 Clients to use S3 Access Grants as a permission layer!
23:54:02.917 [main] INFO  software.amazon.awssdk.s3accessgrants - Running the S3 Access grants plugin with fallback setting enabled : false
23:54:02.917 [main] WARN  software.amazon.awssdk.s3accessgrants - Fallback not opted in! S3 Client will not fall back to evaluate policies if permissions are not provided through S3 Access Grants!
Time taken: 3.081 seconds
spark-sql (default)> INSERT INTO student1 VALUES (1001, 'Amy Smith', 5),(1002, 'Kate Brown', 6),(1003, 'Jim White', 7),(1004, 'Sam Lee', 8),(1005, 'Youna Kim', 8),(1006, 'Grayson Miller', 7),(1007, 'Cathy Johnson', 10);
Time taken: 9.765 seconds
spark-sql (default)> select * from student1;
1001    Amy Smith       5
1002    Kate Brown      6
1003    Jim White       7
1007    Cathy Johnson   10
1006    Grayson Miller  7
1004    Sam Lee 8
1005    Youna Kim       8
1006    Grayson Miller  7
1007    Cathy Johnson   10
1004    Sam Lee 8
1005    Youna Kim       8
1006    Grayson Miller  7
1007    Cathy Johnson   10
1001    Amy Smith       5
1003    Jim White       7
1005    Youna Kim       8
1002    Kate Brown      6
1001    Amy Smith       5
1002    Kate Brown      6
1003    Jim White       7
1004    Sam Lee 8
Time taken: 1.329 seconds, Fetched 21 row(s)
spark-sql (default)> drop table student1;
Time taken: 0.571 seconds


spark-sql (default)> CREATE EXTERNAL TABLE student1 (id INT, name STRING, age INT) STORED AS PARQUET LOCATION 's3a://s3ag-pentests-public-us-east-1/public-data/student';
00:26:54.976 [main] INFO  software.amazon.awssdk.s3accessgrants - Configuring S3 Clients to use S3 Access Grants as a permission layer!
00:26:54.980 [main] INFO  software.amazon.awssdk.s3accessgrants - Running the S3 Access grants plugin with fallback setting enabled : false
00:26:54.980 [main] WARN  software.amazon.awssdk.s3accessgrants - Fallback not opted in! S3 Client will not fall back to evaluate policies if permissions are not provided through S3 Access Grants!
00:26:55.293 [main] INFO  software.amazon.awssdk.s3accessgrants - Configuring S3 Clients to use S3 Access Grants as a permission layer!
00:26:55.293 [main] INFO  software.amazon.awssdk.s3accessgrants - Running the S3 Access grants plugin with fallback setting enabled : false
00:26:55.293 [main] WARN  software.amazon.awssdk.s3accessgrants - Fallback not opted in! S3 Client will not fall back to evaluate policies if permissions are not provided through S3 Access Grants!
00:26:55.974 [sdk-async-response-4-1] ERROR software.amazon.awssdk.s3accessgrants -  Fall back not enabled! An attempt will not be made to evaluate permissions through policies! You do not have READ permissions to the requested S3 Prefix: s3://s3ag-pentests-public-us-east-1/public-data/student (Service: S3Control, Status Code: 403, Request ID: 9VKYTPAS5EP4WXP2, Extended Request ID: 41OBWQC5tl06EhmMaiHUQ88ytKu4cku+7GMGOo6TfxDdR5cQ0WvYPkNAmY76JKB0GQBTu9y0MVU=)
s3ag is enabled with fallback:
User can access prefixes through s3ag. If s3ag failed to provide credentials, user can access prefixes though IAM role policy.

spark-sql (default)> CREATE EXTERNAL TABLE student1 (id INT, name STRING, age INT) STORED AS PARQUET LOCATION 's3a://s3ag-pentests-us-east-1/s3ag-test/no-permission/student';
01:13:32.912 [main] INFO  software.amazon.awssdk.s3accessgrants - Configuring S3 Clients to use S3 Access Grants as a permission layer!
01:13:32.916 [main] INFO  software.amazon.awssdk.s3accessgrants - Running the S3 Access grants plugin with fallback setting enabled : true
01:13:33.190 [main] INFO  software.amazon.awssdk.s3accessgrants - Configuring S3 Clients to use S3 Access Grants as a permission layer!
01:13:33.191 [main] INFO  software.amazon.awssdk.s3accessgrants - Running the S3 Access grants plugin with fallback setting enabled : true
01:13:33.982 [main] ERROR hive.log - Got exception: java.nio.file.AccessDeniedException s3a://s3ag-pentests-us-east-1/s3ag-test/no-permission/student: getFileStatus on s3a://s3ag-pentests-us-east-1/s3ag-test/no-permission/student: software.amazon.awssdk.services.s3.model.S3Exception: null (Service: S3, Status Code: 403, Request ID: F86ZGAJ08RHN67XX, Extended Request ID: A0s6FRvxdh44IJHv7nU+fDR9oZ4PKD6Oc/G2V3cjlPjOlCFZwVA2QZ3XTCrPIbRmOPrLjlhlNQ8=):null
java.nio.file.AccessDeniedException: s3a://s3ag-pentests-us-east-1/s3ag-test/no-permission/student: getFileStatus on s3a://s3ag-pentests-us-east-1/s3ag-test/no-permission/student: software.amazon.awssdk.services.s3.model.S3Exception: null (Service: S3, Status Code: 403, Request ID: F86ZGAJ08RHN67XX, Extended Request ID: A0s6FRvxdh44IJHv7nU+fDR9oZ4PKD6Oc/G2V3cjlPjOlCFZwVA2QZ3XTCrPIbRmOPrLjlhlNQ8=):null

spark-sql (default)> CREATE EXTERNAL TABLE student1 (id INT, name STRING, age INT) STORED AS PARQUET LOCATION 's3a://s3ag-pentests-us-east-1/s3ag-test/read-write/student';
00:28:11.960 [main] INFO  software.amazon.awssdk.s3accessgrants - Configuring S3 Clients to use S3 Access Grants as a permission layer!
00:28:11.964 [main] INFO  software.amazon.awssdk.s3accessgrants - Running the S3 Access grants plugin with fallback setting enabled : true
00:28:12.216 [main] INFO  software.amazon.awssdk.s3accessgrants - Configuring S3 Clients to use S3 Access Grants as a permission layer!
00:28:12.216 [main] INFO  software.amazon.awssdk.s3accessgrants - Running the S3 Access grants plugin with fallback setting enabled : true
Time taken: 3.086 seconds
spark-sql (default)> INSERT INTO student1 VALUES (1001, 'Amy Smith', 5),(1002, 'Kate Brown', 6),(1003, 'Jim White', 7),(1004, 'Sam Lee', 8),(1005, 'Youna Kim', 8),(1006, 'Grayson Miller', 7),(1007, 'Cathy Johnson', 10);
Time taken: 6.506 seconds
spark-sql (default)> select * from student1;
1004    Sam Lee 8
1005    Youna Kim       8
1006    Grayson Miller  7
1007    Cathy Johnson   10
1004    Sam Lee 8
1005    Youna Kim       8
1006    Grayson Miller  7
1007    Cathy Johnson   10
1006    Grayson Miller  7
1006    Grayson Miller  7
1007    Cathy Johnson   10
1007    Cathy Johnson   10
1001    Amy Smith       5
1002    Kate Brown      6
1003    Jim White       7
1001    Amy Smith       5
1002    Kate Brown      6
1003    Jim White       7
1002    Kate Brown      6
1002    Kate Brown      6
1003    Jim White       7
1003    Jim White       7
1005    Youna Kim       8
1005    Youna Kim       8
1001    Amy Smith       5
1001    Amy Smith       5
1004    Sam Lee 8
1004    Sam Lee 8
Time taken: 1.282 seconds, Fetched 28 row(s)
spark-sql (default)> drop table student1;
Time taken: 0.43 seconds
spark-sql (default)> CREATE EXTERNAL TABLE student1 (id INT, name STRING, age INT) STORED AS PARQUET LOCATION 's3a://s3ag-pentests-public-us-east-1/public-data/student';
00:28:51.638 [main] INFO  software.amazon.awssdk.s3accessgrants - Configuring S3 Clients to use S3 Access Grants as a permission layer!
00:28:51.638 [main] INFO  software.amazon.awssdk.s3accessgrants - Running the S3 Access grants plugin with fallback setting enabled : true
00:28:51.642 [main] INFO  software.amazon.awssdk.s3accessgrants - Configuring S3 Clients to use S3 Access Grants as a permission layer!
00:28:51.643 [main] INFO  software.amazon.awssdk.s3accessgrants - Running the S3 Access grants plugin with fallback setting enabled : true
Time taken: 0.583 seconds
spark-sql (default)> 
                   > ;
spark-sql (default)> INSERT INTO student1 VALUES (1001, 'Amy Smith', 5),(1002, 'Kate Brown', 6),(1003, 'Jim White', 7),(1004, 'Sam Lee', 8),(1005, 'Youna Kim', 8),(1006, 'Grayson Miller', 7),(1007, 'Cathy Johnson', 10);
Time taken: 3.916 seconds
spark-sql (default)> 
                   > ;
spark-sql (default)> select * from student1;
1004    Sam Lee 8
1005    Youna Kim       8
1006    Grayson Miller  7
1007    Cathy Johnson   10
1006    Grayson Miller  7
1007    Cathy Johnson   10
1001    Amy Smith       5
1002    Kate Brown      6
1003    Jim White       7
1002    Kate Brown      6
1003    Jim White       7
1005    Youna Kim       8
1001    Amy Smith       5
1004    Sam Lee 8
Time taken: 0.982 seconds, Fetched 14 row(s)
spark-sql (default)> drop table student1;
Time taken: 0.077 seconds

s3ag is disabled:

User can only access prefixes through IAM role policy, not s3ag.

spark-sql (default)> CREATE EXTERNAL TABLE student1 (id INT, name STRING, age INT) STORED AS PARQUET LOCATION 's3a://s3ag-pentests-us-east-1/s3ag-test/no-permission/student';
01:17:00.011 [main] ERROR hive.log - Got exception: java.nio.file.AccessDeniedException s3a://s3ag-pentests-us-east-1/s3ag-test/no-permission/student: getFileStatus on s3a://s3ag-pentests-us-east-1/s3ag-test/no-permission/student: software.amazon.awssdk.services.s3.model.S3Exception: null (Service: S3, Status Code: 403, Request ID: 4WNMHR9SQBTJN1EH, Extended Request ID: tJuQcHQCBzwLWd6IerngFKdAdz4klNAAi7ufUgZURgJiVMJjYmG7CeBYD+XSMT9moQzk1B4L1Ls=):null
java.nio.file.AccessDeniedException: s3a://s3ag-pentests-us-east-1/s3ag-test/no-permission/student: getFileStatus on s3a://s3ag-pentests-us-east-1/s3ag-test/no-permission/student: software.amazon.awssdk.services.s3.model.S3Exception: null (Service: S3, Status Code: 403, Request ID: 4WNMHR9SQBTJN1EH, Extended Request ID: tJuQcHQCBzwLWd6IerngFKdAdz4klNAAi7ufUgZURgJiVMJjYmG7CeBYD+XSMT9moQzk1B4L1Ls=):null

spark-sql (default)> CREATE EXTERNAL TABLE student1 (id INT, name STRING, age INT) STORED AS PARQUET LOCATION 's3a://s3ag-pentests-us-east-1/s3ag-test/read-write/student';
00:31:13.960 [main] ERROR hive.log - Got exception: java.nio.file.AccessDeniedException s3a://s3ag-pentests-us-east-1/s3ag-test/read-write/student: getFileStatus on s3a://s3ag-pentests-us-east-1/s3ag-test/read-write/student: software.amazon.awssdk.services.s3.model.S3Exception: null (Service: S3, Status Code: 403, Request ID: GAY7RMCG51DR6968, Extended Request ID: GqRCHwooGmUDC5MzGpfKOasprj2jnxb3sCscKtAKFZ+vZ87lvoIvQ8nZ+rLA4Q66Kh54wtfWWks=):null

spark-sql (default)> CREATE EXTERNAL TABLE student1 (id INT, name STRING, age INT) STORED AS PARQUET LOCATION 's3a://s3ag-pentests-public-us-east-1/public-data/student';
Time taken: 0.438 seconds
spark-sql (default)> INSERT INTO student1 VALUES (1001, 'Amy Smith', 5),(1002, 'Kate Brown', 6),(1003, 'Jim White', 7),(1004, 'Sam Lee', 8),(1005, 'Youna Kim', 8),(1006, 'Grayson Miller', 7),(1007, 'Cathy Johnson', 10);
Time taken: 7.929 seconds
spark-sql (default)> select * from student1;
1001    Amy Smith       5
1002    Kate Brown      6
1003    Jim White       7
1007    Cathy Johnson   10
1006    Grayson Miller  7
1004    Sam Lee 8
1005    Youna Kim       8
1006    Grayson Miller  7
1007    Cathy Johnson   10
1004    Sam Lee 8
1005    Youna Kim       8
1006    Grayson Miller  7
1007    Cathy Johnson   10
1001    Amy Smith       5
1003    Jim White       7
1005    Youna Kim       8
1002    Kate Brown      6
1001    Amy Smith       5
1002    Kate Brown      6
1003    Jim White       7
1004    Sam Lee 8
Time taken: 1.117 seconds, Fetched 21 row(s)
spark-sql (default)> drop table student1;
Time taken: 0.44 seconds

@jxhan3
Copy link
Author

jxhan3 commented Feb 1, 2024

Local verification is running, update soon.

@adnanhemani
Copy link
Contributor

@jxhan3 can you please put the output from your console testing onto the comments here? No need to paste the actual grants but just say which ones have grants and should be successful or not. It would be nice to have the actual output noted on this CR itself as proof.

@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.
+0 🆗 shelldocs 0m 0s Shelldocs was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 32s Maven dependency ordering for branch
+1 💚 mvninstall 30m 58s trunk passed
+1 💚 compile 16m 15s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 compile 14m 50s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 checkstyle 4m 45s trunk passed
+1 💚 mvnsite 18m 39s trunk passed
+1 💚 javadoc 8m 27s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 7m 29s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+0 🆗 spotbugs 0m 19s branch/hadoop-project no spotbugs output file (spotbugsXml.xml)
+1 💚 shadedclient 60m 30s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 34s Maven dependency ordering for patch
+1 💚 mvninstall 28m 43s the patch passed
+1 💚 compile 15m 39s the patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javac 15m 39s the patch passed
+1 💚 compile 14m 51s the patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 javac 14m 51s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 4m 3s /results-checkstyle-root.txt root: The patch generated 5 new + 2 unchanged - 0 fixed = 7 total (was 2)
+1 💚 mvnsite 13m 33s the patch passed
+1 💚 shellcheck 0m 0s No new issues.
+1 💚 javadoc 8m 24s the patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 7m 32s the patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+0 🆗 spotbugs 0m 19s hadoop-project has no data from spotbugs
+1 💚 shadedclient 61m 1s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 746m 38s /patch-unit-root.txt root in the patch passed.
+1 💚 asflicense 1m 35s The patch does not generate ASF License warnings.
1090m 33s
Reason Tests
Failed junit tests hadoop.hdfs.server.datanode.TestDirectoryScanner
hadoop.hdfs.TestRollingUpgrade
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/5/artifact/out/Dockerfile
GITHUB PR #6507
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient codespell detsecrets xmllint spotbugs checkstyle shellcheck shelldocs
uname Linux 2741712011d2 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 167fecd
Default Java Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/5/testReport/
Max. process+thread count 4193 (vs. ulimit of 5500)
modules C: hadoop-project hadoop-tools/hadoop-aws . U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/5/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2 shellcheck=0.7.0
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@jxhan3 jxhan3 force-pushed the HDFS-17351 branch 2 times, most recently from 8382af8 to 347cc9f Compare February 3, 2024 03:18
@jxhan3
Copy link
Author

jxhan3 commented Feb 3, 2024

Test optional plugin:

  1. if plugin is in class path, same result
  2. if plugin is not in class path:


hadoop@ip-172-31-35-222 ~]$ hadoop fs -ls s3a://s3ag-pentests-us-east-1/s3ag-test/read-only/sample-pyspark.py
2024-02-03 03:16:01,189 INFO impl.MetricsConfig: Loaded properties from hadoop-metrics2.properties
2024-02-03 03:16:01,270 INFO impl.MetricsSystemImpl: Scheduled Metric snapshot period at 300 second(s).
2024-02-03 03:16:01,270 INFO impl.MetricsSystemImpl: s3a-file-system metrics system started
2024-02-03 03:16:01,348 WARN impl.ConfigurationHelper: Option fs.s3a.connection.establish.timeout is too low (5,000 ms). Setting to 15,000 ms instead
2024-02-03 03:16:01,510 WARN tools.S3AccessGrantsUtil: s3ag plugin is not available.
ls: s3a://s3ag-pentests-us-east-1/s3ag-test/read-only/sample-pyspark.py: getFileStatus on s3a://s3ag-pentests-us-east-1/s3ag-test/read-only/sample-pyspark.py: software.amazon.awssdk.services.s3.model.S3Exception: null (Service: S3, Status Code: 403, Request ID: 4Y02S3N6HM5A1NBQ, Extended Request ID: Kish6CPduYPD6y/2+iSeW8ZlcPJGLJ/Ef0Q9lhN7eVX+OG8TkvpMpgaXSy27tg5pJEnJIiyuugA=):null
2024-02-03 03:16:04,593 INFO impl.MetricsSystemImpl: Stopping s3a-file-system metrics system...
2024-02-03 03:16:04,593 INFO impl.MetricsSystemImpl: s3a-file-system metrics system stopped.
2024-02-03 03:16:04,594 INFO impl.MetricsSystemImpl: s3a-file-system metrics system shutdown complete.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 11m 19s 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.
+0 🆗 shelldocs 0m 0s Shelldocs was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 15m 10s Maven dependency ordering for branch
+1 💚 mvninstall 31m 19s trunk passed
+1 💚 compile 16m 9s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 compile 14m 44s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 checkstyle 4m 14s trunk passed
+1 💚 mvnsite 19m 1s trunk passed
+1 💚 javadoc 8m 21s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 7m 31s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+0 🆗 spotbugs 0m 19s branch/hadoop-project no spotbugs output file (spotbugsXml.xml)
+1 💚 shadedclient 60m 32s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 34s Maven dependency ordering for patch
+1 💚 mvninstall 29m 3s the patch passed
+1 💚 compile 15m 47s the patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javac 15m 47s the patch passed
+1 💚 compile 14m 58s the patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 javac 14m 58s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 4m 3s /results-checkstyle-root.txt root: The patch generated 8 new + 2 unchanged - 0 fixed = 10 total (was 2)
+1 💚 mvnsite 13m 33s the patch passed
+1 💚 shellcheck 0m 0s No new issues.
+1 💚 javadoc 8m 56s the patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 7m 32s the patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+0 🆗 spotbugs 0m 19s hadoop-project has no data from spotbugs
+1 💚 shadedclient 61m 1s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 746m 36s /patch-unit-root.txt root in the patch passed.
+1 💚 asflicense 1m 32s The patch does not generate ASF License warnings.
1102m 26s
Reason Tests
Failed junit tests hadoop.yarn.webapp.TestWebApp
hadoop.hdfs.TestRollingUpgrade
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/6/artifact/out/Dockerfile
GITHUB PR #6507
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient codespell detsecrets xmllint spotbugs checkstyle shellcheck shelldocs
uname Linux 8d079798773f 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 8382af8
Default Java Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/6/testReport/
Max. process+thread count 3517 (vs. ulimit of 5500)
modules C: hadoop-project hadoop-tools/hadoop-aws . U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/6/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2 shellcheck=0.7.0
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 34s 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.
+0 🆗 shelldocs 0m 0s Shelldocs was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 31s Maven dependency ordering for branch
+1 💚 mvninstall 30m 32s trunk passed
+1 💚 compile 16m 20s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 compile 14m 53s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 checkstyle 4m 12s trunk passed
+1 💚 mvnsite 18m 14s trunk passed
+1 💚 javadoc 8m 30s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 7m 34s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+0 🆗 spotbugs 0m 19s branch/hadoop-project no spotbugs output file (spotbugsXml.xml)
+1 💚 shadedclient 60m 19s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 33s Maven dependency ordering for patch
+1 💚 mvninstall 29m 2s the patch passed
+1 💚 compile 15m 55s the patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javac 15m 55s the patch passed
+1 💚 compile 14m 46s the patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 javac 14m 46s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 4m 14s /results-checkstyle-root.txt root: The patch generated 7 new + 2 unchanged - 0 fixed = 9 total (was 2)
+1 💚 mvnsite 13m 51s the patch passed
+1 💚 shellcheck 0m 0s No new issues.
+1 💚 javadoc 8m 21s the patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 7m 34s the patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+0 🆗 spotbugs 0m 19s hadoop-project has no data from spotbugs
+1 💚 shadedclient 62m 14s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 742m 0s /patch-unit-root.txt root in the patch passed.
-1 ❌ asflicense 1m 35s /results-asflicense.txt The patch generated 1 ASF License warnings.
1086m 27s
Reason Tests
Failed junit tests hadoop.hdfs.server.datanode.TestDirectoryScanner
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/8/artifact/out/Dockerfile
GITHUB PR #6507
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient codespell detsecrets xmllint spotbugs checkstyle shellcheck shelldocs
uname Linux be58e8be39f5 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / b404c2d
Default Java Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/8/testReport/
Max. process+thread count 4013 (vs. ulimit of 5500)
modules C: hadoop-project hadoop-tools/hadoop-aws . U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/8/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2 shellcheck=0.7.0
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Logfile Comment
+0 🆗 reexec 0m 48s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s 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.
+0 🆗 shelldocs 0m 0s Shelldocs was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 28s Maven dependency ordering for branch
+1 💚 mvninstall 34m 54s trunk passed
+1 💚 compile 18m 16s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 compile 16m 52s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 checkstyle 4m 44s trunk passed
+1 💚 mvnsite 19m 23s trunk passed
+1 💚 javadoc 8m 47s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 7m 31s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+0 🆗 spotbugs 0m 18s branch/hadoop-project no spotbugs output file (spotbugsXml.xml)
+1 💚 shadedclient 67m 25s branch has no errors when building and testing our client artifacts.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 32s Maven dependency ordering for patch
+1 💚 mvninstall 33m 47s the patch passed
+1 💚 compile 17m 53s the patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javac 17m 53s the patch passed
+1 💚 compile 17m 3s the patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 javac 17m 3s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 4m 35s /results-checkstyle-root.txt root: The patch generated 7 new + 2 unchanged - 0 fixed = 9 total (was 2)
+1 💚 mvnsite 14m 40s the patch passed
+1 💚 shellcheck 0m 0s No new issues.
+1 💚 javadoc 8m 37s the patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 7m 29s the patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+0 🆗 spotbugs 0m 18s hadoop-project has no data from spotbugs
-1 ❌ spotbugs 1m 14s /new-spotbugs-hadoop-tools_hadoop-aws.html hadoop-tools/hadoop-aws generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
-1 ❌ spotbugs 31m 30s /new-spotbugs-root.html root generated 1 new + 0 unchanged - 0 fixed = 1 total (was 0)
+1 💚 shadedclient 68m 35s patch has no errors when building and testing our client artifacts.
_ Other Tests _
-1 ❌ unit 792m 8s /patch-unit-root.txt root in the patch passed.
-1 ❌ asflicense 1m 31s /results-asflicense.txt The patch generated 1 ASF License warnings.
1171m 11s
Reason Tests
SpotBugs module:hadoop-tools/hadoop-aws
Useless object stored in variable argTypes of method org.apache.hadoop.fs.s3a.DefaultS3ClientFactory.applyS3AccessGrantsConfigurations(S3BaseClientBuilder, Configuration) At DefaultS3ClientFactory.java:argTypes of method org.apache.hadoop.fs.s3a.DefaultS3ClientFactory.applyS3AccessGrantsConfigurations(S3BaseClientBuilder, Configuration) At DefaultS3ClientFactory.java:[line 421]
SpotBugs module:root
Useless object stored in variable argTypes of method org.apache.hadoop.fs.s3a.DefaultS3ClientFactory.applyS3AccessGrantsConfigurations(S3BaseClientBuilder, Configuration) At DefaultS3ClientFactory.java:argTypes of method org.apache.hadoop.fs.s3a.DefaultS3ClientFactory.applyS3AccessGrantsConfigurations(S3BaseClientBuilder, Configuration) At DefaultS3ClientFactory.java:[line 421]
Failed junit tests hadoop.hdfs.server.datanode.TestDirectoryScanner
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/7/artifact/out/Dockerfile
GITHUB PR #6507
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient codespell detsecrets xmllint spotbugs checkstyle shellcheck shelldocs
uname Linux 686a24e04556 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 347cc9f
Default Java Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/7/testReport/
Max. process+thread count 3705 (vs. ulimit of 5500)
modules C: hadoop-project hadoop-tools/hadoop-aws . U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/7/console
versions git=2.25.1 maven=3.6.3 spotbugs=4.2.2 shellcheck=0.7.0
Powered by Apache Yetus 0.14.0 https://yetus.apache.org

This message was automatically generated.

applyS3AccessGrantsConfigurations(BuilderT builder, Configuration conf) {
boolean s3agEnabled = conf.getBoolean(AWS_S3_ACCESS_GRANTS_ENABLED, false);
if (!s3agEnabled){
LOG_EXACTLY_ONCE.debug("s3ag plugin is not enabled.");
Copy link
Contributor

Choose a reason for hiding this comment

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

On all logs, can we use the full name: "S3 Access Grants..." to make it clear for users looking through the logs?

Copy link
Contributor

Choose a reason for hiding this comment

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

this won't work, so basically it will log s3ag plugin is not enabled. once, but then your LOG_EXACTLY_ONCE.debug( "Class {} is not found exception: {}." and wherever else you use it will never log. If you want to log those they will need their own instances of log exactly once.

But also these are debug logs, you don't need to use log exactly once. We do that more when we need to make user logs clearer when logging at warn or info. You can just use a regular logger here in my opinion.

I also don't think you need this s3ag plugin is not enabled. log specifically. it's getting logged for any who is not using S3AG, so not adding any value. instead maybe add a log in the try block Configuring S3 access grants plugin

@adnanhemani
Copy link
Contributor

Hi @steveloughran and @ahmarsuhail - I think this code is in a much more ready state than before and we've attempted to answer the questions you had earlier. Please let us know what other thoughts you have on this.

(Also, I think the Unit Tests are a bit flaky here - not sure what to do about those)

Copy link
Contributor

@ahmarsuhail ahmarsuhail left a comment

Choose a reason for hiding this comment

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

thanks, left some comments.

Also please add documentation. you'll need to add the new config option in index.md and then a new section there explaining how this access grants stuff works. also that if there are any S3 access grant related issues, they should be reported on the plugin github. As all we do is enable it on the S3Client.

applyS3AccessGrantsConfigurations(BuilderT builder, Configuration conf) {
boolean s3agEnabled = conf.getBoolean(AWS_S3_ACCESS_GRANTS_ENABLED, false);
if (!s3agEnabled){
LOG_EXACTLY_ONCE.debug("s3ag plugin is not enabled.");
Copy link
Contributor

Choose a reason for hiding this comment

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

this won't work, so basically it will log s3ag plugin is not enabled. once, but then your LOG_EXACTLY_ONCE.debug( "Class {} is not found exception: {}." and wherever else you use it will never log. If you want to log those they will need their own instances of log exactly once.

But also these are debug logs, you don't need to use log exactly once. We do that more when we need to make user logs clearer when logging at warn or info. You can just use a regular logger here in my opinion.

I also don't think you need this s3ag plugin is not enabled. log specifically. it's getting logged for any who is not using S3AG, so not adding any value. instead maybe add a log in the try block Configuring S3 access grants plugin

@@ -401,4 +409,32 @@ private static Region getS3RegionFromEndpoint(final String endpoint,
return Region.of(AWS_S3_DEFAULT_REGION);
}

public static <BuilderT extends S3BaseClientBuilder<BuilderT, ClientT>, ClientT> void
Copy link
Contributor

Choose a reason for hiding this comment

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

method can be private?

Copy link
Author

Choose a reason for hiding this comment

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

This is for testing purpose, otherwise we may need to use reflection to test private method. Please share your thoughts on this. Thanks.

@@ -0,0 +1,60 @@
package org.apache.hadoop.fs.s3a.tools;

import org.apache.hadoop.conf.Configuration;
Copy link
Contributor

Choose a reason for hiding this comment

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

add apache license to the top of this class (copy it over from any other class)

protected static final Logger LOG =
LoggerFactory.getLogger(S3AccessGrantsUtil.class);

private static final LogExactlyOnce LOG_EXACTLY_ONCE = new LogExactlyOnce(LOG);
Copy link
Contributor

Choose a reason for hiding this comment

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

rename from LOG_EXACTLY_ONCE to what this log is actually for, eg: IAM_FALLBACK_WARN. look at WARN_OF_DEFAULT_REGION_CHAIN in DefaultS3ClientFactory as an example.

S3AccessGrantsPlugin accessGrantsPlugin =
S3AccessGrantsPlugin.builder().enableFallback(s3agFallbackEnabled).build();
builder.addPlugin(accessGrantsPlugin);
LOG_EXACTLY_ONCE.info("s3ag plugin is added to s3 client with fallback: {}", s3agFallbackEnabled);
Copy link
Contributor

Choose a reason for hiding this comment

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

Have two different Loggers that log exactly once for these two different statements.

Copy link
Contributor

Choose a reason for hiding this comment

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

and +1 on @adnanhemani 's comment, let's make these logs uniform so they begin with "S3 access grant ... "

@@ -0,0 +1,60 @@
package org.apache.hadoop.fs.s3a.tools;

Copy link
Contributor

Choose a reason for hiding this comment

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

wrong package for this class, move to the impl package.

assertEquals(builder.plugins().size(), 0);
}
}
}
Copy link
Contributor

Choose a reason for hiding this comment

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

add new line after class

@@ -508,6 +508,29 @@
<artifactId>bundle</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
Copy link
Contributor

Choose a reason for hiding this comment

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

these should all be moved into the pom.xml in hadoop-project as that where we define dependencies. look at how we import the sdk dependency in this pom.xml for example.

@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 1 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 34s Maven dependency ordering for branch
+1 💚 mvninstall 30m 49s trunk passed
+1 💚 compile 16m 23s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 compile 15m 4s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 checkstyle 4m 12s trunk passed
+1 💚 mvnsite 1m 31s trunk passed
+1 💚 javadoc 1m 15s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 1m 20s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+0 🆗 spotbugs 0m 42s branch/hadoop-project no spotbugs output file (spotbugsXml.xml)
+1 💚 shadedclient 32m 57s branch has no errors when building and testing our client artifacts.
-0 ⚠️ patch 33m 21s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 33s Maven dependency ordering for patch
+1 💚 mvninstall 0m 44s the patch passed
+1 💚 compile 15m 37s the patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javac 15m 37s the patch passed
+1 💚 compile 14m 50s the patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 javac 14m 50s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 4m 2s /results-checkstyle-root.txt root: The patch generated 7 new + 2 unchanged - 0 fixed = 9 total (was 2)
+1 💚 mvnsite 1m 28s the patch passed
+1 💚 javadoc 1m 12s the patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 1m 20s the patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+0 🆗 spotbugs 0m 33s hadoop-project has no data from spotbugs
+1 💚 shadedclient 33m 14s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 0m 34s hadoop-project in the patch passed.
+1 💚 unit 3m 12s hadoop-aws in the patch passed.
+1 💚 asflicense 0m 57s The patch does not generate ASF License warnings.
206m 37s
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/9/artifact/out/Dockerfile
GITHUB PR #6507
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient codespell detsecrets xmllint spotbugs checkstyle
uname Linux e44bc4938765 5.15.0-91-generic #101-Ubuntu SMP Tue Nov 14 13:30:08 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / 2bc7c41
Default Java Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/9/testReport/
Max. process+thread count 625 (vs. ulimit of 5500)
modules C: hadoop-project hadoop-tools/hadoop-aws U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/9/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.

@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.
+0 🆗 markdownlint 0m 0s markdownlint was not available.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+0 🆗 mvndep 14m 26s Maven dependency ordering for branch
+1 💚 mvninstall 30m 37s trunk passed
+1 💚 compile 16m 16s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 compile 14m 41s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 checkstyle 4m 41s trunk passed
+1 💚 mvnsite 1m 32s trunk passed
+1 💚 javadoc 1m 12s trunk passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 1m 17s trunk passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+0 🆗 spotbugs 0m 41s branch/hadoop-project no spotbugs output file (spotbugsXml.xml)
+1 💚 shadedclient 32m 58s branch has no errors when building and testing our client artifacts.
-0 ⚠️ patch 33m 22s Used diff version of patch file. Binary files and potentially other changes not applied. Please rebase and squash commits if necessary.
_ Patch Compile Tests _
+0 🆗 mvndep 0m 34s Maven dependency ordering for patch
+1 💚 mvninstall 0m 43s the patch passed
+1 💚 compile 15m 33s the patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javac 15m 33s the patch passed
+1 💚 compile 15m 13s the patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+1 💚 javac 15m 13s the patch passed
+1 💚 blanks 0m 0s The patch has no blanks issues.
-0 ⚠️ checkstyle 4m 4s /results-checkstyle-root.txt root: The patch generated 7 new + 2 unchanged - 0 fixed = 9 total (was 2)
+1 💚 mvnsite 1m 25s the patch passed
+1 💚 javadoc 1m 8s the patch passed with JDK Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04
+1 💚 javadoc 1m 9s the patch passed with JDK Private Build-1.8.0_392-8u392-ga-1~20.04-b08
+0 🆗 spotbugs 0m 34s hadoop-project has no data from spotbugs
+1 💚 shadedclient 34m 27s patch has no errors when building and testing our client artifacts.
_ Other Tests _
+1 💚 unit 0m 32s hadoop-project in the patch passed.
+1 💚 unit 3m 10s hadoop-aws in the patch passed.
+1 💚 asflicense 0m 56s The patch does not generate ASF License warnings.
207m 7s
Subsystem Report/Notes
Docker ClientAPI=1.44 ServerAPI=1.44 base: https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/10/artifact/out/Dockerfile
GITHUB PR #6507
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient codespell detsecrets xmllint spotbugs checkstyle markdownlint
uname Linux e6a0ac0030c9 5.15.0-88-generic #98-Ubuntu SMP Mon Oct 2 15:18:56 UTC 2023 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality dev-support/bin/hadoop.sh
git revision trunk / dcbab4b
Default Java Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Multi-JDK versions /usr/lib/jvm/java-11-openjdk-amd64:Ubuntu-11.0.21+9-post-Ubuntu-0ubuntu120.04 /usr/lib/jvm/java-8-openjdk-amd64:Private Build-1.8.0_392-8u392-ga-1~20.04-b08
Test Results https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/10/testReport/
Max. process+thread count 550 (vs. ulimit of 5500)
modules C: hadoop-project hadoop-tools/hadoop-aws U: .
Console output https://ci-hadoop.apache.org/job/hadoop-multibranch/job/PR-6507/10/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.

@adnanhemani
Copy link
Contributor

Update: I've successfully influenced the S3 Access Grants team and the AWS Java SDK team to include the S3 Access Grants Plugin within the AWS Java SDK bundle. For that, we will require an SDK version upgrade. Will work on that first to ensure we don't require the reflection logic here.

In the meantime, any review on the latest version of this code would be appreciated - it will help me make the logic here solid while we work on the AWS SDK upgrade in parallel.

@adnanhemani
Copy link
Contributor

This has been evolved into #6544. This PR will no longer be used now.

@steveloughran
Copy link
Contributor

@adnanhemani thanks; without that change we'd have problems with the PR, as in "you get to support it all through reflection" the way we have to do with wildfly/openssl binding (NetworkBinding) and more.

Copy link
Contributor

@steveloughran steveloughran left a comment

Choose a reason for hiding this comment

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

@adnanhemani aah. trouble with the decoupling is it misses a key reason we love the bundle jar, despite its weight.

The bundle JAR shades its dependencies which is critical for us so it is possible

  1. For the AWS team to update their dependencies without forcing us to update and cause transitive pain all the way down the stack
  2. Avoids forcing us to freeze the aws jar version because of version conflict.
  3. avoids subtle version conflict between dependencies which only surface in production

These are not hypothetical concerns: we have encountered all of them in previous releases of the v1 SDK to the point where we simply stopped upgrading the AWS SDK as it was trying to dictate versions all the way up the stack. You look for the relevant JIRAs in hadoop 2.x releases if you are curious.

In your new library, you are now importing caffeine. What if we want to use it ourselves? We don't want the AG to force us to upgrade when you do, or stop us upgrading when we want to.

If you want this to get into the hadoop-aws module then I'm afraid you will need to get it into bundle.jar. Please discuss with the SDK team.

<dependency>
<groupId>software.amazon.s3.accessgrants</groupId>
<artifactId>aws-s3-accessgrants-java-plugin</artifactId>
<version>2.0.0</version>
Copy link
Contributor

Choose a reason for hiding this comment

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

can you move this version flag into a property next to the other aws s3 options, at least until this module is merged into bundle.jar. this makes it overrideable

<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>org.assertj</groupId>
Copy link
Contributor

Choose a reason for hiding this comment

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

this should really be scoped as testing in the module itself...

<artifactId>*</artifactId>
</exclusion>
<exclusion>
<groupId>com.github.ben-manes.caffeine</groupId>
Copy link
Contributor

Choose a reason for hiding this comment

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

are you confident this isn't used?

@@ -508,6 +508,29 @@
<artifactId>bundle</artifactId>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>software.amazon.s3.accessgrants</groupId>
Copy link
Contributor

Choose a reason for hiding this comment

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

@ahmarsuhail put in the work to get s3 express in

LOG.debug(
"Class {} is not found exception: {}.",
S3AG_UTIL_CLASSNAME,
e.getStackTrace()
Copy link
Contributor

Choose a reason for hiding this comment

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

  1. pass in e and let the logger handle the rest.
  2. use multiple classes in the catch statement to avoid duplication/maintenance costs

```xml
<configuration>
...
<property>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: use two chars for indentation

applyVerifyS3AGPlugin(S3AsyncClient.builder(), true, false);
}

private Configuration createConfig(boolean isDefault, boolean s3agEnabled) {
Copy link
Contributor

Choose a reason for hiding this comment

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

add javadoc

DefaultS3ClientFactory.applyS3AccessGrantsConfigurations(builder, createConfig(isDefault, enabled));
if (enabled){
assertEquals(1, builder.plugins().size());
assertEquals("software.amazon.awssdk.s3accessgrants.plugin.S3AccessGrantsPlugin",
Copy link
Contributor

Choose a reason for hiding this comment

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

use assertj asserts here

applyVerifyS3AGPlugin(BuilderT builder, boolean isDefault, boolean enabled) {
DefaultS3ClientFactory.applyS3AccessGrantsConfigurations(builder, createConfig(isDefault, enabled));
if (enabled){
assertEquals(1, builder.plugins().size());
Copy link
Contributor

Choose a reason for hiding this comment

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

assert j assert on .hasSize() for list

);
}
else {
assertEquals(builder.plugins().size(), 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

assertj

@steveloughran steveloughran changed the title HADOOP-19050, Add Support for AWS S3 Access Grants HADOOP-19050. SDK Add Support for AWS S3 Access Grants Mar 5, 2024
@adnanhemani
Copy link
Contributor

adnanhemani commented Mar 5, 2024

Hi @steveloughran, as noted in this comment (and the one above it), I’ve made the changes you requested (including getting the S3 Access Grants plugin added to the bundle JAR) in a new PR: #6507 (comment)

#6544 has those changes. Unless I’m misunderstanding what you are commenting about (from what I got, you are advocating for the plugin to be part of the bundle JAR - which is now the case), please close this PR. I’m glad to continue our discussion on the new PR (#6544)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants