Skip to content

Commit 335aa70

Browse files
云玖LewisLiu-code
authored andcommitted
update nebulaGraph service and config docker yaml
1 parent ff7aff7 commit 335aa70

File tree

13 files changed

+1232
-351
lines changed

13 files changed

+1232
-351
lines changed

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,5 @@ build
1616
dist
1717
.ipynb_checkpoints
1818
zdatafront*
19-
*antgroup*
19+
*antgroup*
20+
*ipynb

Dockerfile

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
From python:3.9.18-bookworm
2-
# FROM python:3.9-slim-bookworm
1+
FROM python:3.9-bookworm
32

43
WORKDIR /home/user
54

@@ -16,7 +15,6 @@ COPY ./requirements.txt /home/user/docker_requirements.txt
1615
# RUN dpkg -i nebula-graph-3.6.0.ubuntu1804.amd64.deb
1716

1817
RUN pip config set global.index-url https://pypi.tuna.tsinghua.edu.cn/simple
19-
RUN pip install fastapi uvicorn notebook
20-
# RUN pip install -r /home/user/docker_requirements.txt
18+
RUN pip install -r /home/user/docker_requirements.txt --retries 5 --timeout 120
2119

2220
CMD ["bash"]

docker-compose.yaml

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
1-
version: '0.1'
2-
1+
version: '3.4'
32
services:
43
metad0:
4+
# image: docker.io/vesoft/nebula-metad:v3.8.0
55
image: vesoft/nebula-metad:v3.8.0
6-
container_name: metad0
76
environment:
87
USER: root
98
command:
@@ -36,8 +35,8 @@ services:
3635
- SYS_PTRACE
3736

3837
storaged0:
38+
# image: docker.io/vesoft/nebula-storaged:v3.8.0
3939
image: vesoft/nebula-storaged:v3.8.0
40-
container_name: storaged0
4140
environment:
4241
USER: root
4342
TZ: "${TZ}"
@@ -73,8 +72,8 @@ services:
7372
- SYS_PTRACE
7473

7574
graphd:
75+
# image: docker.io/vesoft/nebula-graphd:v3.8.0
7676
image: vesoft/nebula-graphd:v3.8.0
77-
container_name: graphd
7877
environment:
7978
USER: root
8079
TZ: "${TZ}"
@@ -109,7 +108,7 @@ services:
109108

110109
redis-stack:
111110
image: redis/redis-stack:7.4.0-v0
112-
container_name: redis
111+
container_name: redis-stack
113112
ports:
114113
- "6379:6379"
115114
- "8001:8001"
@@ -118,7 +117,7 @@ services:
118117
networks:
119118
- ekg-net
120119
restart: always
121-
120+
122121

123122
ollama:
124123
image: ollama/ollama:0.3.6
@@ -129,8 +128,8 @@ services:
129128
ports:
130129
- 11434:11434
131130
volumes:
132-
- //d/models/ollama:/root/.ollama # windows path
133-
# - /User/models:/root/.ollama # linux/mac path
131+
# - //d/models/ollama:/root/.ollama # windows path
132+
- /Users/yunjiu/ant/models:/root/.ollama # linux/mac path
134133
networks:
135134
- ekg-net
136135
restart: on-failure
@@ -149,22 +148,26 @@ services:
149148
context: .
150149
dockerfile: Dockerfile
151150
container_name: ekgservice
152-
image: muagent:test
151+
image: muagent:0.1.0
152+
# image: muagent:0.2.0
153153
environment:
154154
USER: root
155155
TZ: "${TZ}"
156156
ports:
157-
- 5050:3737
158-
# - 8080:8888
157+
# - 5050:3737
158+
- 3737:3737
159159
volumes:
160160
- ./examples:/home/user/muagent/examples
161161
- ./muagent:/home/user/muagent/muagent
162162
- ./tests:/home/user/muagent/tests
163163
restart: on-failure
164164
networks:
165165
- ekg-net
166-
# command: ["python", "/home/user/muagent/examples/ekg_examples/start.py"] # 指定要执行的脚本
167-
command: ["python", "/home/user/muagent/tests/httpapis/fastapi_test.py"] # 指定要执行的脚本
166+
command: ["python", "/home/user/muagent/examples/ekg_examples/start.py"] # 指定要执行的脚本
167+
# command: ["python", "/home/user/muagent/tests/httpapis/fastapi_test.py"] # 指定要执行的脚本
168+
168169

169170
networks:
170-
ekg-net:
171+
ekg-net:
172+
# driver: bridge
173+
external: true

examples/ekg_examples/ekg.yaml

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -8,16 +8,17 @@ geabase_config:
88

99
# nebula config
1010
nebula_config:
11-
host: 'localhost'
12-
port: 7070
13-
username: 'default'
14-
password: 'default'
15-
space_name: 'default'
11+
host: 'graphd'
12+
port: '9669'
13+
username: 'root'
14+
password: 'nebula'
15+
space_name: 'client'
1616

1717
# tbase config
1818
tbase_config:
19-
host: 'localhost'
20-
port: 321321
19+
# host: 'localhost'
20+
host: 'redis-stack'
21+
port: '6379'
2122
username: 'default'
2223
password: ''
2324
definition_value: 'opsgptkg'

examples/ekg_examples/start.py

Lines changed: 23 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -211,6 +211,17 @@ def embed_query(self, text: str) -> List[float]:
211211
# extra_kwargs={}
212212
# )
213213

214+
# 初始化 NebulaHandler 实例
215+
gb_config = GBConfig(
216+
gb_type="NebulaHandler",
217+
extra_kwargs={
218+
'host': config_data["nebula_config"]['host'],
219+
'port': config_data["nebula_config"]['port'],
220+
'username': config_data["nebula_config"]['username'] ,
221+
'password': config_data["nebula_config"]['password'],
222+
"space": config_data["nebula_config"]['space_name'],
223+
}
224+
)
214225

215226
# 初始化 TbaseHandler 实例
216227
tb_config = TBConfig(
@@ -236,18 +247,19 @@ def embed_query(self, text: str) -> List[float]:
236247

237248

238249
embeddings = CustomEmbeddings()
239-
embed_config = EmbedConfig(
240-
embed_model="default",
241-
langchain_embeddings=embeddings
242-
)
250+
# embed_config = EmbedConfig(
251+
# embed_model="default",
252+
# langchain_embeddings=embeddings
253+
# )
254+
embed_config = None
243255

244256

245-
# ekg_construct_service = EKGConstructService(
246-
# embed_config=embed_config,
247-
# llm_config=llm_config,
248-
# tb_config=tb_config,
249-
# gb_config=gb_config,
250-
# )
257+
ekg_construct_service = EKGConstructService(
258+
embed_config=embed_config,
259+
llm_config=llm_config,
260+
tb_config=tb_config,
261+
gb_config=gb_config,
262+
)
251263

252264
from muagent.httpapis.ekg_construct import create_api
253-
create_api(llm, embeddings)
265+
create_api(llm, embeddings, ekg_construct_service)

0 commit comments

Comments
 (0)