Essential code collection for custom container runtime development.
Runtime Requirements
- Linux kernel 3.0+
- Kernel modules (
loop,squashfs,overlay)
Use devcontainers for development.
- All runtime requirements
- Docker (rootful)
Run ci/check_devhost.sh to check build requirements.
- Clone the repository. Make sure to clone every submodule (
clone --recursive). - Enter the devcontainer via VSCode. Alternatively, you can enter a devcontainer on CLI using
ci/enter_buildenv.sh. - Build
libsarususing./build.sh. You can findlibsarus.aunder./build/src.
- To build
libsaruswith a release mode setting, modifyBUILD_TYPEin./build.shtoRelease. (default:Debug) - To disable unit tests, add
-DENABLE_UNIT_TESTS=FALSEto CMake options in./build.sh. (default:TRUE) - To build
libsarusas a shared library, add-DBUILD_SHARED_LIBS=TRUEto CMake options in./build.sh. (default:FALSE) Caveat: this will create a runtime dependency to Boost 1.82 (filesystemandregex). - To disable the dependency building (e.g., libboost), add
-DENABLE_DEP_BUILD=FALSEto CMake options in./build.sh. (default:TRUE) Caveat: this will create a link-time dependency to Boost 1.82 (filesystemandregex).
libsarus has some basic unit tests to verify the functionality. To run unit tests,
- Build
libsarusfirst (with unit tests enabled). - In the same devcontainer, run
ctestin the./builddirectory. Alternatively, selectively run unit tests by permission as follows.
# sudo -u nobody env "PATH=$PATH" ctest -E AsRoot # Do unprivileged tests
# ctest -R AsRoot # Do privileged tests
The CI pipeline runs the same unit tests upon each push.
All contributions should pass all CI pipeline stages. If you don't have write permission to this repository, please submit your contribution via PR.
Failing to satisfy the code formatting standard causes the pipeline stage check.format to fail. To avoid this, run ./ci/format_code.sh to fix the formatting issues automatically before pushing commits.