You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The above commands provide a very essential Pascal environment. Consider installing the following packages for additional units: `fp-units-base`, `fp-units-fcl`, `fp-units-misc`, `fp-units-math` and `fp-units-rtl`.
70
85
71
86
Arch Linux
72
87
----------
73
88
74
-
On Arch Linux, the following command will install almost all dependencies (some
75
-
of them can be found in the AUR):
89
+
On Arch Linux, run the following commands as root to install almost all dependencies
Download :gh_download:`CMS` |release| from GitHub as an archive, then extract it on your filesystem. You should then access the ``cms`` folder using a terminal.
97
-
98
-
.. warning::
99
-
100
-
If you decided to ``git clone`` the repository instead of downloading the archive, and you didn't use the ``--recursive`` option when cloning, then **you need** to issue the following command to fetch the source code of the sandbox:
101
-
102
-
.. sourcecode:: bash
103
-
104
-
git submodule update --init
105
-
106
-
In order to run CMS there are some preparation steps to run (like installing the sandbox, compiling localization files, creating the ``cmsuser``, and so on). You can either do all these steps by hand or you can run the following command:
107
-
108
-
.. sourcecode:: bash
109
-
110
-
sudo python3 prerequisites.py install
111
-
112
-
.. FIXME -- The following part probably does not need to be mentioned. Moreover, it would be better if isolate was just a dependency (like postgresql) to be installed separately, with its own group (e.g. 'isolate' instead of 'cmsuser'). The 'cmsuser' group could just become deprected, at that point.
113
-
114
-
This script will add you to the ``cmsuser`` group if you answer ``Y`` when asked. If you want to handle your groups by yourself, answer ``N`` and then run:
109
+
We recommend to create a new user account for CMS, usually called ``cmsuser``:
You can verify to be in the group by issuing the command:
115
+
If you are using a packaged version of Isolate, you need to add ``cmsuser``
116
+
to the ``isolate`` group:
121
117
122
118
.. sourcecode:: bash
123
119
124
-
groups
120
+
sudo usermod -a -G isolate cmsuser
125
121
126
-
Remember to logout, to make the change effective.
127
122
128
-
.. warning::
123
+
Installing CMS
124
+
==============
129
125
130
-
Users in the group ``cmsuser`` will be able to launch the ``isolate`` program with root permission. They may exploit this to gain root privileges. It is then imperative that no untrusted user is allowed in the group ``cmsuser``.
126
+
The installation of CMS should be performed as the ``cmsuser``.
131
127
132
-
.. _installation_updatingcms:
128
+
First obtain the source code of CMS. Download :gh_download:`CMS release`
129
+
|release| from GitHub as an archive, extract it and start a shell inside.
130
+
Alternatively, if you like living at the bleeding edge, check out the CMS
The preferred method of installation is using :samp:`./install.py --dir={target} cms`,
134
+
which does the following:
134
135
135
-
Installing CMS and its Python dependencies
136
-
==========================================
136
+
* Creates a *target directory* of the given name. It contains a Python
137
+
virtual environment and subdirectories where CMS stores its data, logs, and caches.
138
+
If you omit the ``--dir`` option, CMS is installed to ``~/cms`` (``cms`` in the
139
+
home directory of the current user). Make sure that it is different from the
140
+
source directory.
137
141
138
-
There are a number of ways to install CMS and its Python dependencies:
142
+
* Populates the virtual environment with CMS and Python packages on which CMS depends.
139
143
140
-
Method 1: Virtual environment
141
-
-----------------------------
144
+
* Checks that Isolate is available.
142
145
143
-
The recommended method to install CMS is via a `virtual environment
144
-
<https://virtualenv.pypa.io/en/latest/>`_, which is an isolated Python
145
-
environment that you can put wherever you like and that can be
146
-
activated/deactivated at will.
146
+
* Installs the sample configuration files to :samp:`{target}/etc/cms.toml`
147
+
and :samp:`{target}/etc/cms_ranking.toml`.
147
148
148
-
You will need to create a virtual environment somewhere in your filesystem. For
149
-
example, let's assume that you decided to create it under your home directory
150
-
(as ``~/cms_venv``):
149
+
Now you can run CMS commands from the shell directly as :samp:`{target}/bin/{command}`.
150
+
It is usually more convenient to activate the virtual environment, which adds
151
+
:samp:`{target}/bin` to your ``$PATH``. This can be done by adding the following line
152
+
to your ``~/.profile``:
151
153
152
154
.. sourcecode:: bash
153
155
154
-
python3 -m venv ~/cms_venv
156
+
source $TARGET/bin/activate
155
157
156
-
To activate it:
158
+
(with ``$TARGET`` replaced by the path to your target directory).
157
159
158
-
.. sourcecode:: bash
159
160
160
-
source ~/cms_venv/bin/activate
161
+
Development installs
162
+
--------------------
161
163
162
-
After the activation, the ``pip`` command will *always* be available (even if it
163
-
was not available globally, e.g. because you did not install it). In general,
164
-
every python command (python, pip) will refer to their corresponding virtual
165
-
version. So, you can install python dependencies by issuing:
166
-
167
-
.. sourcecode:: bash
168
-
169
-
pip install -r requirements.txt
170
-
pip install .
171
-
172
-
.. note::
173
-
174
-
Once you finished using CMS, you can deactivate the virtual environment by
175
-
issuing:
176
-
177
-
.. sourcecode:: bash
178
-
179
-
deactivate
180
-
181
-
Method 2: Using the Docker image
182
-
--------------------------------
183
-
184
-
See :doc:`here <Docker image>` for more information. This method is the
185
-
recommended way for running tests locally and for local development. It hasn't
186
-
been tested in production yet, so use it at your own risk.
187
-
188
-
Method 3: Global installation with pip
189
-
--------------------------------------
190
-
191
-
There are good reasons to install CMS and its Python dependencies via pip
192
-
instead of your package manager (e.g. apt-get). For example: two different Linux
193
-
distro (or two different versions of the same distro) may offer two different
194
-
versions of ``python-sqlalchemy``. When using pip, you can choose to install a
195
-
*specific version* of ``sqlalchemy`` that is known to work correctly with CMS.
196
-
197
-
Assuming you have ``pip`` installed, you can do this:
198
-
199
-
.. sourcecode:: bash
200
-
201
-
sudo pip3 install -r requirements.txt
202
-
sudo pip3 install .
203
-
204
-
This command installs python dependencies globally. Note that on some distros, like Arch Linux, this might interfere with the system package manager. If you want to perform the installation in your home folder instead, then you can do this instead:
205
-
206
-
.. sourcecode:: bash
207
-
208
-
pip3 install --user -r requirements.txt
209
-
pip3 install --user .
210
-
211
-
Method 4: Using your distribution's system packages
You might be able to install compatible versions of the dependencies in `requirements.txt`
215
-
through your distribution's packages; this method is not supported.
164
+
If you want to develop CMS, you can use :samp:`./install.py --dir={target} cms --devel --editable`.
165
+
This includes development dependencies. It also makes the installation linked to the
166
+
source directory, so you don't need to reinstall if you edit the source.
216
167
217
168
218
169
Configuring the worker machines
219
170
===============================
220
171
221
-
Worker machines need to be carefully set up in order to ensure that evaluation results are valid and consistent. Just running the evaluations under isolate does not achieve this: for example, if the machine has an active swap partition, memory limit will not be honored.
222
-
223
-
Apart from validity, there are many possible tweaks to reduce the variability in resource usage of an evaluation.
172
+
Worker machines need to be carefully set up in order to ensure that evaluation
173
+
results are valid and consistent. Just running the evaluations under Isolate
174
+
does not achieve this: for example, if the machine has CPU power management
175
+
configured, it might affect execution time in an unpredictable way.
176
+
Having an active swap partition may allow programs to evade memory limits.
224
177
225
-
We suggest following isolate's `guidelines <https://github.com/ioi/isolate/blob/c679ae936d8e8d64e5dab553bdf1b22261324315/isolate.1.txt#L292>`_ for reproducible results.
178
+
We suggest following Isolate's `guidelines <https://www.ucw.cz/isolate/isolate.1.html#_reproducibility>`_ for reproducible results
179
+
and running the ``isolate-check-environment`` command which checks your system
0 commit comments