ostis-apps / dockerized-ostis

Official Docker project for OSTIS

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Dockerized OSTIS

This is the official repository of the Docker image for OSTIS.

OSTIS (Open Semantic Technology for Intelligent Systems) is an open-source integrated mass technology for component-based intelligent systems design.

For application examples, visit the OSTIS Applications page.

Docker Installation

Please find installation instructions for your operating system here.

Available image tags (versions)

To find an actual versions released as Docker images please see the list of Docker hub tags.

Current versions:

Quickstart

You can run the OSTIS container like so:

  • for scp_stable version:
    docker run -it -p 8000:8000 ostis/ostis:scp_stable sh ostis --all
  • for 0.5.0 version:
    docker run -it -p 8000:8000 ostis/ostis:0.5.0 sh ostis --all
  • for 0.6.0 version:
    docker run -it -p 8000:8000 -p 8090:8090 ostis/ostis:0.6.0 sh ostis --all

Open localhost:8000 in your browser to see web interface. For 0.6.0 version new interface version will be available on localhost:8090.

Note: you can specify custom port like so using -p 8080:8000 as an example to run on localhost:8080.

How to customize image

Custom knowledge base source folder and agents source folder can be set up using Docker volumes.

Add -v full_path_to_kb_folder:/ostis/kb to specify your local folder with kb sources.

Note that if you're using custom kb then kb folder should contain ui_main_menu and ui_start_sc_element like here. Be aware that by using custom kb you will not override existing ims.ostis.kb but add additional knowledge base sources.

Add -v full_path_to_problem_solver_folder:/ostis/problem-solver to specify your local folder with problem-solver sources.

Note that C++ agents should be inside problem-solver/cxx folder, SCP agents should be inside problem-solver/scp folder.

Example of the image usage:

docker run -it -v /home/user/test/kb:/ostis/kb -v /home/user/test/problem-solver:/ostis/problem-solver -p 8000:8000 ostis/ostis:0.5.0 sh ostis [OSTIS FLAGS]

OSTIS FLAGS:

  • --help -h - Print help message
  • --all -a - Run all services
  • --sc-machine --scm - Rebuild sc-machine
  • --build_kb --kb - Rebuild kb
  • --sc-web --web - Run sc-web only
  • --sctp - Run sctp only

Run image locally using script

Run script has additional useful options comparing to Quickstart section. To run:

  1. Clone the repo:
git clone https://github.com/ostis-apps/dockerized-ostis
  1. Checkout to branch according to version you need
  2. Run the script with needed options:
./run.sh [OPTIONS]

See flags with

./run.sh --help

OPTIONS:

  • --help -h - Print help message
  • --port -p - Set a custom port
  • --app - Set a custom path to the app directory(By default, it is expected, that inside the app you have all default directories for kb, problem-solver etc)
  • --kb - Set a custom path to kb directory
  • --solver - Set a custom path to problem-solvers directory
  • --startflags --sf - To set container startup flags(using --all by default). Usage: --startflags "[OSTIS FLAGS]" (quotes are necessary for multiple flags!) Example of usage:
./run.sh --app ~/ostis-example-app

Building image locally

To build image locally you will need:

  1. Clone the repo:
git clone https://github.com/ostis-apps/dockerized-ostis
  1. Checkout to branch according to version you need
  2. Run build image script:
./build_image.sh

CLion Integration

Please, read following at the page of our github repository.

Environment

  1. Clone sc-machine repo.
git clone --single-branch --branch 0.5.0 https://github.com/ShunkevichDV/sc-machine.git
  1. Add problem-solver folder with your agents beside the sc-machine's folder.
    folders
  2. Add SET(CMAKE_BUILD_TYPE Debug) at the end of CMakeLists.txt of your module.
    cmake of example module

Workflow with configured CLion

  1. Build clion debug image(Don't forget to do this every time you update the repository):
./clion_debug/build_image.sh
  1. Run clion debug container with needed options:
./clion_debug/run_container.sh [OPTIONS]

See flags with

./clion_debug/run_container.sh --help

OPTIONS:

  • --help -h - Print help message
  • --port -p - Set a custom port
  • --app - Set a custom path to the app directory(By default, it is expected, that inside the app you have all default directories for kb, problem-solver etc)
  • --kb - Set a custom path to kb directory
  • --solver - Set a custom path to problem-solvers deirectory
  • --startflags --sf - To set container startup flags(using --build_kb --sc-web by default). Usage: --startflags "[OSTIS FLAGS]" (quotes are necessary for multiple flags!)
    Example of usage:
./clion_debug/run_container.sh --app ~/ostis-example-app
  1. Debug your code! (See project configuration below)
  2. After finishing your work stop and remove debug container:
./clion_debug/stop_container.sh

Configuring CLion

  1. Add toolchain in Settings/Preferences | Build, Execution, Deployment | Toolchains adding new ssh connection. Default user is user and password is password.
    toolchain config ssh config
  2. Add new CMake profile for container in Settings/Preferences | Build, Execution, Deployment | CMake.
    CMake profile
  3. Configure container's deployment connection and folders mapping in Settings/Preferences | Build, Execution, Deployment | Deployment.
    Deployment connection Deployment folders mappings
  4. Reload CMake project(If you don't have CMake Tab, you can find the option in File | Reload CMake Project).
    Reload CMake project
  5. After successfully reloading your CMake project you'll see sc-machine running configurations and problem-solver folder module.
  6. Add make_all configuration for rebuilding sc-machine inside the container and update local dependencies. The script works properly only if you set up your docker to work without sudo. See instructions here.
    make_all script adding
  7. Update sctp-server debug configuration with dependencies and make_all script.
    sctp-server debug config
  8. Be sure that you choose "Debug-Local container" option in configurations. Debug-Local container
  9. Add breakpoints and start working!

Contribute

Pull requests are very welcome!

It would be great to hear your feedback and suggestions in the issue tracker!

About

Official Docker project for OSTIS

License:MIT License


Languages

Language:Shell 75.1%Language:Dockerfile 24.9%