You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
recodex-wiki/System-configuration.md

5.0 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.

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

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 (_or if not reachable probably this.

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.

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 content kernel.randomize_va_space=0. Changes will take effect after restart or run sysctl 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

WebApp