Skip to content

Commit

Permalink
Improve deploy server and test dbpedia music (#131)
Browse files Browse the repository at this point in the history
* fix: disable post, put and delete method

* fix: run docker as user

* fix: add dbpedia ontology

* fix: add ci dbpedia music

* fix: path

* fix: test using pink floyd

* fix: wait for the server
  • Loading branch information
mosoriob authored Sep 24, 2020
1 parent 4792bb0 commit ba3adae
Show file tree
Hide file tree
Showing 7 changed files with 30,576 additions and 7 deletions.
12 changes: 12 additions & 0 deletions .ci/dbpedia_music.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
set -xe

java -jar target/oba-*-jar-with-dependencies.jar -c examples/dbpedia/config_music.yaml
pushd outputs/dbpedia_music/servers/python
bash generate-server.sh
pushd server
docker build -t openapi_server .
docker run --name dbpedia_music -d -p 8080:8080 openapi_server
popd
sleep 10s
curl -X GET "http://0.0.0.0:8080/v1.3.0/bands/Pink_Floyd" -H "accept: application/json"
docker logs dbpedia_music
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
language: java
script:
- mvn package
- bash .ci/dbpedia_music.sh
before_deploy:
- ls -lR
deploy:
Expand Down
2 changes: 1 addition & 1 deletion examples/dbpedia/config_full.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ openapi:
## Ontologies
### List of ontologies
ontologies:
- https://gist.githubusercontent.com/mosoriob/cec147b24bd241295584dfcc21c21b93/raw/b6fa41ddf93212d967f35da20278f54d2ae2d40d/gistfile1.txt
- examples/dbpedia/ontology.xml

## SPARQL information
endpoint:
Expand Down
9 changes: 4 additions & 5 deletions examples/dbpedia/config_music.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,18 @@ openapi:
## Ontologies
### List of ontologies
ontologies:
- https://gist.githubusercontent.com/mosoriob/cec147b24bd241295584dfcc21c21b93/raw/b6fa41ddf93212d967f35da20278f54d2ae2d40d/gistfile1.txt
- examples/dbpedia/ontology.xml

## SPARQL information
endpoint:
url: http://dbpedia.org/sparql
prefix: http://dbpedia.org/resource
graph_base: http://ontosoft.isi.edu:3030/modelCatalog-1.2.0/data/

## Filter the paths by methods
enable_get_paths: true
enable_post_paths: true
enable_delete_paths: true
enable_put_paths: true
enable_post_paths: false
enable_delete_paths: false
enable_put_paths: false

## Select the classes to add in the API
classes:
Expand Down
30,553 changes: 30,553 additions & 0 deletions examples/dbpedia/ontology.xml

Large diffs are not rendered by default.

Binary file modified src/main/resources/servers.zip
Binary file not shown.
6 changes: 5 additions & 1 deletion src/main/resources/servers/python/generate-server.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,11 @@ dir=${PWD}
cp ../openapi.yaml ${PWD}

SERVER_DIR=server
docker run -ti --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v4.1.2 \


docker run -ti --rm -v ${PWD}:/local \
-u "$(id -u):$(id -u)" \
openapitools/openapi-generator-cli:v4.1.2 \
generate \
-i /local/openapi.yaml\
-g python-flask \
Expand Down

0 comments on commit ba3adae

Please sign in to comment.