-
Notifications
You must be signed in to change notification settings - Fork 3.6k
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
[CI][C++] Force CMake to find Python2 #9690
[CI][C++] Force CMake to find Python2 #9690
Conversation
After discussing with @eolivelli in #9684 , instead of removing Python2 which may need a lot of work, this PR just keeps the original CI and lets CMake to find Python2 only in CI. Since there's no way to verify |
It looks like
It tried to download
I found the cause is the |
what about installing pip 2.7 with this command ?
|
@eolivelli Yeah, I've already tested successfully in my local environment, just waiting for docker image uploaded. |
@zymap The CPP, Python Tests have passed. I think you can upload a new image now. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
thank you!
@BewareMyPower This should also work with the current image on DockerHub, right? Just saying that because we could merge this PR, wait few days and then push the image, so that we minimize the chances of having PRs blocked on CI because they were created on top of a version of master that didn't include this PR yet. |
Uhm, actually, we should just call this image with a different tag... I'll push the image |
Thanks @merlimat |
/pulsarbot run-failure-checks |
1 similar comment
/pulsarbot run-failure-checks |
@aahmed-se @BewareMyPower @merlimat |
@eolivelli It looks like @merlimat has already pushed a new image |
@BewareMyPower thanks for your information. and thanks to @merlimat for pushing the new image. I will start to run CI jobs in JDK11 on my private fork and see what happens. I hope we can merge this patch soon and keep the master branch up to date |
I just did the basic versioning with |
### Motivation The CI - Pulsar Website Build has been broken for a long time. Here's an example run: https://github.com/apache/pulsar/runs/2635024657?check_suite_focus=true ``` CMake Error at python/CMakeLists.txt:85 (MESSAGE): -- Using Boost Python libs: Could not find Boost Python library ``` It looks like to be the same issue with #9682. #9690 fixed the broken CI for cpp client but the `ci-pulsar-website-build.yaml` wasn't modified. Another issue is after I fixed the cpp build for website build, the `python-doc-gen.sh` still failed because the default `pdoc` is a Python3 tool ``` + pdoc pulsar --html --html-dir /pulsar/generated-site/api/python/2.8.0-SNAPSHOT Traceback (most recent call last): File "/usr/local/bin/pdoc", line 7, in <module> from pdoc.__main__ import cli File "/usr/local/lib/python3.5/dist-packages/pdoc/__init__.py", line 328 ) -> str: ^ ``` So we need to install a Python2 version `pdoc` as well. ### Modifications - Use `ubuntu-16.04-py2` tag instead of old `ubuntu-16.04` tag in `docker-build-site.sh` and force CMake to find Python2 in `python-doc-gen.sh`. The the Pulsar Python client library could be built successfully. - Install a Python2 version `pdoc` in `python-doc-gen.sh`.
### Motivation The CI - Pulsar Website Build has been broken for a long time. Here's an example run: https://github.com/apache/pulsar/runs/2635024657?check_suite_focus=true ``` CMake Error at python/CMakeLists.txt:85 (MESSAGE): -- Using Boost Python libs: Could not find Boost Python library ``` It looks like to be the same issue with apache#9682. apache#9690 fixed the broken CI for cpp client but the `ci-pulsar-website-build.yaml` wasn't modified. Another issue is after I fixed the cpp build for website build, the `python-doc-gen.sh` still failed because the default `pdoc` is a Python3 tool ``` + pdoc pulsar --html --html-dir /pulsar/generated-site/api/python/2.8.0-SNAPSHOT Traceback (most recent call last): File "/usr/local/bin/pdoc", line 7, in <module> from pdoc.__main__ import cli File "/usr/local/lib/python3.5/dist-packages/pdoc/__init__.py", line 328 ) -> str: ^ ``` So we need to install a Python2 version `pdoc` as well. ### Modifications - Use `ubuntu-16.04-py2` tag instead of old `ubuntu-16.04` tag in `docker-build-site.sh` and force CMake to find Python2 in `python-doc-gen.sh`. The the Pulsar Python client library could be built successfully. - Install a Python2 version `pdoc` in `python-doc-gen.sh`.
Fixes #9682 Currently, ci-cpp-tests uses `pulsar-build` image that is from `ubuntu:16.04` to build C++/Python client. The image uses `libboost-all-dev` for CMake to find boost dependencies. However, the Boost.Python library from Ubuntu 16.04's apt source only supports Python 2. - Specifying `PYTHON_INCLUDE_DIR` and `PYTHON_LIBRARY` could indicate the installation of Python to use. Since the `pulsar-build` image only contains Python binary but not the Python2 library (`libpython2.7so`), this PR installs `libpython-dev` to setup the Python2 library. Otherwise, CMake would still find the Python3 library(`libpython3.5.so`). - Remove redundant C++ client dependencies like `libjsoncpp-dev` and replace `libboost-all-dev` with the specific `libboost-xxx-dev`. - [ ] Make sure that the change passes the CI checks. *(Please pick either of the following options)* This change is a trivial rework / code cleanup without any test coverage. (cherry picked from commit 1419d28)
### Motivation The CI - Pulsar Website Build has been broken for a long time. Here's an example run: https://github.com/apache/pulsar/runs/2635024657?check_suite_focus=true ``` CMake Error at python/CMakeLists.txt:85 (MESSAGE): -- Using Boost Python libs: Could not find Boost Python library ``` It looks like to be the same issue with apache#9682. apache#9690 fixed the broken CI for cpp client but the `ci-pulsar-website-build.yaml` wasn't modified. Another issue is after I fixed the cpp build for website build, the `python-doc-gen.sh` still failed because the default `pdoc` is a Python3 tool ``` + pdoc pulsar --html --html-dir /pulsar/generated-site/api/python/2.8.0-SNAPSHOT Traceback (most recent call last): File "/usr/local/bin/pdoc", line 7, in <module> from pdoc.__main__ import cli File "/usr/local/lib/python3.5/dist-packages/pdoc/__init__.py", line 328 ) -> str: ^ ``` So we need to install a Python2 version `pdoc` as well. ### Modifications - Use `ubuntu-16.04-py2` tag instead of old `ubuntu-16.04` tag in `docker-build-site.sh` and force CMake to find Python2 in `python-doc-gen.sh`. The the Pulsar Python client library could be built successfully. - Install a Python2 version `pdoc` in `python-doc-gen.sh`.
Fixes #9682
Motivation
Currently, ci-cpp-tests uses
pulsar-build
image that is fromubuntu:16.04
to build C++/Python client. The image useslibboost-all-dev
for CMake to find boost dependencies. However, the Boost.Python library from Ubuntu 16.04's apt source only supports Python 2.Modifications
PYTHON_INCLUDE_DIR
andPYTHON_LIBRARY
could indicate the installation of Python to use. Since thepulsar-build
image only contains Python binary but not the Python2 library (libpython2.7so
), this PR installslibpython-dev
to setup the Python2 library. Otherwise, CMake would still find the Python3 library(libpython3.5.so
).libjsoncpp-dev
and replacelibboost-all-dev
with the specificlibboost-xxx-dev
.Verifying this change
(Please pick either of the following options)
This change is a trivial rework / code cleanup without any test coverage.