-
Notifications
You must be signed in to change notification settings - Fork 16k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci[minor] : Added graphdb in docker compose for integration tests (#1…
…7510) This PR adds graphdb to the docker compose so it can be used in integration tests. Co-authored-by: KARTHEEK YAKKALA <[email protected]>
- Loading branch information
1 parent
0835eba
commit 44db441
Showing
5 changed files
with
95 additions
and
0 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 |
---|---|---|
|
@@ -15,3 +15,7 @@ services: | |
- "6020:6379" | ||
volumes: | ||
- ./redis-volume:/data | ||
graphdb: | ||
image: graphdb | ||
ports: | ||
- "6021:7200" |
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,5 @@ | ||
FROM ontotext/graphdb:10.5.1 | ||
RUN mkdir -p /opt/graphdb/dist/data/repositories/langchain | ||
COPY config.ttl /opt/graphdb/dist/data/repositories/langchain/ | ||
COPY graphdb_create.sh /run.sh | ||
ENTRYPOINT bash /run.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,46 @@ | ||
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#>. | ||
@prefix rep: <http://www.openrdf.org/config/repository#>. | ||
@prefix sr: <http://www.openrdf.org/config/repository/sail#>. | ||
@prefix sail: <http://www.openrdf.org/config/sail#>. | ||
@prefix graphdb: <http://www.ontotext.com/config/graphdb#>. | ||
|
||
[] a rep:Repository ; | ||
rep:repositoryID "langchain" ; | ||
rdfs:label "" ; | ||
rep:repositoryImpl [ | ||
rep:repositoryType "graphdb:SailRepository" ; | ||
sr:sailImpl [ | ||
sail:sailType "graphdb:Sail" ; | ||
|
||
graphdb:read-only "false" ; | ||
|
||
# Inference and Validation | ||
graphdb:ruleset "empty" ; | ||
graphdb:disable-sameAs "true" ; | ||
graphdb:check-for-inconsistencies "false" ; | ||
|
||
# Indexing | ||
graphdb:entity-id-size "32" ; | ||
graphdb:enable-context-index "false" ; | ||
graphdb:enablePredicateList "true" ; | ||
graphdb:enable-fts-index "false" ; | ||
graphdb:fts-indexes ("default" "iri") ; | ||
graphdb:fts-string-literals-index "default" ; | ||
graphdb:fts-iris-index "none" ; | ||
|
||
# Queries and Updates | ||
graphdb:query-timeout "0" ; | ||
graphdb:throw-QueryEvaluationException-on-timeout "false" ; | ||
graphdb:query-limit-results "0" ; | ||
|
||
# Settable in the file but otherwise hidden in the UI and in the RDF4J console | ||
graphdb:base-URL "http://example.org/owlim#" ; | ||
graphdb:defaultNS "" ; | ||
graphdb:imports "" ; | ||
graphdb:repository-type "file-repository" ; | ||
graphdb:storage-folder "storage" ; | ||
graphdb:entity-index-size "10000000" ; | ||
graphdb:in-memory-literal-properties "true" ; | ||
graphdb:enable-literal-index "true" ; | ||
] | ||
]. |
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,28 @@ | ||
#! /bin/bash | ||
REPOSITORY_ID="langchain" | ||
GRAPHDB_URI="http://localhost:7200/" | ||
|
||
echo -e "\nUsing GraphDB: ${GRAPHDB_URI}" | ||
|
||
function startGraphDB { | ||
echo -e "\nStarting GraphDB..." | ||
exec /opt/graphdb/dist/bin/graphdb | ||
} | ||
|
||
function waitGraphDBStart { | ||
echo -e "\nWaiting GraphDB to start..." | ||
for _ in $(seq 1 5); do | ||
CHECK_RES=$(curl --silent --write-out '%{http_code}' --output /dev/null ${GRAPHDB_URI}/rest/repositories) | ||
if [ "${CHECK_RES}" = '200' ]; then | ||
echo -e "\nUp and running" | ||
break | ||
fi | ||
sleep 30s | ||
echo "CHECK_RES: ${CHECK_RES}" | ||
done | ||
} | ||
|
||
|
||
startGraphDB & | ||
waitGraphDBStart | ||
wait |
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,12 @@ | ||
# Makefile | ||
|
||
build_graphdb: | ||
docker build --tag graphdb ./graphdb | ||
|
||
start_graphdb: | ||
docker-compose up -d graphdb | ||
|
||
down: | ||
docker-compose down -v --remove-orphans | ||
|
||
.PHONY: build_graphdb start_graphdb down |