Dockerized example for running a Local SysML2 server and API pipeline with some examples
The following instuctions are extracted from the official repo https://github.com/Systems-Modeling/SysML-v2-API-Services and the docker API Server Dockefile has been extracted from https://github.com/gorenje/sysmlv2-jupyter-docker
For using this Server API docker is needed. For install docker follow https://docs.docker.com/desktop/install/ubuntu/ installing instructions.
If using Linux I recommend configuring this -> https://docs.docker.com/engine/install/linux-postinstall/ (only things related with non root-user)
git clone https://github.com/miferco97/SysML2-server-api
cd SysML2-server-api
For downloading the postgres docker image run:
docker pull postgres
Then the SysML2 API Server image has to be build. For building it run:
$ docker build ./docker_images -t sysml-v2-api # --progress=plain for verbose stdout
In order to store the database in a persistent way a docker volume has to be created:
$ docker volume create postgresdbserver
For deleting it you can run:
$ docker volume rm postgresdbserver
For running the SysML2 API Server a docker compose is used for starting all the containers toguether:
$ docker compose up # add -d for detaching
The server waits until the first request is done for setup. After this it can spend up to 2 minutes in initializing it completely (the first execution even more) When the server is ready this prompt will be displayed:
[info] play.api.Play - Application started (Dev) (no global state)
go to http://localhost:9000/docs/ inside your web browser to check if all works (it can spend up to 2 minutes in initailizing the server)
For futher examples using the API through Jupyter Notebooks refer https://github.com/Systems-Modeling/SysML-v2-API-Cookbook
For closing the compose when running in detach mode:
$ docker compose down
This work has received funding from the European Union's Horizon Europe research and innovation programme under grant agreement No 101070254 (CORESENSE). Views and opinions expressed are however those of the author(s) only and do not necessarily reflect those of the European Union or the European Commission. Neither the European Union nor the granting authority can be held responsible for them.