Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Thank you for your interest in OpenViking! We welcome contributions of all kinds
### Prerequisites

- **Python**: 3.10+
- **Go**: 1.19.1+ (Required for building AGFS components from source)
- **Go**: 1.22+ (Required for building AGFS components from source)
- **C++ Compiler**: GCC 9+ or Clang 11+ (Required for building core extensions, must support C++17)
- **CMake**: 3.12+

Expand Down
2 changes: 1 addition & 1 deletion CONTRIBUTING_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
### 前置要求

- **Python**: 3.10+
- **Go**: 1.19+ (从源码构建 AGFS 组件需要)
- **Go**: 1.22+ (从源码构建 AGFS 组件需要)
- **C++ 编译器**: GCC 9+ 或 Clang 11+ (构建核心扩展需要,必须支持 C++17)
- **CMake**: 3.12+

Expand Down
2 changes: 2 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,8 @@ With OpenViking, developers can build an Agent's brain just like managing local
Before starting with OpenViking, please ensure your environment meets the following requirements:

- **Python Version**: 3.10 or higher
- **Go Version**: 1.22 or higher (Required for building AGFS components)
- **C++ Compiler**: GCC 9+ or Clang 11+ (Required for building core extensions)
- **Operating System**: Linux, macOS, Windows
- **Network Connection**: A stable network connection is required (for downloading dependencies and accessing model services)

Expand Down
2 changes: 2 additions & 0 deletions README_CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@
在开始使用 OpenViking 之前,请确保您的环境满足以下要求:

- **Python 版本**:3.10 或更高版本
- **Go 版本**:1.22 或更高(从源码构建 AGFS 组件需要)
- **C++ 编译器**:GCC 9+ 或 Clang 11+(构建核心扩展需要,必须支持 C++17)
- **操作系统**:Linux、macOS、Windows
- **网络连接**:需要稳定的网络连接(用于下载依赖和访问模型服务)

Expand Down
44 changes: 35 additions & 9 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,14 +107,18 @@ def build_agfs(self):
else ["make", "build"]
)

subprocess.run(
result = subprocess.run(
build_args,
cwd=str(agfs_server_dir),
env=env,
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
if result.stdout:
print(f"Build stdout: {result.stdout.decode('utf-8', errors='replace')}")
if result.stderr:
print(f"Build stderr: {result.stderr.decode('utf-8', errors='replace')}")

agfs_built_binary = agfs_server_dir / "build" / binary_name
if agfs_built_binary.exists():
Expand All @@ -135,7 +139,8 @@ def build_agfs(self):
error_msg += (
f"\nBuild stderr:\n{e.stderr.decode('utf-8', errors='replace')}"
)
print(f"[Warning] {error_msg}")
print(f"[Error] {error_msg}")
raise RuntimeError(error_msg)

# Build binding library
try:
Expand All @@ -146,14 +151,18 @@ def build_agfs(self):

lib_build_args = ["make", "build-lib"]

subprocess.run(
result = subprocess.run(
lib_build_args,
cwd=str(agfs_server_dir),
env=env,
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
if result.stdout:
print(f"Build stdout: {result.stdout.decode('utf-8', errors='replace')}")
if result.stderr:
print(f"Build stderr: {result.stderr.decode('utf-8', errors='replace')}")

agfs_built_lib = agfs_server_dir / "build" / lib_name
if agfs_built_lib.exists():
Expand All @@ -162,16 +171,20 @@ def build_agfs(self):
else:
print(f"[Warning] Binding library not found at {agfs_built_lib}")
except Exception as e:
print(f"[Warning] Failed to build AGFS binding library: {e}")
error_msg = f"Failed to build AGFS binding library: {e}"
if isinstance(e, subprocess.CalledProcessError):
if e.stdout:
print(f"Build stdout: {e.stdout.decode('utf-8', errors='replace')}")
error_msg += f"\nBuild stdout: {e.stdout.decode('utf-8', errors='replace')}"
if e.stderr:
print(f"Build stderr: {e.stderr.decode('utf-8', errors='replace')}")
error_msg += f"\nBuild stderr: {e.stderr.decode('utf-8', errors='replace')}"
print(f"[Error] {error_msg}")
raise RuntimeError(error_msg)

else:
if agfs_target_binary.exists():
print(f"[Info] Go compiler not found, but AGFS binary exists at {agfs_target_binary}. Skipping build.")
print(
f"[Info] Go compiler not found, but AGFS binary exists at {agfs_target_binary}. Skipping build."
)
elif not agfs_server_dir.exists():
print(f"[Warning] AGFS source directory not found at {agfs_server_dir}")
else:
Expand Down Expand Up @@ -219,12 +232,18 @@ def build_ov(self):
print(f"Cross-compiling with CARGO_BUILD_TARGET={target}")
build_args.extend(["--target", target])

subprocess.run(
result = subprocess.run(
build_args,
cwd=str(ov_cli_dir),
env=env,
check=True,
stdout=subprocess.PIPE,
stderr=subprocess.PIPE,
)
if result.stdout:
print(f"Build stdout: {result.stdout.decode('utf-8', errors='replace')}")
if result.stderr:
print(f"Build stderr: {result.stderr.decode('utf-8', errors='replace')}")

# Find built binary
if target:
Expand All @@ -238,7 +257,14 @@ def build_ov(self):
else:
print(f"[Warning] Built ov binary not found at {built_bin}")
except Exception as e:
print(f"[Warning] Failed to build ov CLI from source: {e}")
error_msg = f"Failed to build ov CLI from source: {e}"
if isinstance(e, subprocess.CalledProcessError):
if e.stdout:
error_msg += f"\nBuild stdout: {e.stdout.decode('utf-8', errors='replace')}"
if e.stderr:
error_msg += f"\nBuild stderr: {e.stderr.decode('utf-8', errors='replace')}"
print(f"[Error] {error_msg}")
raise RuntimeError(error_msg)
else:
if not ov_cli_dir.exists():
print(f"[Warning] ov CLI source directory not found at {ov_cli_dir}")
Expand Down
2 changes: 1 addition & 1 deletion third_party/agfs/agfs-server/go.mod
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module github.com/c4pt0r/agfs/agfs-server

go 1.19
go 1.22.0

require (
github.com/aws/aws-sdk-go-v2 v1.39.2
Expand Down
Loading