6.7 KiB
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.
Table of Content
Common
Add testing repositories to Debian OS
- Create file
/etc/apt/apt.conf
with content
APT::Default-Release "stable";
- Add testing repos to
/etc/apt/sources.list
deb http://ftp.cz.debian.org/debian/ testing main contrib non-free
deb-src http://ftp.cz.debian.org/debian/ testing contrib non-free
- Install packages with
-t testing
option. For example
$ sudo apt-get -t testing install gcc
Add EPEL repository to RHEL
- See this for instructions.
Install ZeroMQ in version at least 4.0
- For Debian, run
$ sudo apt-get install libzmq3-dev
- For Fedora (Red Hat), install
zeromq
andzeromq-devel
(on RHEL from EPEL repository).
Install YAML-CPP library
- For Debian:
$ sudo apt-get install libyaml-cpp0.5v5 libyaml-cpp-dev
- For Fedora (Red Hat), install
yaml-cpp
andyaml-cpp-devel
packages (on RHEL from EPEL repository).
Install libcurl library
- For Debian:
$ sudo apt-get install libcurl4-gnutls-dev
- For Fedora (Red Hat), install
libcurl-devel
package.
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
).
# 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
.
For better reproducibility of results, some kernel parameters can be tweaked:
- Disable address space randomization. Create file
/etc/sysctl.d/10-recodex.conf
with contentkernel.randomize_va_space=0
. Changes will take effect after restart or runsysctl kernel.randomize_va_space=0
command. - 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, Debian setup
Compilers
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.
# yum group install "Development Tools"
To install the compiler separately, you could install it from the distribution's repositories.
# yum install gcc gcc-c++ make
To get reasonably new version, you may consider installing Red Hat Developer Toolset 4, or install these from Fedora repo. In Debian, testing repo can be used.
C#
For new versions of Mono, we'll use Xamarin repositories. For Red Hat based OS:
# rpm --import "http://keyserver.ubuntu.com/pks/lookup?op=get&search=0x3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF"
# yum-config-manager --add-repo http://download.mono-project.com/repo/centos/
# yum upgrade
# yum install mono-complete
For Debian based OS:
$ sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
$ echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
$ sudo apt-get update
$ sudo apt-get install mono-complete
Free Pascal
Free Pascal compiler 3.0.0 can be downloaded as rpm
packages from official website. In Debian, this version is expetimental, but seems to be stable enough.
Java TODO
Windows Worker
From beginning we are determined to support Windows operating system on which some of the workers may run (especially for projects in C# programming language). Support for Windows is quite hard and time consuming and there were several problems during this. To ensure capability of compilation on Windows we set up CI for Windows named Appveyor. However installation should be easy due to Visual Studio NuGet package manager.
There are only two dependencies needed. Windows 7 and higher and Visual Studio 2014. Visual Studio itself contains all features needed for compilation. All dependencies as libraries and such are either installed through NuGet package manager or are managed as submodules in git repository.
Installation Pipeline:
- Download git repository of BasicWorker
- Initialize and download all git submodules
- Run cmake in default directory of repository with at least VS 2014
cmake -G "Visual Studio 14 2015"
- When cmake does its job open generated solution file in VS 2014+
- For entire solution add these NuGet packages:
- boost
- boost_system-vc140
- boost_filesystem-vc140
- boost_program_options-vc140
- rmt_curl
- fix8.dependencies.zmq
- Build ALL_BUILD target
- Download (here) and copy certificate bundle for libcurl to working directory
- Rename downloaded certificate bundle to curl-ca-bundle.crt
- Run tests or whole worker with suitable programs