Skip to content

Commit

Permalink
[config] move config to the root to be project
Browse files Browse the repository at this point in the history
This change is required by the new logic of build_kb.py
Also it's consistent with how we store configs in projects that use sc-machine
  • Loading branch information
FallenChromium committed Apr 18, 2023
1 parent 1ea3384 commit 7bfb09f
Show file tree
Hide file tree
Showing 6 changed files with 13 additions and 13 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,4 +62,4 @@ jobs:
run: |
mkdir kb
bin/sc-builder -i kb -o kb.bin --clear -f
bin/sc-server -t -c config/sc-machine.ini -r kb.bin
bin/sc-server -t -c sc-machine.ini -r kb.bin
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ RUN --mount=type=cache,target=/ccache/ ./scripts/make_all.sh
FROM base AS final

COPY --from=builder /sc-machine/scripts /sc-machine/scripts
COPY --from=builder /sc-machine/config /sc-machine/config
COPY --from=builder /sc-machine/sc-machine.ini /sc-machine/sc-machine.ini
COPY --from=builder /sc-machine/bin /sc-machine/bin
WORKDIR /sc-machine/scripts

Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,18 +68,18 @@ SC-machine is a core of any OSTIS-system, so you can use a reference system name

```sh
# build kb
docker run --rm -it -v <full path to kb sources>:/kb -v sc-machine_kb:/kb.bin ostis/sc-machine:latest build -c /sc-machine/config/sc-machine.ini -b /sc-machine/bin /kb
docker compose run --rm machine build
# run sc-server
docker run --rm -it -v sc-machine_kb:/kb.bin -p 8090:8090 ostis/sc-machine:latest serve -c /sc-machine/config/sc-machine.ini -b /sc-machine/bin
docker compose up
```

- Native

```sh
#build kb
python3 scripts/build_kb.py -c config/sc-machine.ini -b bin <path to kb folder with SCs and SCg sources (or path to repo.path file)>
python3 scripts/build_kb.py -c ./sc-machine.ini -b bin <path to kb folder with SCs and SCg sources (or path to repo.path file)>
#launch sc-server
./bin/sc-server -c config/sc-machine.ini
./bin/sc-server -c ./sc-machine.ini
```

Most of these commands have a help page bundled inside, so if you have any questions or want to customize the command behavior, use `--help` flag to learn more about them.
Expand Down
2 changes: 1 addition & 1 deletion docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ services:
- "REBUILD_KB=${REBUILD_KB:-0}"
- "KB_PATH=${KB_PATH:-/kb/repo.path}"
- "BINARY_PATH=/sc-machine/bin"
- "CONFIG_PATH=/sc-machine/config/sc-machine.ini"
- "CONFIG_PATH=/sc-machine/sc-machine.ini"
command:
- "serve"

Expand Down
2 changes: 1 addition & 1 deletion docs/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ All our releases are automatically uploaded to Docker Hub, so to start using our
### Launch

```sh
docker compose run machine build #build KB (see below for details)
docker compose run --rm machine build #build KB (see below for details)
docker compose up #launch server
```

Expand Down
10 changes: 5 additions & 5 deletions config/sc-machine.ini → sc-machine.ini
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@ max_searchable_string_size = 1000
save_period = 3600
update_period = 1800

repo_path = ../../kb.bin
extensions_path = ../bin/extensions
repo_path = ./kb.bin
extensions_path = ./bin/extensions

log_type = Console
log_file = ../sc-memory.log
log_file = ./sc-memory.log
log_level = Info

init_memory_generated_upload = false
Expand All @@ -25,8 +25,8 @@ port = 8090
sync_actions = 0

log_type = File
log_file = ../sc-server.log
log_file = ./sc-server.log
log_level = Info

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

0 comments on commit 7bfb09f

Please sign in to comment.