diff --git a/System-configuration.md b/System-configuration.md index d676442..eb2259a 100644 --- a/System-configuration.md +++ b/System-configuration.md @@ -1,5 +1,5 @@ # System configuration -This page contains steps to set up a server to successfully run **ReCodEx**. Before final release most of them will be included in instalation script or listed as dependecies to binary package (`rpm` or `deb`). This page is mostly oriented to Red Hat based Linux distros (like RHEL, Centos or Fedora), but I'll try to keep updated information about Debian too. Before starting, make sure you have completed basic OS installation and set up, including users and logins, SSH, Git, firewall, etc. +This page contains steps to set up a computer to successfully run **ReCodEx**. Most steps are listed in two variants, for Red Hat based distributions (like RHEL, Centos or Fedora) and Debian based distibutions. Before starting, make sure you have completed basic OS installation and set up, including users and logins, SSH, Git, firewall, etc. ## Table of Content * [Common](#common) @@ -8,6 +8,8 @@ This page contains steps to set up a server to successfully run **ReCodEx**. Bef * [WebApp](#webapp) ## Common +### Repositories + **Add _testing_ repositories to Debian OS** - Create file `/etc/apt/apt.conf` with content ``` @@ -25,38 +27,48 @@ $ sudo apt-get -t testing install gcc **Add EPEL repository to RHEL** - See [this](https://fedoraproject.org/wiki/EPEL) for instructions. + +### Installation of dependencies + +Install as new version of each package as possible, so mostly Debian packages are from testing repositories and RHEL packages are the newest ones from EPEL repositories. + +**Basic development tools** +- `g++` +- `cmake` +- `make` +- `git` + **Install ZeroMQ** in version at least 4.0 -- For Debian, run -``` -$ sudo apt-get install libzmq3-dev -``` -- For Fedora (Red Hat), install `zeromq` and `zeromq-devel` (on RHEL from EPEL repository). +- Debian package is `libzmq3-dev`. +- RedHat packages are `zeromq` and `zeromq-devel`. **Install YAML-CPP library** -- For Debian: -``` -$ sudo apt-get install libyaml-cpp0.5v5 libyaml-cpp-dev -``` -- For Fedora (Red Hat), install `yaml-cpp` and `yaml-cpp-devel` packages (on RHEL from EPEL repository). +- Debian packages: `libyaml-cpp0.5v5` and `libyaml-cpp-dev`. +- RedHat packages are `yaml-cpp` and `yaml-cpp-devel`. -**Install libcurl library** -- For Debian: -``` -$ sudo apt-get install libcurl4-gnutls-dev -``` -- For Fedora (Red Hat), install `libcurl-devel` package. +### Worker specific dependencies -## Worker Worker requirements are written in this section. Some parts of this guide may be different for each type of worker, for example Compiler principles worker is not fully covered here. -### Isolate -First, we need to compile sandbox Isolate from source and install. Assume that we keep source code in `/opt/src` dir. For building man page you need to have package `asciidoc` installed (`yum install asciidoc`). +**Install libcurl library** +- Debian package is `libcurl4-gnutls-dev`. +- RedHat package is `libcurl-devel`. + +**Install libarchive library** (optional) + +Installing this package will only speed up build process, otherwise libarchive is built from source. +- Debian package is `libarchive-dev`. +- RedHat packages are `libarchive` and `libarchive-devel`. These are probably not available for RHEL. + +**Install Isolate from source** + +First, we need to compile sandbox Isolate from source and install. Assume that we keep source code in `/opt/src` dir. For building man page you need to have package `asciidoc` installed. ``` -# cd /opt/src -# git clone https://github.com/ioi/isolate.git -# cd isolate -# make +$ cd /opt/src +$ git clone https://github.com/ioi/isolate.git +$ cd isolate +$ make # make install && make install-doc ``` For proper work Isolate depends on several advanced features of the Linux kernel. Make sure that your kernel is compiled with `CONFIG_PID_NS`, `CONFIG_IPC_NS`, `CONFIG_NET_NS`, `CONFIG_CPUSETS`, `CONFIG_CGROUP_CPUACCT`, `CONFIG_MEMCG`. If your machine has swap enabled, also check `CONFIG_MEMCG_SWAP`. Which flags was your kernel compiled with can be found in `/boot` directory, for example in `/boot/config-4.2.6-301.fc23.x86_64` file for kernel version 4.2.6-301. Red Hat distros should have these enabled by default, for Debian you you may want to add the parameters `cgroup_enable=memory swapaccount=1` to the kernel command-line, which can be set using `GRUB_CMDLINE_LINUX_DEFAULT` in `/etc/default/grub`. @@ -66,7 +78,34 @@ For better reproducibility of results, some kernel parameters can be tweaked: - Disable dynamic CPU frequency scaling. This requires setting the cpufreq scaling governor to _performance_. _**TODO** - do we really need it and is it worth higher power consumption? [Red Hat setup](https://access.redhat.com/documentation/en-US/Red_Hat_Enterprise_Linux/7/html/Power_Management_Guide/cpufreq_governors.html), [Debian setup](https://wiki.debian.org/HowTo/CpuFrequencyScaling)_ + +### Clone ReCodEx source code repositories +- Worker: +``` +$ git clone https://github.com/ReCodEx/worker.git +$ git submodule update --init +``` +- Broker +``` +$ git clone https://github.com/ReCodEx/broker.git +$ git submodule update --init +``` + +### Install **worker** and **broker** binaries + +Installation steps are equal for both worker and broker. Following guide is for worker. It's supposed that your current working directory is that one with clonned worker source codes. + +- Prepare environment running `mkdir build && cd build` +- Build sources by `cmake ..` following by `make -j#` where '#' symbol refers to number of your CPU threads. +- Build binary package by `make package` (may require root permissions). +Note that `rpm` and `deb` packages are build in the same time. You may need to have `rpmbuild` command (usually as `rpmbuild` or `rpm` package) or edit CPACK_GENERATOR variable _CMakeLists.txt_ file in root of source code tree. +- Install generated package through your package manager (`yum`, `dnf`, `dpkg`). + + ### Compilers + +For evaluating jobs you have to install tools that fit your needs. Here are some useful tips of different compillers to install. + **C/C++** For compiling C and C++ programs is used `GCC` compiler. Maybe you could install install most of the staff by executing following command, but it's not needed.