Skip to content

Commit

Permalink
Merge pull request #84 from codefuse-ai/antcode_dev
Browse files Browse the repository at this point in the history
bugfix: update readme about images
  • Loading branch information
peng3307165 authored Nov 25, 2024
2 parents e15a4fb + a2746d8 commit 2a61cc9
Show file tree
Hide file tree
Showing 11 changed files with 89 additions and 33 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/docker-image-pull.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
os: [linux]
service:
- name: runtime:0.1.0
- name: ekgservice:0.1.0
- name: muagent:0.1.0
- name: ekgfrontend:0.1.0

steps:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ jobs:
- name: ekgservice
context: .
dockerfile: ./Dockerfile_gh
tag: ghcr.io/codefuse-ai/ekgservice:0.1.0
tag_latest: ghcr.io/codefuse-ai/ekgservice:latest
tag: ghcr.io/codefuse-ai/muagent:0.1.0
tag_latest: ghcr.io/codefuse-ai/muagent:latest

steps:
- name: Checkout code
Expand Down
3 changes: 1 addition & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ docker compose up -d

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

Now is beta version. Once the v1.0+ version is enhanced, we will release v1.0+ image for download.
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`.

To Be Continued!

### SDK

Expand Down
3 changes: 1 addition & 2 deletions README_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,8 @@ https://github.com/user-attachments/assets/7d5251a0-2864-438c-8897-b0445f0b1c30

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

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

敬请期待!

### SKD 版本

Expand Down
27 changes: 27 additions & 0 deletions docker_pull_images.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/bin/bash


# while network is error, `docker-compose up -d` might error
# so we add a script for pulling dependent images befort `docker-compose up -d`

# 国内镜像源,根据需要自行配置,不一定完全生效
# 搜索引擎搜 ”DockerHub国内镜像源列表“ 即可
# "registry-mirrors": []


# pull images from dockerhub docker.io
docker pull vesoft/nebula-metad:v3.8.0
docker pull vesoft/nebula-storaged:v3.8.0
docker pull vesoft/nebula-graphd:v3.8.0
docker pull redis/redis-stack:7.4.0-v0
docker pull ollama/ollama:0.3.6

# pull images from github ghcr.io by nju
docker pull ghcr.nju.edu.cn/runtime:0.1.0
docker pull ghcr.nju.edu.cn/muagent:0.1.0
docker pull ghcr.nju.edu.cn/ekgfrontend:0.1.0

# # pull images from github ghcr.io
# docker pull ghcr.io/runtime:0.1.0
# docker pull ghcr.io/muagent:0.1.0
# docker pull ghcr.io/ekgfrontend:0.1.0
4 changes: 2 additions & 2 deletions docs/gh_image_to_aliyun_image.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
## 1、使用google/baidu 搜索 阿里云镜像服务

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

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

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

# 登录阿里云镜像库
docker login --username=xxx registry.cn-hangzhou.aliyuncs.com
Expand Down
Binary file added docs/resources/aliyun_01.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file removed docs/resources/aliyun_01.webp
Binary file not shown.
11 changes: 10 additions & 1 deletion muagent/db_handler/graph_db_handler/nebula_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,16 @@ def add_node(self, node: GNode) -> GbaseExecStatus:
if prop_name in {'extra', 'description', 'envdescription','updaterule'}:
# 转义换行符和双引号
value = value.replace("\n", "\\n").replace("\"", "\\\"")
cypher += f'"{value}",'
cypher += f'"{value}",'
elif prop_name == 'description':
value = value.replace("\n", "\\n").replace("\"", "\\\"")
cypher += f'"{value}",'
elif prop_name == 'envdescription':
value = value.replace("\n", "\\n").replace("\"", "\\\"")
cypher += f'"{value}",'
else:
cypher += f'"{value}",'
#cypher += f'"{value}",'
else:
cypher += f'{value},'
cypher = cypher.rstrip(',')
Expand Down
16 changes: 10 additions & 6 deletions muagent/db_handler/vector_db_handler/tbase_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -117,20 +117,24 @@ def vector_search(self, base_query: str, index_name: str = None, query_params: d
r = self.search(query, index_name, query_params, limit=limit)
return r

def delete(self, content):
def delete(self, content: str):
'''
delete
:param id:
:return:
'''
id = f"{self.definition_value}:{content}"
id = content if content.startswith(f"{self.definition_value}:") \
else f"{self.definition_value}:{content}"
res = self.client.delete(id)
return res

def get(self, content):
id = f"{self.definition_value}:{content}"
logger.debug(f"{id}")
res = self.client.hgetall(id)
def get(self, content, id=None, key=None):
id = id or f"{self.definition_value}:{content}"

if key:
res = self.client.hget(id, key)
else:
res = self.client.hgetall(id)
return res

def fuzzy_delete(self, collection_name, delete_str, index_name="test"):
Expand Down
52 changes: 35 additions & 17 deletions muagent/service/ekg_construct/ekg_construct_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -481,15 +481,21 @@ def add_nodes(self, nodes: List[GNode], teamid: str, ekg_type: str="ekgnode") ->
tbase_nodes = []
for node in nodes:
# get the node's teamids
r = self.tb.search(
f"@node_id: *{node.id}*", index_name=self.node_indexname
)

r = self.tb.get(node.id, key="node_str")
teamids = [
i.strip()
for i in r.docs[0]["node_str"].replace("graph_id=", "").split(",")
if i.strip()
] if r.docs else []
for i in r.decode().replace("graph_id=", "").split(",")
] if r else []

# r = self.tb.search(
# f"@node_id: *{node.id}*", index_name=self.node_indexname
# )

# teamids = [
# i.strip()
# for i in r.docs[0]["node_str"].replace("graph_id=", "").split(",")
# if i.strip()
# ] if r.docs else []
teamids = list(set(teamids+[teamid]))

tbase_nodes.append({
Expand Down Expand Up @@ -667,11 +673,17 @@ def update_nodes(self, nodes: List[GNode], teamid: str):
logger.error(f"there must something wrong! "
f"ID not match, such as {tbase_missing_nodeids}")
for nodeid in tbase_missing_nodeids:
r = self.tb.search(
f"@node_id: {nodeid.replace('-', '_')}",
index_name=self.node_indexname)
teamids_by_nodeid.update(
{data['node_id']: data["node_str"] for data in r.docs})
r = self.tb.get(nodeid.replace('-', '_'), key="node_str")
if r:
teamids_by_nodeid.update(
{nodeid.replace('-', '_'): r.decode()}
)

# r = self.tb.search(
# f"@node_id: {nodeid.replace('-', '_')}",
# index_name=self.node_indexname)
# teamids_by_nodeid.update(
# {data['node_id']: data["node_str"] for data in r.docs})

tbase_datas = []
for node in nodes:
Expand Down Expand Up @@ -811,12 +823,18 @@ def get_node_by_id(
else:
node = GNode(id=nodeid, type="", attributes={})
# tbase search
r = self.tb.search(f"@node_id: *{nodeid}*", index_name=self.node_indexname)
r = self.tb.get(nodeid.replace('-', '_'), key="node_str")
teamids = [
i.strip()
for i in r.docs[0]["node_str"].replace("graph_id=", "").split(",")
if i.strip()
] if r.docs else []
i.strip()
for i in r.decode().replace("graph_id=", "").split(",")
] if r else []

# r = self.tb.search(f"@node_id: *{nodeid}*", index_name=self.node_indexname)
# teamids = [
# i.strip()
# for i in r.docs[0]["node_str"].replace("graph_id=", "").split(",")
# if i.strip()
# ] if r.docs else []

node.attributes["teamids"] = ', '.join(teamids)
return node
Expand Down

0 comments on commit 2a61cc9

Please sign in to comment.