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

CentOS 8 RPM/Build Support #393

Open
t0mtaylor opened this issue Apr 10, 2022 · 1 comment
Open

CentOS 8 RPM/Build Support #393

t0mtaylor opened this issue Apr 10, 2022 · 1 comment

Comments

@t0mtaylor
Copy link

Hi

Please can we have details on CentOS 8 RPM/Build Support?

Either a pre-build rpm, or how to compile on CentOS 8?

Thanks

@jeffbyrnes
Copy link

jeffbyrnes commented Jul 18, 2022

I can’t promise this will work for you as-is, but we had to work this out for an install on Oracle Linux 8 (which is based on RHEL & is similar to CentOS as a result) internally at @athenahealth.

Here’s the docs we came up with:

Building package 

  1. Create a Athenanet Developer VM via VRA - See How to Request an athenaNet Developer Virtual Machine (VM)

  2. Install all the dependencies:

    1. Basic dep's

      yum install cmake gcc-c++ pandoc binutils-devel boost-devel bzip2-devel double-conversion-devel fmt-devel gmock-devel libaio-devel libdwarf-devel libevent-devel libsodium-devel libunwind-devel liburing-devel libzstd-devel lz4-devel openssl-devel snappy-devel xz-devel zlib-devel python3-devel python3 python3-Cython python3-wheel wget make
    2. Devel package dep's

      yum install binutils-devel boost-devel bzip2-devel cmake-filesystem double-conversion-devel fmt-devel glog-devel gmock-devel libaio-devel libdwarf-devel libevent-devel libsodium-devel libunwind-devel liburing-devel libzstd-devel lz4-devel openssl-devel snappy-devel xz-devel zlib-devel chrpath
    3. The packages glog and gflags currently available in Oracle Linux 8.4 are not recent enough to build the upstream version of fbthrift. You need to retrieve and install the more recent packages from Centos8 streams

      1. gflags-2.2.2-1.el8.x86_64.rpm

      2. glog-0.3.5-5.el8.aarch64.rpm

        wget http://mirror.centos.org/centos/8-stream/PowerTools/x86_64/os/Packages/gflags-2.2.2-1.el8.x86_64.rpm
        wget http://mirror.centos.org/centos/8-stream/PowerTools/x86_64/os/Packages/glog-0.3.5-5.el8.x86_64.rpm
        rpm -Uvh gflags-2.2.2-1.el8.x86_64.rpm
        rpm -Uvh glog-0.3.5-5.el8.x86_64.rpm
  3. Setup your ~/rpmbuild dir:

    mkdir -p ~/rpmbuild/{BUILD,RPMS,SOURCES,SPECS,SRPMS}
    cd ~/rpmbuild
  4. Begin building mcrouter and all of its dependencies

    1. The packages need to be built in order to satisfy the dependencies of the next one. That order is follyfizzwanglefbthriftmcrouter. 
      1. folly

        wget https://download-ib01.fedoraproject.org/pub/epel/next/8/Everything/source/tree/Packages/f/folly-2022.02.21.00-1.el8.next.src.rpm
        rpm -Uvh folly-2022.02.21.00-1.el8.next.src.rpm
        rpmbuild -ba SPECS/folly.spec
        rpm -Uvh RPMS/
        rpm -Uvh RPMS/x86_64/folly-2022.02.21.00-1.el8.x86_64.rpm RPMS/x86_64/folly-static-2022.02.21.00-1.el8.x86_64.rpm RPMS/x86_64/folly-devel-2022.02.21.00-1.el8.x86_64.rpm
      2. fizz

        wget https://download-ib01.fedoraproject.org/pub/epel/next/8/Everything/source/tree/Packages/f/fizz-2022.02.21.00-1.el8.next.src.rpm
        rpm -Uvh fizz-2022.02.21.00-1.el8.next.src.rpm
        rpmbuild -ba SPECS/fizz.spec
        rpm -Uvh RPMS/x86_64/fizz-2022.02.21.00-1.el8.x86_64.rpm RPMS/x86_64/fizz-devel-2022.02.21.00-1.el8.x86_64.rpm RPMS/x86_64/fizz-static-2022.02.21.00-1.el8.x86_64.rpm
      3. wangle

        wget https://download-ib01.fedoraproject.org/pub/epel/next/8/Everything/source/tree/Packages/w/wangle-2022.02.21.00-1.el8.next.src.rpm
        rpm -Uvh wangle-2022.02.21.00-1.el8.next.src.rpm
        rpmbuild -ba SPECS/wangle.spec
        rpm -Uvh RPMS/x86_64/wangle-2022.02.21.00-1.el8.x86_64.rpm RPMS/x86_64/wangle-devel-2022.02.21.00-1.el8.x86_64.rpm RPMS/x86_64/wangle-static-2022.02.21.00-1.el8.x86_64.rpm
      4. fbthrift
        Building the fbthrift package has some challenges. The .spec file that comes from the upstream src rpm specifies to build python3 language bindings as a separate package. This part of the .spec fails to build for us on OL8.4 and it appears to be optional for us. We want to install fbthrift to support installing mcrouter. Mcrouter does not need python3 language bindings so commenting out this section of the .spec works for us and allows us to build a working fbthrift rpm. It also seems to rely on some syntax in the spec file thats only works in newer versions of rpmbuild than are available to us. I'm posting the diff between the spec file I used and the original so it can be recreated.

        sdiff -s fbthrift.spec rpmbuild/SPECS/fbthrift.spec
                                          >  # requires python3-Cython >= 0.29.17 for libcpp.utility.move
                                          >  %if 0%{?fedora} || 0%{?rhel} >= 9
                                          >  %bcond_without python
                                          >  %else
                                          >  %bcond_with python
                                          >  %endif
                                          >
                                          >  %if %{with python}
        BuildRequires:  python38-devel                    | BuildRequires:  python3-devel
        BuildRequires:  python38-setuptools               | BuildRequires:  python3-setuptools
                                          >  %endif

        At this point you should have all the dependencies for mcrouter built and installed. This will allow you to build the mcrouter RPM.

      5. mcrouter

        wget https://download-ib01.fedoraproject.org/pub/fedora/linux/development/rawhide/Everything/source/tree/Packages/m/mcrouter-0.41.0-8.20211222git90d63a3.fc36.src.rpm

        The mcrouter.spec from the fedora package provided above required two updates to the spec file in order to build successfully: (1) comment out BuildRequires for python3-fbthrift-devel and (2) remove %{limit_build -m 4096} macro from the make_build line. Here is the diff so it can be recreated:

        diff -s mcrouter.spec rpmbuild/SPECS/mcrouter.spec
        61c61
        < BuildRequires:  python3-fbthrift-devel
        ---
        > #BuildRequires:  python3-fbthrift-devel
        91c91
        < %make_build %{limit_build -m 4096}
        ---
        > %make_build

If you have made it this far without any errors. Congratulations. You now have a mcrouter RPM + supporting dependencies that will allow you to install mcrouter on our current OL8.4 systems. 

Notes about building for OL8

Native build

As of this writing, the Mcrouter projects most recent native build process that would be compatible with our OS is for Centos 7.2. You can see the script at

https://github.com/facebook/mcrouter/blob/main/mcrouter/scripts/install_centos_7.2.sh

I attempted to build this several times with some modification and was never able to successfully build it

Upstream

Mcrouter is slowly being made available for Centos 8 streams. As of this writing its only made it into FedoraCore 35. Still needs to get into FC36 and from there it can be included in Centos8 streams. 

https://src.fedoraproject.org/rpms/mcrouter/c/38c2768b4f6f935c7fee961a980f8c54df75b45b?branch=rawhide

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants