From 008443b9eaec9ee02a1c083459bed121f9baad5d Mon Sep 17 00:00:00 2001 From: Martin Polanka Date: Thu, 22 Sep 2016 14:34:55 +0200 Subject: [PATCH] worker dependencies --- Worker.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) diff --git a/Worker.md b/Worker.md index 7ee4727..4b5d016 100644 --- a/Worker.md +++ b/Worker.md @@ -22,6 +22,33 @@ Picture below is overall internal architecture of worker which shows its defined ## Installation +### Dependencies +Worker specific 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. + +**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 +# 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)_ + + ## Configuration and usage Following text describes how to set up and run **worker** program. It's supposed to have required binaries installed. For instructions see [[Installation|Worker#installation]] section. Also, using systemd is recommended for best user experience, but it's not required. Almost all modern Linux distributions are using systemd now.