Skip to content

Commit

Permalink
update docker compose to use the default virtuoso image
Browse files Browse the repository at this point in the history
  • Loading branch information
syphax-bouazzouni committed Jan 17, 2025
1 parent 850c8da commit 9dcfc78
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 12 deletions.
20 changes: 15 additions & 5 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@ services:
ports:
- 8983:8983
command: bin/solr start -cloud -f
# volumes:
# volumes:
#- solr_data:/var/solr/data
agraph-ut:
image: franzinc/agraph:v8.1.0
Expand All @@ -111,19 +111,26 @@ services:
# interval: 10s
# timeout: 5s
# retries: 5
networks:
- app
profiles:
- ag

virtuoso-ut:
image: tenforce/virtuoso:virtuoso7.2.5
image: openlink/virtuoso-opensource-7:7.2
platform: linux/amd64
environment:
- SPARQL_UPDATE=true
ports:
- 1111:1111
- 8890:8890
environment:
- DBA_PASSWORD=dba
profiles:
- vo
volumes:
- ./test/data/virtuoso.ini:/opt/virtuoso-opensource/database/virtuoso.ini
- ./test/data/virtuso_grant_write_permission.sh:/opt/virtuoso-opensource/initdb.d/virtuso_grant_write_permission.sh
entrypoint: >
bash -c "cd ..; ./bin/virtuoso-t -c ./database/virtuoso.ini ; ./initdb.d/virtuso_grant_write_permission.sh ; tail -f database/virtuoso.log"
healthcheck:
test: [ "CMD-SHELL", "curl -sf http://localhost:8890/sparql || exit 1" ]
start_period: 10s
Expand Down Expand Up @@ -155,4 +162,7 @@ volumes:
bundle:
agdata:
4store:
#solr_data:
#solr_data:
networks:
app:
driver: bridge
14 changes: 7 additions & 7 deletions test/data/graphdb-repo-config.ttl
Original file line number Diff line number Diff line change
Expand Up @@ -13,21 +13,21 @@
<http://www.ontotext.com/trree/owlim#defaultNS> "";
<http://www.ontotext.com/trree/owlim#disable-sameAs> "true";
<http://www.ontotext.com/trree/owlim#enable-context-index> "false";
<http://www.ontotext.com/trree/owlim#enable-literal-index> "true";
<http://www.ontotext.com/trree/owlim#enable-literal-index> "false";
<http://www.ontotext.com/trree/owlim#enablePredicateList> "true";
<http://www.ontotext.com/trree/owlim#entity-id-size> "32";
<http://www.ontotext.com/trree/owlim#entity-index-size> "10000000";
<http://www.ontotext.com/trree/owlim#entity-id-size> "64";
<http://www.ontotext.com/trree/owlim#entity-index-size> "100000000000000000";
<http://www.ontotext.com/trree/owlim#imports> "";
<http://www.ontotext.com/trree/owlim#in-memory-literal-properties> "true";
<http://www.ontotext.com/trree/owlim#in-memory-literal-properties> "false";
<http://www.ontotext.com/trree/owlim#owlim-license> "";
<http://www.ontotext.com/trree/owlim#query-limit-results> "0";
<http://www.ontotext.com/trree/owlim#query-timeout> "0";
<http://www.ontotext.com/trree/owlim#query-timeout> "600";
<http://www.ontotext.com/trree/owlim#read-only> "false";
<http://www.ontotext.com/trree/owlim#repository-type> "file-repository";
<http://www.ontotext.com/trree/owlim#ruleset> "rdfsplus-optimized";
<http://www.ontotext.com/trree/owlim#storage-folder> "storage";
<http://www.ontotext.com/trree/owlim#throw-QueryEvaluationException-on-timeout> "false";
<http://www.ontotext.com/trree/owlim#throw-QueryEvaluationException-on-timeout> "true";
sail:sailType "owlim:Sail"
]
];
rdfs:label "" .
rdfs:label "" .
61 changes: 61 additions & 0 deletions test/data/virtuoso.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
[Database]
DatabaseFile = ./database/virtuoso.db
ErrorLogFile = ./database/virtuoso.log
TransactionFile = ./database/virtuoso.trx
xa_persistent_file = ./database/virtuoso.pxa
MaxCheckpointRemap = 200000
CheckpointInterval = 60
NumberOfBuffers = 2450000 ; Each buffer is 8KB, so ~19GB total
MaxDirtyBuffers = 1837500 ; About 75% of NumberOfBuffers
TransactionAfterImageLimit = 50000000
; NumberOfBuffers = 1000000
MaxStaticCursorRows = 5000
Striping = 0
TempStorage = .
ErrorLogLevel = 7

