kfp.compiler.Compiler.compile() failed with Bazel due to kfp.CHECK_TYPE not found
See original GitHub issueWhat steps did you take:
I use Bazel to compile the pipeline. It has been working for kfp==1.0.0
but failed for kfp>=1.1.2
.
Environment:
python==3.8.5 bazel==3.2.0
KFP SDK version: kfp==1.1.2
as well as kfp==1.3.0
Anything else you would like to add:
Traceback from kfp==1.1.2
.../pypi_kfp/kfp/compiler/compiler.py", line 917, in compile
type_check_old_value = kfp.TYPE_CHECK
AttributeError: module 'kfp' has no attribute 'TYPE_CHECK'
I suspect that the pkgutil style namespace packaging breaks the import (at least in Bazel) https://github.com/kubeflow/pipelines/blob/1.1.2/sdk/python/kfp/__init__.py#L17
/kind bug /area sdk
Issue Analytics
- State:
- Created 3 years ago
- Comments:7 (1 by maintainers)
Top Results From Across the Web
kfp.compiler.compiler — Kubeflow Pipelines documentation
[docs]class Compiler(object): """DSL Compiler that compiles pipeline functions into workflow yaml. Example: How to use the compiler to construct workflow ...
Read more >Bazel fails to compile TypeScript project - node.js
I'm using the nodejs_rules for bazel. Anyhow the TypeScript compiler genrates the transpiled .js files. The yarn install seems to have worked ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
This error comes from 2 things:
__init__.py
for each modulekfp
module depends on kfp-pipeline-spec, which has a folderkfp
Rules python will make that
kfp
folder fromkfp-pipeline-spec
a module and, after that, python will try to load ‘TYPE_CHECK’ from there and everything fails.As a workaround you need to delete the generated
__init__.py
file from bazel path.Something like this before loading the kfp module:
replace the path with whatever you have named your pip_parse/pip_install call in WORKSPACE.
Or open an issue with rules_python for a proper fix
Given that the original goal for adopting namespace package style is to ensure the protobuf generated python modules can be accessed under the same kfp namespace, would it be possible to bundle them at release time?