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

Lock in version of kfp #30

Merged
merged 1 commit into from
Apr 9, 2019

Conversation

MattMorgis
Copy link
Contributor

My team and I hit a snag this week when trying to compile Kubeflow Pipelines:

File "/tfx/examples/chicago_taxi_pipeline/taxi_pipeline_kubeflow.py", line 187, in <module>
    pipeline = KubeflowRunner().run(_create_pipeline())

File "/tfx/orchestration/kubeflow/runner.py", line 122, in run
    _construct_pipeline)

TypeError: add_pipeline() takes 2 positional arguments but 3 were given

Thanks to commit eb63dae this week which added a test for this, we were able to debug easier.

It turns out the issue was that we had version 0.1.14 of the Kubeflow Pipelines SDK installed. The docs recommended this, and the docs and the Release Page do not install from PyPi.

This feels like it was intentional, but only version published to PyPi is 0.1.11, the last compatible version with tfx. I've tried 0.1.12 all the way to the most recent 0.1.15 and continue to get the same error as above.

Additionally, the check submitted by this PR doesn't even catch this.

When running pip show kfp from the non-PyPi install, I get:

Name: kfp
Version: 0.1
Summary: KubeFlow Pipelines SDK
Home-page: UNKNOWN
Author: google
Author-email: None
License: UNKNOWN
Location: /usr/local/lib/python3.7/site-packages
Requires: PyYAML, kubernetes, requests-toolbelt, certifi, google-cloud-storage, google-auth, cryptography, python-dateutil, six, PyJWT, urllib3
Required-by:

And when running after installing from setup.py:

Name: kfp
Version: 0.1.11
Summary: KubeFlow Pipelines SDK
Home-page: UNKNOWN
Author: google
Author-email: None
License: UNKNOWN
Location:  /usr/local/lib/python3.7/site-packages
Requires: PyJWT, google-cloud-storage, PyYAML, certifi, six, python-dateutil, kubernetes, requests-toolbelt, cryptography, urllib3, google-auth

I'm not sure if I should follow an issue in Kubeflow/pipelines and ask if they can tag with the patch, or if these will never be published to PyPi and this is a non-issue.

I'm unsure what the proper fix should be, but wanted to submit to start the conversation and document for anyone else who may run into this.

@googlebot
Copy link

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here (e.g. I signed it!) and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@MattMorgis
Copy link
Contributor Author

I signed it

@googlebot
Copy link

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes and removed cla: no labels Apr 5, 2019
@ruoyu90 ruoyu90 requested a review from neuromage April 8, 2019 22:08
Copy link

@neuromage neuromage left a comment

Choose a reason for hiding this comment

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

Thanks for the fix @MattMorgis!

I'll also send out a fix later so that later versions of KFP can be used as well.

@tfx-copybara tfx-copybara merged commit e21a907 into tensorflow:master Apr 9, 2019
tfx-copybara pushed a commit that referenced this pull request Apr 9, 2019
@Ark-kun
Copy link
Contributor

Ark-kun commented Apr 11, 2019

Thanks for the fix.

The runner is failing, because it was using undocumented hack.

The KFP documentation clearly says that the pipeline function must be decorated with @pipeline decorator. It's even mentioned in the compile function documentation: https://github.com/kubeflow/pipelines/blob/086d4763d9f163acdeb423bc2bc49ab470442a92/sdk/python/kfp/compiler/compiler.py#L636

Running compile without having the function decorated

compiler.Compiler().compile(_construct_pipeline, pipeline_file)
will raise error: https://github.com/kubeflow/pipelines/blob/086d4763d9f163acdeb423bc2bc49ab470442a92/sdk/python/kfp/compiler/compiler.py#L578 'Please use a function with @dsl.pipeline decorator.'.

This documented behavior was circumvented by a hack that used an undocumented function that should be a part of internal compiler API. Ning has recently changed this internal function, which triggered TFX failure.

I'll send a PR fixing TFX code fixing this issue and removing the use of undocumented API.

Ark-kun added a commit to Ark-kun/tfx that referenced this pull request Apr 11, 2019
See tensorflow#30 (comment)

The KFP documentation clearly says that the pipeline function must be decorated with `@pipeline` decorator. It's even mentioned in the `compile` function documentation: https://github.com/kubeflow/pipelines/blob/086d4763d9f163acdeb423bc2bc49ab470442a92/sdk/python/kfp/compiler/compiler.py#L636

Running `compile` without having the function decorated
https://github.com/tensorflow/tfx/blob/d9f87b9b03ab8bb98653b8a96d5bf952bc22b2b7/tfx/orchestration/kubeflow/runner.py#L125 will raise error: https://github.com/kubeflow/pipelines/blob/086d4763d9f163acdeb423bc2bc49ab470442a92/sdk/python/kfp/compiler/compiler.py#L578 `'Please use a function with @dsl.pipeline decorator.'`.

For some reason this documented behavior was circumvented by a hack that used an undocumented function that should be a part of internal compiler API.

This PR fixes this issue.
@Ark-kun
Copy link
Contributor

Ark-kun commented Apr 11, 2019

Added the PR to fix the TFX code: #39
It adds the @pipeline decorator to the pipeline function just like the documentation says.

ruoyu90 pushed a commit to ruoyu90/tfx that referenced this pull request Aug 28, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants