OpenSPG / openspg

OpenSPG is a Knowledge Graph Engine developed by Ant Group in collaboration with OpenKG, based on the SPG (Semantic-enhanced Programmable Graph) framework. Core Capabilities: 1) domain model constrained knowledge modeling, 2) facts and logic fused representation, 3) KAG will be natively supported soon, so please stay tuned...
https://spg.openkg.cn/en-US
Apache License 2.0
756 stars 93 forks source link

about data persistence #1

Closed jiamliang closed 1 year ago

jiamliang commented 1 year ago

I'd like to mount directories from my local file system into the container for the purpose of data persistence. Could you please advise which directories I should be mounting? Thanks a lot.

baifuyu commented 1 year ago

I'd like to mount directories from my local file system into the container for the purpose of data persistence. Could you please advise which directories I should be mounting? Thanks a lot.

@jiamliang Sorry, we have just open sourced OpenSPG, and there are some details that are not perfect enough. We will complete the documentation in the future to make it easier for everyone to use.

The version we released is currently a beta version. It uses MySQL to store SPG-Schema and project metadata, TuGraph to store graph data, and ElasticSearch to index the graph data. If you want to persist this data, you can add volume configuration to the startup parameters of docker compose. Welcome to participate and use the OpenSPG project again.

The following changes are based on the docker compose configuration of our OpenSPG official website.

version: "3.7"
services:
    openspg:
        restart: always
        image: baifuyu/openspg:latest
        container_name: release-openspg
        ports:
            - "8887:8887"
        depends_on:
            - mysql
            - tugraph
            - elasticsearch
        command: [
            '--cloudext.repository.impl.jdbc.host=mysql',
            '--builder.operator.python.exec=/usr/bin/python3.8',
            '--builder.operator.python.paths=/usr/lib/python3.8/site-packages;/usr/local/lib/python3.8/dist-packages;'
        ]
        environment:
            - PYTHONPATH=/usr/lib/python3.8/site-packages:/usr/local/lib/python3.8/dist-packages

    mysql:
        restart: always
        image: baifuyu/openspg-mysql:latest
        container_name: release-openspg-mysql
        environment:
            TZ: Asia/Shanghai
            LANG: C.UTF-8
        ports:
            - "3306:3306"
        command: [
            '--character-set-server=utf8mb4',
            '--collation-server=utf8mb4_general_ci'
        ]
        volumes:
            - my-dataVolume:/var/lib/mysql

    tugraph:
        image: tugraph/tugraph-runtime-centos7:4.0.1
        container_name: release-openspg-tugraph
        # default username is admin and default password is 73@TuGraph
        ports:
            - "7070:7070"
            - "9090:9090"
        command: lgraph_server
        volumes:
            - my-dataVolume:/var/lgraph/data

    elasticsearch:
        image: elasticsearch:8.5.3
        container_name: release-openspg-elasticsearch
        ports:
            - "9200:9200"
            - "9300:9300"
        environment:
            - discovery.type=single-node
            - xpack.security.enabled=false
        volumes:
            - my-dataVolume:/usr/share/elasticsearch/data
jiamliang commented 1 year ago

thanks a lot.