Skip to content

Nebula #1265

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 73 commits into
base: main
Choose a base branch
from
Open

Nebula #1265

wants to merge 73 commits into from

Conversation

jeanyu-habana
Copy link
Collaborator

Description

support NebulaGraph cluster deployment in k8s

Issues

n/a

Type of change

List the type of change like below. Please delete options that are not relevant.

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds new functionality)
  • Breaking change (fix or feature that would break existing design and interface)
  • Others (enhancement, documentation, validation, etc.)

Dependencies

n/a

Tests

Tested the deployment and config scripts. NebulaGraph services were up and running. DB spaces can be created and managed.

jeanyu-habana and others added 8 commits February 7, 2025 15:23
Signed-off-by: jeanyu-habana <jean1.yu@intel.com>
Signed-off-by: jeanyu-habana <jean1.yu@intel.com>
Signed-off-by: jeanyu-habana <jean1.yu@intel.com>
Signed-off-by: jeanyu-habana <jean1.yu@intel.com>
Signed-off-by: jeanyu-habana <jean1.yu@intel.com>
Signed-off-by: jeanyu-habana <jean1.yu@intel.com>
Signed-off-by: jeanyu-habana <jean1.yu@intel.com>
@xiguiw xiguiw requested review from lianhao and yongfengdu February 25, 2025 13:35
@xiguiw
Copy link
Collaborator

xiguiw commented Feb 25, 2025

@lianhao @yongfengdu
Would you please review this PR? Does the structure, style etc. confirm to ours?

```bash
helm repo add nebula-operator https://vesoft-inc.github.io/nebula-operator/charts
helm repo update
helm install nebula-operator nebula-operator/nebula-operator --namespace=<namespace_name> --version=${chart_version}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We should either give specific chart version or let user to use the latest.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, updated with a specific version.

## 1. Install cert-manager

```bash
kubectl apply -f https://github.com/cert-manager/cert-manager/releases/download/v1.9.1/cert-manager.yaml
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can we have cert-manager of versions othern than 1.9.1? I'm asking this because the user might have other versions of cert-manager in their cluster already.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good catch. I replaced specific version with <release_version> in the README to indicate that the user can use other versions. Thanks.

Run the following command to check the IP of the Service:

```bash
$ kubectl get service -l app.kubernetes.io/cluster=<nebula> #<nebula> is a variable value. Replace it with the desired name.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what should be? Replace it by what value?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be any desired name.

Run the following command to connect to the NebulaGraph database using the IP of the <cluster-name>-graphd-svc Service above:

```bash
kubectl run -ti --image vesoft/nebula-console --restart=Never -- <nebula_console_name> -addr <cluster_ip> -port <service_port> -u <username> -p <password>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be better to give users direct bash commands to get <cluster_ip>, <service_port> .

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added the bash commands to find <cluster_ip>, <service_port> in README.

resources:
requests:
storage: 2Gi
storageClassName: "${STORAGE_CLASS_NAME}"
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If nebula requires k8s to have a valid storage class, we'd better to say it clearly in README. Also if we follow the README strictly, this ${STORAGE_CLASS_NAME} dereference could cause the kubectl create -f enterprise_edition.yaml fail due to the mismatch of storageClassName. Does nebula operator support not setting specific storageClassName?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, a storage class is required. The current readme me already mentioned that the storageClassName in the yaml file. I have add the following in the README to address the issue:
"Create a StorageClass or use an existing one in the k8s cluster. Edit the config with the proper storageClassName and run the command below".

cpu: "1"
memory: "1Gi"
replicas: 1
image: vesoft/nebula-graphd
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should we pin the image tag instead of using latest image? Just in case future versions of nebula might not be compatible with this resource operator definition.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay, updated the yaml file with specific version for all related images.

@yongfengdu
Copy link
Collaborator

I would propose to add this (If necessary) together with you mentioned HybridRAG.
Otherwise, it's not clear why we need to add this components - Adding an open source GraphDB and use OEPA CI to test it.

@xiguiw
Copy link
Collaborator

xiguiw commented Feb 26, 2025

@jeanyu-habana

There is a graphRAG component implemented by @rbrugaro

class GraphRAGStore(Neo4jPropertyGraphStore):

It is integrated into data-prep, to improve the OPEA RAG through data-prep and retriever.

To bring the NebulaGraph in, I have some questions.

  1. What's the difference (or gap) between NebulaGraph and the existed GraphRAG?

  2. How the NebulaGraph being integrated into OPEA components or improve the OPEA components functionality?
    Build an example with third party is not the targets of OPEA because there is no contribution from OPEA.
    Could you integrate it with OPEA retriever/data-prep?

Thanks!

@xiguiw
Copy link
Collaborator

xiguiw commented Feb 26, 2025

@jeanyu-habana
Would you please address the comments and questions? Thanks!

@yongfengdu
Copy link
Collaborator

@jeanyu-habana I was convinced that, in a sense of providing more components for OPEA project, so any users could utilize this components for new AI apps, it's ok to put these instructions for reference.
Because we don't have related helm charts for this in https://github.com/opea-project/GenAIInfra, the test logic would be different and you'll need to maintain it by yourself.

I would propose to add this (If necessary) together with you mentioned HybridRAG. Otherwise, it's not clear why we need to add this components - Adding an open source GraphDB and use OEPA CI to test it.

@jeanyu-habana
Copy link
Collaborator Author

jeanyu-habana commented Feb 26, 2025

@yongfengdu Thank you for meeting with me. Just to summarize, we went over the example in GenAIExamples and GenAIInfra (i.e., milvus), and I agreed when we implement our HybridRAG in GenAIExamples and GenAIInfra, we will follow the guidance. However, having nebulagraph k8s deployment in the GenAIComps repo still has value. The script here is tested and can be used to deploy nebulagraph as microservice in k8s. Please let me know if there is anything needed, and we will address them ASAP.

@jeanyu-habana
Copy link
Collaborator Author

@jeanyu-habana

There is a graphRAG component implemented by @rbrugaro

class GraphRAGStore(Neo4jPropertyGraphStore):

It is integrated into data-prep, to improve the OPEA RAG through data-prep and retriever.

To bring the NebulaGraph in, I have some questions.

  1. What's the difference (or gap) between NebulaGraph and the existed GraphRAG?
  2. How the NebulaGraph being integrated into OPEA components or improve the OPEA components functionality?
    Build an example with third party is not the targets of OPEA because there is no contribution from OPEA.
    Could you integrate it with OPEA retriever/data-prep?

Thanks!

  1. Existing GraphRAG in OPEA uses Neo4J graph database. Several of RAG related microservices we are about to submit to OPEA can use either Neo4J or NebulaGraph. NebulaGraph is distrubuted and much faster than Neo4J, especially during query and used in production environment. The difference between Neo4J and NebulaGraph can be found here: https://www.nebula-graph.io/posts/Neo4j_Alternative_Open-Source_Distributed_and_Lightning_Fast.
  2. There are multi ways we can integrate NebulaGraph microservice into the new projects we are about to submit. We can also integrate it into the existing OPEA retriever/data-prep (as you suggested above).

@jeanyu-habana
Copy link
Collaborator Author

@jeanyu-habana I was convinced that, in a sense of providing more components for OPEA project, so any users could utilize this components for new AI apps, it's ok to put these instructions for reference. Because we don't have related helm charts for this in https://github.com/opea-project/GenAIInfra, the test logic would be different and you'll need to maintain it by yourself.

I would propose to add this (If necessary) together with you mentioned HybridRAG. Otherwise, it's not clear why we need to add this components - Adding an open source GraphDB and use OEPA CI to test it.

Agreed. Thank you. We will make sure at least one of our submissions will use Nebula and have OPEA CI test enabled.

@jeanyu-habana
Copy link
Collaborator Author

@jeanyu-habana Would you please address the comments and questions? Thanks!

Please see "quoted" reply in the context of your original question.

@jeanyu-habana
Copy link
Collaborator Author

@lianhao Could you please review the changes I made per your requests? Thank you.

@joshuayao joshuayao self-requested a review March 4, 2025 01:51
Copy link
Collaborator

@joshuayao joshuayao left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jeanyu-habana Thank you for your contribution! As per the OPEA contribution guidelines, new components are required to include Docker Compose deployment support. Could you please provide this to ensure compliance with the guidelines?

@xiguiw
Copy link
Collaborator

xiguiw commented Mar 6, 2025

2. There are multi ways we can integrate NebulaGraph microservice into the new projects we are about to submit. We can also integrate it into the existing OPEA retriever/data-prep (as you suggested above).

Only Data-pre and retrieval interacts with graph DB. Maybe you can refer to Graph RAG to integrate NebulaGraph into data-prep/retrieval.

@siddhivelankar23
Copy link
Collaborator

Docker support has been added for nebula as requested, please refer to PR 1396

echo "[ test create ] creating space.."
query="CREATE SPACE my_space(partition_num=10, replica_factor=1, vid_type=FIXED_STRING(32)); USE my_space; CREATE TAG person(name string, age int);"

create_response=$(kubectl run -ti --rm --image vesoft/nebula-console --restart=Never -- nebula-console -addr "$cluster_ip" -port 9669 -u root -p vesoft -e "$query" 2>&1)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can other microservices access Nebula Database? Are there any software APIs or endpoints available? Using Nebula-Console is not good way for this purpose.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How can other microservices access Nebula Database? Are there any software APIs or endpoints available? Using Nebula-Console is not good way for this purpose.

@jeanyu-habana

Could you resolve this?

@joshuayao joshuayao requested review from joshuayao and xiguiw March 25, 2025 01:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants