Building RethinkDB - linux-on-ibm-z/docs GitHub Wiki

Building RethinkDB

The instructions specify the steps to build RethinkDB version v2.4.4 on Linux on IBM Z for following distributions:

  • RHEL (7.8, 7.9, 8.6, 8.8, 8.9, 9.0, 9.2, 9.3)
  • SLES (12 SP5, 15 SP5)

Note: For Ubuntu (20.04, 22.04, 23.10), please refer to this link to install RethinkDB from the community RethinkDB repository.

General Notes:

  • When following the steps below please use a standard permission user unless otherwise specified.

  • A directory /<source_root>/ will be referred to in these instructions, this is a temporary writable directory anywhere you'd like to place it

Step 1 : Build using script

If you want to build RethinkDB using manual steps, go to STEP 2.

Use the following commands to build RethinkDB using the build script. Please make sure you have wget installed.

wget -q https://raw.githubusercontent.com/linux-on-ibm-z/scripts/master/RethinkDB/2.4.4/build_rethinkdb.sh

# Build Spark
bash build_rethinkdb.sh   [Provide -h option to print help menu]

If the build completes successfully, go to STEP 3. In case of error, check logs for more details or go to STEP 2 to follow manual build steps.

Step 2: Build and Install RethinkDB

export SOURCE_ROOT=/<source_root>/

2.1) Install the Dependencies

  • RHEL (7.8, 7.9)
  sudo yum install -y python2-devel python2 openssl-devel libcurl-devel wget tar unzip bzip2 m4 git-core gcc-c++ ncurses-devel curl which patch make ncurses-static zlib-devel zlib-static protobuf protobuf-compiler protobuf-devel
  • RHEL (8.6, 8.8, 8.9)
  sudo yum install -y python2-devel python2 openssl-devel libcurl-devel jemalloc-devel wget tar unzip bzip2 m4 git-core boost gcc-c++ ncurses-devel curl which patch make ncurses zlib-devel zlib procps protobuf-devel protobuf-compiler xz
  sudo ln -s /usr/bin/python2 /usr/bin/python
  • RHEL (9.0, 9.2, 9.3)
sudo yum install -y openssl-devel libcurl-devel jemalloc-devel wget tar unzip bzip2 m4 git-core boost gcc-c++ ncurses-devel curl which patch make ncurses zlib-devel zlib procps protobuf-devel protobuf-compiler xz	
  • SLES 12 SP5
sudo zypper install -y gcc gcc-c++ make libopenssl-devel zlib-devel wget tar patch unzip autoconf automake m4 libtool python python-xml python-curses libicu-devel termcap curl libcurl-devel git awk libncurses5
  • SLES 15 SP5
sudo zypper install -y gcc gcc-c++ make libopenssl-devel zlib-devel wget tar patch unzip autoconf automake m4 libtool libicu-devel protobuf-devel libprotobuf-c-devel boost-devel termcap curl libcurl-devel git bzip2 awk gzip xz readline-devel libncurses5 ncurses-devel netcfg libbz2-devel glibc-locale	

2.2) Build and Install Python 2.7.18 ( for RHEL 9.x and SLES 15 SP5 only )

wget https://www.python.org/ftp/python/2.7.18/Python-2.7.18.tar.xz
tar -xvf Python-2.7.18.tar.xz
cd $SOURCE_ROOT/Python-2.7.18
./configure --prefix=/usr/local --exec-prefix=/usr/local
make
sudo make install
sudo ln -s /usr/bin/python2 /usr/bin/python
python -V

2.3) Clone and build RethinkDB

cd $SOURCE_ROOT
git clone -b v2.4.4 https://github.com/rethinkdb/rethinkdb
cd rethinkdb
./configure --allow-fetch
make -j4

Note: make -j4 will execute up to 4 build tasks in parallel. This number may be increased or decreased as necessary to match the resources available on the machine.

2.4) Install RethinkDB

sudo make install

2.5) Start RethinkDB server

rethinkdb --bind all

Step 3: Testing (Optional)

3.1) Execute Unit Tests

  • Rebuild the binary with debug info
cd $SOURCE_ROOT/rethinkdb
make -j4 DEBUG=1
  • To run the whole unit test suite
./build/debug/rethinkdb-unittest
  • To run a subset of test suite (For example test cases in RPCDirectoryTest category)
./build/debug/rethinkdb-unittest --gtest_filter=RPCDirectoryTest.*
  • To run an individual test case (For example test case TimerTest.TestApproximateWaitTimes)
./build/debug/rethinkdb-unittest --gtest_filter=TimerTest.TestApproximateWaitTimes

Note:

  1. ./test/run unit -j4 will execute up to 4 unit tests in parallel. This number may be increased or decreased to match the resources available on the machine.

  2. Test case UtilsTest.TimeLocal may fail if the local Time Zone is not defined.

  3. Several test cases such as TimerTest.TestApproximateWaitTimes may fail intermittently but will pass after rerun.

3.2) Execute Integration Tests

  • Build Python and Ruby drivers
git clone -b v2.4.1 https://github.com/rethinkdb/rethinkdb $SOURCE_ROOT/rethinkdb-v2.4.1
cd $SOURCE_ROOT/rethinkdb-v2.4.1
./configure --allow-fetch
make py-driver
make rb-driver
cp -r build/drivers ../rethinkdb/build/

Note: Since the drivers were extracted from this repo in release v2.4.1, we need to build them separately.

  • Run the whole integration test suite
cd $SOURCE_ROOT/rethinkdb
./test/run -j4
  • Run an individual test case (For example regression.4383)
cd $SOURCE_ROOT/rethinkdb
./test/run regression.4383

Note:

  1. Test case regression.known_failures_1774, interface.artificial_table and cpplint.cpplint fail on both s390x and Intel.

  2. Several test cases such as regression.4383 or static_cluster.append-stress may fail or get timeout intermittently but will pass after rerun.

Reference