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

[fix][C++ client] Fix rpm and deb packaging #17064

Merged

Conversation

BewareMyPower
Copy link
Contributor

@BewareMyPower BewareMyPower commented Aug 11, 2022

Motivation

For branch-2.11 and master branches, the rpm and deb packaging is
broken.

/usr/bin/env: 'python3': No such file or directory

It's caused by PIP-155,
which removes the Python2 support. In addition, the Dockerfiles of rpm
and deb subdirectories of pulsar-client-cpp/pkg don't install Boost
for Python3 well. But the rpm build disables the
BUILD_PYTHON_WRAPPER option while the deb build doesn't.

Modifications

  • Fix Dockerfiles under pkg and rpm subdirectories and speed up the
    docker build process:
    • Install python3 to fix the bug
    • Download the CMake 3.24.0 binaries directly instead of building
      from source
    • Upgrade Boost to 1.79 so that only headers are required (the
      boost::regex module is required for CentOS 7 because the default
      GCC is 4.8 that there is something wrong with std::regex)
    • Add -j8 option when compiling some large dependencies that uses 8
      threads to speed the compilation
    • Remove the -v option of tar to avoid showing too many info
  • Check the BUILD_IMAGE environment variable in docker-build-xxx.sh
    under rpm and deb subdirectories. If it's defined, build the image
    rather than pull the image from DockerHub before executing the build
    script. Because currently only a few committers have the permission to
    push the Docker images.
  • Add two workflows to build RPM and DEB packages if the files under
    pulsar-client-cpp changed. They build the docker images and run the
    build script for RPM and DEB packaging.

Documentation

Check the box below or label this PR directly.

Need to update docs?

  • doc-required
    (Your PR needs to update docs and you will update later)

  • doc-not-needed
    I will update the docs in Wiki pages. The dos in the repository don't need update.

  • doc
    (Your PR contains doc changes)

  • doc-complete
    (Docs have been already added)

@BewareMyPower BewareMyPower added component/client-c++ area/build release/blocker Indicate the PR or issue that should block the release until it gets resolved labels Aug 11, 2022
@BewareMyPower BewareMyPower added this to the 2.11.0 milestone Aug 11, 2022
@BewareMyPower BewareMyPower self-assigned this Aug 11, 2022
@BewareMyPower
Copy link
Contributor Author

I add the release/blocker label first. @Technoboy- I think the Step 3 in release process should have failed when you released 2.11.0. Can you confirm it?

@github-actions
Copy link

@BewareMyPower Please provide a correct documentation label for your PR.
Instructions see Pulsar Documentation Label Guide.

@BewareMyPower BewareMyPower marked this pull request as draft August 11, 2022 08:38
@github-actions
Copy link

@BewareMyPower Please provide a correct documentation label for your PR.
Instructions see Pulsar Documentation Label Guide.

@BewareMyPower BewareMyPower marked this pull request as ready for review August 11, 2022 09:14
@BewareMyPower
Copy link
Contributor Author

/pulsarbot rerun-failure-checks

@github-actions
Copy link

@BewareMyPower Please provide a correct documentation label for your PR.
Instructions see Pulsar Documentation Label Guide.

@github-actions github-actions bot added doc-not-needed Your PR changes do not impact docs and removed doc-label-missing labels Aug 11, 2022
@BewareMyPower BewareMyPower force-pushed the bewaremypower/fix-cpp-deb-build branch from 4d4b183 to f4b68a8 Compare August 15, 2022 03:08
### Motivation

For branch-2.11 and master branches, the rpm and deb packaging is
broken.

> /usr/bin/env: 'python3': No such file or directory

It's caused by [PIP-155](apache#15376),
which removes the Python2 support. In addition, the Dockerfiles of `rpm`
and `deb` subdirectories of `pulsar-client-cpp/pkg` don't install Boost
for Python3 well. But the rpm build disables the
`BUILD_PYTHON_WRAPPER` option while the deb build doesn't.

### Modifications

- Fix Dockerfiles under `pkg` and `rpm` subdirectories and speed up the
  `docker build` process:
   - Install python3 to fix the bug
   - Download the CMake 3.24.0 binaries directly instead of building
     from source
   - Upgrade Boost to 1.79 so that only headers are required (the
     boost::regex module is required for CentOS 7 because the default
     GCC is 4.8 that there is something wrong with std::regex)
   - Add `-j8` option when compiling some large dependencies that uses 8
     threads to speed the compilation
   - Remove the `-v` option of `tar` to avoid showing too many info
- Check the `BUILD_IMAGE` environment variable in `docker-build-xxx.sh`
  under `rpm` and `deb` subdirectories. If it's defined, build the image
  rather than pull the image from DockerHub before executing the build
  script. Because currently only a few committers have the permission to
  push the Docker images.
- Add two workflows to build RPM and DEB packages if the files under
  `pulsar-client-cpp` changed. They build the docker images and run the
  build script for RPM and DEB packaging.
- Specify the platform to `linux/amd64` so that the scripts can be used
  in ARM64 machines like Mac M1.
@BewareMyPower BewareMyPower force-pushed the bewaremypower/fix-cpp-deb-build branch from 1b81221 to 96fb9d0 Compare August 15, 2022 07:28
Copy link
Member

@Demogorgon314 Demogorgon314 left a comment

Choose a reason for hiding this comment

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

I tried the M1 macOS, it can build packages.

@Technoboy-
Copy link
Contributor

Also worked in my M1

@Technoboy- Technoboy- merged commit d88933a into apache:master Aug 15, 2022
@BewareMyPower BewareMyPower deleted the bewaremypower/fix-cpp-deb-build branch August 15, 2022 15:44
Technoboy- pushed a commit to merlimat/pulsar that referenced this pull request Aug 16, 2022
coderzc added a commit to coderzc/pulsar that referenced this pull request Aug 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/build cherry-picked/branch-2.11 doc-not-needed Your PR changes do not impact docs release/blocker Indicate the PR or issue that should block the release until it gets resolved
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants