GithubHelp home page GithubHelp logo

CentOS 8 RPM/Build Support about mcrouter HOT 1 OPEN

t0mtaylor avatar t0mtaylor commented on May 18, 2024
CentOS 8 RPM/Build Support

from mcrouter.

Comments (1)

jeffbyrnes avatar jeffbyrnes commented on May 18, 2024

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

from mcrouter.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.