[HTTPServer]
ServerPort = 8890
ServerRoot = ./var/lib/virtuoso/vsp
MaxClientConnections = 200
MaxKeepAlives = 10
KeepAliveTimeout = 10
ServerThreads = 50
HttpTimeout = 300
MaxBody = 20000000
EnableGzip = 1
GzipMimeType = text/html, text/xml, text/plain, text/css, application/xml, application/xhtml+xml, application/rss+xml, application/javascript, application/x-javascript, image/svg+xml
HTTPLogFile = ./http17012025.log

[Parameters]
ServerPort = 1111
NumOfThreads = 100
MaxMem = 20000000000 ; 5GB memory
ResultSetMaxRows = 10000
DirsAllowed = ., ./vad, ./virtuoso, ../migration-to-virtuoso,../migration-to-virtuoso/processed_files
MaxQueryCostEstimationTime = 6000
MaxQueryExecutionTime = 6000
DynamicLocal = 1
LogEnable = 2 ; Enable SPARQL query logging
TraceOn = errors
LogFile = virtuoso.log
NumberOfBuffers = 2450000 ; Each buffer is 8KB, so ~19GB total
MaxDirtyBuffers = 1837500 ; About 75% of NumberOfBuffers

[VDB]
ArrayOptimization = 0
NumArrayParams = 0
VDBDisconnectTimeout = 1000
KeepAliveTimeout = 60
RetryCount = 3
ThreadCleanupInterval = 600

[Replication]
ServerName = virtuoso
ServerEnable = 1

[SPARQL]
ResultSetMaxRows = 1000000000000
MaxQueryExecutionTime = 6000
DefaultGraph = http://localhost:8890/sparql
MaxSortedTopRows = 10000
58 changes: 58 additions & 0 deletions test/data/virtuso_grant_write_permission.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
#!/bin/bash

# Virtuoso database connection credentials
DB_PORT=1111
DB_USER="dba"
DB_PASS="dba"
VIRTUOSO_DIR=$1

if [ "$#" -ne 1 ]; then
VIRTUOSO_DIR="/opt/virtuoso-opensource/"
fi
# Connect to Virtuoso using isql and grant EXECUTE permission
echo "-- Granting EXECUTE permission on DB.DBA.SPARQL_INSERT_DICT_CONTENT..."

$VIRTUOSO_DIR/bin/isql $DB_PORT $DB_USER $DB_PASS <<EOF
GRANT EXECUTE ON DB.DBA.SPARQL_INSERT_DICT_CONTENT TO "SPARQL";
EOF

# Check if the operation was successful
if [ $? -eq 0 ]; then
echo "Permission granted successfully."
else
echo "Failed to grant permission."
exit 1
fi

# Optionally, grant the SPARQL_UPDATE role to the user for more permissions
echo "-- Granting SPARQL_UPDATE role to 'SPARQL'..."
$VIRTUOSO_DIR/bin/isql $DB_PORT $DB_USER $DB_PASS <<EOF
GRANT SPARQL_UPDATE TO "SPARQL";
EOF

if [ $? -eq 0 ]; then
echo "SPARQL_UPDATE role granted successfully."
else
echo "Failed to grant SPARQL_UPDATE role."
exit 1
fi

echo "-- Granting WRITE permission on all graphs to SPARQL user..."

$VIRTUOSO_DIR/bin/isql $DB_PORT $DB_USER $DB_PASS <<EOF
DB.DBA.RDF_DEFAULT_USER_PERMS_SET ('nobody', 7);
EOF

# Check if the operation was successful
if [ $? -eq 0 ]; then
echo "WRITE permission granted successfully to SPARQL on all graphs."
else
echo "Failed to grant WRITE permission."
exit 1
fi

# Restart Virtuoso to apply changes
echo "-- Restarting Virtuoso server to apply changes..."
$VIRTUOSO_DIR/bin/virtuoso-t +wait

echo "Permission changes applied and Virtuoso restarted."

0 comments on commit 9dcfc78

Please sign in to comment.