Skip to content

Commit

Permalink
Merge pull request #93 from ostis-ai/develop
Browse files Browse the repository at this point in the history
Release 0.8.0-Fusion
  • Loading branch information
NikitaZotov authored Sep 24, 2023
2 parents fdc8396 + 6b52bc6 commit db59d15
Show file tree
Hide file tree
Showing 36 changed files with 380 additions and 515 deletions.
12 changes: 8 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,16 @@ jobs:
runs-on: ${{ matrix.os }}

strategy:
fail-fast: false
matrix:
os: [ ubuntu-20.04, ubuntu-22.04 ]
fail-fast: false
matrix:
os: [ubuntu-20.04, ubuntu-22.04, macos-latest]

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Update
if: startswith(matrix.os, 'ubuntu')
run: |
sudo apt-get update
Expand All @@ -31,6 +32,9 @@ jobs:
key: ${{ github.job }}

- name: Preparing platform
env:
TERM: linux
run: |
cd scripts
./prepare.sh
./set_vars.sh
./install_platform.sh
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,13 @@ ims.ostis.kb_copy
geometry.drawings
web-scn-editor
prepared_kb
bin
build

*.*~
.idea
__pycache__
.vscode

# texstudio
*.aux
Expand Down
36 changes: 13 additions & 23 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ To learn more about the platform, check out our [documentation](https://github.c
- Quick start using Docker Compose

<details>

<summary><b>Additional steps for Windows users</b></summary>

Make sure you are using UNIX line endings inside the repository and `longpaths` are enabled, otherwise you may face problems during build or installation process. Use the commands below to reconfigure Git on your machine:
Expand All @@ -32,12 +32,10 @@ To learn more about the platform, check out our [documentation](https://github.c
Requirements: you will need [Docker](https://docs.docker.com/get-docker/) installed and running on your machine.

```sh
git clone https://github.com/ostis-ai/ostis-web-platform
git clone https://github.com/ostis-ai/ostis-web-platform --recursive
cd ostis-web-platform
# download images from Docker Hub
docker compose pull
# download KB and LaTeX docs plugin
git submodule update --init --recursive
# build knowledge base
docker compose run machine build
# launch web platform stack
Expand All @@ -57,23 +55,22 @@ To learn more about the platform, check out our [documentation](https://github.c
### Build process
```sh
git clone https://github.com/ostis-ai/ostis-web-platform
git submodule update --init --recursive
cd scripts
./prepare.sh no_build_sc_machine no_build_sc_web # download all submodules without compilation.
cd ..
git clone https://github.com/ostis-ai/ostis-web-platform --recursive
cd ostis-web-platform
./scripts/install_submodules.sh # download all submodules without compilation.
docker compose build
```
</details>
- Natively
Note: Currently, only Ubuntu is supported by this installation method. If you're going to use it, it might take a while to download dependencies and compile the components. Use it only if you know what you're doing!
Note: Currently, only Linux (Ubuntu-20.04, Ubuntu-22.04) and macOS are supported by this installation method. If you're going to use it, it might take a while to download dependencies and compile the components. Use it only if you know what you're doing!
```sh
cd ostis-web-platform/scripts/
./prepare.sh
git clone https://github.com/ostis-ai/ostis-web-platform --recursive
cd ostis-web-platform
./scripts/install_platform.sh
```
## Usage
Expand All @@ -91,16 +88,11 @@ To learn more about the platform, check out our [documentation](https://github.c
- Native installation
```sh
# Build knowledge base
cd ostis-web-platform/scripts/
./build_kb.sh
# Launch knowledge processing machine
cd ostis-web-platform/scripts/
./run_sc_server.sh
./scripts/run_sc_server.sh
# *in another terminal*
# Launch semantic web interface at localhost:8000
cd ostis-web-platform/scripts/
./run_scweb.sh
./scripts/run_sc_web.sh
```
## Documentation
Expand All @@ -117,21 +109,19 @@ the help of LaTeX tools in SCn-code representation. To build documentation manua
```sh
# feel free to skip this step if the platform is already installed natively
cd ostis-web-platform/scripts
./prepare.sh no_build_sc_machine no_build_sc_web
./scripts/install_submodules.sh
```
- ### Build steps (using LaTeX)
```sh
cd ostis-web-platform/docs
cd docs
TEXINPUTS=./scn: latexmk -pdf -bibtex main.tex
```
- ### Build steps (using Docker)
```sh
cd ostis-web-platform
docker run -v ${PWD}:/workdir --rm -it ostis/scn-latex-plugin:latest "docs/main.tex"
```
Expand Down
6 changes: 4 additions & 2 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
services:
web:
image: ostis/sc-web:0.7.0-Rebirth
image: ostis/sc-web:0.8.0-Fusion
build:
context: ./sc-web
restart: unless-stopped
Expand All @@ -15,7 +15,7 @@ services:
condition: service_healthy

machine:
image: ostis/sc-machine:0.7.0-Rebirth
image: ostis/sc-machine:0.8.0-Fusion
build:
context: ./sc-machine
restart: unless-stopped
Expand All @@ -36,6 +36,8 @@ services:
# Use the commented env variable if you need to rebuild KB every startup.
#- "REBUILD_KB=1"
- "KB_PATH=/kb/repo.path"
- "BINARY_PATH=/sc-machine/bin"
- "CONFIG_PATH=/kb/ostis-web-platform.ini"
command:
- "serve"

Expand Down
34 changes: 33 additions & 1 deletion docs/changelog.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,39 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [Unreleased]
## [0.8.0-Fusion] - 24.09.2023
### Added
- Generalize all scripts
- Configure events and agents threads

### Changed
- Link scripts with sc-machine and sc-web scripts
- Unify config file for sc-server and sc-builder

### Deprecated
- Deprecate `run_scweb.sh`, add `run_sc_web.sh` instead
- Deprecate and divide `prepare.sh` into `install_submodules.sh`, `install_dependencies.sh`, `build_sc_machine.sh` and `build_sc_web.sh`

### Removed
- Remove windows scripts
- Remove drawings and scp scripts
- Remove dump scripts
- Remove sctp-server scripts

## [0.7.0-Rebirth] - 13.10.2022
### Breaking actions
- Remove sctp-server scripts from projects that use ostis-web-platform
- Use py-sc-client and ts-sc-client for sc-server instead of sctp-clients for sctp-server

### Added
- Add latex documentation from OSTIS Standard
- Add CI

### Changed
- Unify config file for sc-server and sc-builder

### Removed
- Remove sctp-server scripts


## [0.7.0-Rebirth] - 13.10.2022
Expand Down
2 changes: 1 addition & 1 deletion ims.ostis.kb
Submodule ims.ostis.kb updated 1442 files
11 changes: 11 additions & 0 deletions ostis-web-platform.ini
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
[sc-memory]
max_loaded_segments = 1000
max_threads = 32
max_events_and_agents_threads = 32

save_period = 3600
update_period = 1800
Expand All @@ -12,6 +13,14 @@ log_type = File
log_file = sc-machine/sc-memory.log
log_level = Info

init_memory_generated_upload = false
init_memory_generated_structure = basic_ontology_structure

max_strings_channels = 1000
max_strings_channel_size = 100000
max_searchable_string_size = 1000
term_separators = " _"

[sc-server]
host = 127.0.0.1
port = 8090
Expand All @@ -24,3 +33,5 @@ log_level = Info

[sc-builder]
log_file = sc-machine/scripts/sc_builder.log

input_path = repo.path
10 changes: 9 additions & 1 deletion scripts/build_kb.sh
Original file line number Diff line number Diff line change
@@ -1 +1,9 @@
python3 ../sc-machine/scripts/build_kb.py ../repo.path -c ../ostis-web-platform.ini
#!/usr/bin/env bash
set -eo pipefail

if [ -z "${SC_MACHINE_PATH}" ];
then
source "$(cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)"/set_vars.sh
fi

"${SC_MACHINE_PATH}/scripts/build_kb.sh" "$@"
9 changes: 9 additions & 0 deletions scripts/build_sc_machine.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -eo pipefail

if [ -z "${SC_MACHINE_PATH}" ];
then
source "$(cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)"/set_vars.sh
fi

"${SC_MACHINE_PATH}/scripts/build_sc_machine.sh" "$@"
9 changes: 9 additions & 0 deletions scripts/build_sc_web.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/usr/bin/env bash
set -eo pipefail

if [ -z "${SC_WEB_PATH}" ];
then
source "$(cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)"/set_vars.sh
fi

"${SC_WEB_PATH}/scripts/build_sc_web.sh" "$@"
6 changes: 0 additions & 6 deletions scripts/clean.sh

This file was deleted.

60 changes: 0 additions & 60 deletions scripts/dump_saver.sh

This file was deleted.

1 change: 0 additions & 1 deletion scripts/fix_libhiredis.sh

This file was deleted.

4 changes: 4 additions & 0 deletions scripts/formats.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
stage()
{
([ -n "$(tput setaf 1 2<&-)" ] && { tput setaf 4 && tput bold && echo "$1" && tput sgr0; }) || echo "$1"
}
44 changes: 44 additions & 0 deletions scripts/install_dependencies.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
#!/usr/bin/env bash
set -eo pipefail

CURRENT_DIR=$(cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd)
source "${CURRENT_DIR}/formats.sh"

if [[ -z "${SC_MACHINE_PATH}" || -z "${SC_WEB_PATH}" ]];
then
source "${CURRENT_DIR}/set_vars.sh"
fi

function usage() {
cat <<USAGE
Usage: $0 [--dev]
Options:
--dev: installs dependencies required to compile sc-machine and sc-web
USAGE
exit 1
}

stage "Install dependencies"

args=()
while [ "$1" != "" ]; do
case $1 in
--dev)
args+=("--dev")
;;
-h | --help)
usage # show help
;;
*)
usage
exit 1
;;
esac
shift 1 # remove the current value for `$1` and use the next
done

"${SC_MACHINE_PATH}/scripts/install_dependencies.sh" "${args[@]}"
"${SC_WEB_PATH}/scripts/install_dependencies.sh"

stage "Dependencies installed successfully"
Loading

0 comments on commit db59d15

Please sign in to comment.