Skip to content

Commit

Permalink
fix: fixes devcontainer.json and docker compose for local dev [skip ci]
Browse files Browse the repository at this point in the history
  • Loading branch information
sennierer committed Mar 8, 2024
1 parent f73f79b commit 76d47b8
Show file tree
Hide file tree
Showing 5 changed files with 123 additions and 10 deletions.
50 changes: 50 additions & 0 deletions .devcontainer/blazegraph/RWStore.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
#
# Note: These options are applied when the journal and the triple store are
# first created.

##
## Journal options.
##

# The backing file. This contains all your data. You want to put this someplace
# safe. The default locator will wind up in the directory from which you start
# your servlet container.
com.bigdata.journal.AbstractJournal.file=bigdata.jnl

# The persistence engine. Use 'Disk' for the WORM or 'DiskRW' for the RWStore.
com.bigdata.journal.AbstractJournal.bufferMode=DiskRW

# Setup for the RWStore recycler rather than session protection.
com.bigdata.service.AbstractTransactionService.minReleaseAge=1

# Enable group commit. See http://wiki.blazegraph.com/wiki/index.php/GroupCommit
# Note: Group commit is a beta feature in BlazeGraph release 1.5.1.
#com.bigdata.journal.Journal.groupCommit=true

com.bigdata.btree.writeRetentionQueue.capacity=4000
com.bigdata.btree.BTree.branchingFactor=128

# 200M initial extent.
com.bigdata.journal.AbstractJournal.initialExtent=209715200
com.bigdata.journal.AbstractJournal.maximumExtent=209715200

##
## Setup for QUADS mode without the full text index.
##
com.bigdata.rdf.sail.truthMaintenance=false
com.bigdata.rdf.store.AbstractTripleStore.quads=true
com.bigdata.rdf.store.AbstractTripleStore.statementIdentifiers=false
com.bigdata.rdf.store.AbstractTripleStore.textIndex=true
com.bigdata.rdf.store.AbstractTripleStore.axiomsClass=com.bigdata.rdf.axioms.NoAxioms

# Bump up the branching factor for the lexicon indices on the default kb.
com.bigdata.namespace.kb.lex.com.bigdata.btree.BTree.branchingFactor=400

# Bump up the branching factor for the statement indices on the default kb.
com.bigdata.namespace.kb.spo.com.bigdata.btree.BTree.branchingFactor=1024

# Uncomment to enable collection of OS level performance counters. When
# collected they will be self-reported through the /counters servlet and
# the workbench "Performance" tab.
#
# com.bigdata.journal.Journal.collectPlatformStatistics=true
5 changes: 2 additions & 3 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@
//Use 'forwardPorts' to make a list of ports inside the container available locally.
"forwardPorts": [
8000,
8080,
9999
8080
]
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
// "remoteUser": "root"
}
}
52 changes: 52 additions & 0 deletions .devcontainer/docker-compose-standalone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
version: '3'

services:
intavia_backend_app:
build:
context: ..
dockerfile: Dockerfile
args:
# [Choice] Python version: 3, 3.8, 3.7, 3.6
VARIANT: "3.10"
# [Choice] Install Node.js
# On Linux, you may need to update USER_UID and USER_GID below if not your local UID is not 1000.
INSTALL_DEV: "true"
USER_UID: 1000
USER_GID: 1000

#- /home/sennierer/.ssh:/home/vscode/.ssh:cached

# Overrides default command so things don't shut down after the process ends.
# command: sleep infinity

# Runs app on the same network as the database container, allows "forwardPorts" in devcontainer.json function.
# network_mode: service:db
env_file:
- development-standalone.env

ports:
- "5000:5000"

# Uncomment the next line to use a non-root user for all processes.
# user: vscode

# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
db:
image: lyrasis/blazegraph:2.1.5
environment:
JAVA_XMS: 512m
JAVA_XMX: 1g
volumes:
- ./blazegraph/data:/data
- ./blazegraph/RWStore.properties:/RWStore.properties
ports:
- "8889:8889"

redis:
image: bitnami/redis:latest
environment:
- ALLOW_EMPTY_PASSWORD=yes
# network_mode: service:db
# Add "forwardPorts": ["5432"] to **devcontainer.json** to forward PostgreSQL locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
9 changes: 4 additions & 5 deletions .devcontainer/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,21 +25,20 @@ services:
network_mode: service:db
env_file:
- development.env

# Uncomment the next line to use a non-root user for all processes.
# user: vscode

# Use "forwardPorts" in **devcontainer.json** to forward an app port locally.
# (Adding the "ports" property to this file will not forward from a Codespace.)
db:
image: nawer/blazegraph
image: lyrasis/blazegraph:2.1.5
environment:
JAVA_XMS: 512m
JAVA_XMX: 1g
volumes:
- ./var/blazegraph:/var/lib/blazegraph
- ./docker-entrypoint-initdb.d:/docker-entrypoint-initdb.d
ports:
- "9999:9999"
- ./blazegraph/data:/data
- ./blazegraph/RWStore.properties:/RWStore.properties

redis:
image: bitnami/redis:latest
Expand Down
17 changes: 15 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,28 @@
"version": "0.2.0",
"configurations": [
{
"name": "Python: FastAPI",
"name": "local blazegraph",
"type": "python",
"request": "launch",
"module": "uvicorn",
"args": [
"intavia_backend.main:app"
],
"jinja": true,
"justMyCode": true
"justMyCode": true,
"env": {"SPARQL_ENDPOINT": "http://db:8080/bigdata/sparql"},
},
{
"name": "InTaVia production blazegraph",
"type": "python",
"request": "launch",
"module": "uvicorn",
"args": [
"intavia_backend.main:app"
],
"jinja": true,
"justMyCode": true,
"env": {"SPARQL_ENDPOINT": "https://intavia-ts.acdh-dev.oeaw.ac.at/sparql"},
}
]
}

0 comments on commit 76d47b8

Please sign in to comment.