How to install and build C++ gRPC

From epsciwiki
Revision as of 17:00, 16 December 2022 by Timmer (talk | contribs)
Jump to navigation Jump to search

HI THERE


Here are the official instructions for downloading and building grpc.
However, the following is a more relevant version of how grpc was installed on the ejfat nodes:


  1. Setup some environmental variables (assuming bash)
    export GRPC_INSTALL_DIR=/daqfs/gRPC/installation
    export PATH="$GRPC_INSTALL_DIR/bin:$PATH"
    export LD_LIBRARY_PATH="$GRPC_INSTALL_DIR/lib:$LD_LIBRARY_PATH"
    The alternative is to run a provided bash setup script which does the same thing
    /daqfs/gRPC/setupgrpc
  2. Clone the repository
    git clone --recurse-submodules -b v1.50 --depth 1 --shallow-submodules https://github.com/grpc/grpc
  3. Build the package
    cd grpc
    mkdir -p cmake/build
    1. python client libraries:
      pip install prometheus-client
      pip install prometheus-api-client
    2. exporter start up:
      sudo systemctl start prometheus-node-exporter
      sudo systemctl enable prometheus-node-exporter
  1. For increased UDP buffer sizes:
    1. For the long term write the following lines into the sysctl.conf file:
      net.core.rmem_max=25000000
      net.core.wmem_max=25000000
    2. To make it immediately effective, execute:
      sudo sysctl -w net.core.rmem_max=25000000
      sudo sysctl -w net.core.wmem_max=25000000
  2. To mount /daqfs:
    1. sudo mkdir /daqfs
    2. edit /etc/fstab to include the line:
      dubhe:/raid/daqfs          nfs     rw,bg           0       0
    3. sudo apt-get install nfs-common
    4. sudo mount /daqfs
  3. To change one's home directory to /daqfs/home/myUserName:
    1. Edit the /etc/passwd file to include a line something like:
      myUserName:x:2101:1208:John Doe,,,:/daqfs/home/myUserName:/bin/bash
      where 2101 is user id and 1208 is epsci group. Hint: set your user id and group ids on the ejfat nodes to be the same as it is on the computer center machines or there will be an issue when you access files served by computer center like /daqfs/home or /group/...