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

HIVE-25829: Tez exec mode support for credential provider for jobs #2911

Merged
merged 2 commits into from Jan 12, 2022

Conversation

abstractdog
Copy link
Contributor

@abstractdog abstractdog commented Jan 3, 2022

What changes were proposed in this pull request?

Adapting the changes of HIVE-14822 to Tez.
The actual change is very small:

  1. call updateJobCredentialProviders on the needed tez codepaths (session creation + tez dag submission)
  2. adapt updateJobCredentialProviders to needed tez options (only AM needed, details are in code comments)
    3. depending on HADOOP-18066, setting the hs2 job keystore password into config (+added as redacted), details are on HADOOP-18066 <-- not anymore, fixed code in TezSessionState

Why are the changes needed?

Tez support.

Does this PR introduce any user-facing change?

No.

How was this patch tested?

Tested on cluster against Azure.

Stream.of(
JobConf.MAPRED_MAP_TASK_ENV,
JobConf.MAPRED_REDUCE_TASK_ENV,
MRJobConfig.MR_AM_ADMIN_USER_ENV)
MRJobConfig.MR_AM_ADMIN_USER_ENV,
"tez.am.launch.env")
Copy link
Contributor

Choose a reason for hiding this comment

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

Is this credential required for tez.task.launch.env ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

thanks @nareshpr, I'll double-check, I tested this patch on a cluster as a POC, and I saw a simple map/reduce dag worked
also, I'm going to decide how to use this as referring to TezConfiguration.TEZ_AM_LAUNCH_ENV, which is not visible currently in hive-common

@abstractdog
Copy link
Contributor Author

can I get a review on this @nareshpr , @vihangk1 , @deniskuzZ , @szlta
tested on cluster, customer is waiting for the fix

* as this config has an effect in HS2 (on TezClient codepath), and the original hadoop
* credential store should be used.
*/
HiveConfUtil.updateCredentialProviderPasswordForJobs(tezConfig);
Copy link
Member

Choose a reason for hiding this comment

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

Do you know if that information won't be localized by Tez in plain text?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the credential store password appears in the launch-container.sh script, which is created by yarn, and it contains the environment variables, I think this is the same as in case of any other execution engine that's localized by yarn, but I'm sure that launch-container.sh is not included into application logs, so it's only readable of somebody having access to the cluster nodes

@abstractdog
Copy link
Contributor Author

test failures are due to https://issues.apache.org/jira/browse/HIVE-25859

@abstractdog
Copy link
Contributor Author

can I get approval or rejection on this one? looks like there is an extreme customer push on this case

test failures are all due to https://issues.apache.org/jira/browse/HIVE-25859

Copy link
Member

@deniskuzZ deniskuzZ left a comment

Choose a reason for hiding this comment

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

LGTM

@@ -244,6 +256,16 @@ public static String getJobCredentialProviderPassword(Configuration conf) {
return null;
}

/**
* Sets a "keyName=newKeyValue" pair to a jobConf to a given property.
* If the property is empty, is simply inserts keyName=newKeyValue,
Copy link
Contributor

Choose a reason for hiding this comment

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

typo: it simply

Copy link
Contributor Author

Choose a reason for hiding this comment

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

going to fix it before committing

Copy link
Contributor

@pgaref pgaref left a comment

Choose a reason for hiding this comment

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

I would expect to add the TEZ case as part of https://github.com/apache/hive/blob/master/ql/src/test/org/apache/hadoop/hive/ql/exec/TestHiveCredentialProviders.java

This can also be done as a follow up -- changes look straightforward to me

@abstractdog
Copy link
Contributor Author

I would expect to add the TEZ case as part of https://github.com/apache/hive/blob/master/ql/src/test/org/apache/hadoop/hive/ql/exec/TestHiveCredentialProviders.java

This can also be done as a follow up -- changes look straightforward to me

absolutely makes sense, added corresponding cases to the existing unit tests
if it passes in precommit, I'll merge this

@abstractdog abstractdog merged commit 4ebff3b into apache:master Jan 12, 2022
DongWei-4 pushed a commit to DongWei-4/hive that referenced this pull request Oct 28, 2022
…pache#2911) (Laszlo Bodor reviewed by Panagiotis Garefalakis, Denys Kuzmenko)
dengzhhu653 pushed a commit to dengzhhu653/hive that referenced this pull request Dec 15, 2022
…pache#2911) (Laszlo Bodor reviewed by Panagiotis Garefalakis, Denys Kuzmenko)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants