Skip to content

Commit

Permalink
[#23] Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
blcham committed Aug 3, 2023
1 parent 271f054 commit a1a5e3b
Showing 1 changed file with 29 additions and 20 deletions.
49 changes: 29 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,29 +3,38 @@
We will use `$PROJECT_ROOT` as the root directory of this project, i.e., the directory where this README is located. Similarly, we will define:
- `$SPIPES_EDITOR_ROOT` -- root folder of cloned repository [s-pipes-editor](https://github.com/kbss-cvut/s-pipes-editor)
- `$SPIPES_MODULES_ROOT` -- root folder of cloned repository [s-pipes-modules](https://kbss.felk.cvut.cz/gitblit/summary/s-pipes-modules.git)
- `$SCRIPTS_ROOT` -- root folder of cloned repository [s-pipes](https://github.com/kbss-cvut/s-pipes)

Note that the `*_ROOT` paths are paths in the individual service containers. In order for the `*_ROOT` paths to work
properly inside the containers, local paths are mounted as volumes. Variable `PATH_ROOT` is used to mount local root directory
containing referenced project paths.
- Setting up `PATH_ROOT` when running on Windows with wsl -- use prefix `/host_mnt` for paths from the root or `~` for
paths from user home. For example, assume that the current user is `user1`, correct `PATH_ROOT` values that point to
`/c/Users/user1/code` are:
- `/host_mnt/c/Users/user1/code` or
- `~/code`.

- `$SPIPES_ROOT` -- root folder of cloned repository [s-pipes](https://github.com/kbss-cvut/s-pipes)
- `$SHARED_ROOT` -- root folder that you want to share between docker services and your host system. It is the folder that
will be visible from docker services as well as from host filesytem and paths to all files will be the same.
Thus one can copy absolute path to a file from docker service and open it from host filesystem and other way around.
For linux the typical value would be `/home` or `/home/$user` and for windows the typical value would be `/host_mnt` or
`/host_mnt/c/Users/user1/code`.

### Running Editor UI

Default configuration assumes that:
- you have **at least** docker-compose v2.20.2 (due to https://github.com/docker/cli/issues/4265; earlier versions were not tested)
- all relevant projects are "git cloned" as sibling directories to `$PROJECT_ROOT` (i.e. `$SPIPES_EDITOR_ROOT=$PROJECT_ROOT/../s-pipes-editor`, $SPIPES_MODULES_ROOT=$PROJECT_ROOT/../s-pipes-modules, and `$SPIPES_ROOT=$PROJECT_ROOT/../s-pipes`).

To run the editor, do the following steps:
- create `$PROJECT_ROOT/.env` file and configure the following parameters:
- `PATH_ROOT` -- e.g. `/home` for linux; `/host_mnt/c/Users/user1/code` or `~/code` for Windows
- `SCRIPTPATHS` -- e.g. `$SPIPES_MODULES_ROOT;$SPIPES_ROOT/doc/examples/hello-world/`, note the separator ";"
- `SCRIPTRULES` -- e.g. `$SPIPES_EDITOR_ROOT/src/main/resources/rules`
- `RDF4J_REPOSITORYNAME` -- e.g. `s-pipes-hello-world`
- `RDF4J_PCONFIGURL` -- e.g. `$SPIPES_ROOT/doc/examples/hello-world/config.ttl`
- run `docker-compose up` in the root directory of this project
- create rdf4j repository with the name specified in `RDF4J_REPOSITORYNAME`
- access the editor from URL `http://localhost:3000`
- `cd $PROJECT_ROOT`
- if on Windows, create `$PROJECT_ROOT/.env` file with variable assignment `SHARED_ROOT=/host_mnt`
- `docker-compose up`
- open the editor in browser at `http://localhost:3000`. The editor should be showing [example scripts from SPipes repository](https://github.com/kbss-cvut/s-pipes/doc/examples).

To override default configuration create `$PROJECT_ROOT/.env` and use following variables:
- `CUSTOM_SCRIPT_PATHS` -- to show different SPipes scripts (defaults to `${PROJECT_ROOT}/../s-pipes/doc/examples`).
Use separator ";" to add multiple paths. The path must be absolute and the same as in host filesystem.
- `SCRIPTRULES` -- to set up different rules to validate SPipes scripts
(defaults to `${PROJECT_ROOT}/../s-pipes-editor/src/main/resources/rules`),
- `RDF4J_SERVER_URL` -- to set up different Rdf4j server (defaults to docker service server at `http://rdf4j:8080/rdf4j-server`).
**Note that this variable must be consistent with variable `RDF4J_PCONFIGURL`**.
- `RDF4J_REPOSITORYNAME` -- to set up different Rdf4j repository name where SPipes logs from execution are created
(defaults to `s-pipes-hello-world`). **Note that this variable must be consistent with
variable `RDF4J_PCONFIGURL`**.
- `RDF4J_PCONFIGURL` -- to set up configuration of Rdf4j repository where SPipes logs from execution are created
(defaults to `$SPIPES_ROOT/doc/examples/hello-world/config.ttl`). **Note that this variable must be consistent with
variables `RDF4J_SERVER_URL` and `RDF4J_REPOSITORYNAME`**.

### Building

Expand Down

0 comments on commit a1a5e3b

Please sign in to comment.