]> mj.ucw.cz Git - eval.git/blob - doc/install.html
Updated TODO.
[eval.git] / doc / install.html
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html40/strict.dtd">
2
3 <html><head>
4 <title>MO Eval - Installation</title>
5 <link rev=made href="mailto:mj@ucw.cz">
6 <link rel=stylesheet title=Default href="mo-eval.css" type="text/css" media=all>
7 </head><body>
8
9 <h1>The Installation of MO-Eval</h1>
10
11 <p>MO-Eval can be installed in two possible ways:
12
13 <h2>Minimal Installation</h2>
14
15 <p>Just invoke <code>make</code> and edit the top-level config file to suit
16 your needs, leaving <code>TEST_USER</code> commented out.
17
18 <p>In this setup, everything lives in the source tree you have started with
19 and you don't need any special privileges for neither installation or running
20 of the evaluator.
21
22 <p><em>Beware: The evaluated programs are <b>NOT</b> fully separated
23 from the evaluation environment and they could interfere with it. Use it only for
24 playing with the package, not for any real competition.</em>
25
26 <h2>Normal Installation</h2>
27
28 <p>The recommended way is to let the evaluator use two user accounts. One (let's
29 call the user <code>mo-eval</code>) runs the evaluator and keeps all secret
30 files like the test data, another one (<code>mo-test</code>) runs the tested
31 programs. There can be multiple test users if you want to run several evaluators
32 in parallel. However, in practice the evaluation is so fast that this is seldom
33 needed.
34
35 <p>How to set up this installation:
36
37 <ul>
38 <li>Run <code>make</code> to compile all programs.
39 <li>Edit <code>config</code> to suit your needs, in particular set <code>MO_ROOT</code>,
40 <code>EVAL_USER</code>, <code>EVAL_GROUP</code>, <code>TEST_USER</code> and <code>TEST_USERS</code>.
41 <li>Create <code>$MO_ROOT</code> (here we will assume that it's set to <code>/aux/mo</code>
42 <li>Create the evaluation users:
43 <pre>
44         mo-eval:x:65000:65000:MO Evaluator:/aux/mo/eval/mo-eval:/bin/bash
45         mo-test1:x:65001:65000:MO Tester 1:/aux/mo/eval/mo-test1:/bin/bash
46         mo-test2:x:65002:65000:MO Tester 2:/aux/mo/eval/mo-test2:/bin/bash
47 </pre>
48 <li>And the evaluation group:
49 <pre>
50         mo-eval:x:65000:
51 </pre>
52 <li>Run <code>bin/mo-install</code> as root to create the directory hierarchy under <code>$MO_ROOT</code>
53 install all parts of the evaluator there and set the correct access rights.
54 <li>Log in as <code>mo-eval</code> and do everything else from there.
55 <li>Later, you can reinstall parts of the hierarchy, without affecting the rest, by running:
56    <ul>
57    <li><code>mo-create-public</code> to update the public data available to contestants
58         according to the contents of the <code>public</code> directory
59    <li><code>mo-create-testusers</code> to update the home directory of the <code>mo-test</code> users.
60    </ul>
61
62 </ul>
63
64 <h2>Contestants' homes</h2>
65
66 <p>MO-Eval can either take care of the home directories of contestants or use
67 an existing infrastructure. In the former case, you need to do the following:
68
69 <ul>
70 <li>Set <code>CT_UID_MIN</code> and <code>CT_UID_MAX</code> in the top-level config file.
71 (The evaluator users described above should be outside this range!).
72 <li>Create the contestant users inside the UID range you defined; choose names as you wish:
73 <pre>
74         mo00:x:65100:65100:MO Contestant 00:/aux/mo/users/mo00/mo00:/bin/bash
75         ...
76         mo99:x:65199:65199:MO Contestant 99:/aux/mo/users/mo99/mo99:/bin/bash
77 </pre>
78 <li>Create a group for each of these users (preferably with the same ID's):
79 <pre>
80         mo00:x:65100:
81         ...
82         mo99:x:65199:
83 </pre>
84 <li>(You can use the <code>bin/mo-create-logins</code> script to automate this
85 process, including printing of leaflets with passwords, but you will probably need
86 to customize the script.)
87 <li>Run <code>bin/mo-create-contestants</code> as root to create the home directories.
88 (The permissions are set up so that the contestants cannot see each other's directory
89 even if they want. However you still need to make sure that there is no directory
90 all of them can write to, like the system-wide <code>/tmp</code>. In our contest,
91 the users work on their own machines and only the home directories are shared across
92 the network, so this problem doesn't arise.)
93 <li>If multiple contestants work on the same machine remotely, you need to set quotas
94 and other limits for them. On some systems, you cannot use <code>limits.conf</code>
95 for that, because <code>sshd</code> applies the limits as root, so you either
96 limit root or the limits don't work at all. In such cases, modify <code>/etc/profile</code>:
97 <pre>
98         if [ $UID -ge 65100 -a $UID -le 65199 ] ; then
99                 ulimit -Sc 8192         # core file size
100                 ulimit -SHu 32          # processes
101                 ulimit -SHn 256         # max open files
102                 ulimit -SHv 262144      # max virtual memory
103         fi
104 </pre>
105 </ul>
106
107 </body></html>