/libsbox

Sandbox management library

Primary LanguageC++MIT LicenseMIT

libsbox

Build Status

libsbox is open source C++ library introduced to be used in programming contests environments. It is simple and provide full functionality needed to evaluate participants' solutions.

Getting started

These instructions will guide you through the installation process of libsbox.

Prerequisites

To build libsbox you need:
  • GCC or Clang compiler that can compile C++14 source
  • cmake version 3.10 or higher
To use libsbox you need:
  • linux kernel supporting following features (kernel version 5 or higher is recommended):
    • cgroup filesystem, namely cpuacct and memory controllers
    • oom_kill counter in memory cgroup
    • namespaces, namely mount, ipc, net and pid namespaces
  • cgroup hierarchy mounted in /sys/fs/cgroup

Installing

Follow the steps bellow to install libsbox on your system

  1. Create build directory and change to it
mkdir build
cd build
  1. Run Cmake to generate build files
cmake ..
  1. Compile sources using make
make
  1. Install library and associated headers
make install

Running the tests

To run tests type

sudo ctest --output-on-failure

or

sudo CTEST_OUTPUT_ON_FAILURE=1 make test

If memory tests fail disable swap

sudo swapoff -a

If tests don't pass check whether your system satisfies prerequisites. If you can't solve the problem yourself, open an issue in project github

Documentation

Not ready yet

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

License

This project is licensed under the MIT License - see the LICENSE file for details

Acknowledgments

libsbox inspired by isolate and created to simplify writing invokers (evaluators) for various task types.