-
Notifications
You must be signed in to change notification settings - Fork 92
Building
This page describes how to build Cocaine Core from sources. Cocaine Core is the server runtime for the Cocaine Platform, which is meant to be running on every backend and aggregating node of the cluster. Its job is to provision and run your apps, to provide infrastructure services, like logging or storage, and to configure cloud access gateways so that clients could use it without knowing the cloud topology.
We use Git Submodules for some of our dependencies, so cloning the repository is not enough. You have to pull in the submodules too, using the following command:
git submodule update --init
This command has to be used while in the root of the cloned repository. For Cocaine Core, it'll pull in the backward-cpp sources - a beautiful stacktrace pretty printer.
I'll assume that you're running some sort of Debian-based distro, like Ubuntu, because that's what we do here, and I don't really know how to do that on anything else - feel free to write additional sections for some other distros or OSes.
First of all, we'll need a couple of build dependencies. There's an easy way to do that using mk-build-deps
. What it does is basically scan our debian/control
, generate an empty package which depends on all the build dependencies and install it into the system:
sudo apt-get install equivs devscripts
sudo mk-build-deps -ir
Installing dependencies on Mac Os X 10.11 when using homebrew
brew install boost
brew install cmake
brew install mhash
brew install libtool --universal
brew link libtool
brew install msgpack
Now that we have all the build dependencies in place, we can try to build the runtime:
mkdir build && cd build
cmake -DCMAKE_BUILD_TYPE=RelWithDebInfo -DCMAKE_INSTALL_PREFIX=/usr/local ..
make -j$(grep -c 'processor' /proc/cpuinfo)
sudo make install
If everything's okay, you'll see some fancy green-colored output from CMake telling you that now you have your own cloud platform server ready to go. There's a default configuration file in debian/cocaine-runtime.conf
, which should be good enough to actually start it for the first time: it's configured to keep its stuff in /var/{cache,lib,run,spool}/cocaine
and write logs to syslog
.