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

CI cpp-tests is broken now for the latest pulsar-build image #9682

Closed
BewareMyPower opened this issue Feb 23, 2021 · 8 comments · Fixed by #9690
Closed

CI cpp-tests is broken now for the latest pulsar-build image #9682

BewareMyPower opened this issue Feb 23, 2021 · 8 comments · Fixed by #9690
Labels
type/bug The PR fixed a bug or issue reported a bug

Comments

@BewareMyPower
Copy link
Contributor

Describe the bug
Currently, the CI for cpp tests is broken because it uses the apache/pulsar-build:ubuntu16.04 image as the base image to build cpp client. However, the image was updated yesterday to contain the change of #9609. This PR add python3 and pip3 and then CMake found python3 by default and tried to find boost python for python3. However, the boost python of pulsar-build image was installed by libboost-all-dev, which only supports python2.

To Reproduce
See recent PR's CI.

-- Found the following Boost libraries:
--   system
-- Found PythonLibs: /usr/lib/x86_64-linux-gnu/libpython3.5m.so (found version "3.5.2") 
-- PYTHON: 3.5.2
-- DETECTED Python 3
-- Boost version: 1.58.0
CMake Error at python/CMakeLists.txt:84 (MESSAGE):
  Could not find Boost Python library

Expected behavior
The pulsar-build image should work for cpp-tests.

Screenshots
If applicable, add screenshots to help explain your problem.

Desktop (please complete the following information):

  • OS: [e.g. iOS]

Additional context
Add any other context about the problem here.

@BewareMyPower BewareMyPower added the type/bug The PR fixed a bug or issue reported a bug label Feb 23, 2021
@BewareMyPower
Copy link
Contributor Author

I think one available solution is to update the image again to add boost python for python3. It could also remove python2 and use python3 for python tests. And I'm trying to do this work.

However, the image could only be tested in local environment. It seems that there's no way to verify if the new pulsar-build image works. It may need another empty PR to verify if CI would pass after the new pulsar-build image was uploaded.

@eolivelli
Copy link
Contributor

@BewareMyPower @aahmed-se probably it would have been better to tag the image with a new name and to not override the old name.
I am sorry I did not ask for it explicitly.

I believe the best way to fix this is to publish again the old image.

We can work on the new image without hurry.

My expectation was to have a new image and test it on CI

@BewareMyPower
Copy link
Contributor Author

@eolivelli I agree with you. Currently it should use the old image and the CI for pulsar-build image is necessary.

@eolivelli
Copy link
Contributor

@BewareMyPower are you working on a fix on the build image or should I do it ?
No problem from my side.
Your call

I hope that @aahmed-se @merlimat or anyone how has deploy permissions can fix the problem ASAP

@BewareMyPower
Copy link
Contributor Author

I think @zymap is going to publish the old image soon.

BTW, I'm working on fix the image that contains changes of #9609 . The problem is, since it cannot be verified by CI currently, should we wait until the CI for pulsar-build image first?

@eolivelli
Copy link
Contributor

Yes.
In the meantime you can test the image locally.
you build it and tag it with your preferred name and then you change the build scripts of the cpp-client to use that image

@BewareMyPower
Copy link
Contributor Author

@eolivelli OK

@zymap
Copy link
Member

zymap commented Feb 23, 2021

I have pushed the old image. And will push the new image after @BewareMyPower is fixed the issue.

The old Dockerfile have some file can not download, I change some of it:

#
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements.  See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership.  The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License.  You may obtain a copy of the License at
#
#   http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied.  See the License for the
# specific language governing permissions and limitations
# under the License.
#

FROM ubuntu:16.04

# prepare the directory for pulsar related files
RUN mkdir /pulsar
ADD protobuf.patch /pulsar

