From a07d0b5dea7d2952426a8b5f642347c0f67bcd75 Mon Sep 17 00:00:00 2001 From: Petr Stefan Date: Tue, 1 Dec 2015 15:47:26 +0100 Subject: [PATCH] Initial version, not tested --- System-configuration.md | 58 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 58 insertions(+) create mode 100644 System-configuration.md diff --git a/System-configuration.md b/System-configuration.md new file mode 100644 index 0000000..e5dfaac --- /dev/null +++ b/System-configuration.md @@ -0,0 +1,58 @@ +# 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. + +## 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](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)_ + +### 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](https://access.redhat.com/documentation/en-US/Red_Hat_Developer_Toolset/4/html-single/4.0_Release_Notes/index.html), or install these from Fedora repo. In Debian, _testing_ repo can be used. + +**C\#** + +For new versions of **Mono**, we'll use [Xamarin repositories](http://www.mono-project.com/download/#download-lin). 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](http://www.freepascal.org/down/x86_64/linux-austria.var). In Debian, this version is [expetimental](https://packages.debian.org/experimental/fpc-3.0.0), but seems to be stable enough. + +**Java** +_**TODO**_ \ No newline at end of file