You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/02/03 02:38:44 UTC
[GitHub] [flink] JackWangCS opened a new pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
JackWangCS opened a new pull request #14841:
URL: https://github.com/apache/flink/pull/14841
## What is the purpose of the change
Introduce a pluggable delegation provider via SPI.
Delegation provider could be placed in connector related code and is more extendable comparing using reflection way to obtain DTs.
## Brief change log
- *Introduce the HadoopDelegationTokenProvider interface for Hadoop service to obtain delegation tokens*
- *Introduce HadoopDelegationTokenManager to manage HadoopDelegationTokenProviders*
- *Implement HadoopDelegationTokenProvider for Hadoop Filesystems and HBase*
## Verifying this change
This change added tests and can be verified as follows:
- Tests are still working in progress
## Does this pull request potentially affect one of the following parts:
- Dependencies (does it add or upgrade a dependency): no
- The public API, i.e., is any changed class annotated with `@Public(Evolving)`: no
- The serializers: no
- The runtime per-record code paths (performance sensitive): no
- Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: yes, this will affect Yarn deployment
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? yes
- If yes, how is the feature documented? not documented now, it's still work in progress
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* a02d0f10862cc919e7e6c125bc54381b475e53be Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040)
* 9427b12058c9bb662187d0b8b63ea483c97524a0 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* 9427b12058c9bb662187d0b8b63ea483c97524a0 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048)
* 5ac13369815e62f4e5ad1916f745bc9eaf111b81 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zuston commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
zuston commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-842804878
@JackWangCS Thanks for your reply promptly.
Sorry, i don't know why not reusing the `TokenCache.obtainTokensForNamenodes` to obtain fs delegation tokens.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-843288390
Hi @zuston , thanks for pointing out this again, I just missed that. This time, it will throw a Runtime Exception to fail the job.
Very grateful for your review!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zuston commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
zuston commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-842044733
Thanks for your geat work @JackWangCS.
Left a minor comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] lirui-apache commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
lirui-apache commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-790614175
Hi @JackWangCS , sorry I realized that we can't simply use `TableFactory` because it's located in the table module. But I still feel it's necessary to support custom properties for different connectors to implement the interface. Let me give it more thoughts and get back to you.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
}, {
"hash" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095",
"triggerID" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"triggerType" : "PUSH"
}, {
"hash" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14131",
"triggerID" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"triggerType" : "PUSH"
}, {
"hash" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14484",
"triggerID" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"triggerType" : "PUSH"
}, {
"hash" : "83aa947d7ab9528a7c8b3418316066b19f0e6916",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14579",
"triggerID" : "83aa947d7ab9528a7c8b3418316066b19f0e6916",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* 9f3d3ba536485d6d4113cd0dd3f162300abef855 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14484)
* 83aa947d7ab9528a7c8b3418316066b19f0e6916 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14579)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* dffe43fa9727cd26df45162fe880542f4c49162c Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075)
* cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* a02d0f10862cc919e7e6c125bc54381b475e53be Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-893501105
Hi @mbalassi and @gaborgsomogyi , thanks for your reply. You are right, this implementation now just introduces new APIs but does not address some main concerns. The initial idea for this PR is that we want to support Hive delegation token in a short-live sql-client, so it does not include features such as renewing tokens, propagating DTs to workers, etc. I will close this PR.
@gaborgsomogyi , great to hear that you already have a FLIP, I am happy to contribute and collaborate with you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772174441
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.
## Automated Checks
Last check on commit 6836c1c8fa5104ce24ca1fabd16c743032ffafac (Sat Aug 28 13:10:17 UTC 2021)
**Warnings:**
* No documentation files were touched! Remember to keep the Flink docs up to date!
<sub>Mention the bot in a comment to re-run the automated checks.</sub>
## Review Progress
* ❓ 1. The [description] looks good.
* ❓ 2. There is [consensus] that the contribution should go into to Flink.
* ❓ 3. Needs [attention] from.
* ❓ 4. The change fits into the overall [architecture].
* ❓ 5. Overall code [quality] is good.
Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
- `@flinkbot approve all` to approve all aspects
- `@flinkbot approve-until architecture` to approve everything until `architecture`
- `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
- `@flinkbot disapprove architecture` to remove an approval you gave earlier
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 20eea1289502f47226453012ae600303352f7cb9 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826)
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* a02d0f10862cc919e7e6c125bc54381b475e53be Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 20eea1289502f47226453012ae600303352f7cb9 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* dffe43fa9727cd26df45162fe880542f4c49162c Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zuston commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
zuston commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-843693171
Could you help review it @XComp?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-842484467
Hi @zuston , thanks for you review! I have made some changes based on your comment, ccould you please take a look?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] XComp commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
XComp commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-845210277
> Could you help review it @XComp?
Sorry for this late reply @zuston . Not sure whether I'm gonna have time in the next days as we're busy with releasing.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-796811187
Hi @lirui-apache , I have removed the factories and could you help this pr again? Thank you!
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
}, {
"hash" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095",
"triggerID" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* 76442a5286c4d6916506fdd6dc877065b3c95b39 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] lirui-apache commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
lirui-apache commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-801610111
@tillrohrmann Would you mind also have a look at the PR?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-842810784
Hi @zuston , `TokenCache.obtainTokensForNamenodes` need to pass in a set of paths. In the context of `HadoopFSDelegationTokenProvider`, it's a bit complex to constrcut the paths(both from uploader and extra paths to access) and it's unnecessary to do it. So HadoopFSDelegationTokenProvider use the `fs.addDelegationTokens` to obtain token directly(). In fact, Spark also use this method.
`TokenCache.obtainTokensForNamenodes` also call the `fs.addDelegationTokens` to obtain tokens in its implementation.
See: https://github.com/hanborq/hadoop/blob/99babec26a5f42021c0ec2a39ee7dbad4387b176/src/mapred/org/apache/hadoop/mapreduce/security/TokenCache.java#L115
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zuston commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
zuston commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-842044733
Thanks for your geat work @JackWangCS.
Left a minor comment.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] gaborgsomogyi edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
gaborgsomogyi edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-891938008
As I see this is not solving 2 major issues which belongs to this area:
* DTs not re-obtained which makes workloads fail after 7 days (I don't thing renew worth the hassle, we've seen this in Spark already) Please see [this](https://github.com/apache/flink/blob/4d19a9f09e58ae5726901b1c6c473b655d908440/flink-runtime/src/main/java/org/apache/flink/runtime/security/modules/HadoopModule.java#L89-L104).
* DTs are not propagated to workers in a flexible but secure way
Adding features and not solving these problems is is a way we should't proceed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-842484467
Hi @zuston , thanks for you review! I have made some changes based on your comment, ccould you please take a look?
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS commented on a change in pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS commented on a change in pull request #14841:
URL: https://github.com/apache/flink/pull/14841#discussion_r633699874
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/Utils.java
##########
@@ -197,13 +196,19 @@ private static LocalResource registerLocalResource(
}
public static void setTokensFor(
- ContainerLaunchContext amContainer, List<Path> paths, Configuration conf)
+ org.apache.flink.configuration.Configuration flinkConf,
+ ContainerLaunchContext amContainer,
+ Configuration hadoopConf)
throws IOException {
Credentials credentials = new Credentials();
- // for HDFS
- TokenCache.obtainTokensForNamenodes(credentials, paths.toArray(new Path[0]), conf);
- // for HBase
- obtainTokenForHBase(credentials, conf);
+
+ // obtain tokens from HadoopDelegationTokenProviders
Review comment:
Merged with FLINK-21700
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
}, {
"hash" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095",
"triggerID" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"triggerType" : "PUSH"
}, {
"hash" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14131",
"triggerID" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"triggerType" : "PUSH"
}, {
"hash" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* 46e3ffab55d1abcae38cdd50335ae33276016168 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14131)
* 9f3d3ba536485d6d4113cd0dd3f162300abef855 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] tillrohrmann commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
tillrohrmann commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-891889399
cc @gaborgsomogyi. Maybe you can help with this effort.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-893501105
Hi @mbalassi and @gaborgsomogyi , thanks for your reply. You are right, this implementation now just introduces new APIs but does not address some main concerns. The initial idea for this PR is that we want to support Hive delegation token in a short-live sql-client, so it does not include features such as renewing tokens, propagating DTs to workers, etc and it's not an end-to-end solution, I will close this PR.
If we want to refactor the whole DT handling in the Flink, it will be a huge job. For your questions, I only have some basic ideas currently:
* I think it's better to re-obtain the tokens than renew the tokens. There are a few components now supporting the renew. Re-obtaining will be enough and simple.
* For propagating DT to workers, it's better to implement a RPC to do this and don't depend on any external distributed storage such as HDFS.
Also, it will be more complicated since Flink supports many deployment modes such as per-job, session and application modes. The `HadoopDelegationTokenManager` can be run at client as well as JobManager side and have different lifecyle in different deployment modes.
@gaborgsomogyi , great to hear that you already have a FLIP, I am happy to contribute and collaborate with you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] tillrohrmann commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
tillrohrmann commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-891870529
Sorry for the slow response @JackWangCS. At the moment, I don't have time for it unfortunately because of the upcoming feature freeze. I probably won't be able to help until after the 1.14 release. Maybe another committer can help in the mean time.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS commented on a change in pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS commented on a change in pull request #14841:
URL: https://github.com/apache/flink/pull/14841#discussion_r633613001
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopFSDelegationTokenProvider.java
##########
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.configuration.ConfigUtils;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenConfiguration;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenProvider;
+import org.apache.flink.util.FlinkRuntimeException;
+import org.apache.flink.util.function.FunctionUtils;
+import org.apache.flink.yarn.configuration.YarnConfigOptions;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapred.Master;
+import org.apache.hadoop.security.Credentials;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/** Delegation token provider implementation for Hadoop FileSystems. */
+public class HadoopFSDelegationTokenProvider implements HadoopDelegationTokenProvider {
+
+ private static final Logger LOG =
+ LoggerFactory.getLogger(HadoopFSDelegationTokenProvider.class);
+
+ private HadoopDelegationTokenConfiguration hadoopDelegationTokenConf;
+
+ @Override
+ public String serviceName() {
+ return "hadoopfs";
+ }
+
+ @Override
+ public void init(final HadoopDelegationTokenConfiguration conf) {
+ this.hadoopDelegationTokenConf = conf;
+ }
+
+ @Override
+ public boolean delegationTokensRequired() {
+ return UserGroupInformation.isSecurityEnabled();
+ }
+
+ @Override
+ public Optional<Long> obtainDelegationTokens(final Credentials credentials) {
+ try {
+ Set<FileSystem> fileSystemsToAccess = getFileSystemsToAccess();
+
+ final String renewer = getTokenRenewer(hadoopDelegationTokenConf.getHadoopConf());
+ fileSystemsToAccess.forEach(
+ fs -> {
+ try {
+ LOG.info("Getting FS token for: {} with renewer {}", fs, renewer);
+ fs.addDelegationTokens(renewer, credentials);
+ } catch (IOException e) {
+ LOG.warn("Failed to get token for {}.", fs);
Review comment:
Hi @zuston , if the job fails to get the FS DTs, it's supposed to fail, so I will throw a runtime exception to fail fast.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 20eea1289502f47226453012ae600303352f7cb9 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
}, {
"hash" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095",
"triggerID" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"triggerType" : "PUSH"
}, {
"hash" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14131",
"triggerID" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"triggerType" : "PUSH"
}, {
"hash" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14484",
"triggerID" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* 9f3d3ba536485d6d4113cd0dd3f162300abef855 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14484)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-787424225
Hi @lirui-apache, thanks for your reply. I will try to use `TableFactory` method to support custome properties.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] gaborgsomogyi edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
gaborgsomogyi edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-891938008
As I see this is not solving 2 major issues which belongs to this area:
* DTs not re-obtained which makes workloads fail after 7 days, please see [this](https://github.com/apache/flink/blob/4d19a9f09e58ae5726901b1c6c473b655d908440/flink-runtime/src/main/java/org/apache/flink/runtime/security/modules/HadoopModule.java#L89-L104) (I don't thing renew worth the hassle, we've seen this in Spark already, re-obtain is enough with less code).
* DTs are not propagated to workers in a flexible but secure way
Adding features and not solving these problems is a way we should't proceed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] gaborgsomogyi commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
gaborgsomogyi commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-891938008
As I see this is not solving 2 major issues which belongs to this area:
* DTs not re-obtained which makes workloads fail after 7 days (I don't thing renew worth the hassle, we've seen this in Spark already) Please see [this](https://github.com/apache/flink/blob/4d19a9f09e58ae5726901b1c6c473b655d908440/flink-runtime/src/main/java/org/apache/flink/runtime/security/modules/HadoopModule.java#L89-L104).
* DTs are not propagated to workers in a flexible but secure way
Adding features and not solving these problems is not something is the way we should proceed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zuston commented on a change in pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
zuston commented on a change in pull request #14841:
URL: https://github.com/apache/flink/pull/14841#discussion_r633250018
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopDelegationTokenManager.java
##########
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenConfiguration;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenProvider;
+
+import org.apache.hadoop.security.Credentials;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ServiceLoader;
+
+/**
+ * HadoopDelegationTokenManager is responsible for managing delegation tokens. It can be used to
+ * obtain delegation tokens by calling `obtainDelegationTokens` method.
+ */
+public class HadoopDelegationTokenManager {
+ private static final Logger LOG = LoggerFactory.getLogger(HadoopDelegationTokenManager.class);
+
+ private final HadoopDelegationTokenConfiguration hadoopDelegationTokenConf;
+ private final List<HadoopDelegationTokenProvider> delegationTokenProviders;
+
+ public HadoopDelegationTokenManager(
+ HadoopDelegationTokenConfiguration hadoopDelegationTokenConf) {
+ this.hadoopDelegationTokenConf = hadoopDelegationTokenConf;
+ delegationTokenProviders = loadProviders();
+ }
+
+ /**
+ * Obtain delegation tokens using HadoopDelegationProviders, and store them in the give
+ * credentials.
+ *
+ * @param credentials Credentials object where to store the delegation tokens.
+ */
+ public void obtainDelegationTokens(Credentials credentials) {
+ delegationTokenProviders.forEach(
+ provider -> {
+ if (provider.delegationTokensRequired()) {
+ provider.obtainDelegationTokens(credentials);
+ } else {
+ LOG.info(
+ "Service {} does not need to require a token,",
+ provider.serviceName());
+ }
+ });
+ }
+
+ private List<HadoopDelegationTokenProvider> loadProviders() {
+ ServiceLoader<HadoopDelegationTokenProvider> serviceLoader =
+ ServiceLoader.load(HadoopDelegationTokenProvider.class);
+
+ List<HadoopDelegationTokenProvider> providers = new ArrayList<>();
+
+ Iterator<HadoopDelegationTokenProvider> providerIterator = serviceLoader.iterator();
+ providerIterator.forEachRemaining(
+ provider -> {
+ try {
+ provider.init(hadoopDelegationTokenConf);
Review comment:
Add logs that indicates which is hadoop delegation token provider loaded?
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/Utils.java
##########
@@ -197,13 +196,19 @@ private static LocalResource registerLocalResource(
}
public static void setTokensFor(
- ContainerLaunchContext amContainer, List<Path> paths, Configuration conf)
+ org.apache.flink.configuration.Configuration flinkConf,
+ ContainerLaunchContext amContainer,
+ Configuration hadoopConf)
throws IOException {
Credentials credentials = new Credentials();
- // for HDFS
- TokenCache.obtainTokensForNamenodes(credentials, paths.toArray(new Path[0]), conf);
- // for HBase
- obtainTokenForHBase(credentials, conf);
+
+ // obtain tokens from HadoopDelegationTokenProviders
Review comment:
Need to be compatible with https://issues.apache.org/jira/browse/FLINK-21700#
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopFSDelegationTokenProvider.java
##########
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.configuration.ConfigUtils;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenConfiguration;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenProvider;
+import org.apache.flink.util.FlinkRuntimeException;
+import org.apache.flink.util.function.FunctionUtils;
+import org.apache.flink.yarn.configuration.YarnConfigOptions;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapred.Master;
+import org.apache.hadoop.security.Credentials;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/** Delegation token provider implementation for Hadoop FileSystems. */
+public class HadoopFSDelegationTokenProvider implements HadoopDelegationTokenProvider {
+
+ private static final Logger LOG =
+ LoggerFactory.getLogger(HadoopFSDelegationTokenProvider.class);
+
+ private HadoopDelegationTokenConfiguration hadoopDelegationTokenConf;
+
+ @Override
+ public String serviceName() {
+ return "hadoopfs";
+ }
+
+ @Override
+ public void init(final HadoopDelegationTokenConfiguration conf) {
+ this.hadoopDelegationTokenConf = conf;
+ }
+
+ @Override
+ public boolean delegationTokensRequired() {
+ return UserGroupInformation.isSecurityEnabled();
+ }
+
+ @Override
+ public Optional<Long> obtainDelegationTokens(final Credentials credentials) {
+ try {
+ Set<FileSystem> fileSystemsToAccess = getFileSystemsToAccess();
+
+ final String renewer = getTokenRenewer(hadoopDelegationTokenConf.getHadoopConf());
+ fileSystemsToAccess.forEach(
+ fs -> {
+ try {
+ LOG.info("Getting FS token for: {} with renewer {}", fs, renewer);
+ fs.addDelegationTokens(renewer, credentials);
+ } catch (IOException e) {
+ LOG.warn("Failed to get token for {}.", fs);
Review comment:
Why throw exception when obtaining DT failed?
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopFSDelegationTokenProvider.java
##########
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.configuration.ConfigUtils;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenConfiguration;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenProvider;
+import org.apache.flink.util.FlinkRuntimeException;
+import org.apache.flink.util.function.FunctionUtils;
+import org.apache.flink.yarn.configuration.YarnConfigOptions;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapred.Master;
+import org.apache.hadoop.security.Credentials;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/** Delegation token provider implementation for Hadoop FileSystems. */
+public class HadoopFSDelegationTokenProvider implements HadoopDelegationTokenProvider {
+
+ private static final Logger LOG =
+ LoggerFactory.getLogger(HadoopFSDelegationTokenProvider.class);
+
+ private HadoopDelegationTokenConfiguration hadoopDelegationTokenConf;
+
+ @Override
+ public String serviceName() {
+ return "hadoopfs";
+ }
+
+ @Override
+ public void init(final HadoopDelegationTokenConfiguration conf) {
+ this.hadoopDelegationTokenConf = conf;
+ }
+
+ @Override
+ public boolean delegationTokensRequired() {
+ return UserGroupInformation.isSecurityEnabled();
+ }
+
+ @Override
+ public Optional<Long> obtainDelegationTokens(final Credentials credentials) {
+ try {
+ Set<FileSystem> fileSystemsToAccess = getFileSystemsToAccess();
+
+ final String renewer = getTokenRenewer(hadoopDelegationTokenConf.getHadoopConf());
+ fileSystemsToAccess.forEach(
+ fs -> {
+ try {
+ LOG.info("Getting FS token for: {} with renewer {}", fs, renewer);
Review comment:
This log will makes users confused. Because it dont indicate which path is getting fs token.
Besides, I think it is inappropriate for the fs object to be used directly in the log, it will be shown like as follows:
`Getting FS token for: org.apache.hadoop.fs.LocalFileSystem@1a4927d6 with renewer xxxxx`
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopFSDelegationTokenProvider.java
##########
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.configuration.ConfigUtils;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenConfiguration;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenProvider;
+import org.apache.flink.util.FlinkRuntimeException;
+import org.apache.flink.util.function.FunctionUtils;
+import org.apache.flink.yarn.configuration.YarnConfigOptions;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapred.Master;
+import org.apache.hadoop.security.Credentials;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/** Delegation token provider implementation for Hadoop FileSystems. */
+public class HadoopFSDelegationTokenProvider implements HadoopDelegationTokenProvider {
+
+ private static final Logger LOG =
+ LoggerFactory.getLogger(HadoopFSDelegationTokenProvider.class);
+
+ private HadoopDelegationTokenConfiguration hadoopDelegationTokenConf;
+
+ @Override
+ public String serviceName() {
+ return "hadoopfs";
+ }
+
+ @Override
+ public void init(final HadoopDelegationTokenConfiguration conf) {
+ this.hadoopDelegationTokenConf = conf;
+ }
+
+ @Override
+ public boolean delegationTokensRequired() {
+ return UserGroupInformation.isSecurityEnabled();
+ }
+
+ @Override
+ public Optional<Long> obtainDelegationTokens(final Credentials credentials) {
+ try {
+ Set<FileSystem> fileSystemsToAccess = getFileSystemsToAccess();
+
+ final String renewer = getTokenRenewer(hadoopDelegationTokenConf.getHadoopConf());
+ fileSystemsToAccess.forEach(
+ fs -> {
+ try {
+ LOG.info("Getting FS token for: {} with renewer {}", fs, renewer);
Review comment:
This log will makes users confused. Because it dont indicate which path is getting fs token.
Besides, I think it is inappropriate for the fs object to be used directly in the log msg, it will be shown like as follows:
`Getting FS token for: org.apache.hadoop.fs.LocalFileSystem@1a4927d6 with renewer xxxxx`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zuston commented on a change in pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
zuston commented on a change in pull request #14841:
URL: https://github.com/apache/flink/pull/14841#discussion_r634018947
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopFSDelegationTokenProvider.java
##########
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.configuration.ConfigUtils;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenConfiguration;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenProvider;
+import org.apache.flink.util.FlinkRuntimeException;
+import org.apache.flink.util.function.FunctionUtils;
+import org.apache.flink.yarn.configuration.YarnConfigOptions;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapred.Master;
+import org.apache.hadoop.security.Credentials;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/** Delegation token provider implementation for Hadoop FileSystems. */
+public class HadoopFSDelegationTokenProvider implements HadoopDelegationTokenProvider {
+
+ private static final Logger LOG =
+ LoggerFactory.getLogger(HadoopFSDelegationTokenProvider.class);
+
+ private HadoopDelegationTokenConfiguration hadoopDelegationTokenConf;
+
+ @Override
+ public String serviceName() {
+ return "hadoopfs";
+ }
+
+ @Override
+ public void init(final HadoopDelegationTokenConfiguration conf) {
+ this.hadoopDelegationTokenConf = conf;
+ }
+
+ @Override
+ public boolean delegationTokensRequired() {
+ return UserGroupInformation.isSecurityEnabled();
+ }
+
+ @Override
+ public Optional<Long> obtainDelegationTokens(final Credentials credentials) {
+ try {
+ Set<FileSystem> fileSystemsToAccess = getFileSystemsToAccess();
+
+ final String renewer = getTokenRenewer(hadoopDelegationTokenConf.getHadoopConf());
+ fileSystemsToAccess.forEach(
+ fs -> {
+ try {
+ LOG.info("Getting FS token for: {} with renewer {}", fs, renewer);
+ fs.addDelegationTokens(renewer, credentials);
+ } catch (IOException e) {
+ LOG.warn("Failed to get token for {}.", fs);
Review comment:
But it looks that you catch the IOException.
Besides, i don't know why not reuse the original code to obtain delegation tokens, like `TokenCache.obtainTokensForNamenodes`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] lirui-apache commented on a change in pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
lirui-apache commented on a change in pull request #14841:
URL: https://github.com/apache/flink/pull/14841#discussion_r583616554
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopDelegationTokenProvider.java
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
Review comment:
But if we put the interface in `flink-yarn` module, it's not possible for other deployments to implement this interface, unless they depend on `flink-yarn` right? So perhaps it's better to put it in `flink-runtime`?
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopDelegationTokenProvider.java
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.configuration.Configuration;
+
+import org.apache.hadoop.security.Credentials;
+
+import java.util.Optional;
+
+/** Hadoop delegation token provider. */
+public interface HadoopDelegationTokenProvider {
+
+ /** Name of the service to provide delegation tokens. This name should be unique. */
+ String serviceName();
+
+ /**
+ * Return true if delegation tokens are required for this service.
+ *
+ * @param flinkConf Flink configuration
+ * @param hadoopConf Hadoop configuration
+ * @return true if delegation tokens are required
+ */
+ boolean delegationTokensRequired(
Review comment:
I mean it's not clear whether `delegationTokensRequired` and `obtainDelegationTokens` get the same configurations. And what `obtainDelegationTokens` should do if DT is not required at all. We need to clarify these in the API contract.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] gaborgsomogyi commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
gaborgsomogyi commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-891919782
@tillrohrmann Thanks for pinging, this is definitely interesting topic because proper DT handling is a key feature to many ppls including us.
@JackWangCS since this one is a big feature I would like to take a look at the FLIP. Where can I find it?
As I see you've partially copy/pasted the Spark DT handling which is good. What I lack is the DT lifecycle description. The most important parts:
* Who and when renews/re-obtains/propagates DTs?
* How is it made sure that DTs are propagated in a secure way to workers?
* Can you share what is the lifecycle of `HadoopDelegationTokenManager`?
* Will this be run as a standalone multi-tenant service? Or once per Flink job? Or something else?
BTW since I have quite some knowledge in security area I've already a 99% done FLIP for this.
All in all w/o knowing at least the mentioned questions I don't think it should go in.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
}, {
"hash" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095",
"triggerID" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"triggerType" : "PUSH"
}, {
"hash" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14131",
"triggerID" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"triggerType" : "PUSH"
}, {
"hash" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14484",
"triggerID" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"triggerType" : "PUSH"
}, {
"hash" : "83aa947d7ab9528a7c8b3418316066b19f0e6916",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14579",
"triggerID" : "83aa947d7ab9528a7c8b3418316066b19f0e6916",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* 83aa947d7ab9528a7c8b3418316066b19f0e6916 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14579)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zuston commented on a change in pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
zuston commented on a change in pull request #14841:
URL: https://github.com/apache/flink/pull/14841#discussion_r633250018
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopDelegationTokenManager.java
##########
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenConfiguration;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenProvider;
+
+import org.apache.hadoop.security.Credentials;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ServiceLoader;
+
+/**
+ * HadoopDelegationTokenManager is responsible for managing delegation tokens. It can be used to
+ * obtain delegation tokens by calling `obtainDelegationTokens` method.
+ */
+public class HadoopDelegationTokenManager {
+ private static final Logger LOG = LoggerFactory.getLogger(HadoopDelegationTokenManager.class);
+
+ private final HadoopDelegationTokenConfiguration hadoopDelegationTokenConf;
+ private final List<HadoopDelegationTokenProvider> delegationTokenProviders;
+
+ public HadoopDelegationTokenManager(
+ HadoopDelegationTokenConfiguration hadoopDelegationTokenConf) {
+ this.hadoopDelegationTokenConf = hadoopDelegationTokenConf;
+ delegationTokenProviders = loadProviders();
+ }
+
+ /**
+ * Obtain delegation tokens using HadoopDelegationProviders, and store them in the give
+ * credentials.
+ *
+ * @param credentials Credentials object where to store the delegation tokens.
+ */
+ public void obtainDelegationTokens(Credentials credentials) {
+ delegationTokenProviders.forEach(
+ provider -> {
+ if (provider.delegationTokensRequired()) {
+ provider.obtainDelegationTokens(credentials);
+ } else {
+ LOG.info(
+ "Service {} does not need to require a token,",
+ provider.serviceName());
+ }
+ });
+ }
+
+ private List<HadoopDelegationTokenProvider> loadProviders() {
+ ServiceLoader<HadoopDelegationTokenProvider> serviceLoader =
+ ServiceLoader.load(HadoopDelegationTokenProvider.class);
+
+ List<HadoopDelegationTokenProvider> providers = new ArrayList<>();
+
+ Iterator<HadoopDelegationTokenProvider> providerIterator = serviceLoader.iterator();
+ providerIterator.forEachRemaining(
+ provider -> {
+ try {
+ provider.init(hadoopDelegationTokenConf);
Review comment:
Add logs that indicates which is hadoop delegation token provider loaded?
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/Utils.java
##########
@@ -197,13 +196,19 @@ private static LocalResource registerLocalResource(
}
public static void setTokensFor(
- ContainerLaunchContext amContainer, List<Path> paths, Configuration conf)
+ org.apache.flink.configuration.Configuration flinkConf,
+ ContainerLaunchContext amContainer,
+ Configuration hadoopConf)
throws IOException {
Credentials credentials = new Credentials();
- // for HDFS
- TokenCache.obtainTokensForNamenodes(credentials, paths.toArray(new Path[0]), conf);
- // for HBase
- obtainTokenForHBase(credentials, conf);
+
+ // obtain tokens from HadoopDelegationTokenProviders
Review comment:
Need to be compatible with https://issues.apache.org/jira/browse/FLINK-21700#
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopFSDelegationTokenProvider.java
##########
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.configuration.ConfigUtils;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenConfiguration;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenProvider;
+import org.apache.flink.util.FlinkRuntimeException;
+import org.apache.flink.util.function.FunctionUtils;
+import org.apache.flink.yarn.configuration.YarnConfigOptions;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapred.Master;
+import org.apache.hadoop.security.Credentials;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/** Delegation token provider implementation for Hadoop FileSystems. */
+public class HadoopFSDelegationTokenProvider implements HadoopDelegationTokenProvider {
+
+ private static final Logger LOG =
+ LoggerFactory.getLogger(HadoopFSDelegationTokenProvider.class);
+
+ private HadoopDelegationTokenConfiguration hadoopDelegationTokenConf;
+
+ @Override
+ public String serviceName() {
+ return "hadoopfs";
+ }
+
+ @Override
+ public void init(final HadoopDelegationTokenConfiguration conf) {
+ this.hadoopDelegationTokenConf = conf;
+ }
+
+ @Override
+ public boolean delegationTokensRequired() {
+ return UserGroupInformation.isSecurityEnabled();
+ }
+
+ @Override
+ public Optional<Long> obtainDelegationTokens(final Credentials credentials) {
+ try {
+ Set<FileSystem> fileSystemsToAccess = getFileSystemsToAccess();
+
+ final String renewer = getTokenRenewer(hadoopDelegationTokenConf.getHadoopConf());
+ fileSystemsToAccess.forEach(
+ fs -> {
+ try {
+ LOG.info("Getting FS token for: {} with renewer {}", fs, renewer);
+ fs.addDelegationTokens(renewer, credentials);
+ } catch (IOException e) {
+ LOG.warn("Failed to get token for {}.", fs);
Review comment:
Why throw exception when obtaining DT failed?
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopFSDelegationTokenProvider.java
##########
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.configuration.ConfigUtils;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenConfiguration;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenProvider;
+import org.apache.flink.util.FlinkRuntimeException;
+import org.apache.flink.util.function.FunctionUtils;
+import org.apache.flink.yarn.configuration.YarnConfigOptions;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapred.Master;
+import org.apache.hadoop.security.Credentials;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/** Delegation token provider implementation for Hadoop FileSystems. */
+public class HadoopFSDelegationTokenProvider implements HadoopDelegationTokenProvider {
+
+ private static final Logger LOG =
+ LoggerFactory.getLogger(HadoopFSDelegationTokenProvider.class);
+
+ private HadoopDelegationTokenConfiguration hadoopDelegationTokenConf;
+
+ @Override
+ public String serviceName() {
+ return "hadoopfs";
+ }
+
+ @Override
+ public void init(final HadoopDelegationTokenConfiguration conf) {
+ this.hadoopDelegationTokenConf = conf;
+ }
+
+ @Override
+ public boolean delegationTokensRequired() {
+ return UserGroupInformation.isSecurityEnabled();
+ }
+
+ @Override
+ public Optional<Long> obtainDelegationTokens(final Credentials credentials) {
+ try {
+ Set<FileSystem> fileSystemsToAccess = getFileSystemsToAccess();
+
+ final String renewer = getTokenRenewer(hadoopDelegationTokenConf.getHadoopConf());
+ fileSystemsToAccess.forEach(
+ fs -> {
+ try {
+ LOG.info("Getting FS token for: {} with renewer {}", fs, renewer);
Review comment:
This log will makes users confused. Because it dont indicate which path is getting fs token.
Besides, I think it is inappropriate for the fs object to be used directly in the log, it will be shown like as follows:
`Getting FS token for: org.apache.hadoop.fs.LocalFileSystem@1a4927d6 with renewer xxxxx`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] lirui-apache commented on a change in pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
lirui-apache commented on a change in pull request #14841:
URL: https://github.com/apache/flink/pull/14841#discussion_r571603548
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopFSDelegationTokenProvider.java
##########
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.configuration.ConfigUtils;
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.util.function.FunctionUtils;
+import org.apache.flink.yarn.configuration.YarnConfigOptions;
+
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapred.Master;
+import org.apache.hadoop.security.Credentials;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/** Delegation token provider implementation for Hadoop FileSystems. */
+public class HadoopFSDelegationTokenProvider implements HadoopDelegationTokenProvider {
+
+ private static final Logger LOG =
+ LoggerFactory.getLogger(HadoopFSDelegationTokenProvider.class);
+
+ @Override
+ public String serviceName() {
+ return "hadoopfs";
+ }
+
+ @Override
+ public boolean delegationTokensRequired(
+ Configuration flinkConf, org.apache.hadoop.conf.Configuration hadoopConf) {
+ return UserGroupInformation.isSecurityEnabled();
+ }
+
+ @Override
+ public Optional<Long> obtainDelegationTokens(
+ Configuration flinkConf,
+ org.apache.hadoop.conf.Configuration hadoopConf,
+ Credentials credentials) {
+ try {
+ Set<FileSystem> fileSystemsToAccess = getFileSystemsToAccess(flinkConf, hadoopConf);
+
+ final String renewer = getTokenRenewer(hadoopConf);
+ fileSystemsToAccess.forEach(
+ fs -> {
+ try {
+ LOG.info("Getting FS token for: {} with renewer {}", fs, renewer);
+ fs.addDelegationTokens(renewer, credentials);
+ } catch (IOException e) {
+ LOG.warn("Failed to get token for {}.", fs);
+ }
+ });
+ } catch (IOException e) {
+ LOG.error("Failed to obtain tokens for Hadoop FileSystems: {}", e.getMessage());
Review comment:
Shouldn't we error out if DT can't be obtained? I suppose the job would fail in that case. So it's better to fail fast.
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HBaseDelegationTokenProvider.java
##########
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.configuration.Configuration;
+
+import org.apache.hadoop.security.Credentials;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.apache.hadoop.security.token.Token;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.Closeable;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Optional;
+
+/** Delegation token provider implementation for HBase. */
+public class HBaseDelegationTokenProvider implements HadoopDelegationTokenProvider {
+
+ private static final Logger LOG = LoggerFactory.getLogger(HBaseDelegationTokenProvider.class);
+
+ private org.apache.hadoop.conf.Configuration hbaseConf;
+
+ @Override
+ public String serviceName() {
+ return "hbase";
+ }
+
+ @Override
+ public boolean delegationTokensRequired(
+ Configuration flinkConf, org.apache.hadoop.conf.Configuration hadoopConf) {
+ if (UserGroupInformation.isSecurityEnabled()) {
+ hbaseConf = createHBaseConfiguration(hadoopConf);
+ LOG.debug("HBase security setting: {}", hbaseConf.get("hbase.security.authentication"));
Review comment:
If this method is not frequently called, let's not change the log level here. Users may rely on the previous INFO level logs.
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopDelegationTokenProvider.java
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.configuration.Configuration;
+
+import org.apache.hadoop.security.Credentials;
+
+import java.util.Optional;
+
+/** Hadoop delegation token provider. */
+public interface HadoopDelegationTokenProvider {
+
+ /** Name of the service to provide delegation tokens. This name should be unique. */
+ String serviceName();
+
+ /**
+ * Return true if delegation tokens are required for this service.
+ *
+ * @param flinkConf Flink configuration
+ * @param hadoopConf Hadoop configuration
+ * @return true if delegation tokens are required
+ */
+ boolean delegationTokensRequired(
Review comment:
Both `delegationTokensRequired` and `obtainDelegationTokens` take some configuration parameters. I wonder what's the relationship between these configurations? Should `obtainDelegationTokens` check whether DT is required before actually get the DT? If the configurations are identical, maybe we can have an `init` method to configure the provider and other methods won't accept configurations parameters?
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopFSDelegationTokenProvider.java
##########
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.configuration.ConfigUtils;
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.util.function.FunctionUtils;
+import org.apache.flink.yarn.configuration.YarnConfigOptions;
+
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapred.Master;
+import org.apache.hadoop.security.Credentials;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/** Delegation token provider implementation for Hadoop FileSystems. */
+public class HadoopFSDelegationTokenProvider implements HadoopDelegationTokenProvider {
+
+ private static final Logger LOG =
+ LoggerFactory.getLogger(HadoopFSDelegationTokenProvider.class);
+
+ @Override
+ public String serviceName() {
+ return "hadoopfs";
+ }
+
+ @Override
+ public boolean delegationTokensRequired(
+ Configuration flinkConf, org.apache.hadoop.conf.Configuration hadoopConf) {
+ return UserGroupInformation.isSecurityEnabled();
+ }
+
+ @Override
+ public Optional<Long> obtainDelegationTokens(
+ Configuration flinkConf,
+ org.apache.hadoop.conf.Configuration hadoopConf,
+ Credentials credentials) {
+ try {
+ Set<FileSystem> fileSystemsToAccess = getFileSystemsToAccess(flinkConf, hadoopConf);
+
+ final String renewer = getTokenRenewer(hadoopConf);
+ fileSystemsToAccess.forEach(
+ fs -> {
+ try {
+ LOG.info("Getting FS token for: {} with renewer {}", fs, renewer);
+ fs.addDelegationTokens(renewer, credentials);
+ } catch (IOException e) {
+ LOG.warn("Failed to get token for {}.", fs);
+ }
+ });
+ } catch (IOException e) {
+ LOG.error("Failed to obtain tokens for Hadoop FileSystems: {}", e.getMessage());
+ }
+ // Flink does not support to renew the delegation token currently
Review comment:
If flink doesn't support renew a DT, why would we fail when a renewer can't be get in `getTokenRenewer`?
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HBaseDelegationTokenProvider.java
##########
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
Review comment:
Shouldn't this be placed in hbase connector and get rid of those reflections?
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopDelegationTokenProvider.java
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
Review comment:
Does this mean DT provider is only supported when running Flink on YARN? Is it possible to support this feature for other deployments, such as standalone or k8s?
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HBaseDelegationTokenProvider.java
##########
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.configuration.Configuration;
+
+import org.apache.hadoop.security.Credentials;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.apache.hadoop.security.token.Token;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.Closeable;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Optional;
+
+/** Delegation token provider implementation for HBase. */
+public class HBaseDelegationTokenProvider implements HadoopDelegationTokenProvider {
+
+ private static final Logger LOG = LoggerFactory.getLogger(HBaseDelegationTokenProvider.class);
+
+ private org.apache.hadoop.conf.Configuration hbaseConf;
+
+ @Override
+ public String serviceName() {
+ return "hbase";
+ }
+
+ @Override
+ public boolean delegationTokensRequired(
+ Configuration flinkConf, org.apache.hadoop.conf.Configuration hadoopConf) {
+ if (UserGroupInformation.isSecurityEnabled()) {
+ hbaseConf = createHBaseConfiguration(hadoopConf);
+ LOG.debug("HBase security setting: {}", hbaseConf.get("hbase.security.authentication"));
+
+ boolean required = "kerberos".equals(hbaseConf.get("hbase.security.authentication"));
+ if (!required) {
+ LOG.debug("HBase has not been configured to use Kerberos.");
+ }
+ return required;
+ } else {
+ return false;
+ }
+ }
+
+ private org.apache.hadoop.conf.Configuration createHBaseConfiguration(
+ org.apache.hadoop.conf.Configuration conf) {
+ try {
+ // ----
+ // Intended call: HBaseConfiguration.create(conf);
+ return (org.apache.hadoop.conf.Configuration)
+ Class.forName("org.apache.hadoop.hbase.HBaseConfiguration")
+ .getMethod("create", org.apache.hadoop.conf.Configuration.class)
+ .invoke(null, conf);
+ // ----
+
+ } catch (InvocationTargetException
+ | NoSuchMethodException
+ | IllegalAccessException
+ | ClassNotFoundException e) {
+ LOG.info(
+ "HBase is not available (not packaged with this application): {} : \"{}\".",
+ e.getClass().getSimpleName(),
+ e.getMessage());
+ }
+ return conf;
+ }
+
+ @Override
+ public Optional<Long> obtainDelegationTokens(
+ Configuration flinkConf,
+ org.apache.hadoop.conf.Configuration hadoopConf,
+ Credentials credentials) {
+ Token<?> token;
+ try {
+ try {
+ LOG.info("Obtaining Kerberos security token for HBase");
+ // ----
+ // Intended call: Token<AuthenticationTokenIdentifier> token =
+ // TokenUtil.obtainToken(conf);
+ token =
+ (Token<?>)
+ Class.forName("org.apache.hadoop.hbase.security.token.TokenUtil")
+ .getMethod(
+ "obtainToken",
+ org.apache.hadoop.conf.Configuration.class)
+ .invoke(null, hbaseConf);
+ } catch (NoSuchMethodException e) {
+ // for HBase 2
+
+ // ----
+ // Intended call: ConnectionFactory connectionFactory =
+ // ConnectionFactory.createConnection(conf);
+ Closeable connectionFactory =
+ (Closeable)
+ Class.forName("org.apache.hadoop.hbase.client.ConnectionFactory")
+ .getMethod(
+ "createConnection",
+ org.apache.hadoop.conf.Configuration.class)
+ .invoke(null, hbaseConf);
+ // ----
+ Class<?> connectionClass =
+ Class.forName("org.apache.hadoop.hbase.client.Connection");
+ // ----
+ // Intended call: Token<AuthenticationTokenIdentifier> token =
+ // TokenUtil.obtainToken(connectionFactory);
+ token =
+ (Token<?>)
+ Class.forName("org.apache.hadoop.hbase.security.token.TokenUtil")
+ .getMethod("obtainToken", connectionClass)
+ .invoke(null, connectionFactory);
+ if (null != connectionFactory) {
+ connectionFactory.close();
+ }
+ }
+ if (token == null) {
+ LOG.error("No Kerberos security token for HBase available");
Review comment:
Similar to the FS DT, shouldn't we fail here?
##########
File path: flink-yarn/src/test/java/org/apache/flink/yarn/security/HadoopFSDelegationTokenProviderTest.java
##########
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.yarn.configuration.YarnConfigOptions;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.junit.Test;
+import sun.security.krb5.KrbException;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeTrue;
+
+/** Tests for {@link HadoopFSDelegationTokenProvider}. */
+public class HadoopFSDelegationTokenProviderTest {
+
+ public static final String HADOOP_SECURITY_AUTHENTICATION = "hadoop.security.authentication";
+ private final org.apache.flink.configuration.Configuration flinkConf =
+ new org.apache.flink.configuration.Configuration();
+
+ @Test
+ public void testShouldReturnFalseWhenSecurityIsNotEnabled() {
+ HadoopFSDelegationTokenProvider provider = new HadoopFSDelegationTokenProvider();
+
+ final Configuration hadoopConf = new Configuration();
+ assumeTrue("simple".equals(hadoopConf.get(HADOOP_SECURITY_AUTHENTICATION)));
+ assertFalse(
+ "Hadoop FS delegation tokens are not required when authentication is simple",
+ provider.delegationTokensRequired(flinkConf, hadoopConf));
+ }
+
+ @Test
+ public void testShouldReturnTrueWhenSecurityIsEnabled() throws KrbException {
+ // fake the realm when kerberos is enabled
+ System.setProperty("java.security.krb5.kdc", "");
+ System.setProperty("java.security.krb5.realm", "DEFAULT.REALM");
+ System.setProperty("java.security.krb5.conf", "/dev/null");
+ sun.security.krb5.Config.refresh();
+
+ final Configuration hadoopConf = new Configuration();
+ // set new hadoop conf to UGI to re-initialize it
+ hadoopConf.set(HADOOP_SECURITY_AUTHENTICATION, "kerberos");
+ try {
+ UserGroupInformation.setConfiguration(hadoopConf);
+ HadoopFSDelegationTokenProvider provider = new HadoopFSDelegationTokenProvider();
+ assertTrue(
+ "Hadoop FS delegation tokens are required when authentication is not simple",
+ provider.delegationTokensRequired(flinkConf, hadoopConf));
+ } finally {
+ // restore the default UGI
+ UserGroupInformation.setConfiguration(new Configuration());
Review comment:
Do we also need to restore the system properties?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772174441
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.
## Automated Checks
Last check on commit 20eea1289502f47226453012ae600303352f7cb9 (Wed Feb 03 02:40:23 UTC 2021)
**Warnings:**
* No documentation files were touched! Remember to keep the Flink docs up to date!
* **This pull request references an unassigned [Jira ticket](https://issues.apache.org/jira/browse/FLINK-21232).** According to the [code contribution guide](https://flink.apache.org/contributing/contribute-code.html), tickets need to be assigned before starting with the implementation work.
<sub>Mention the bot in a comment to re-run the automated checks.</sub>
## Review Progress
* ❓ 1. The [description] looks good.
* ❓ 2. There is [consensus] that the contribution should go into to Flink.
* ❓ 3. Needs [attention] from.
* ❓ 4. The change fits into the overall [architecture].
* ❓ 5. Overall code [quality] is good.
Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
- `@flinkbot approve all` to approve all aspects
- `@flinkbot approve-until architecture` to approve everything until `architecture`
- `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
- `@flinkbot disapprove architecture` to remove an approval you gave earlier
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS commented on a change in pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS commented on a change in pull request #14841:
URL: https://github.com/apache/flink/pull/14841#discussion_r633613001
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopFSDelegationTokenProvider.java
##########
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.configuration.ConfigUtils;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenConfiguration;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenProvider;
+import org.apache.flink.util.FlinkRuntimeException;
+import org.apache.flink.util.function.FunctionUtils;
+import org.apache.flink.yarn.configuration.YarnConfigOptions;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapred.Master;
+import org.apache.hadoop.security.Credentials;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/** Delegation token provider implementation for Hadoop FileSystems. */
+public class HadoopFSDelegationTokenProvider implements HadoopDelegationTokenProvider {
+
+ private static final Logger LOG =
+ LoggerFactory.getLogger(HadoopFSDelegationTokenProvider.class);
+
+ private HadoopDelegationTokenConfiguration hadoopDelegationTokenConf;
+
+ @Override
+ public String serviceName() {
+ return "hadoopfs";
+ }
+
+ @Override
+ public void init(final HadoopDelegationTokenConfiguration conf) {
+ this.hadoopDelegationTokenConf = conf;
+ }
+
+ @Override
+ public boolean delegationTokensRequired() {
+ return UserGroupInformation.isSecurityEnabled();
+ }
+
+ @Override
+ public Optional<Long> obtainDelegationTokens(final Credentials credentials) {
+ try {
+ Set<FileSystem> fileSystemsToAccess = getFileSystemsToAccess();
+
+ final String renewer = getTokenRenewer(hadoopDelegationTokenConf.getHadoopConf());
+ fileSystemsToAccess.forEach(
+ fs -> {
+ try {
+ LOG.info("Getting FS token for: {} with renewer {}", fs, renewer);
+ fs.addDelegationTokens(renewer, credentials);
+ } catch (IOException e) {
+ LOG.warn("Failed to get token for {}.", fs);
Review comment:
Hi @zuston , if the job fails to get the FS DTs, it's supposed to fail, so I will throw a runtime exception to fail fast.
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopFSDelegationTokenProvider.java
##########
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.configuration.ConfigUtils;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenConfiguration;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenProvider;
+import org.apache.flink.util.FlinkRuntimeException;
+import org.apache.flink.util.function.FunctionUtils;
+import org.apache.flink.yarn.configuration.YarnConfigOptions;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapred.Master;
+import org.apache.hadoop.security.Credentials;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/** Delegation token provider implementation for Hadoop FileSystems. */
+public class HadoopFSDelegationTokenProvider implements HadoopDelegationTokenProvider {
+
+ private static final Logger LOG =
+ LoggerFactory.getLogger(HadoopFSDelegationTokenProvider.class);
+
+ private HadoopDelegationTokenConfiguration hadoopDelegationTokenConf;
+
+ @Override
+ public String serviceName() {
+ return "hadoopfs";
+ }
+
+ @Override
+ public void init(final HadoopDelegationTokenConfiguration conf) {
+ this.hadoopDelegationTokenConf = conf;
+ }
+
+ @Override
+ public boolean delegationTokensRequired() {
+ return UserGroupInformation.isSecurityEnabled();
+ }
+
+ @Override
+ public Optional<Long> obtainDelegationTokens(final Credentials credentials) {
+ try {
+ Set<FileSystem> fileSystemsToAccess = getFileSystemsToAccess();
+
+ final String renewer = getTokenRenewer(hadoopDelegationTokenConf.getHadoopConf());
+ fileSystemsToAccess.forEach(
+ fs -> {
+ try {
+ LOG.info("Getting FS token for: {} with renewer {}", fs, renewer);
Review comment:
You're right, I will change this log to show the Filesystem's URI:
`Getting FS token for: viewfs://clusterXX/ with renewer yarn/host@REALM`.
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/Utils.java
##########
@@ -197,13 +196,19 @@ private static LocalResource registerLocalResource(
}
public static void setTokensFor(
- ContainerLaunchContext amContainer, List<Path> paths, Configuration conf)
+ org.apache.flink.configuration.Configuration flinkConf,
+ ContainerLaunchContext amContainer,
+ Configuration hadoopConf)
throws IOException {
Credentials credentials = new Credentials();
- // for HDFS
- TokenCache.obtainTokensForNamenodes(credentials, paths.toArray(new Path[0]), conf);
- // for HBase
- obtainTokenForHBase(credentials, conf);
+
+ // obtain tokens from HadoopDelegationTokenProviders
Review comment:
Merged with FLINK-21700
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopDelegationTokenManager.java
##########
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenConfiguration;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenProvider;
+
+import org.apache.hadoop.security.Credentials;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ServiceLoader;
+
+/**
+ * HadoopDelegationTokenManager is responsible for managing delegation tokens. It can be used to
+ * obtain delegation tokens by calling `obtainDelegationTokens` method.
+ */
+public class HadoopDelegationTokenManager {
+ private static final Logger LOG = LoggerFactory.getLogger(HadoopDelegationTokenManager.class);
+
+ private final HadoopDelegationTokenConfiguration hadoopDelegationTokenConf;
+ private final List<HadoopDelegationTokenProvider> delegationTokenProviders;
+
+ public HadoopDelegationTokenManager(
+ HadoopDelegationTokenConfiguration hadoopDelegationTokenConf) {
+ this.hadoopDelegationTokenConf = hadoopDelegationTokenConf;
+ delegationTokenProviders = loadProviders();
+ }
+
+ /**
+ * Obtain delegation tokens using HadoopDelegationProviders, and store them in the give
+ * credentials.
+ *
+ * @param credentials Credentials object where to store the delegation tokens.
+ */
+ public void obtainDelegationTokens(Credentials credentials) {
+ delegationTokenProviders.forEach(
+ provider -> {
+ if (provider.delegationTokensRequired()) {
+ provider.obtainDelegationTokens(credentials);
+ } else {
+ LOG.info(
+ "Service {} does not need to require a token,",
+ provider.serviceName());
+ }
+ });
+ }
+
+ private List<HadoopDelegationTokenProvider> loadProviders() {
+ ServiceLoader<HadoopDelegationTokenProvider> serviceLoader =
+ ServiceLoader.load(HadoopDelegationTokenProvider.class);
+
+ List<HadoopDelegationTokenProvider> providers = new ArrayList<>();
+
+ Iterator<HadoopDelegationTokenProvider> providerIterator = serviceLoader.iterator();
+ providerIterator.forEachRemaining(
+ provider -> {
+ try {
+ provider.init(hadoopDelegationTokenConf);
Review comment:
I added a debug log for this, I don't want to print log in a verbose way. For each provider, it will print some information about this.
```
INFO org.apache.flink.yarn.Utils [] - Obtaining delegation tokens...
DEBUG org.apache.flink.yarn.security.HadoopDelegationTokenManager [] - Delegation provider hbase loaded and initialized
DEBUG org.apache.flink.yarn.security.HadoopDelegationTokenManager [] - Delegation provider hadoopfs loaded and initialized
INFO org.apache.flink.yarn.security.HBaseDelegationTokenProvider [] - HBase is not available (not packaged with this application): ClassNotFoundException : "org.apache.hadoop.hbase.HBaseConfiguration".
INFO org.apache.flink.yarn.security.HadoopDelegationTokenManager [] - Service hbase does not need to require a token.
INFO org.apache.flink.yarn.security.HadoopFSDelegationTokenProvider [] - Getting FS token for: viewfs://cluster14/ with renewer yarn
INFO org.apache.hadoop.hdfs.DFSClient [] - Created token for test: HDFS_DELEGATION_TOKEN owner=test, renewer=yarn, realUser=, issueDate=1621268501397, maxDate=1621873301397, sequenceNumber=26153859, masterKeyId=726 on ha-hdfs:apstore
INFO org.apache.hadoop.hdfs.DFSClient [] - Created token for test: HDFS_DELEGATION_TOKEN owner=test, renewer=yarn, realUser=, issueDate=1621268501434, maxDate=1621873301434, sequenceNumber=10388618, masterKeyId=252 on ha-hdfs:warehousextab
INFO org.apache.hadoop.hdfs.DFSClient [] - Created token for test: HDFS_DELEGATION_TOKEN owner=test, renewer=yarn, realUser=, issueDate=1621268501489, maxDate=1621873301489, sequenceNumber=86464794, masterKeyId=729 on ha-hdfs:warehousestore
INFO org.apache.hadoop.hdfs.DFSClient [] - Created token for test: HDFS_DELEGATION_TOKEN owner=test, renewer=yarn, realUser=, issueDate=1621268501506, maxDate=1621873301506, sequenceNumber=10343224, masterKeyId=255 on ha-hdfs:warehousextac
INFO org.apache.hadoop.hdfs.DFSClient [] - Created token for test: HDFS_DELEGATION_TOKEN owner=test, renewer=yarn, realUser=, issueDate=1621268501524, maxDate=1621873301524, sequenceNumber=10340707, masterKeyId=249 on ha-hdfs:warehousextaa
INFO org.apache.hadoop.hdfs.DFSClient [] - Created token for test: HDFS_DELEGATION_TOKEN owner=test, renewer=yarn, realUser=, issueDate=1621268501528, maxDate=1621873301528, sequenceNumber=421001249, masterKeyId=714 on ha-hdfs:beaconstore
INFO org.apache.flink.yarn.YarnClusterDescriptor [] - Submitting application master application_1620874570676_200951
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* a02d0f10862cc919e7e6c125bc54381b475e53be Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040)
* 9427b12058c9bb662187d0b8b63ea483c97524a0 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] lirui-apache commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
lirui-apache commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-786638294
@JackWangCS Sorry for the late reply. Regarding how to specify hive-site, I guess it's better to use `TableFactory` to support custom properties. And each implementation can use the service name as the identifier. You can refer to `HiveCatalogFactory` to see how it supports hive conf dir.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
}, {
"hash" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095",
"triggerID" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"triggerType" : "PUSH"
}, {
"hash" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14131",
"triggerID" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"triggerType" : "PUSH"
}, {
"hash" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14484",
"triggerID" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"triggerType" : "PUSH"
}, {
"hash" : "83aa947d7ab9528a7c8b3418316066b19f0e6916",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14579",
"triggerID" : "83aa947d7ab9528a7c8b3418316066b19f0e6916",
"triggerType" : "PUSH"
}, {
"hash" : "b88e8b4068b23de76bfcba85fbeeee1373b478a5",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "b88e8b4068b23de76bfcba85fbeeee1373b478a5",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* 83aa947d7ab9528a7c8b3418316066b19f0e6916 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14579)
* b88e8b4068b23de76bfcba85fbeeee1373b478a5 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
}, {
"hash" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095",
"triggerID" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"triggerType" : "PUSH"
}, {
"hash" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14131",
"triggerID" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* 76442a5286c4d6916506fdd6dc877065b3c95b39 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095)
* 46e3ffab55d1abcae38cdd50335ae33276016168 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14131)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* 5ac13369815e62f4e5ad1916f745bc9eaf111b81 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS commented on a change in pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS commented on a change in pull request #14841:
URL: https://github.com/apache/flink/pull/14841#discussion_r571630224
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopDelegationTokenProvider.java
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
Review comment:
DT provider could also work with other deployments in the future if we leverage DT for long running jobs(instead of using keytab to connect HDFS/Hive directly), but this needs a big refactor.
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HBaseDelegationTokenProvider.java
##########
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.configuration.Configuration;
+
+import org.apache.hadoop.security.Credentials;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.apache.hadoop.security.token.Token;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.Closeable;
+import java.io.IOException;
+import java.lang.reflect.InvocationTargetException;
+import java.util.Optional;
+
+/** Delegation token provider implementation for HBase. */
+public class HBaseDelegationTokenProvider implements HadoopDelegationTokenProvider {
+
+ private static final Logger LOG = LoggerFactory.getLogger(HBaseDelegationTokenProvider.class);
+
+ private org.apache.hadoop.conf.Configuration hbaseConf;
+
+ @Override
+ public String serviceName() {
+ return "hbase";
+ }
+
+ @Override
+ public boolean delegationTokensRequired(
+ Configuration flinkConf, org.apache.hadoop.conf.Configuration hadoopConf) {
+ if (UserGroupInformation.isSecurityEnabled()) {
+ hbaseConf = createHBaseConfiguration(hadoopConf);
+ LOG.debug("HBase security setting: {}", hbaseConf.get("hbase.security.authentication"));
+
+ boolean required = "kerberos".equals(hbaseConf.get("hbase.security.authentication"));
+ if (!required) {
+ LOG.debug("HBase has not been configured to use Kerberos.");
+ }
+ return required;
+ } else {
+ return false;
+ }
+ }
+
+ private org.apache.hadoop.conf.Configuration createHBaseConfiguration(
+ org.apache.hadoop.conf.Configuration conf) {
+ try {
+ // ----
+ // Intended call: HBaseConfiguration.create(conf);
+ return (org.apache.hadoop.conf.Configuration)
+ Class.forName("org.apache.hadoop.hbase.HBaseConfiguration")
+ .getMethod("create", org.apache.hadoop.conf.Configuration.class)
+ .invoke(null, conf);
+ // ----
+
+ } catch (InvocationTargetException
+ | NoSuchMethodException
+ | IllegalAccessException
+ | ClassNotFoundException e) {
+ LOG.info(
+ "HBase is not available (not packaged with this application): {} : \"{}\".",
+ e.getClass().getSimpleName(),
+ e.getMessage());
+ }
+ return conf;
+ }
+
+ @Override
+ public Optional<Long> obtainDelegationTokens(
+ Configuration flinkConf,
+ org.apache.hadoop.conf.Configuration hadoopConf,
+ Credentials credentials) {
+ Token<?> token;
+ try {
+ try {
+ LOG.info("Obtaining Kerberos security token for HBase");
+ // ----
+ // Intended call: Token<AuthenticationTokenIdentifier> token =
+ // TokenUtil.obtainToken(conf);
+ token =
+ (Token<?>)
+ Class.forName("org.apache.hadoop.hbase.security.token.TokenUtil")
+ .getMethod(
+ "obtainToken",
+ org.apache.hadoop.conf.Configuration.class)
+ .invoke(null, hbaseConf);
+ } catch (NoSuchMethodException e) {
+ // for HBase 2
+
+ // ----
+ // Intended call: ConnectionFactory connectionFactory =
+ // ConnectionFactory.createConnection(conf);
+ Closeable connectionFactory =
+ (Closeable)
+ Class.forName("org.apache.hadoop.hbase.client.ConnectionFactory")
+ .getMethod(
+ "createConnection",
+ org.apache.hadoop.conf.Configuration.class)
+ .invoke(null, hbaseConf);
+ // ----
+ Class<?> connectionClass =
+ Class.forName("org.apache.hadoop.hbase.client.Connection");
+ // ----
+ // Intended call: Token<AuthenticationTokenIdentifier> token =
+ // TokenUtil.obtainToken(connectionFactory);
+ token =
+ (Token<?>)
+ Class.forName("org.apache.hadoop.hbase.security.token.TokenUtil")
+ .getMethod("obtainToken", connectionClass)
+ .invoke(null, connectionFactory);
+ if (null != connectionFactory) {
+ connectionFactory.close();
+ }
+ }
+ if (token == null) {
+ LOG.error("No Kerberos security token for HBase available");
Review comment:
For HBase case, I think we shouldn't fail here. It's very common that the hbase-site.xml is in the classpath but the job does not access the HBase. If we fail here, it will impact these kinds of jobs.
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopFSDelegationTokenProvider.java
##########
@@ -0,0 +1,117 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.configuration.ConfigUtils;
+import org.apache.flink.configuration.Configuration;
+import org.apache.flink.util.function.FunctionUtils;
+import org.apache.flink.yarn.configuration.YarnConfigOptions;
+
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapred.Master;
+import org.apache.hadoop.security.Credentials;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/** Delegation token provider implementation for Hadoop FileSystems. */
+public class HadoopFSDelegationTokenProvider implements HadoopDelegationTokenProvider {
+
+ private static final Logger LOG =
+ LoggerFactory.getLogger(HadoopFSDelegationTokenProvider.class);
+
+ @Override
+ public String serviceName() {
+ return "hadoopfs";
+ }
+
+ @Override
+ public boolean delegationTokensRequired(
+ Configuration flinkConf, org.apache.hadoop.conf.Configuration hadoopConf) {
+ return UserGroupInformation.isSecurityEnabled();
+ }
+
+ @Override
+ public Optional<Long> obtainDelegationTokens(
+ Configuration flinkConf,
+ org.apache.hadoop.conf.Configuration hadoopConf,
+ Credentials credentials) {
+ try {
+ Set<FileSystem> fileSystemsToAccess = getFileSystemsToAccess(flinkConf, hadoopConf);
+
+ final String renewer = getTokenRenewer(hadoopConf);
+ fileSystemsToAccess.forEach(
+ fs -> {
+ try {
+ LOG.info("Getting FS token for: {} with renewer {}", fs, renewer);
+ fs.addDelegationTokens(renewer, credentials);
+ } catch (IOException e) {
+ LOG.warn("Failed to get token for {}.", fs);
+ }
+ });
+ } catch (IOException e) {
+ LOG.error("Failed to obtain tokens for Hadoop FileSystems: {}", e.getMessage());
+ }
+ // Flink does not support to renew the delegation token currently
Review comment:
Thanks for pointing out this. I have changed the code so that `getTokenRenewer` will hanlde the IOException and if it fails to get renewer, it will return null to indicate that.
Also, if the job fails to get the FS DTs, it's supposed to fail, so I will throw a runtime exception to fail fast
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopDelegationTokenProvider.java
##########
@@ -0,0 +1,56 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.configuration.Configuration;
+
+import org.apache.hadoop.security.Credentials;
+
+import java.util.Optional;
+
+/** Hadoop delegation token provider. */
+public interface HadoopDelegationTokenProvider {
+
+ /** Name of the service to provide delegation tokens. This name should be unique. */
+ String serviceName();
+
+ /**
+ * Return true if delegation tokens are required for this service.
+ *
+ * @param flinkConf Flink configuration
+ * @param hadoopConf Hadoop configuration
+ * @return true if delegation tokens are required
+ */
+ boolean delegationTokensRequired(
Review comment:
The `flinkConf` contains the Flink configuration, user could specify some additional configurations when implementing the `HadoopDelegationTokenProvider`. The `hadoopConf` is the hadoop conf for the Yarn cluster the job will be submitted to.
As far as I know, DelegationTokenIssuer will automatically handle the existing tokens case:
https://github.com/apache/hadoop/blob/19ae0faacc5b1e8ce05f11c555922c0c025dcf3b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/security/token/DelegationTokenIssuer.java#L58
The `init()` method is a good idea, I will change to that.
##########
File path: flink-yarn/src/test/java/org/apache/flink/yarn/security/HadoopFSDelegationTokenProviderTest.java
##########
@@ -0,0 +1,105 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.yarn.configuration.YarnConfigOptions;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.junit.Test;
+import sun.security.krb5.KrbException;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeTrue;
+
+/** Tests for {@link HadoopFSDelegationTokenProvider}. */
+public class HadoopFSDelegationTokenProviderTest {
+
+ public static final String HADOOP_SECURITY_AUTHENTICATION = "hadoop.security.authentication";
+ private final org.apache.flink.configuration.Configuration flinkConf =
+ new org.apache.flink.configuration.Configuration();
+
+ @Test
+ public void testShouldReturnFalseWhenSecurityIsNotEnabled() {
+ HadoopFSDelegationTokenProvider provider = new HadoopFSDelegationTokenProvider();
+
+ final Configuration hadoopConf = new Configuration();
+ assumeTrue("simple".equals(hadoopConf.get(HADOOP_SECURITY_AUTHENTICATION)));
+ assertFalse(
+ "Hadoop FS delegation tokens are not required when authentication is simple",
+ provider.delegationTokensRequired(flinkConf, hadoopConf));
+ }
+
+ @Test
+ public void testShouldReturnTrueWhenSecurityIsEnabled() throws KrbException {
+ // fake the realm when kerberos is enabled
+ System.setProperty("java.security.krb5.kdc", "");
+ System.setProperty("java.security.krb5.realm", "DEFAULT.REALM");
+ System.setProperty("java.security.krb5.conf", "/dev/null");
+ sun.security.krb5.Config.refresh();
+
+ final Configuration hadoopConf = new Configuration();
+ // set new hadoop conf to UGI to re-initialize it
+ hadoopConf.set(HADOOP_SECURITY_AUTHENTICATION, "kerberos");
+ try {
+ UserGroupInformation.setConfiguration(hadoopConf);
+ HadoopFSDelegationTokenProvider provider = new HadoopFSDelegationTokenProvider();
+ assertTrue(
+ "Hadoop FS delegation tokens are required when authentication is not simple",
+ provider.delegationTokensRequired(flinkConf, hadoopConf));
+ } finally {
+ // restore the default UGI
+ UserGroupInformation.setConfiguration(new Configuration());
Review comment:
yes, it's better to clean up these properties.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
}, {
"hash" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095",
"triggerID" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"triggerType" : "PUSH"
}, {
"hash" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14131",
"triggerID" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* 46e3ffab55d1abcae38cdd50335ae33276016168 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14131)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
}, {
"hash" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095",
"triggerID" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075)
* 76442a5286c4d6916506fdd6dc877065b3c95b39 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
}, {
"hash" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095",
"triggerID" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"triggerType" : "PUSH"
}, {
"hash" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* 76442a5286c4d6916506fdd6dc877065b3c95b39 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095)
* 46e3ffab55d1abcae38cdd50335ae33276016168 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 20eea1289502f47226453012ae600303352f7cb9 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826)
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* a02d0f10862cc919e7e6c125bc54381b475e53be UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] gaborgsomogyi edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
gaborgsomogyi edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-891938008
As I see this is not solving 2 major issues which belongs to this area:
* DTs not re-obtained which makes workloads fail after 7 days (I don't thing renew worth the hassle, we've seen this in Spark already) Please see [this](https://github.com/apache/flink/blob/4d19a9f09e58ae5726901b1c6c473b655d908440/flink-runtime/src/main/java/org/apache/flink/runtime/security/modules/HadoopModule.java#L89-L104).
* DTs are not propagated to workers in a flexible but secure way
Adding features and not solving these problems is a way we should't proceed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 20eea1289502f47226453012ae600303352f7cb9 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826)
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] lirui-apache commented on a change in pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
lirui-apache commented on a change in pull request #14841:
URL: https://github.com/apache/flink/pull/14841#discussion_r593128531
##########
File path: flink-yarn/src/test/java/org/apache/flink/yarn/security/HadoopFSDelegationTokenProviderTest.java
##########
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenConfiguration;
+import org.apache.flink.yarn.configuration.YarnConfigOptions;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.junit.Test;
+import sun.security.krb5.KrbException;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeTrue;
+
+/** Tests for {@link HadoopFSDelegationTokenProvider}. */
+public class HadoopFSDelegationTokenProviderTest {
+
+ public static final String HADOOP_SECURITY_AUTHENTICATION = "hadoop.security.authentication";
Review comment:
Can we use the key in hadoop's `CommonConfigurationKeysPublic`?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
}, {
"hash" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095",
"triggerID" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"triggerType" : "PUSH"
}, {
"hash" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14131",
"triggerID" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"triggerType" : "PUSH"
}, {
"hash" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14484",
"triggerID" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"triggerType" : "PUSH"
}, {
"hash" : "83aa947d7ab9528a7c8b3418316066b19f0e6916",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14579",
"triggerID" : "83aa947d7ab9528a7c8b3418316066b19f0e6916",
"triggerType" : "PUSH"
}, {
"hash" : "b88e8b4068b23de76bfcba85fbeeee1373b478a5",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "b88e8b4068b23de76bfcba85fbeeee1373b478a5",
"triggerType" : "PUSH"
}, {
"hash" : "5a2467236a4ef8c211a9d4a9d9092d91cff1b23d",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18050",
"triggerID" : "5a2467236a4ef8c211a9d4a9d9092d91cff1b23d",
"triggerType" : "PUSH"
}, {
"hash" : "6836c1c8fa5104ce24ca1fabd16c743032ffafac",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18104",
"triggerID" : "6836c1c8fa5104ce24ca1fabd16c743032ffafac",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* b88e8b4068b23de76bfcba85fbeeee1373b478a5 UNKNOWN
* 6836c1c8fa5104ce24ca1fabd16c743032ffafac Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18104)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS closed pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS closed pull request #14841:
URL: https://github.com/apache/flink/pull/14841
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
}, {
"hash" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095",
"triggerID" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"triggerType" : "PUSH"
}, {
"hash" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14131",
"triggerID" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"triggerType" : "PUSH"
}, {
"hash" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14484",
"triggerID" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"triggerType" : "PUSH"
}, {
"hash" : "83aa947d7ab9528a7c8b3418316066b19f0e6916",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14579",
"triggerID" : "83aa947d7ab9528a7c8b3418316066b19f0e6916",
"triggerType" : "PUSH"
}, {
"hash" : "b88e8b4068b23de76bfcba85fbeeee1373b478a5",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "b88e8b4068b23de76bfcba85fbeeee1373b478a5",
"triggerType" : "PUSH"
}, {
"hash" : "5a2467236a4ef8c211a9d4a9d9092d91cff1b23d",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18050",
"triggerID" : "5a2467236a4ef8c211a9d4a9d9092d91cff1b23d",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* b88e8b4068b23de76bfcba85fbeeee1373b478a5 UNKNOWN
* 5a2467236a4ef8c211a9d4a9d9092d91cff1b23d Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18050)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-774828868
Hi @lirui-apache, thanks for your review! For Hive DT provider, from my view, there are two basic ways:
* User need to specify it in Flink Configuration via yaml or command line args
* Keep a registration about each Hive catalogs, the DT provider could access the registration to get the hive related information.
I am not familiar about hive connector part, what do you think?
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* 5ac13369815e62f4e5ad1916f745bc9eaf111b81 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062)
* dffe43fa9727cd26df45162fe880542f4c49162c Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
}, {
"hash" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095",
"triggerID" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"triggerType" : "PUSH"
}, {
"hash" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14131",
"triggerID" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"triggerType" : "PUSH"
}, {
"hash" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14484",
"triggerID" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"triggerType" : "PUSH"
}, {
"hash" : "83aa947d7ab9528a7c8b3418316066b19f0e6916",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14579",
"triggerID" : "83aa947d7ab9528a7c8b3418316066b19f0e6916",
"triggerType" : "PUSH"
}, {
"hash" : "b88e8b4068b23de76bfcba85fbeeee1373b478a5",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "b88e8b4068b23de76bfcba85fbeeee1373b478a5",
"triggerType" : "PUSH"
}, {
"hash" : "5a2467236a4ef8c211a9d4a9d9092d91cff1b23d",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "5a2467236a4ef8c211a9d4a9d9092d91cff1b23d",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* 83aa947d7ab9528a7c8b3418316066b19f0e6916 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14579)
* b88e8b4068b23de76bfcba85fbeeee1373b478a5 UNKNOWN
* 5a2467236a4ef8c211a9d4a9d9092d91cff1b23d UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
}, {
"hash" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095",
"triggerID" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"triggerType" : "PUSH"
}, {
"hash" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14131",
"triggerID" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"triggerType" : "PUSH"
}, {
"hash" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14484",
"triggerID" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"triggerType" : "PUSH"
}, {
"hash" : "83aa947d7ab9528a7c8b3418316066b19f0e6916",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14579",
"triggerID" : "83aa947d7ab9528a7c8b3418316066b19f0e6916",
"triggerType" : "PUSH"
}, {
"hash" : "b88e8b4068b23de76bfcba85fbeeee1373b478a5",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "b88e8b4068b23de76bfcba85fbeeee1373b478a5",
"triggerType" : "PUSH"
}, {
"hash" : "5a2467236a4ef8c211a9d4a9d9092d91cff1b23d",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18050",
"triggerID" : "5a2467236a4ef8c211a9d4a9d9092d91cff1b23d",
"triggerType" : "PUSH"
}, {
"hash" : "6836c1c8fa5104ce24ca1fabd16c743032ffafac",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "6836c1c8fa5104ce24ca1fabd16c743032ffafac",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* b88e8b4068b23de76bfcba85fbeeee1373b478a5 UNKNOWN
* 5a2467236a4ef8c211a9d4a9d9092d91cff1b23d Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18050)
* 6836c1c8fa5104ce24ca1fabd16c743032ffafac UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-893501105
Hi @mbalassi and @gaborgsomogyi , thanks for your reply. You are right, this implementation now just introduces new APIs but does not address some main concerns. The initial idea for this PR is that we want to support Hive delegation token in a short-live sql-client, so it does not include features such as renewing tokens, propagating DTs to workers, etc and it's not an end-to-end solution, I will close this PR.
@gaborgsomogyi , great to hear that you already have a FLIP, I am happy to contribute and collaborate with you.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* 9427b12058c9bb662187d0b8b63ea483c97524a0 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zentol commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
zentol commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-786559519
@lirui-apache ping
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
}, {
"hash" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095",
"triggerID" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"triggerType" : "PUSH"
}, {
"hash" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14131",
"triggerID" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"triggerType" : "PUSH"
}, {
"hash" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14484",
"triggerID" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* 46e3ffab55d1abcae38cdd50335ae33276016168 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14131)
* 9f3d3ba536485d6d4113cd0dd3f162300abef855 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14484)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS commented on a change in pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS commented on a change in pull request #14841:
URL: https://github.com/apache/flink/pull/14841#discussion_r593730703
##########
File path: flink-yarn/src/test/java/org/apache/flink/yarn/security/HadoopFSDelegationTokenProviderTest.java
##########
@@ -0,0 +1,123 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenConfiguration;
+import org.apache.flink.yarn.configuration.YarnConfigOptions;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.junit.Test;
+import sun.security.krb5.KrbException;
+
+import java.io.IOException;
+import java.util.Collections;
+import java.util.HashSet;
+import java.util.List;
+import java.util.Set;
+
+import static org.hamcrest.CoreMatchers.is;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertThat;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assume.assumeTrue;
+
+/** Tests for {@link HadoopFSDelegationTokenProvider}. */
+public class HadoopFSDelegationTokenProviderTest {
+
+ public static final String HADOOP_SECURITY_AUTHENTICATION = "hadoop.security.authentication";
Review comment:
I will use the `CommonConfigurationKeysPublic` for this, thanks
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
}, {
"hash" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075)
* 76442a5286c4d6916506fdd6dc877065b3c95b39 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] lirui-apache commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
lirui-apache commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-795082975
Hi @JackWangCS , I guess it's not worth the efforts to implement something like the TableFactory in flink runtime. Perhaps we can just support configurations in yaml file like you initially proposed. So no need of the factories. Sorry for the back and forth.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-774586795
Hi @lirui-apache , @XComp , could you help to review this PR? thanks
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS commented on a change in pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS commented on a change in pull request #14841:
URL: https://github.com/apache/flink/pull/14841#discussion_r633702422
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopDelegationTokenManager.java
##########
@@ -0,0 +1,96 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenConfiguration;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenProvider;
+
+import org.apache.hadoop.security.Credentials;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.util.ArrayList;
+import java.util.Iterator;
+import java.util.List;
+import java.util.ServiceLoader;
+
+/**
+ * HadoopDelegationTokenManager is responsible for managing delegation tokens. It can be used to
+ * obtain delegation tokens by calling `obtainDelegationTokens` method.
+ */
+public class HadoopDelegationTokenManager {
+ private static final Logger LOG = LoggerFactory.getLogger(HadoopDelegationTokenManager.class);
+
+ private final HadoopDelegationTokenConfiguration hadoopDelegationTokenConf;
+ private final List<HadoopDelegationTokenProvider> delegationTokenProviders;
+
+ public HadoopDelegationTokenManager(
+ HadoopDelegationTokenConfiguration hadoopDelegationTokenConf) {
+ this.hadoopDelegationTokenConf = hadoopDelegationTokenConf;
+ delegationTokenProviders = loadProviders();
+ }
+
+ /**
+ * Obtain delegation tokens using HadoopDelegationProviders, and store them in the give
+ * credentials.
+ *
+ * @param credentials Credentials object where to store the delegation tokens.
+ */
+ public void obtainDelegationTokens(Credentials credentials) {
+ delegationTokenProviders.forEach(
+ provider -> {
+ if (provider.delegationTokensRequired()) {
+ provider.obtainDelegationTokens(credentials);
+ } else {
+ LOG.info(
+ "Service {} does not need to require a token,",
+ provider.serviceName());
+ }
+ });
+ }
+
+ private List<HadoopDelegationTokenProvider> loadProviders() {
+ ServiceLoader<HadoopDelegationTokenProvider> serviceLoader =
+ ServiceLoader.load(HadoopDelegationTokenProvider.class);
+
+ List<HadoopDelegationTokenProvider> providers = new ArrayList<>();
+
+ Iterator<HadoopDelegationTokenProvider> providerIterator = serviceLoader.iterator();
+ providerIterator.forEachRemaining(
+ provider -> {
+ try {
+ provider.init(hadoopDelegationTokenConf);
Review comment:
I added a debug log for this, I don't want to print log in a verbose way. For each provider, it will print some information about this.
```
INFO org.apache.flink.yarn.Utils [] - Obtaining delegation tokens...
DEBUG org.apache.flink.yarn.security.HadoopDelegationTokenManager [] - Delegation provider hbase loaded and initialized
DEBUG org.apache.flink.yarn.security.HadoopDelegationTokenManager [] - Delegation provider hadoopfs loaded and initialized
INFO org.apache.flink.yarn.security.HBaseDelegationTokenProvider [] - HBase is not available (not packaged with this application): ClassNotFoundException : "org.apache.hadoop.hbase.HBaseConfiguration".
INFO org.apache.flink.yarn.security.HadoopDelegationTokenManager [] - Service hbase does not need to require a token.
INFO org.apache.flink.yarn.security.HadoopFSDelegationTokenProvider [] - Getting FS token for: viewfs://cluster14/ with renewer yarn
INFO org.apache.hadoop.hdfs.DFSClient [] - Created token for test: HDFS_DELEGATION_TOKEN owner=test, renewer=yarn, realUser=, issueDate=1621268501397, maxDate=1621873301397, sequenceNumber=26153859, masterKeyId=726 on ha-hdfs:apstore
INFO org.apache.hadoop.hdfs.DFSClient [] - Created token for test: HDFS_DELEGATION_TOKEN owner=test, renewer=yarn, realUser=, issueDate=1621268501434, maxDate=1621873301434, sequenceNumber=10388618, masterKeyId=252 on ha-hdfs:warehousextab
INFO org.apache.hadoop.hdfs.DFSClient [] - Created token for test: HDFS_DELEGATION_TOKEN owner=test, renewer=yarn, realUser=, issueDate=1621268501489, maxDate=1621873301489, sequenceNumber=86464794, masterKeyId=729 on ha-hdfs:warehousestore
INFO org.apache.hadoop.hdfs.DFSClient [] - Created token for test: HDFS_DELEGATION_TOKEN owner=test, renewer=yarn, realUser=, issueDate=1621268501506, maxDate=1621873301506, sequenceNumber=10343224, masterKeyId=255 on ha-hdfs:warehousextac
INFO org.apache.hadoop.hdfs.DFSClient [] - Created token for test: HDFS_DELEGATION_TOKEN owner=test, renewer=yarn, realUser=, issueDate=1621268501524, maxDate=1621873301524, sequenceNumber=10340707, masterKeyId=249 on ha-hdfs:warehousextaa
INFO org.apache.hadoop.hdfs.DFSClient [] - Created token for test: HDFS_DELEGATION_TOKEN owner=test, renewer=yarn, realUser=, issueDate=1621268501528, maxDate=1621873301528, sequenceNumber=421001249, masterKeyId=714 on ha-hdfs:beaconstore
INFO org.apache.flink.yarn.YarnClusterDescriptor [] - Submitting application master application_1620874570676_200951
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS commented on a change in pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS commented on a change in pull request #14841:
URL: https://github.com/apache/flink/pull/14841#discussion_r633699654
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopFSDelegationTokenProvider.java
##########
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.configuration.ConfigUtils;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenConfiguration;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenProvider;
+import org.apache.flink.util.FlinkRuntimeException;
+import org.apache.flink.util.function.FunctionUtils;
+import org.apache.flink.yarn.configuration.YarnConfigOptions;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapred.Master;
+import org.apache.hadoop.security.Credentials;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/** Delegation token provider implementation for Hadoop FileSystems. */
+public class HadoopFSDelegationTokenProvider implements HadoopDelegationTokenProvider {
+
+ private static final Logger LOG =
+ LoggerFactory.getLogger(HadoopFSDelegationTokenProvider.class);
+
+ private HadoopDelegationTokenConfiguration hadoopDelegationTokenConf;
+
+ @Override
+ public String serviceName() {
+ return "hadoopfs";
+ }
+
+ @Override
+ public void init(final HadoopDelegationTokenConfiguration conf) {
+ this.hadoopDelegationTokenConf = conf;
+ }
+
+ @Override
+ public boolean delegationTokensRequired() {
+ return UserGroupInformation.isSecurityEnabled();
+ }
+
+ @Override
+ public Optional<Long> obtainDelegationTokens(final Credentials credentials) {
+ try {
+ Set<FileSystem> fileSystemsToAccess = getFileSystemsToAccess();
+
+ final String renewer = getTokenRenewer(hadoopDelegationTokenConf.getHadoopConf());
+ fileSystemsToAccess.forEach(
+ fs -> {
+ try {
+ LOG.info("Getting FS token for: {} with renewer {}", fs, renewer);
Review comment:
You're right, I will change this log to show the Filesystem's URI:
`Getting FS token for: viewfs://clusterXX/ with renewer yarn/host@REALM`.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
}, {
"hash" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095",
"triggerID" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"triggerType" : "PUSH"
}, {
"hash" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14131",
"triggerID" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"triggerType" : "PUSH"
}, {
"hash" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14484",
"triggerID" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"triggerType" : "PUSH"
}, {
"hash" : "83aa947d7ab9528a7c8b3418316066b19f0e6916",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "83aa947d7ab9528a7c8b3418316066b19f0e6916",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* 9f3d3ba536485d6d4113cd0dd3f162300abef855 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14484)
* 83aa947d7ab9528a7c8b3418316066b19f0e6916 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zuston commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
zuston commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-842922741
Here. https://github.com/apache/flink/pull/14841/files/83aa947d7ab9528a7c8b3418316066b19f0e6916?file-filters%5B%5D=.java#r634018947.
Why you catch IOException? @JackWangCS
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772173966
The PR is just a PoC and still working in progress.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] gaborgsomogyi edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
gaborgsomogyi edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-891938008
As I see this is not solving 2 major issues which belongs to this area:
* DTs not re-obtained which makes workloads fail after 7 days, please see [this](https://github.com/apache/flink/blob/4d19a9f09e58ae5726901b1c6c473b655d908440/flink-runtime/src/main/java/org/apache/flink/runtime/security/modules/HadoopModule.java#L89-L104) (I don't thing renew worth the hassle, we've seen this in Spark already).
* DTs are not propagated to workers in a flexible but secure way
Adding features and not solving these problems is a way we should't proceed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-885999002
Hi @XComp , @tillrohrmann , could you help to review this PR?
Thanks!
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* 5ac13369815e62f4e5ad1916f745bc9eaf111b81 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062)
* dffe43fa9727cd26df45162fe880542f4c49162c UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14075",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
}, {
"hash" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14095",
"triggerID" : "76442a5286c4d6916506fdd6dc877065b3c95b39",
"triggerType" : "PUSH"
}, {
"hash" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14131",
"triggerID" : "46e3ffab55d1abcae38cdd50335ae33276016168",
"triggerType" : "PUSH"
}, {
"hash" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14484",
"triggerID" : "9f3d3ba536485d6d4113cd0dd3f162300abef855",
"triggerType" : "PUSH"
}, {
"hash" : "83aa947d7ab9528a7c8b3418316066b19f0e6916",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14579",
"triggerID" : "83aa947d7ab9528a7c8b3418316066b19f0e6916",
"triggerType" : "PUSH"
}, {
"hash" : "b88e8b4068b23de76bfcba85fbeeee1373b478a5",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "b88e8b4068b23de76bfcba85fbeeee1373b478a5",
"triggerType" : "PUSH"
}, {
"hash" : "5a2467236a4ef8c211a9d4a9d9092d91cff1b23d",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18050",
"triggerID" : "5a2467236a4ef8c211a9d4a9d9092d91cff1b23d",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* 83aa947d7ab9528a7c8b3418316066b19f0e6916 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=14579)
* b88e8b4068b23de76bfcba85fbeeee1373b478a5 UNKNOWN
* 5a2467236a4ef8c211a9d4a9d9092d91cff1b23d Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=18050)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* 9427b12058c9bb662187d0b8b63ea483c97524a0 Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048)
* 5ac13369815e62f4e5ad1916f745bc9eaf111b81 UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
}, {
"hash" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "60e427103cca73ac1fc29fb18893e3996edb1c7a",
"triggerType" : "PUSH"
}, {
"hash" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13040",
"triggerID" : "a02d0f10862cc919e7e6c125bc54381b475e53be",
"triggerType" : "PUSH"
}, {
"hash" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13048",
"triggerID" : "9427b12058c9bb662187d0b8b63ea483c97524a0",
"triggerType" : "PUSH"
}, {
"hash" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13062",
"triggerID" : "5ac13369815e62f4e5ad1916f745bc9eaf111b81",
"triggerType" : "PUSH"
}, {
"hash" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075",
"triggerID" : "dffe43fa9727cd26df45162fe880542f4c49162c",
"triggerType" : "PUSH"
}, {
"hash" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 60e427103cca73ac1fc29fb18893e3996edb1c7a UNKNOWN
* dffe43fa9727cd26df45162fe880542f4c49162c Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=13075)
* cbaf10a07272ce5b3019e98a51cb0ef7f1cdd86b UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS commented on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS commented on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-791421666
Hi @lirui-apache, thanks for your comment. When implementing this PoC, I also want to support properties dynamically. But in some cases, the delegation tokens are obtained before the Job's main fucntion running. If user runs his job using `run-application` command in application mode, the main function will be executed at Yarn.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-772182984
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "20eea1289502f47226453012ae600303352f7cb9",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826",
"triggerID" : "20eea1289502f47226453012ae600303352f7cb9",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 20eea1289502f47226453012ae600303352f7cb9 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=12826)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@flinkbot run azure` re-run the last Azure build
</details>
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] gaborgsomogyi edited a comment on pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
gaborgsomogyi edited a comment on pull request #14841:
URL: https://github.com/apache/flink/pull/14841#issuecomment-891938008
As I see this is not solving 2 major issues which belongs to this area:
* DTs not re-obtained which makes workloads fail after 7 days, please see [this](https://github.com/apache/flink/blob/4d19a9f09e58ae5726901b1c6c473b655d908440/flink-runtime/src/main/java/org/apache/flink/runtime/security/modules/HadoopModule.java#L89-L104) (I don't thing renew worth the hassle, we've seen this in Spark already, re-obtain is enough with less code).
* DTs are not propagated to workers in a flexible but secure way
Adding features and not solving these problems is a way we should't proceed.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] JackWangCS commented on a change in pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
JackWangCS commented on a change in pull request #14841:
URL: https://github.com/apache/flink/pull/14841#discussion_r571628601
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HBaseDelegationTokenProvider.java
##########
@@ -0,0 +1,153 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
Review comment:
Idealy, we should do that. But this may break the back compatibility if we move it hbase connector currently because the hbase connector is an optional jar in dist binary.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] zuston commented on a change in pull request #14841: [FLINK-21232][YARN][Common] Introduce pluggable Hadoop delegation token providers
Posted by GitBox <gi...@apache.org>.
zuston commented on a change in pull request #14841:
URL: https://github.com/apache/flink/pull/14841#discussion_r633255170
##########
File path: flink-yarn/src/main/java/org/apache/flink/yarn/security/HadoopFSDelegationTokenProvider.java
##########
@@ -0,0 +1,126 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.flink.yarn.security;
+
+import org.apache.flink.annotation.VisibleForTesting;
+import org.apache.flink.configuration.ConfigUtils;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenConfiguration;
+import org.apache.flink.runtime.security.delegationtokens.HadoopDelegationTokenProvider;
+import org.apache.flink.util.FlinkRuntimeException;
+import org.apache.flink.util.function.FunctionUtils;
+import org.apache.flink.yarn.configuration.YarnConfigOptions;
+
+import org.apache.hadoop.conf.Configuration;
+import org.apache.hadoop.fs.FileSystem;
+import org.apache.hadoop.fs.Path;
+import org.apache.hadoop.mapred.Master;
+import org.apache.hadoop.security.Credentials;
+import org.apache.hadoop.security.UserGroupInformation;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.HashSet;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+/** Delegation token provider implementation for Hadoop FileSystems. */
+public class HadoopFSDelegationTokenProvider implements HadoopDelegationTokenProvider {
+
+ private static final Logger LOG =
+ LoggerFactory.getLogger(HadoopFSDelegationTokenProvider.class);
+
+ private HadoopDelegationTokenConfiguration hadoopDelegationTokenConf;
+
+ @Override
+ public String serviceName() {
+ return "hadoopfs";
+ }
+
+ @Override
+ public void init(final HadoopDelegationTokenConfiguration conf) {
+ this.hadoopDelegationTokenConf = conf;
+ }
+
+ @Override
+ public boolean delegationTokensRequired() {
+ return UserGroupInformation.isSecurityEnabled();
+ }
+
+ @Override
+ public Optional<Long> obtainDelegationTokens(final Credentials credentials) {
+ try {
+ Set<FileSystem> fileSystemsToAccess = getFileSystemsToAccess();
+
+ final String renewer = getTokenRenewer(hadoopDelegationTokenConf.getHadoopConf());
+ fileSystemsToAccess.forEach(
+ fs -> {
+ try {
+ LOG.info("Getting FS token for: {} with renewer {}", fs, renewer);
Review comment:
This log will makes users confused. Because it dont indicate which path is getting fs token.
Besides, I think it is inappropriate for the fs object to be used directly in the log msg, it will be shown like as follows:
`Getting FS token for: org.apache.hadoop.fs.LocalFileSystem@1a4927d6 with renewer xxxxx`
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org