-
Notifications
You must be signed in to change notification settings - Fork 381
Make GC work with EMR 7.0.0 #9013
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
Open
idanovo
wants to merge
96
commits into
master
Choose a base branch
from
spark-client-emr-7
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
96 commits
Select commit
Hold shift + click to select a range
2b4eb7c
Test GC for EMR 7.0.0
idanovo 0a811fc
WIP
idanovo 0883db7
WIP
idanovo c5fe3b7
WIP
idanovo 8dba842
WIP
idanovo 8742b36
WIP
idanovo 867b44b
WIP
idanovo f053195
removed unused imports
idanovo c6cf6a3
WIP
idanovo ef04b3a
WIP
idanovo 1125925
WIP
idanovo 4e7c055
WIP
idanovo 2a12d48
Fix
idanovo bbe0927
Fix
idanovo 689ce97
Fix
idanovo 476e7bb
Fix
idanovo 5d34dec
Fix
idanovo 3f0aac1
Fix
idanovo b257af7
Fix
idanovo b26632b
Fix
idanovo 3279cfb
Fix
idanovo 5a42aea
Fix
idanovo 7188598
Fix
idanovo b7b2891
WIP
idanovo 63aaf68
WIP
idanovo 4ae55b3
Merge branch 'master' of https://github.com/treeverse/lakeFS into spa…
idanovo 3afd435
WIP
idanovo a03179f
WIP
idanovo 62f28db
WIP
idanovo bd7f9e3
WIP
idanovo fe00178
WIP
idanovo b17d0b0
WIP
idanovo 91c6faa
WIP
idanovo f82a3aa
WIP
idanovo ebe8a62
WIP
idanovo 8526186
WIP
idanovo 4184cf0
Fix tests
idanovo bfc34d6
Fix tests
idanovo eb2d3d4
Fix tests
idanovo bb55c31
Fix tests
idanovo 045b1a3
WIP
idanovo f758199
Fix tests
idanovo b9eb652
Fix
idanovo d648480
Fix
idanovo b12b32f
Fix
idanovo bdd3222
Test
idanovo bf900dc
Test
idanovo 2858223
Test
idanovo 51a03e7
Revert
idanovo bb4bb10
Test
idanovo fa7bc5a
Revert
idanovo 03a0be3
Test
idanovo 4707004
Revert test
idanovo d94a4b0
Merge branch 'master' of https://github.com/treeverse/lakeFS into spa…
idanovo 128b355
Test
idanovo 6c631dd
Test
idanovo 84ae17b
Test
idanovo 4026128
Test
idanovo da64484
Test
idanovo 6c83598
Test
idanovo a76f231
Test
idanovo 2eb2275
Test
idanovo 4bf02e1
Work
idanovo d76b199
Fix
idanovo 5e26f65
Trying support both EMR 6.9.0 and 7.0.0
idanovo 19c8467
Trying support both EMR 6.9.0 and 7.0.0
idanovo fd46fd0
Trying support both EMR 6.9.0 and 7.0.0
idanovo 473d09d
Trying support both EMR 6.9.0 and 7.0.0
idanovo 6daf089
Trying support both EMR 6.9.0 and 7.0.0
idanovo 40ccf5d
Trying support both EMR 6.9.0 and 7.0.0
idanovo 30a9973
Trying support both EMR 6.9.0 and 7.0.0
idanovo cf65eb1
Trying support both EMR 6.9.0 and 7.0.0
idanovo 6365eac
Skip tests
idanovo 8c28317
Skip tests
idanovo e46bb6f
Trying support both EMR 6.9.0 and 7.0.0
idanovo 4ce21bf
Trying support both EMR 6.9.0 and 7.0.0
idanovo 83215f6
Trying support both EMR 6.9.0 and 7.0.0
idanovo e27db78
Trying support both EMR 6.9.0 and 7.0.0
idanovo 48389b8
Trying support both EMR 6.9.0 and 7.0.0
idanovo 1060a68
Merge branch 'master' of https://github.com/treeverse/lakeFS into spa…
idanovo 1dbf653
Trying support both EMR 6.9.0 and 7.0.0
idanovo 3c87229
Merge branch 'master' of https://github.com/treeverse/lakeFS into spa…
idanovo 04b792a
Pull from master and reverted to a version that works only for EMR 7.0.0
idanovo ba732d3
Fix
idanovo 467d198
Removed unused import
idanovo dc57c79
Add logs
idanovo b48df4c
Revert fix
idanovo 4a1de2b
Test
idanovo 0fa17d4
Test
idanovo bdf7b44
Revert test
idanovo 6a0409d
Merge branch 'master' of https://github.com/treeverse/lakeFS into spa…
idanovo 54cfc27
Fix
idanovo 4174480
test
idanovo fb24bff
Remove test changes
idanovo be6e8ec
remove log
idanovo 0ea188b
Skip json files
idanovo File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
package io.treeverse.clients | ||
|
||
import com.amazonaws.auth.AWSCredentialsProvider | ||
import com.amazonaws.auth.{ | ||
AWSCredentialsProvider, | ||
DefaultAWSCredentialsProviderChain, | ||
STSAssumeRoleSessionCredentialsProvider | ||
} | ||
import com.amazonaws.client.builder.AwsClientBuilder | ||
import com.amazonaws.retry.PredefinedRetryPolicies.SDKDefaultRetryCondition | ||
import com.amazonaws.retry.RetryUtils | ||
|
@@ -11,6 +15,7 @@ import org.slf4j.{Logger, LoggerFactory} | |
|
||
import java.net.URI | ||
import java.util.concurrent.TimeUnit | ||
import java.util.UUID | ||
|
||
object StorageUtils { | ||
val StorageTypeS3 = "s3" | ||
|
@@ -143,10 +148,34 @@ object StorageUtils { | |
builder.withRegion(region) | ||
else | ||
builder | ||
val builderWithCredentials = credentialsProvider match { | ||
case Some(cp) => builderWithEndpoint.withCredentials(cp) | ||
case None => builderWithEndpoint | ||
} | ||
|
||
// Check for Hadoop's assumed role configuration | ||
val roleArn = System.getProperty("spark.hadoop.fs.s3a.assumed.role.arn") | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. please move to consts file we have |
||
|
||
// Apply credentials based on configuration | ||
val builderWithCredentials = | ||
if (roleArn != null && !roleArn.isEmpty) { | ||
// If we have a role ARN configured, assume that role | ||
try { | ||
val sessionName = "lakefs-gc-" + UUID.randomUUID().toString | ||
val stsProvider = | ||
new STSAssumeRoleSessionCredentialsProvider.Builder(roleArn, sessionName) | ||
Isan-Rivkin marked this conversation as resolved.
Show resolved
Hide resolved
|
||
.withLongLivedCredentialsProvider(new DefaultAWSCredentialsProviderChain()) | ||
.build() | ||
|
||
builderWithEndpoint.withCredentials(stsProvider) | ||
} catch { | ||
case e: Exception => | ||
logger.info("Falling back to DefaultAWSCredentialsProviderChain") | ||
builderWithEndpoint.withCredentials(new DefaultAWSCredentialsProviderChain()) | ||
} | ||
} else | ||
( | ||
// Use standard AWSCredentialsProvider if available | ||
builderWithEndpoint.withCredentials( | ||
credentialsProvider.get.asInstanceOf[AWSCredentialsProvider] | ||
) | ||
) | ||
builderWithCredentials.build | ||
} | ||
|
||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is this bump (hadoop + aws-java-sdk-bundle) backward compatible? was it tested?
i.e in hadoop 3.2.1 and aws-sdk 1.12.194?
backward compatibility is a hard requirement right, we mentioned breaking compatability as a long-term work with progress.