Skip to content

Conversation

@tisonkun
Copy link
Member

What is the purpose of the change

Enable configure shared libraries on YARN. See also https://issues.apache.org/jira/browse/FLINK-13938

Brief change log

  • Add command-line option -ysl --yarnsharedLibs and config option yarn.shared-libraries
  • respect options

Verifying this change

I am looking for adding a test case but it seems hard without a real HDFS env. Maybe e2e tests required. But one can still verify it manually.

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, Yarn/Mesos, ZooKeeper: (yes, enable configure shared libs on YARN)
  • The S3 file system connector: (no)

Documentation

  • Does this pull request introduce a new feature? (yes)
  • If yes, how is the feature documented? (docs)

cc @wangyang0918

@flinkbot
Copy link
Collaborator

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 e1c1980 (Thu Nov 14 06:09:18 UTC 2019)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!

Mention the bot in a comment to re-run the automated checks.

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 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 Bot commands
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

@flinkbot
Copy link
Collaborator

flinkbot commented Nov 14, 2019

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run travis re-run the last Travis build

@tisonkun
Copy link
Member Author

cc @yanghua @MalcolmSanders

Copy link
Contributor

@yanghua yanghua left a comment

Choose a reason for hiding this comment

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

Hi @tisonkun Thanks for implementing this feature. I think it would be helpful for the users who use Flink on Yarn. I left some tiny comments you can consider. Do not know whether this (partial) feature can be tested with a unit test or not. If we can not, did you tested it offline?

<tr>
<td><h5>yarn.shared-libraries</h5></td>
<td style="word-wrap: break-word;">(none)</td>
<td>specify the path to use public visibility feature of YARN NodeManager localizing resources.</td>
Copy link
Contributor

Choose a reason for hiding this comment

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

Shall we capitalize the first letter? Like other config option description.

/** Lazily initialized list of files to ship. */
private final List<File> shipFiles = new LinkedList<>();

private final List<Path> sharedLibs = new LinkedList<>();
Copy link
Contributor

Choose a reason for hiding this comment

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

If we want to test this feature like ship files, we may expose getter/setter methods of this field.

applicationId = new Option(shortPrefix + "id", longPrefix + "applicationId", true, "Attach to running YARN session");
queue = new Option(shortPrefix + "qu", longPrefix + "queue", true, "Specify YARN queue.");
shipPath = new Option(shortPrefix + "t", longPrefix + "ship", true, "Ship files in the specified directory (t for transfer)");
sharedLibs = new Option(shortPrefix + "sl", longPrefix + "sharedLibs", true, "Upload a copy of flink libs beforehand and specify the path to use public visibility feature of YARN NodeManager localizing resources.");
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add a test case about this config option or the whole feature like ship files?

.stringType()
.asList()
.noDefaultValue()
.withDescription("specify the path to use public visibility feature of " +
Copy link
Contributor

Choose a reason for hiding this comment

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

Also, shall we capitalize the first letter? Like other config option description.

Copy link
Member Author

Choose a reason for hiding this comment

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

Make sense. Will update.

@tisonkun
Copy link
Member Author

I'd like to add a unit test but fail to have an idea how to start a mini HDFS. Let me think of how to introduce it within YarnTestBase...

@tisonkun
Copy link
Member Author

I've manually verify the changes locally.

My rough thought about testing is using a test job running with YarnTestBase and verify the resource, maybe we have to verify no files uploaded by Flink also.

while (i.hasNext()) {
LocatedFileStatus fileStatus = i.next();
if (fileStatus.isFile()) {
String classpath = setupSharedLib(fileStatus.getPath(), fs, remotePaths, localResources, envShipFileList);
Copy link
Member Author

Choose a reason for hiding this comment

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

Here we flatten all files in the root relative path of program. Maybe it is better we keep the directory layout. Locally changed and verifying...

@tisonkun
Copy link
Member Author

closed for now in favor of another issue.

After discussion with @wangyang0918 I notice FLINK-13938 is not what proposed here.

@walterddr
Copy link
Contributor

sorry for the late follow up @tisonkun . I come to understand that this PR is for something different from FLINK-13938. did we create a new JIRA ticket? I think the approach this PR implements is highly valuable especially for a production cluster setup :-) --Rong

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants