Skip to content

Conversation

@HuangXingBo
Copy link
Contributor

What is the purpose of the change

This pull request will bundle Java libraries into apache-flink-libraries

Brief change log

  • Add a new distributed package named apache-flink-libraries and bundle Java libraries into it
  • Change the pipeline of building apache-flink wheel packages in Azure Pipeline

Verifying this change

This change added tests and can be verified as follows:

  • original IT tests and UT tests
  • Manual test installing apache-flink-libraries and apache-flink in a machine with old version of apache-flink and run some python udf test
  • trigger building apache-flink wheel packages in private Azure pipeline

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: (no)
  • The S3 file system connector: (no)

Documentation

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

@flinkbot
Copy link
Collaborator

flinkbot commented Mar 26, 2021

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 58978e2 (Sat Aug 28 11:11:50 UTC 2021)

Warnings:

  • 1 pom.xml files were touched: Check for build and licensing issues.

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 Mar 26, 2021

CI report:

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

Copy link
Contributor

@WeiZhong94 WeiZhong94 left a comment

Choose a reason for hiding this comment

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

@HuangXingBo Thanks for your PR. I have left some comments for you. In addition I think the content in docs/flinkDev/building#build_pyflink also need to be changed because it does not work on current situation.


try:
exec(open(version_file).read())
except IOError:
Copy link
Contributor

Choose a reason for hiding this comment

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

We can check if the in_flink_source is true instead of try .. except.

To build Flink with maven you can run:
mvn -DskipTests clean package
Building the source dist is done in the flink-python directory:
cd flink-python
Copy link
Contributor

Choose a reason for hiding this comment

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

These scripts need to change.

PACKAGE_DATA['pyflink.licenses'] = ['*']

setup(
name='apache_flink_libraries',
Copy link
Contributor

Choose a reason for hiding this comment

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

use - instead of _

author='Apache Software Foundation',
author_email='dev@flink.apache.org',
python_requires='>=3.6',
description='Apache Flink Python API',
Copy link
Contributor

Choose a reason for hiding this comment

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

The short description need to be changed.

flink_lib_directory = None
flink_opt_directory = None
if 'FLINK_LIB_DIR' in os.environ:
flink_lib_directory = os.path.realpath(os.environ['FLINK_LIB_DIR'])
Copy link
Contributor

Choose a reason for hiding this comment

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

else flink_lib_directory = os.path.join(real_flink_home, "lib")?

if 'FLINK_LIB_DIR' in os.environ:
flink_lib_directory = os.path.realpath(os.environ['FLINK_LIB_DIR'])
if 'FLINK_OPT_DIR' in os.environ:
flink_opt_directory = os.path.realpath(os.environ['FLINK_OPT_DIR'])
Copy link
Contributor

Choose a reason for hiding this comment

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

ditto

@@ -0,0 +1,229 @@
################################################################################
Copy link
Contributor

Choose a reason for hiding this comment

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

We need to add clean logic for this package in flink-python/pom.xml

@@ -0,0 +1,5 @@
# Apache Flink
Copy link
Contributor

Choose a reason for hiding this comment

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

add some description about this library package?

file_elements = (root_data.getElementsByTagName("files")[0]).getElementsByTagName("file")
# extracted <files><file></file></files>
for file_element in file_elements:
source = ((file_element.getElementsByTagName('source')[0]).childNodes[0]).data
Copy link
Contributor

Choose a reason for hiding this comment

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

Currently this function does not support the <includes></includes> tag and <excludes></excludes> tag. I think we need to raise Exception when the file element contains them to ensure the correctness.

@HuangXingBo
Copy link
Contributor Author

@WeiZhong94 Thanks a lot for the review. I have addressed the comments at the latest commit.

@HuangXingBo HuangXingBo force-pushed the FLINK-21732 branch 2 times, most recently from 64c4dfa to 203779a Compare March 31, 2021 10:13
Copy link
Contributor

@WeiZhong94 WeiZhong94 left a comment

Choose a reason for hiding this comment

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

LGTM, +1 to Merge

@HuangXingBo
Copy link
Contributor Author

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.

4 participants