Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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 docs/design/multi-tenant-design.md
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,7 @@ PUT /api/v1/admin/accounts/{account_id}/users/{uid}/role 修改用户角色 (
- **user**:同一 account 内,不同用户的私有数据互不可见。用户记忆、资源、session 属于用户本人
- **agent**:同一 account 内,agent 目录由 user_id + agent_id 共同决定,每用户独立(见 4.3)

**Space 标识符**:`UserIdentifier` 新增两个方法,拆分现有的 `unique_space_name()`:
**Space 标识符**:`UserIdentifier` 提供两个方法 `user_space_name()` 和 `agent_space_name()`:

```python
def user_space_name(self) -> str:
Expand Down
4 changes: 2 additions & 2 deletions docs/en/concepts/04-viking-uri.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,15 +120,15 @@ viking://
│ ├── entities/ # Each independent
│ └── events/ # Each independent
├── agent/{unique_space_name}/ # unique_space_name see UserIdentifier
├── agent/{agent_space}/ # agent_space = agent_space_name()
│ ├── skills/ # Skill definitions
│ ├── memories/
│ │ ├── cases/
│ │ └── patterns/
│ ├── workspaces/
│ └── instructions/
└── session/{unique_space_name}/{session_id}/
└── session/{user_space}/{session_id}/
├── messages/
├── tools/
└── history/
Expand Down
99 changes: 99 additions & 0 deletions docs/en/guides/03-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -191,6 +191,105 @@ curl http://localhost:1933/api/v1/fs/ls?uri=viking:// \
-H "X-API-Key: your-key"
```

## Cloud Deployment

### Docker

```dockerfile
FROM python:3.11-slim
WORKDIR /app
COPY . .
RUN pip install -e .
EXPOSE 1933
CMD ["python", "-m", "openviking", "serve", "--config", "/etc/openviking/ov.conf"]
```

```bash
docker build -t openviking .
docker run -d -p 1933:1933 \
-v /path/to/ov.conf:/etc/openviking/ov.conf:ro \
-v /data/openviking:/data/openviking \
openviking
```

### Kubernetes

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: openviking
spec:
replicas: 1
selector:
matchLabels:
app: openviking
template:
metadata:
labels:
app: openviking
spec:
containers:
- name: openviking
image: openviking:latest
ports:
- containerPort: 1933
volumeMounts:
- name: config
mountPath: /etc/openviking
readOnly: true
- name: data
mountPath: /data/openviking
livenessProbe:
httpGet:
path: /health
port: 1933
initialDelaySeconds: 5
periodSeconds: 10
readinessProbe:
httpGet:
path: /ready
port: 1933
initialDelaySeconds: 10
periodSeconds: 15
volumes:
- name: config
configMap:
name: openviking-config
- name: data
persistentVolumeClaim:
claimName: openviking-data
---
apiVersion: v1
kind: Service
metadata:
name: openviking
spec:
selector:
app: openviking
ports:
- port: 1933
targetPort: 1933
```

## Health Checks

| Endpoint | Auth | Purpose |
|----------|------|---------|
| `GET /health` | No | Liveness probe — returns `{"status": "ok"}` immediately |
| `GET /ready` | No | Readiness probe — checks AGFS, VectorDB, APIKeyManager |

```bash
# Liveness
curl http://localhost:1933/health

# Readiness
curl http://localhost:1933/ready
# {"status": "ready", "checks": {"agfs": "ok", "vectordb": "ok", "api_key_manager": "ok"}}
```

Use `/health` for Kubernetes liveness probes and `/ready` for readiness probes.

## Related Documentation

- [Authentication](04-authentication.md) - API key setup
Expand Down
99 changes: 99 additions & 0 deletions docs/zh/guides/03-deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -185,6 +185,105 @@ curl http://localhost:1933/api/v1/fs/ls?uri=viking:// \
-H "X-API-Key: your-key"
```

## 云上部署

### Docker

```dockerfile
FROM python:3.11-slim
WORKDIR /app
COPY . .
RUN pip install -e .
EXPOSE 1933
CMD ["python", "-m", "openviking", "serve", "--config", "/etc/openviking/ov.conf"]
```

```bash
docker build -t openviking .
docker run -d -p 1933:1933 \
-v /path/to/ov.conf:/etc/openviking/ov.conf:ro \
-v /data/openviking:/data/openviking \
openviking
```

### Kubernetes

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
name: openviking
spec:
replicas: 1
selector:
matchLabels:
app: openviking
template:
metadata:
labels:
app: openviking
spec:
containers:
- name: openviking
image: openviking:latest
ports:
- containerPort: 1933
volumeMounts:
- name: config
mountPath: /etc/openviking
readOnly: true
- name: data
mountPath: /data/openviking
livenessProbe:
httpGet:
path: /health
port: 1933
initialDelaySeconds: 5
periodSeconds: 10
readinessProbe:
httpGet:
path: /ready
port: 1933
initialDelaySeconds: 10
periodSeconds: 15
volumes:
- name: config
configMap:
name: openviking-config
- name: data
persistentVolumeClaim:
claimName: openviking-data
---
apiVersion: v1
kind: Service
metadata:
name: openviking
spec:
selector:
app: openviking
ports:
- port: 1933
targetPort: 1933
```

## 健康检查

| 端点 | 认证 | 用途 |
|------|------|------|
| `GET /health` | 否 | 存活探针 — 立即返回 `{"status": "ok"}` |
| `GET /ready` | 否 | 就绪探针 — 检查 AGFS、VectorDB、APIKeyManager |

```bash
# 存活探针
curl http://localhost:1933/health

# 就绪探针
curl http://localhost:1933/ready
# {"status": "ready", "checks": {"agfs": "ok", "vectordb": "ok", "api_key_manager": "ok"}}
```

在 Kubernetes 中,使用 `/health` 作为存活探针,`/ready` 作为就绪探针。

## 相关文档

- [认证](04-authentication.md) - API Key 设置
Expand Down
4 changes: 3 additions & 1 deletion examples/chatmem/chatmem.py
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,9 @@ def main():
""",
)

parser.add_argument("--config", type=str, default="./ov.conf", help="Path to config file")
parser.add_argument(
"--config", type=str, default="~/.openviking/ov.conf", help="Path to config file"
)
parser.add_argument("--data", type=str, default="./data", help="Path to data directory")
parser.add_argument(
"--session-id",
Expand Down
3 changes: 3 additions & 0 deletions examples/cloud/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
user_keys.json
ovcli.conf
ov.conf
Loading
Loading