RUN apt-get update && \
    apt-get install -y tig g++ cmake libssl-dev libcurl4-openssl-dev \
                liblog4cxx-dev libprotobuf-dev libboost-all-dev google-mock libgtest-dev \
                libjsoncpp-dev libxml2-utils protobuf-compiler wget \
                curl doxygen openjdk-8-jdk-headless clang-format-5.0 \
                gnupg2 golang-1.13-go zip unzip libzstd-dev libsnappy-dev

# Compile and install gtest
RUN cd /usr/src/gtest && cmake . && make && cp libgtest.a /usr/lib

# Compile and install google-mock
RUN cd /usr/src/gmock && cmake . && make && cp libgmock.a /usr/lib

# Include gtest parallel to speed up unit tests
RUN git clone https://github.com/google/gtest-parallel.git

ENV JAVA_HOME=/usr/lib/jvm/java-1.8.0-openjdk-amd64

## Website build dependencies

# Install Ruby-2.4.1
RUN apt-get install -y
RUN gpg2 --keyserver hkp://keys.gnupg.net --recv-keys 409B6B1796C275462A1703113804BB82D39DC0E3 7D2BAF1CF37B13E2069D6956105BD0E739499BDB && \
    (curl -sSL https://get.rvm.io | bash -s stable)
ENV PATH "$PATH:/usr/local/rvm/bin"
RUN rvm install 2.4.1

# Install nodejs and yarn
RUN curl -sL https://deb.nodesource.com/setup_10.x | bash -
RUN apt-get install -y nodejs
RUN curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add -
RUN echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list
RUN apt-get update && apt-get install yarn

# Install crowdin
RUN wget https://artifacts.crowdin.com/repo/deb/crowdin.deb -O crowdin.deb
RUN dpkg -i crowdin.deb

# Install PIP and PDoc
RUN wget https://bootstrap.pypa.io/2.7/get-pip.py && python get-pip.py
RUN pip install pdoc

# Install Protobuf doc generator (requires Go)
ENV GOPATH "$HOME/go"
ENV PATH "/usr/lib/go-1.13/bin:$GOPATH/bin:$PATH"
RUN go get -u github.com/pseudomuto/protoc-gen-doc/cmd/protoc-gen-doc

# Build the patched protoc
RUN git clone https://github.com/google/protobuf.git /pulsar/protobuf && \
    cd /pulsar/protobuf && \
    git checkout v2.4.1 && \
    patch -p1 < /pulsar/protobuf.patch && \
    autoreconf --install && \
    ./configure && \
    make

# Installation
ARG MAVEN_VERSION=3.6.1
ARG MAVEN_FILENAME="apache-maven-${MAVEN_VERSION}-bin.tar.gz"
ARG MAVEN_HOME=/opt/maven
ARG MAVEN_URL="http://archive.apache.org/dist/maven/maven-3/${MAVEN_VERSION}/binaries/${MAVEN_FILENAME}"
ARG MAVEN_TMP="/tmp/${MAVEN_FILENAME}"
RUN wget --no-verbose -O ${MAVEN_TMP} ${MAVEN_URL} 

# Cleanup
RUN tar xzf ${MAVEN_TMP}  -C /opt/ \
        && ln -s /opt/apache-maven-${MAVEN_VERSION} ${MAVEN_HOME} \
        && ln -s ${MAVEN_HOME}/bin/mvn /usr/local/bin 

RUN unset MAVEN_VERSION

zymap pushed a commit that referenced this issue Feb 25, 2021
Fixes #9682 

### Motivation

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.

### Modifications

- 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`.

### Verifying this change

- [ ] 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.
codelipenghui pushed a commit that referenced this issue May 21, 2021
### 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`.
yangl pushed a commit to yangl/pulsar that referenced this issue Jun 23, 2021
### 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`.
codelipenghui pushed a commit that referenced this issue Dec 11, 2021
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)
bharanic-dev pushed a commit to bharanic-dev/pulsar that referenced this issue Mar 18, 2022
### 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`.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug The PR fixed a bug or issue reported a bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants