Skip to content

Commit 2a61cc9

Browse files
authored
Merge pull request #84 from codefuse-ai/antcode_dev
bugfix: update readme about images
2 parents e15a4fb + a2746d8 commit 2a61cc9

File tree

11 files changed

+89
-33
lines changed

11 files changed

+89
-33
lines changed

.github/workflows/docker-image-pull.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ jobs:
1212
os: [linux]
1313
service:
1414
- name: runtime:0.1.0
15-
- name: ekgservice:0.1.0
15+
- name: muagent:0.1.0
1616
- name: ekgfrontend:0.1.0
1717

1818
steps:

.github/workflows/docker-image.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,8 @@ jobs:
2222
- name: ekgservice
2323
context: .
2424
dockerfile: ./Dockerfile_gh
25-
tag: ghcr.io/codefuse-ai/ekgservice:0.1.0
26-
tag_latest: ghcr.io/codefuse-ai/ekgservice:latest
25+
tag: ghcr.io/codefuse-ai/muagent:0.1.0
26+
tag_latest: ghcr.io/codefuse-ai/muagent:latest
2727

2828
steps:
2929
- name: Checkout code

README.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ docker compose up -d
7171

7272
<https://github.com/user-attachments/assets/34e5efea-f237-4b04-aeca-1f443ed7eb88>
7373

74-
Now is beta version. Once the v1.0+ version is enhanced, we will release v1.0+ image for download.
74+
We provide corresponding muagent-related images (beta) at [codefuse-ai/packages](https://github.com/orgs/codefuse-ai/packages). If needed, you can download them using `bash docker_pull_images.sh`.
7575

76-
To Be Continued!
7776

7877
### SDK
7978

README_zh.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -71,9 +71,8 @@ https://github.com/user-attachments/assets/7d5251a0-2864-438c-8897-b0445f0b1c30
7171

7272
https://github.com/user-attachments/assets/34e5efea-f237-4b04-aeca-1f443ed7eb88
7373

74-
现在仍为 beta 版本,待 v1.0 版本完善后,会放出 v1.0+ 的镜像以供下载
74+
我们在[codefuse-ai/packages](https://github.com/orgs/codefuse-ai/packages)中提供了对应muagent相关的镜像(beta版本),有需要可以通过`bash docker_pull_images.sh`进行下载。如果存在网络问题,可通过[个人阿里云镜像方案](docs/gh_image_to_aliyun_image.md)完成镜像同步
7575

76-
敬请期待!
7776

7877
### SKD 版本
7978

docker_pull_images.sh

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
#!/bin/bash
2+
3+
4+
# while network is error, `docker-compose up -d` might error
5+
# so we add a script for pulling dependent images befort `docker-compose up -d`
6+
7+
# 国内镜像源,根据需要自行配置,不一定完全生效
8+
# 搜索引擎搜 ”DockerHub国内镜像源列表“ 即可
9+
# "registry-mirrors": []
10+
11+
12+
# pull images from dockerhub docker.io
13+
docker pull vesoft/nebula-metad:v3.8.0
14+
docker pull vesoft/nebula-storaged:v3.8.0
15+
docker pull vesoft/nebula-graphd:v3.8.0
16+
docker pull redis/redis-stack:7.4.0-v0
17+
docker pull ollama/ollama:0.3.6
18+
19+
# pull images from github ghcr.io by nju
20+
docker pull ghcr.nju.edu.cn/runtime:0.1.0
21+
docker pull ghcr.nju.edu.cn/muagent:0.1.0
22+
docker pull ghcr.nju.edu.cn/ekgfrontend:0.1.0
23+
24+
# # pull images from github ghcr.io
25+
# docker pull ghcr.io/runtime:0.1.0
26+
# docker pull ghcr.io/muagent:0.1.0
27+
# docker pull ghcr.io/ekgfrontend:0.1.0

docs/gh_image_to_aliyun_image.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
## 1、使用google/baidu 搜索 阿里云镜像服务
44

55
## 2、登录后点击管理控制台
6-
![](resources/aliyun_01.webp)
6+
![](resources/aliyun_01.png)
77

88
## 3、点击个人实例,如果没有就生成一个(免费的)
99
![](resources/aliyun_02.webp)
@@ -28,7 +28,7 @@ ALIYUN_PASSWWORD={配置访问凭证}
2828

2929
```bash
3030
# 本地执行拉取镜像
31-
# 示例,仅支持ekgfrontend、runtime、ekgservice;其他镜像根据需求对docker-image-pull进行修改
31+
# 示例,仅支持ekgfrontend、runtime、muagent;其他镜像根据需求对docker-image-pull进行修改
3232

3333
# 登录阿里云镜像库
3434
docker login --username=xxx registry.cn-hangzhou.aliyuncs.com

docs/resources/aliyun_01.png

1.91 MB
Loading

docs/resources/aliyun_01.webp

-16.9 KB
Binary file not shown.

muagent/db_handler/graph_db_handler/nebula_handler.py

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -289,7 +289,16 @@ def add_node(self, node: GNode) -> GbaseExecStatus:
289289
if prop_name in {'extra', 'description', 'envdescription','updaterule'}:
290290
# 转义换行符和双引号
291291
value = value.replace("\n", "\\n").replace("\"", "\\\"")
292-
cypher += f'"{value}",'
292+
cypher += f'"{value}",'
293+
elif prop_name == 'description':
294+
value = value.replace("\n", "\\n").replace("\"", "\\\"")
295+
cypher += f'"{value}",'
296+
elif prop_name == 'envdescription':
297+
value = value.replace("\n", "\\n").replace("\"", "\\\"")
298+
cypher += f'"{value}",'
299+
else:
300+
cypher += f'"{value}",'
301+
#cypher += f'"{value}",'
293302
else:
294303
cypher += f'{value},'
295304
cypher = cypher.rstrip(',')

muagent/db_handler/vector_db_handler/tbase_handler.py

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -117,20 +117,24 @@ def vector_search(self, base_query: str, index_name: str = None, query_params: d
117117
r = self.search(query, index_name, query_params, limit=limit)
118118
return r
119119

120-
def delete(self, content):
120+
def delete(self, content: str):
121121
'''
122122
delete
123123
:param id:
124124
:return:
125125
'''
126-
id = f"{self.definition_value}:{content}"
126+
id = content if content.startswith(f"{self.definition_value}:") \
127+
else f"{self.definition_value}:{content}"
127128
res = self.client.delete(id)
128129
return res
129130

130-
def get(self, content):
131-
id = f"{self.definition_value}:{content}"
132-
logger.debug(f"{id}")
133-
res = self.client.hgetall(id)
131+
def get(self, content, id=None, key=None):
132+
id = id or f"{self.definition_value}:{content}"
133+
134+
if key:
135+
res = self.client.hget(id, key)
136+
else:
137+
res = self.client.hgetall(id)
134138
return res
135139

136140
def fuzzy_delete(self, collection_name, delete_str, index_name="test"):

muagent/service/ekg_construct/ekg_construct_base.py

Lines changed: 35 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -481,15 +481,21 @@ def add_nodes(self, nodes: List[GNode], teamid: str, ekg_type: str="ekgnode") ->
481481
tbase_nodes = []
482482
for node in nodes:
483483
# get the node's teamids
484-
r = self.tb.search(
485-
f"@node_id: *{node.id}*", index_name=self.node_indexname
486-
)
487-
484+
r = self.tb.get(node.id, key="node_str")
488485
teamids = [
489486
i.strip()
490-
for i in r.docs[0]["node_str"].replace("graph_id=", "").split(",")
491-
if i.strip()
492-
] if r.docs else []
487+
for i in r.decode().replace("graph_id=", "").split(",")
488+
] if r else []
489+
490+
# r = self.tb.search(
491+
# f"@node_id: *{node.id}*", index_name=self.node_indexname
492+
# )
493+
494+
# teamids = [
495+
# i.strip()
496+
# for i in r.docs[0]["node_str"].replace("graph_id=", "").split(",")
497+
# if i.strip()
498+
# ] if r.docs else []
493499
teamids = list(set(teamids+[teamid]))
494500

495501
tbase_nodes.append({
@@ -667,11 +673,17 @@ def update_nodes(self, nodes: List[GNode], teamid: str):
667673
logger.error(f"there must something wrong! "
668674
f"ID not match, such as {tbase_missing_nodeids}")
669675
for nodeid in tbase_missing_nodeids:
670-
r = self.tb.search(
671-
f"@node_id: {nodeid.replace('-', '_')}",
672-
index_name=self.node_indexname)
673-
teamids_by_nodeid.update(
674-
{data['node_id']: data["node_str"] for data in r.docs})
676+
r = self.tb.get(nodeid.replace('-', '_'), key="node_str")
677+
if r:
678+
teamids_by_nodeid.update(
679+
{nodeid.replace('-', '_'): r.decode()}
680+
)
681+
682+
# r = self.tb.search(
683+
# f"@node_id: {nodeid.replace('-', '_')}",
684+
# index_name=self.node_indexname)
685+
# teamids_by_nodeid.update(
686+
# {data['node_id']: data["node_str"] for data in r.docs})
675687

676688
tbase_datas = []
677689
for node in nodes:
@@ -811,12 +823,18 @@ def get_node_by_id(
811823
else:
812824
node = GNode(id=nodeid, type="", attributes={})
813825
# tbase search
814-
r = self.tb.search(f"@node_id: *{nodeid}*", index_name=self.node_indexname)
826+
r = self.tb.get(nodeid.replace('-', '_'), key="node_str")
815827
teamids = [
816-
i.strip()
817-
for i in r.docs[0]["node_str"].replace("graph_id=", "").split(",")
818-
if i.strip()
819-
] if r.docs else []
828+
i.strip()
829+
for i in r.decode().replace("graph_id=", "").split(",")
830+
] if r else []
831+
832+
# r = self.tb.search(f"@node_id: *{nodeid}*", index_name=self.node_indexname)
833+
# teamids = [
834+
# i.strip()
835+
# for i in r.docs[0]["node_str"].replace("graph_id=", "").split(",")
836+
# if i.strip()
837+
# ] if r.docs else []
820838

821839
node.attributes["teamids"] = ', '.join(teamids)
822840
return node

0 commit comments

Comments
 (0)