Skip to content

Quick Start for Contributors

This guide provides short information for developers to start to work with ostis-metasystem quickly. You can always learn more about the ostis-metasystem's build system.

Install project

Install ostis-metasystem via git:

git clone https://github.com/ostis-ai/ostis-metasystem
cd ostis-metasystem
git submodule update --init --recursive

Check CMake

Install pipx first using pipx installation guide if not already installed.

Ensure you are using CMake version 3.24 or newer. Verify your version with:

cmake --version

To upgrade CMake, run:

# Use pipx to install cmake if not already installed
pipx install cmake
pipx ensurepath
# relaunch your shell after installation
exec $SHELL

Install Ninja generator for CMake, to use sc-machine CMake presets:

# Use pipx to install ninja if not already installed
pipx install ninja
pipx ensurepath
# relaunch your shell after installation
exec $SHELL

Start develop C++ problem solver of ostis-metasystem with Conan

Install Conan

Install Conan, to build C++ problem solver dependencies with Conan-provided dependencies:

# Use pipx to install conan if not already installed
pipx install conan
pipx ensurepath
# relaunch your shell after installation
exec $SHELL

Add Conan remote repository

Add Conan remote repository with the specified URL:

conan remote add ostis-ai https://conan.ostis.net/artifactory/api/conan/ostis-ai-library

Use C++ problem solver in Debug

Install dependencies with Conan

C++ problem solver of ostis-metasystem is an extension to sc-machine, so sc-machine is main dependency for C++ problem solver. To install it, run in the root of the project:

conan install . -s build_type=Debug --build=missing

Build C++ problem solver in Debug

To build C++ problem solver in debug mode using Conan-provided dependencies, run:

# debug build type
cmake --preset debug-conan
cmake --build --preset debug

Note

By default, configure preset debug enables building C++ problem solver tests.

Run C++ problem solver tests in Debug

After that, you can go to build/Debug and run tests via ctest:

cd build/Debug
ctest -V

You can also check code formatting. To learn more, go to the CMake flags page.

Use C++ problem solver in Release

Install dependencies with Conan

To install it, run in the root of the project:

conan install . -s build_type=Release --build=missing

Build C++ problem solver in Release

To build C++ problem solver in release mode using Conan-provided dependencies, run:

# release build type without tests
cmake --preset release-conan
cmake --build --preset release

To build C++ problem solver with tests in release mode using Conan-provided dependencies, run:

# release build type with tests
cmake --preset release-with-tests-conan
cmake --build --preset release

Run C++ problem solver tests in Release

After that, you can run tests:

cd build/Release
ctest -V

You can also check code formatting. To learn more, go to the CMake flags page.

Start develop Python problem solver of ostis-metasystem

Install dependencies with pip3

To install dependencies, run:

python3 -m venv platform-dependent-components/problem-solver/py/.venv
source platform-dependent-components/problem-solver/py/.venv/bin/activate
pip3 install -r platform-dependent-components/problem-solver/py/requirements.txt

Run Python problem solver tests

Running Python problem solver requires C++ problem solver to be running. Run C++ problem solver:

./path/to/sc-machine/binary -s kb.bin \
    -e "path/to/ostis-metasystem/lib/extensions;path/to/sc-machine/lib/extensions"

and after that, run Python problem-solver tests in new terminal:

source platform-dependent-components/problem-solver/py/.venv/bin/activate && \
python3 -m unittest discover platform-dependent-components/problem-solver/py

Run Python problem solver

Run C++ problem solver:

./path/to/sc-machine/binary -s kb.bin \
    -e "path/to/ostis-metasystem/lib/extensions;path/to/sc-machine/lib/extensions"

and after that, run Python problem-solver in new terminal:

source platform-dependent-components/problem-solver/py/.venv/bin/activate && \
python3 platform-dependent-components/problem-solver/py/server.py

Start develop interface of ostis-metasystem

Install dependencies with npm

To install dependencies, go to the react-sc-web directory and run:

cd platform-dependent-components/interface/react-sc-web
npm install

Build interface

To build interface, run:

npm run build

Run interface

After run:

npm run start

Run ostis-metasystem

Before launching ostis-metasystem:

Firstly, build knowledge base:

./path/to/sc-builder/binary -i repo.path -o kb.bin --clear

After run C++ problem solver:

./path/to/sc-machine/binary -s kb.bin -c ostis-metasystem.ini \
    -e "path/to/ostis-metasystem/lib/extensions;path/to/sc-machine/lib/extensions;path/to/scp-machine/lib/extensions;path/to/sc-component-manager/lib/extensions"
# if several paths to extensions are provided then they should be separated 
# by semicolon and wrapped in double quotes

Run Python problem solver in new terminal:

source platform-dependent-components/problem-solver/py/.venv/bin/activate && \
python3 platform-dependent-components/problem-solver/py/server.py

And run react-sc-web in new terminal:

cd platform-dependent-components/interface/react-sc-web
npm run start

Contributing

To contribute changes to the project, you need to create Pull Request.