Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BEAM-8379] Cache Eviction #10062

Merged
merged 1 commit into from
Nov 15, 2019
Merged

[BEAM-8379] Cache Eviction #10062

merged 1 commit into from
Nov 15, 2019

Conversation

KevinGG
Copy link
Contributor

@KevinGG KevinGG commented Nov 11, 2019

  1. Implemented cache eviction whenever Python interpreter exits.
  2. Cache for PCollections is grouped by PCollections as the
    Interactive Beam user flow is now data-centric. And cache including
    its eviction is managed by a global interactive environment instance
    created/retrieved/reset implicitly by runners in the same main
    thread/loop.
  3. Unified Python version requirement to 3.6 for interactive features
    and their tests for simplicity. We don't have test suite between py35
    and py36 (both exclusive) anyway, so there is no need to check by
    3.5.3 when some mock test features are only available in 3.6 and later.

Thank you for your contribution! Follow this checklist to help us incorporate your contribution quickly and easily:

  • Choose reviewer(s) and mention them in a comment (R: @username).
  • Format the pull request title like [BEAM-XXX] Fixes bug in ApproximateQuantiles, where you replace BEAM-XXX with the appropriate JIRA issue, if applicable. This will automatically link the pull request to the issue.
  • If this contribution is large, please file an Apache Individual Contributor License Agreement.

See the Contributor Guide for more tips on how to make review process smoother.

Post-Commit Tests Status (on master branch)

Lang SDK Apex Dataflow Flink Gearpump Samza Spark
Go Build Status --- --- Build Status --- --- Build Status
Java Build Status Build Status Build Status Build Status
Build Status
Build Status
Build Status Build Status Build Status
Build Status
Python Build Status
Build Status
Build Status
Build Status
--- Build Status
Build Status
Build Status
Build Status
--- --- Build Status
XLang --- --- --- Build Status --- --- ---

Pre-Commit Tests Status (on master branch)

--- Java Python Go Website
Non-portable Build Status Build Status
Build Status
Build Status Build Status
Portable --- Build Status --- ---

See .test-infra/jenkins/README for trigger phrase, status and link of all Jenkins jobs.

@KevinGG KevinGG force-pushed the BEAM-8379 branch 2 times, most recently from af08a2b to 5bb263e Compare November 12, 2019 18:40
@KevinGG
Copy link
Contributor Author

KevinGG commented Nov 12, 2019

Run Python PreCommit

@KevinGG KevinGG force-pushed the BEAM-8379 branch 3 times, most recently from 87994bd to 5127c87 Compare November 13, 2019 20:12
1. Implemented cache eviction whenever Python interpreter exits.
2. Cache for PCollections is grouped by PCollections as the
Interactive Beam user flow is now data-centric. And cache including
its eviction is  managed by a global interactive environment instance
created/retrieved/reset implicitly by runners in the same main
thread/loop.
3. Unified Python version requirement to 3.6 for interactive features and their tests for simplicity. We don't have test suite between py35 and py36 (both exclusive) anyway, so there is no need to check by 3.5.3 when some mock test features are only available in 3.6 and later.
@KevinGG
Copy link
Contributor Author

KevinGG commented Nov 13, 2019

R: @pabloem
Hi Pablo, this PR only adds cache eviction logic and simplified the Python version check for prerequisites and tests.
Thanks!

@KevinGG
Copy link
Contributor Author

KevinGG commented Nov 14, 2019

R: @davidyan74
R: @rohdesamuel

Thanks!

self._is_py_version_ready = False
logging.warning('Interactive Beam requires Python 3.5.3+.')
logging.warning('Interactive Beam requires Python 3.6+.')
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity, why does it require 3.6+?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The assertions in unittest module for if something is called such as assert_called are not available in some older Python versions.
To make it even worse, some features introduced in Python3 has been patched back to some Python2 versions but not some older Python3 versions. So it's possible to see tests passing in Py3.6+ and Py2.7+ but fail for Py3.5.
The 3.5.3 is only a prerequisite for dependency jsons (not json) that allows us to serialize any Python object into json format without providing schema of the data. That's how we can build dataframe from arbitrary data implicitly.

Copy link
Member

Choose a reason for hiding this comment

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

So it sounds like the interactive functionality is available in 3.5.3, but the particular assert method we use in unit tests is only available on 3.6+, right? Would it make sense for us to support 3.5.3+, and skip those tests on <3.6? If we force 3.6+ for support, we'd lose 3.5.3+ users, right?

Perhaps it's fine to do only 3.6+, but just wanting to double click on this.

Copy link
Contributor

@rohdesamuel rohdesamuel left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@davidyan74 davidyan74 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks!

Copy link
Member

@pabloem pabloem left a comment

Choose a reason for hiding this comment

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

Just one comment. LGTM otherwise.

self._is_py_version_ready = False
logging.warning('Interactive Beam requires Python 3.5.3+.')
logging.warning('Interactive Beam requires Python 3.6+.')
Copy link
Member

Choose a reason for hiding this comment

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

So it sounds like the interactive functionality is available in 3.5.3, but the particular assert method we use in unit tests is only available on 3.6+, right? Would it make sense for us to support 3.5.3+, and skip those tests on <3.6? If we force 3.6+ for support, we'd lose 3.5.3+ users, right?

Perhaps it's fine to do only 3.6+, but just wanting to double click on this.

@pabloem pabloem merged commit 1bb581f into apache:master Nov 15, 2019
@KevinGG
Copy link
Contributor Author

KevinGG commented Nov 15, 2019

So it sounds like the interactive functionality is available in 3.5.3, but the particular assert method we use in unit tests is only available on 3.6+, right? Would it make sense for us to support 3.5.3+, and skip those tests on <3.6? If we force 3.6+ for support, we'd lose 3.5.3+ users, right?

Perhaps it's fine to do only 3.6+, but just wanting to double click on this.

Yes! Since we don't have tests for 3.5.3 but only 3.5, 3.6, 3.7, so we'll just say 3.6 in the warning and check for 3.6 in tests for simplicity.

@KevinGG KevinGG deleted the BEAM-8379 branch December 9, 2019 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants