-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Trying out docker for demo script (#39)
# Aim Easier to run demo # Method Creating a docker-based setup that runs all scripts # Consequences Relative path to NOAKADEXPI repo had to be renamed in dexpisvg.xslt so the path works in the docker image. This means running the transformation locally does not work anymore. dexpi.html is now hardcoded to have 14 lines before the svg. Rdfox license must now have a hardcoded position in the repo Xslt transformation uses the unix tool xsltproc in stead of C#, since faster and easier in docker xslt transformation for rotation refactored to be calculated in C# The result of the rml transformation is stored in the same location as before (pandid.trig), while the generated svg is stored in "www/index.html". # User story: https://dev.azure.com/EquinorASA/Spine/_workitems/edit/190800 --------- Co-authored-by: Embla Øye <[email protected]>
- Loading branch information
1 parent
32b2a4d
commit 96e3d41
Showing
11 changed files
with
211 additions
and
119 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,24 @@ | ||
C01V04-VER.EX01.xml | ||
C01V04-VER.EX01.trig | ||
dexpi.properties | ||
pandid.xml | ||
pandid.trig | ||
rml/segments.trig | ||
client/.idea | ||
.vs | ||
client/Boundaries/Dexpi2Svg/test.svg | ||
rml/C03V04.trig | ||
www/C03V04.svg | ||
client/Boundaries/Dexpi2Svg/bin | ||
client/Boundaries/Dexpi2Svg/obj | ||
client/Boundaries/Boundaries/bin | ||
client/Boundaries/Boundaries/obj | ||
client/Boundaries/TestBoundaries/obj | ||
client/Boundaries/TestBoundaries/bin | ||
aibel_dexpi/* | ||
aibel_dexpi.xml | ||
output.svg | ||
local | ||
chex.egg-info | ||
__pycache__ | ||
/owl/boundary.properties | ||
/owl/catalog-v001.xml | ||
/www/node_modules/ | ||
/RDFox.lic | ||
/.idea/ | ||
/www/.idea | ||
/www/index.html |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
# Docker-based demo setup | ||
|
||
## Prerequisites | ||
* Install Docker and Docker-compose [https://docs.docker.com/compose/install/](https://docs.docker.com/compose/install/) | ||
|
||
* Copy the RDFox license file to [../RDFox.lic](../RDFox.lic) | ||
|
||
* Find a dexpi file, and copy it to [../rml_mappings/pandid.xml](../rml_mappings/pandid.xml) | ||
|
||
## Running | ||
|
||
* From the root folder in the project ([../](../)), run | ||
``` | ||
docker-compose -f docker/docker-compose.yml up --build | ||
``` | ||
|
||
* Open [http://localhost:8080](http://localhost:8080) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
|
||
services: | ||
rdfox: | ||
image: oxfordsemantic/rdfox:7.2a | ||
command: -license.file /home/rdfox/.RDFox/RDFox.lic sandbox /home/rdfox/.RDFox/rdfox dexpi | ||
stdin_open: true | ||
tty: true | ||
ports: | ||
- 12110:12110 | ||
volumes: | ||
- type: bind | ||
source: ../ | ||
target: /home/rdfox/.RDFox/ | ||
depends_on: | ||
rml-mapper: | ||
condition: service_completed_successfully | ||
rml-mapper: | ||
build: rml-mapper | ||
tty: true | ||
volumes: | ||
- type: bind | ||
source: ../ | ||
target: /app/local/ | ||
web: | ||
build: web | ||
tty: true | ||
ports: | ||
- 8080:80 | ||
volumes: | ||
- type: bind | ||
source: ../www | ||
target: /var/www/html/ | ||
depends_on: | ||
rml-mapper: | ||
condition: service_completed_successfully |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
# Use official Java image as the base image | ||
FROM eclipse-temurin:21 | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# Download the JAR file from the release URL and rename it to rmlmapper.jar | ||
ADD https://github.com/RMLio/rmlmapper-java/releases/download/v7.1.2/rmlmapper-7.1.2-r374-all.jar /app/rmlmapper.jar | ||
|
||
# Install Git, xsltproc and apache | ||
RUN apt-get update && \ | ||
apt-get install -y git xsltproc dos2unix | ||
|
||
# Clone the NOAKADEXPI Git repo | ||
RUN git clone https://github.com/equinor/NOAKADEXPI.git /app/NOAKADEXPI | ||
|
||
# Copy the demo bash script | ||
COPY demo.sh /app/demo.sh | ||
RUN dos2unix /app/demo.sh | ||
RUN chmod +x /app/demo.sh | ||
|
||
# Run the rml mappings | ||
ENTRYPOINT "/app/demo.sh" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
#!/bin/bash | ||
# This script is for use inside the docker container defined in the Dockerfile in this folder | ||
# See README.md for instructions | ||
|
||
# Create rdf | ||
cd local/rml_mappings | ||
java -jar /app/rmlmapper.jar -m *map*ttl -s trig -o pandid.trig | ||
cd /app/ | ||
|
||
# Copy the lacking Origo symbol | ||
cp /app/local/xslt/PV001A_Origo.svg /app/NOAKADEXPI/Symbols/Origo | ||
|
||
# Create svg | ||
xsltproc --novalid -o /app/dexpi.svg /app/local/xslt/dexpisvg.xslt /app/local/rml_mappings/pandid.xml | ||
|
||
## Copy svg into html | ||
head -n 14 /app/local/www/dexpi.html > /app/local/www/index.html | ||
cat /app/dexpi.svg >> /app/local/www/index.html | ||
tail -n +14 /app/local/www/dexpi.html >> /app/local/www/index.html | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# Use official Java image as the base image | ||
FROM eclipse-temurin:21 | ||
|
||
# Set the working directory | ||
WORKDIR /app | ||
|
||
# apache | ||
RUN apt-get update && \ | ||
apt-get install -y apache2 | ||
|
||
|
||
# Run the web server | ||
ENTRYPOINT ["apache2ctl", "-D", "FOREGROUND"] | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters