You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jena.apache.org by "Martynas Jusevičius (Jira)" <ji...@apache.org> on 2019/12/13 21:09:00 UTC

[jira] [Comment Edited] (JENA-909) Create Docker launcher for Fuseki

    [ https://issues.apache.org/jira/browse/JENA-909?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16995914#comment-16995914 ] 

Martynas Jusevičius edited comment on JENA-909 at 12/13/19 9:08 PM:
--------------------------------------------------------------------

What do you mean with "container namespace"? The container filesystem?

This is currently my setup (of one of the services) in {{docker-compose.yml}}:

{\{ fuseki-admin:}}
 {{  image: atomgraph/fuseki}}
 {{  ports:}}
 {{    - 3030:3030}}
 {{  environment:}}
 {{    - BASE_URI=[https://localhost:4443/admin/]}}
 {{  volumes:}}
 {{    - ./config/fuseki/admin.ttl:/mnt/apache-fuseki/configuration/admin.ttl:ro}}
 {{    - ./datasets/admin.trig:/mnt/apache-fuseki/admin.trig:ro}}
{{entrypoint: [ sh, -c, "\{ echo \"@base <$${BASE_URI}> .\"; cat /mnt/apache-fuseki/admin.trig; } > /mnt/apache-fuseki/based.admin.trig && /usr/bin/java -jar fuseki-server.jar --config /mnt/apache-fuseki/configuration/admin.ttl" ]}}

And this the {{admin.ttl}} config:

{{PREFIX : <#>}}
 {{PREFIX fuseki: <[http://jena.apache.org/fuseki#]>}}
 {{PREFIX rdf: <[http://www.w3.org/1999/02/22-rdf-syntax-ns#]>}}
 {{PREFIX ja: <[http://jena.hpl.hp.com/2005/11/Assembler#]>}}
 {{PREFIX tdb2: <[http://jena.apache.org/2016/tdb#]>}}

{{[] a fuseki:Server .}}

{{<#service> a fuseki:Service ;}}
 {{  fuseki:name "ds" ;}}
 {{  fuseki:endpoint [ fuseki:operation fuseki:query; ] ;}}
 {{  fuseki:endpoint [ fuseki:operation fuseki:update;] ;}}
 {{  fuseki:endpoint [ fuseki:operation fuseki:gsp-rw; ] ;}}
 {{  fuseki:dataset <#dataset> .}}

{{<#dataset> a ja:MemoryDataset;}}
 {{  ja:data "/mnt/apache-fuseki/based.admin.trig" .}}

It works fine with the in-memory dataset. But for real use I need persistence and thus a {{tdb2:DatasetTDB2}}.

The part that looks wobbly to me is that there is no guarantee {{VOLUME $DATA}} will match {{-loc}}. Why not pass {{-loc $DATA}} to the entrypoint by default? That still leaves the problem with {{tdb2:location}} in the RDF config, which if mounted could be anything. Unless the entrypoint substitutes {{tdb2:location "$DATA"}} or something like that?

I also haven't figured out yet how to import a {{DatasetTDB2}} into it before the service starts - or before it becomes available externally. That is why I was looking at the init scripts in the {{mysql}} image (as I wrote above).


was (Author: graphity):
What do you mean with "container namespace"? The container filesystem?

This is currently my setup (of one of the services) in {{docker-compose.yml}}:

{{ fuseki-admin:}}
{{  image: atomgraph/fuseki}}
{{  ports:}}
{{    - 3030:3030}}
{{  environment:}}
{{    - BASE_URI=https://localhost:4443/admin/}}
{{  volumes:}}
{{    - ./config/fuseki/admin.ttl:/mnt/apache-fuseki/configuration/admin.ttl:ro}}
{{    - ./datasets/admin.trig:/mnt/apache-fuseki/admin.trig:ro}}
{{  entrypoint: [ sh, -c, "\{ echo \"@base <$${BASE_URI}> .\"; cat /mnt/apache-fuseki/admin.trig; } > /mnt/apache-fuseki/based.admin.trig && /usr/bin/java -jar fuseki-server.jar --config /mnt/apache-fuseki/configuration/admin.ttl" ] }}

And this the {{admin.ttl}} config:

{{PREFIX : <#>}}
{{PREFIX fuseki: <http://jena.apache.org/fuseki#>}}
{{PREFIX rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#>}}
{{PREFIX ja: <http://jena.hpl.hp.com/2005/11/Assembler#>}}
{{PREFIX tdb2: <http://jena.apache.org/2016/tdb#>}}

{{[] a fuseki:Server .}}

{{<#service> a fuseki:Service ;}}
{{  fuseki:name "ds" ;}}
{{  fuseki:endpoint [ fuseki:operation fuseki:query; ] ;}}
{{  fuseki:endpoint [ fuseki:operation fuseki:update;] ;}}
{{  fuseki:endpoint [ fuseki:operation fuseki:gsp-rw; ] ;}}
{{  fuseki:dataset <#dataset> .}}

{{<#dataset> a ja:MemoryDataset;}}
{{  ja:data "/mnt/apache-fuseki/based.admin.trig" .}}

It works fine with the in-memory dataset. But for real use I need persistence and thus a {{tdb2:DatasetTDB2}}.

The part that looks wobbly to me is that there is no guarantee {{VOLUME $DATA}} will match {{-loc}}. Why not pass {{-loc $DATA}} to the entrypoint by default? That still leaves the problem with {{tdb2:location}} in the RDF config, which if mounted could be anything. Unless the entrypoint substitutes {{tdb2:location "$DATA"}} or something like that?

I also haven't figured out yet how to import a {{DatasetTDB2}} into it before the service starts - or before it becomes available externally. That is why I was looking at the init scripts in the {{mysql}} image (as I wrote above).

> Create Docker launcher for Fuseki
> ---------------------------------
>
>                 Key: JENA-909
>                 URL: https://issues.apache.org/jira/browse/JENA-909
>             Project: Apache Jena
>          Issue Type: Improvement
>          Components: Fuseki
>            Reporter: Andy Seaborne
>            Priority: Major
>         Attachments: Dockerfile.0, image-2019-10-02-22-24-12-723.png, log4j.properties
>
>
> Provide a Docker launcher and setup documentation for  Fuseki2.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)