tfx-addons icon indicating copy to clipboard operation
tfx-addons copied to clipboard

Feat/firebase publisher

Open deep-diver opened this issue 3 years ago • 9 comments
trafficstars

This is a draft PR. Some codes, doc-strings, and comments should be polished. Once they are done, reviews will be requested.

it is now ready. lmk if unit tests are required.

cc: @sayakpaul

deep-diver avatar Aug 23 '22 15:08 deep-diver

Thanks for the PR! :rocket:

Instructions: Approve using /lgtm and mark for automatic merge by using /merge.

github-actions[bot] avatar Aug 23 '22 15:08 github-actions[bot]

Btw would love feedback on precommit docs at CONTRIBUTING.md to make sure they make sense

casassg avatar Aug 24 '22 17:08 casassg

Thanks for the comment @casassg :) Will check out the CONTRIBUTING.md, and I will request reviews by today or tomorrow

deep-diver avatar Aug 24 '22 17:08 deep-diver

@casassg

should I write unit tests? I have checked it works

deep-diver avatar Aug 25 '22 09:08 deep-diver

Preferably some small unit tests would be great. That helps us do upgrades of dependencies while making sure it's fine. As an example, it helps us bump up what version of tfx is compatible without requiring all contributors to test their components individually for each upgrade.

casassg avatar Aug 25 '22 14:08 casassg

@casassg

some tests are added

deep-diver avatar Aug 26 '22 02:08 deep-diver

@sayakpaul addressed your comments :) @casassg ready to have your reviews :D

deep-diver avatar Aug 29 '22 02:08 deep-diver

@deep-diver thanks!

sayakpaul avatar Aug 29 '22 03:08 sayakpaul

addressed your comments @casassg

deep-diver avatar Aug 31 '22 15:08 deep-diver

Seems CI unfortunately still timesout. can you try running locally pip install --dry-run --ignore-installed -e ".[ci_min, firebase_publisher]" This will attempt to resolve the component against our lower support TFX (aka TFX 1.4). ( you may need to upgrade pip - pip install --upgrade pip in order to get --dry-run).

Guessing you may need even a lower version of firebase-admin. It seems to be conflicting with versions of shared google libraries that beam and tensorflow depend on for TFX 1.4

casassg avatar Aug 31 '22 18:08 casassg

(also if you don't mind can you set the name of the PR to something that describes better the change? We use PR titles as release notes on release)

casassg avatar Aug 31 '22 22:08 casassg

when I run pip install --dry-run --ignore-installed -e ".[ci_min, firebase_publisher]", I get the following error: ERROR: No matching distribution found for tfx<1.10.0,>=1.4.0; extra == "firebase_publisher"

deep-diver avatar Aug 31 '22 23:08 deep-diver

What python version are you in? You may need to reduce the version of python to one that is supported by tfx 1.4

casassg avatar Aug 31 '22 23:08 casassg

I was in Python 3.10, let me try with 3.8

deep-diver avatar Aug 31 '22 23:08 deep-diver

I get the same errors with Python 3.6, 3.7, 3.8, 3.9

deep-diver avatar Aug 31 '22 23:08 deep-diver

Okay, I think I found a fix. Change this in version.py

_CI_MIN_CONSTRAINTS = [
    f"tfx~={_INCLUSIVE_MIN_TFX_VERSION}", "tensorflow~=2.6.0",
    "apache-beam[gcp]<2.35", "firebase-admin<5.0.3"
]

The issue is due to https://github.com/firebase/firebase-admin-python/releases/tag/v5.0.3 adding google-api-core 2.X which breaks a lot of stuff w tfx 1.4 and similar as those were released before the 2.X changes. This triggers a tone of backtracking with pip, the fix above just basically tells our CI to bothering looking at any version of firebase_admin above 5.0.3 so it doesnt go down the rabithole of backtracking

casassg avatar Aug 31 '22 23:08 casassg

great! should I fix version.py or are you going to?

deep-diver avatar Aug 31 '22 23:08 deep-diver

you should fix it as part of the PR as otherwise CI wont let you merge it (as CI as of now its failing)

casassg avatar Aug 31 '22 23:08 casassg

I am a little confused, how should I write

_CI_MIN_CONSTRAINTS = [
    f"tfx~={_INCLUSIVE_MIN_TFX_VERSION}", "tensorflow~=2.6.0",
    "apache-beam[gcp]<2.35", "firebase-admin<5.0.3"
]

into version.py ?

since other packages are already defined in _CI_MIN_CONSTRAINTS, I just need like

    "firebase_publisher":
    [f"tfx{_TFXVERSION_CONSTRAINT}", "firebase-admin>=5.0.3,<6.0.0"],

is this right?

deep-diver avatar Aug 31 '22 23:08 deep-diver

Sorry I should have specified more. I meant if you can add "firebase-admin<5.0.3" to https://github.com/tensorflow/tfx-addons/blob/183ee57e8d28edf0252931d9f6b499f719a003da/tfx_addons/version.py#L40

You will need to leave _PKG_METADATA as is but we need modify the CI constraints in order to make sure we can test the component at all

casassg avatar Aug 31 '22 23:08 casassg

I believe I may also be able to commit to your branch if you prefer me to do that

casassg avatar Aug 31 '22 23:08 casassg

please do

deep-diver avatar Aug 31 '22 23:08 deep-diver

this looks better now :D /lgtm

will let you merge at your own discretion (just comment the merge command to merge that should merge the code)

casassg avatar Aug 31 '22 23:08 casassg

Approval received from @casassg! :white_check_mark:

PR is approved. Missing merge command to auto-merge PR!

github-actions[bot] avatar Aug 31 '22 23:08 github-actions[bot]

/merge

deep-diver avatar Aug 31 '22 23:08 deep-diver

oh it looks like there is a pending review by @hanneshapke I will wait until he checks this out then. Huge thanks @casassg

deep-diver avatar Aug 31 '22 23:08 deep-diver

Merged with approvals from casassg - thanks for the contribution! :tada:

github-actions[bot] avatar Aug 31 '22 23:08 github-actions[bot]