Knowledge Graph Documentation
ℹī¸ This is the new documentation of the EBRAINS KG. It's going to be extended continuously.
If you find any issues / have any comment, please contact kg@ebrains.eu to give us your feedback!

KG Core deployment recipes

Docker Compose

version: '2.4'
services:
  arango:
    image: arangodb:3.11
    ports:
      - 9900:8529
    restart: always
    environment:
      - ARANGO_ROOT_PASSWORD=helloWorld # Make sure, the password is identical to the one you specify in the kg-core deployment as "ARANGO_PWD" to allow the KG Core service 
    networks:
      - backend
    volumes:
      - /data/kg-core/arango:/var/lib/arangodb3
      - /data/kg-core/backup:/backups
      - /data/kg-core/restore:/restore
    command: >
      --server.maximal-threads=32 --query.global-memory-limit=6442450944 --query.memory-limit=4294967296
    logging:
      driver: none

  kg-core-all-in-one:
    image: docker-registry.ebrains.eu/kg/kg-core-allinone:prod
    ports:
      - 9130:9130
    environment:
      - EXTERNAL_IP=<YOUR_HOST>
      - EXTERNAL_PORT=9130
      - ARANGO_PWD=helloWorld
      - ARANGO_HOST=<YOUR_HOST>
      - ARANGO_PORT=9900
      - ACTUATOR_PWD=<YOUR_ACTUATOR_PWD>
      - JAVA_OPTS=-Dlogging.config=/config/logback-spring.xml -XX:+HeapDumpOnOutOfMemoryError -XX:HeapDumpPath=/var/log/kg-core -XX:+CrashOnOutOfMemoryError
      - KEYCLOAK_ISSUER_URI=<YOUR_KEYCLOAK_ISSUER_URI>
      - KEYCLOAK_KGCORE_CLIENTSECRET=<YOUR_KEYCLOAK_CLIENT_SECRET>
    volumes:
      - /opt/kg-core/config:/config
      - /data/kg-core/logs:/var/log/kg-core
    networks:
      - backend
    mem_limit: 4096m
    depends_on: 
      - arango
    restart: always
    logging:
      driver: none

networks:
  backend:
    driver: bridge

Kubernetes

 # Arango
apiVersion: v1
kind: PersistentVolumeClaim
metadata:
  name: arango-pv-claim
spec:
  storageClassName: managed-nfs-storage
  accessModes:
    - ReadWriteOnce
  resources:
    requests:
      storage: 10Gi

---

apiVersion: apps/v1
kind: Deployment
metadata:
  name: kg-arango
  labels:
    app: kg-arango
spec:
  selector:
    matchLabels:
      app: kg-arango
  template:
    metadata:
      labels:
        app: kg-arango
    spec:
      volumes:
      - name: arango-pv-storage
        persistentVolumeClaim:
          claimName: arango-pv-claim
      containers:
      - name: kg-arango
        image: docker.kg.ebrains.eu/arangodb:3.11
        env:
        - name: ARANGO_ROOT_PASSWORD
          value: helloWorld # Make sure, the password is identical to the one you specify in the kg-core deployment as "ARANGO_PWD" to allow the KG Core service to talk to the DB
        volumeMounts:
        - mountPath: "/var/lib/arangodb3"
          name: arango-pv-storage

---

apiVersion: v1
kind: Service
metadata:
  name: arango-service
spec:
  selector:
    app: kg-arango
  ports:
  - name: arango-port
    protocol: TCP
    port: 9900 # Make sure, the port is the same as the "ARANGO_PORT" in the kg-core deployment
    targetPort: 8529

---

apiVersion: apps/v1
kind: Deployment
metadata:
  name: kg-core
  labels:
    app: kg-core
spec:
  selector:
    matchLabels:
      app: kg-core
  template:
    metadata:
      labels:
        app: kg-core
    spec:
      containers:
      - name: kg-core
        image: docker-registry.ebrains.eu/kg/kg-core-allinone:prod
        env: 
        - name: ARANGO_PWD
          value: helloWorld
        - name: ARANGO_HOST
          value: arango-service.kg.svc
        - name: ARANGO_PORT
          value: "9900"
        - name: KEYCLOAK_ISSUER_URI
          value: https://iam.ebrains.eu/auth/realms/hbp # Specify the keycloak instance you want to use for authentication


---

apiVersion: v1
kind: Service
metadata:
  name: kg-core-service
spec:
  selector:
    app: kg-core
  ports:
  - name: kg-core-port
    protocol: TCP
    port: 80
    targetPort: 8000

---

apiVersion: route.openshift.io/v1
kind: Route
metadata:
  name: kg-core-route
spec:
  host: kg-core.apps.hbp.eu 
  port:
    targetPort: kg-core-port
  tls:
    insecureEdgeTerminationPolicy: Redirect
    termination: edge
  to:
    kind: Service
    name: kg-core-service
This open source software code was developed in part or in whole in the Human Brain Project, funded from the European Union's Horizon 2020 Framework Programme for Research and Innovation under Specific Grant Agreements No. 720270, No. 785907 and No. 945539 (Human Brain Project SGA1, SGA2 and SGA3).
Co-funded by the European Union