Real Time Bidding (RTB) - Demand Side Platform framework
open-source library utilizing modern C++11/14 features and latest Boost.
What makes us different from other open-source RTB projects we have seen?
Our stack is fairly small and easy to integrate with any cmake project. As a model project please see https://github.com/vanilla-rtb/rapid-bidder
vanilla-rtb stack is completely decoupled by C++ templates and has minimum dependency on outside vendors.
Multi-bidder-model-with-communicator-for-Win-notifications
Recommended build environment: Linux or macOS, CMake - 3.7.2, GCC - 5.1, Boost - 1.60.
Structure :
-
/ -- the root directory
- boost-process/ -- C++11 planned for official boost release version 1.64
- boost-dll/ -- C++11 in official boost release since version 1.61
- CRUD/ -- C++11 high performance HTTP-restful handlers based on boost.ASIO and CRUD API
- jsonv/ -- DSL mapper of json encoded objects to C++ structures
- parsers/ -- fast zero copy, zero memory allocation parsers
- rtb/ -- RTB framework
- core/ -- generic structures shared in the project ( RTB specific )
- common/ -- generic RTB agnostic structures
- datacache/ -- IPC data store for fast targeting lookups
- exchange/ -- exchange handlers implementation
- DSL/ -- DSL formats for jsonv
- examples/ -- root to our sandbox with examples
-
[CMakeLists.txt] - cmake file
The stack of vanilla-rtb includes other C++11 projects and is referencing them via gh-subree. To update to the latest version of boost-process , boost-dll , json-voorhees or CRUD use the following commands :
- git subtree pull --prefix jsonv [email protected]:tgockel/json-voorhees.git master --squash
- git subtree pull --prefix boost-process [email protected]:BorisSchaeling/boost-process.git master --squash
- git subtree pull --prefix boost-dll [email protected]:apolukhin/Boost.DLL.git master --squash
- git subtree pull --prefix CRUD [email protected]:venediktov/CRUD.git master --squash
$vanilla-rtb> mkdir Release
$vanilla-rtb> cd Release
$vanilla-rtb> cmake -DCMAKE_BUILD_TYPE=Release .. -G "Unix Makefiles"
$vanilla-rtb> gmake -j4 install
# creating Debug build
$vanilla-rtb> cd ..
$vanilla-rtb> mkdir Debug
$vanilla-rtb> cd Debug
$vanilla-rtb> cmake -DCMAKE_BUILD_TYPE=Debug .. -G "Unix Makefiles"
$vanilla-rtb> gmake -j4 install
same steps as above for linux , only difference is depending on your environment either Visual Studio or NMake project can be used
######### for NMake ####################
cmake -DCMAKE_BUILD_TYPE=Release .. -G "NMake Makefiles"
cmake -DCMAKE_BUILD_TYPE=Debug .. -G "NMake Makefiles"
######### for Visual Studio ############
cmake -DCMAKE_BUILD_TYPE=Release .. -G "Visual Studio 14 2015"
cmake -DCMAKE_BUILD_TYPE=Debug .. -G "Visual Studio 14 2015"
For the reliable results it is suggested to have the build directory out of source tree.
The process involves creating a build directory, generating an Xcode
project in that directory with CMake
,
opening the project file generated in the build directory with Xcode
, and lastly, adjusting project
settings as requried and kicking off the build.
To generate an Xcode
project invoke cmake from an empty build directory with command line similar to cmake -G Xcode -DCMAKE_BUILD_TYPE=Release
.
xcode-select --install
ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew doctor
brew install cmake
brew install boost
mkdir Release
cd Release
cmake -DCMAKE_BUILD_TYPE=Release .. -G "Unix Makefiles"
make -j4 install
Linux command :
- nproc
4
pass it to your make script like this
gmake -j4 install
-
HTTP-Bidder
- vanilla-rtb/Release/examples/bin$ ./http_bidder_test --config etc/config.cfg
-
Cache loader
- vanilla-rtb/Release/examples/bin$ ./cache_loader_test --config etc/config.cfg
-
Exchange Handler with HTTP handler or Exchange Handler distributing to multi-bidders via communicator
- vanilla-rtb/Release/examples/bin$ ./exchange_handler_test --config etc/config.cfg
-
Mock-bidders starting multiple in one swoop, currently configured as 5 bidders in config
- vanilla-rtb/Release/examples/bin$ ./mock_bidder_test --config etc/config.cfg
-
multi-bidders starting multiple in one swoop, currently configured as 3 bidders in config and exchange
- vanilla-rtb/Release/examples/bin$ ./multi_bidder --config etc/config.cfg
- vanilla-rtb/Release/examples/bin$ ./multi_exchange_handler --config etc/config.cfg
-
Notification service and Slave-Banker
- vanilla-rtb/Release/examples/bin$ ./notification_service_test --config etc/config.cfg
- vanilla-rtb/Release/examples/bin$ ./slavebanker_service_test --config etc/config.cfg
-
Campaign manager - Budget
- vanilla-rtb/Release/examples/bin$ ./campaign_manager_test --config etc/config.cfg
-
Mock exchange - emulating bid requests
- To run mock exchange you need any python, and python "requests" library installed.
- for simple exchange please run
- vanilla-rtb/Release/examples/bin/mock_exchange$ python mock-x.py
- for various geo and size rotation please run
- vanilla-rtb/Release/examples/bin/mock_exchange$ python mock-x.py --geo "Russia:Moscow USA:NY USA:Washington USA:Chicago" --size '100:300 240:400 420:280'
- for more info please run
- vanilla-rtb/Release/examples/bin/mock_exchange$ python mock-x.py --help
-
Fire up UI by connecting to manager via browser http:://localhost:11081/campaign/index.html