refactor: 项目更名 WeKnora → Academy
Build & Publish (dsh-academy) / End-to-end inside dsh (latest, advisory) (push) Skipped
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Frontend / Docker multi-stage image (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-academy) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-academy) / Publish to npm (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Helm / chart (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (latest, advisory) (push) Skipped
CLI / test (macos-latest / go 1.26) (push) Canceled after 0s
CLI / test (ubuntu-latest / go 1.26) (push) Canceled after 0s
CLI / test (windows-latest / go 1.26) (push) Canceled after 0s
Build and Push Docker Image / build-ui (push) Canceled after 0s
Build and Push Docker Image / build-docreader (push) Canceled after 0s
Build and Push Docker Image / build-sandbox (push) Canceled after 0s
Build and Push Docker Image / build-app (amd64, linux/amd64, ubuntu-latest) (push) Canceled after 0s
Build and Push Docker Image / build-app (arm64, linux/arm64, ubuntu-24.04-arm) (push) Canceled after 0s
Build and Push Docker Image / merge (push) Canceled after 0s
Frontend / Test, type-check, and build (push) Canceled after 0s
Frontend / Docker multi-stage image (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.10) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.11) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.12) (push) Canceled after 0s
Build & Publish (mcp-server) / Test (Python 3.13) (push) Canceled after 0s
Build & Publish (mcp-server) / Build sdist + wheel (push) Canceled after 0s
Build & Publish (mcp-server) / Publish to PyPI (push) Canceled after 0s
Anydoc / anydoc parser engine (push) Canceled after 0s
App / Format, vet, test, and build (push) Canceled after 0s
DocReader / Python tests and Go client tests (push) Canceled after 0s
Build & Publish (dsh-academy) / Typecheck, test, pack (push) Canceled after 0s
Build & Publish (dsh-academy) / End-to-end inside dsh (pinned) (push) Canceled after 0s
Build & Publish (dsh-academy) / Publish to npm (push) Canceled after 0s
Go Lint Cache / warm lint cache (.) (push) Canceled after 0s
Go Lint Cache / warm lint cache (cli) (push) Canceled after 0s
Go Lint Cache / warm lint cache (client) (push) Canceled after 0s
Helm / chart (push) Canceled after 0s
- 全量替换代码/配置/文档中的项目名(保留上游 GitHub 链接、weixin 文档域名、Docker Hub 镜像名) - 重命名 32 个含项目名的文件/目录;Go module 路径改为 academy(含 client/cli 子模块) - docreader proto 描述符采用等长替换,保持序列化字节布局有效 - Dockerfile.app 构建网络修复: browserskill 离线产物通道、PyPI/apt 国内镜像 - 运行验证: go build ✓ docker compose up ✓ 健康检查 ✓
This commit is contained in:
1 parent
9097ee699d
commit
9058149576
3136 files changed
+18018
-18004
No files matched your search
@@ -2,7 +2,7 @@
|
||||
|
||||
当前实现与部署要求见[沙箱部署与排障](../../../website-docs/06-development/04-sandbox-deployment.md)。本 PoC 仅保留历史可行性实验,不代表当前适配器行为。
|
||||
|
||||
这个程序直接打 Docker Engine API,逐项验证「Docker 能不能承载 WeKnora
|
||||
这个程序直接打 Docker Engine API,逐项验证「Docker 能不能承载 Academy
|
||||
`RemoteSandboxClient` 契约 + E2B 那套 Snapshot 工作流」。它不是产品代码,也不参与主模块构建
|
||||
(自带 `go.mod`),只作为调研结论的可复现证据。
|
||||
|
||||
@@ -19,7 +19,7 @@ go run . # daemon 在本机 unix socket 上时可能需要 sudo -E
|
||||
```
|
||||
|
||||
程序会自建一个带 uid 1000 `user` 账号的模板镜像(对齐 E2B 模板约定),跑完自行删除它创建的容器。
|
||||
留下的 `weknora-poc/*` 镜像用 `docker image rm` 清理。
|
||||
留下的 `academy-poc/*` 镜像用 `docker image rm` 清理。
|
||||
|
||||
## 覆盖的内容
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
module github.com/Tencent/WeKnora/docs/poc/docker-sandbox
|
||||
module academy/docs/poc/docker-sandbox
|
||||
|
||||
go 1.26.0
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
// Historical PoC: can the Docker Engine API back the
|
||||
// semantics WeKnora's RemoteSandboxClient contract requires (session-persistent
|
||||
// semantics Academy's RemoteSandboxClient contract requires (session-persistent
|
||||
// sandbox, exec, filesystem, metadata, lifecycle), plus the snapshot workflow
|
||||
// planned for E2B?
|
||||
//
|
||||
@@ -57,7 +57,7 @@ func main() {
|
||||
ping, err := cli.Ping(ctx, client.PingOptions{})
|
||||
step("Health: ping control plane", err, fmt.Sprintf("api=%s", ping.APIVersion))
|
||||
|
||||
tmplImage := "weknora-poc/template:v2"
|
||||
tmplImage := "academy-poc/template:v2"
|
||||
err = buildTemplateImage(ctx, cli, tmplImage)
|
||||
step("Template: base image with uid-1000 user", err, tmplImage)
|
||||
if err != nil {
|
||||
@@ -66,11 +66,11 @@ func main() {
|
||||
|
||||
sessionID := fmt.Sprintf("poc-session-%d", time.Now().Unix())
|
||||
labels := map[string]string{
|
||||
"weknora.managed": "true",
|
||||
"weknora.tenant": "1",
|
||||
"weknora.session": sessionID,
|
||||
"weknora.config": "cfg-poc",
|
||||
"weknora.createdAt": time.Now().UTC().Format(time.RFC3339),
|
||||
"academy.managed": "true",
|
||||
"academy.tenant": "1",
|
||||
"academy.session": sessionID,
|
||||
"academy.config": "cfg-poc",
|
||||
"academy.createdAt": time.Now().UTC().Format(time.RFC3339),
|
||||
}
|
||||
|
||||
// --- Create -------------------------------------------------------------
|
||||
@@ -87,18 +87,18 @@ func main() {
|
||||
defer fresh.Close()
|
||||
var insp client.ContainerInspectResult
|
||||
insp, err = fresh.ContainerInspect(ctx, id, client.ContainerInspectOptions{})
|
||||
if err == nil && insp.Container.Config.Labels["weknora.session"] != sessionID {
|
||||
if err == nil && insp.Container.Config.Labels["academy.session"] != sessionID {
|
||||
err = errors.New("metadata labels not preserved")
|
||||
}
|
||||
step("Connect+Metadata: re-attach from a new client", err,
|
||||
fmt.Sprintf("state=%s session=%s", insp.Container.State.Status,
|
||||
insp.Container.Config.Labels["weknora.session"]))
|
||||
insp.Container.Config.Labels["academy.session"]))
|
||||
}
|
||||
|
||||
// --- List by metadata ---------------------------------------------------
|
||||
listed, err := cli.ContainerList(ctx, client.ContainerListOptions{
|
||||
All: true,
|
||||
Filters: client.Filters{}.Add("label", "weknora.session="+sessionID),
|
||||
Filters: client.Filters{}.Add("label", "academy.session="+sessionID),
|
||||
})
|
||||
if err == nil && len(listed.Items) != 1 {
|
||||
err = fmt.Errorf("expected 1 container, got %d", len(listed.Items))
|
||||
@@ -264,7 +264,7 @@ func main() {
|
||||
|
||||
// --- Snapshot workflow --------------------------------------------------
|
||||
mgmtID, err := createSandbox(ctx, cli, tmplImage,
|
||||
map[string]string{"weknora.managed": "true", "weknora.role": "snapshot-builder"})
|
||||
map[string]string{"academy.managed": "true", "academy.role": "snapshot-builder"})
|
||||
step("Snapshot: create workspace management sandbox", err, short(mgmtID))
|
||||
if err != nil {
|
||||
report()
|
||||
@@ -280,16 +280,16 @@ func main() {
|
||||
}
|
||||
step("Snapshot: install a skill into that sandbox", err, "requests==2.32.3 + /opt/skills/pdf")
|
||||
|
||||
snapV1 := "weknora-poc/snapshot:v1"
|
||||
snapV1 := "academy-poc/snapshot:v1"
|
||||
commitRes, err := cli.ContainerCommit(ctx, mgmtID, client.ContainerCommitOptions{
|
||||
Reference: snapV1,
|
||||
Comment: "weknora snapshot v1",
|
||||
Changes: []string{`LABEL weknora.snapshot.version=1`, `LABEL weknora.snapshot.tenant=1`},
|
||||
Comment: "academy snapshot v1",
|
||||
Changes: []string{`LABEL academy.snapshot.version=1`, `LABEL academy.snapshot.tenant=1`},
|
||||
})
|
||||
step("Snapshot: commit container -> image", err, short(commitRes.ID))
|
||||
|
||||
snapSessionID, err := createSandbox(ctx, cli, snapV1,
|
||||
map[string]string{"weknora.managed": "true", "weknora.session": sessionID + "-from-snapshot"})
|
||||
map[string]string{"academy.managed": "true", "academy.session": sessionID + "-from-snapshot"})
|
||||
step("Snapshot: session sandbox boots from snapshot", err, short(snapSessionID))
|
||||
if err == nil {
|
||||
defer remove(cli, snapSessionID)
|
||||
@@ -304,25 +304,25 @@ func main() {
|
||||
}
|
||||
|
||||
// Incremental snapshot update: install a second skill on top of v1.
|
||||
upgradeID, err := createSandbox(ctx, cli, snapV1, map[string]string{"weknora.role": "snapshot-builder"})
|
||||
upgradeID, err := createSandbox(ctx, cli, snapV1, map[string]string{"academy.role": "snapshot-builder"})
|
||||
if err == nil {
|
||||
defer remove(cli, upgradeID)
|
||||
_, err = execIn(ctx, cli, upgradeID, execRequest{
|
||||
cmd: []string{"bash", "-lc", "mkdir -p /opt/skills/chart && echo 'skill v2' > /opt/skills/chart/SKILL.md"},
|
||||
})
|
||||
}
|
||||
snapV2 := "weknora-poc/snapshot:v2"
|
||||
snapV2 := "academy-poc/snapshot:v2"
|
||||
if err == nil {
|
||||
_, err = cli.ContainerCommit(ctx, upgradeID, client.ContainerCommitOptions{
|
||||
Reference: snapV2,
|
||||
Changes: []string{`LABEL weknora.snapshot.version=2`},
|
||||
Changes: []string{`LABEL academy.snapshot.version=2`},
|
||||
})
|
||||
}
|
||||
step("Snapshot: incremental update v1 -> v2", err, snapV2)
|
||||
|
||||
imgs, err := cli.ImageList(ctx, client.ImageListOptions{
|
||||
All: true,
|
||||
Filters: client.Filters{}.Add("label", "weknora.snapshot.version"),
|
||||
Filters: client.Filters{}.Add("label", "academy.snapshot.version"),
|
||||
})
|
||||
step("Snapshot: list snapshots by label", err, fmt.Sprintf("count=%d", len(imgs.Items)))
|
||||
|
||||
@@ -337,11 +337,11 @@ func main() {
|
||||
|
||||
// Does a snapshot preserve running processes / RAM? (E2B pause does.)
|
||||
_, _ = execIn(ctx, cli, mgmtID, execRequest{cmd: []string{"bash", "-lc", "nohup sleep 600 >/dev/null 2>&1 & echo started"}})
|
||||
procSnap := "weknora-poc/snapshot:proc"
|
||||
procSnap := "academy-poc/snapshot:proc"
|
||||
_, err = cli.ContainerCommit(ctx, mgmtID, client.ContainerCommitOptions{Reference: procSnap})
|
||||
if err == nil {
|
||||
var procID string
|
||||
procID, err = createSandbox(ctx, cli, procSnap, map[string]string{"weknora.role": "proc-check"})
|
||||
procID, err = createSandbox(ctx, cli, procSnap, map[string]string{"academy.role": "proc-check"})
|
||||
if err == nil {
|
||||
defer remove(cli, procID)
|
||||
var out execResult
|
||||
@@ -353,7 +353,7 @@ func main() {
|
||||
|
||||
insp2, err := cli.ContainerInspect(ctx, id, client.ContainerInspectOptions{})
|
||||
step("Idle TTL: daemon has none, only timestamps (GAP)", err,
|
||||
fmt.Sprintf("startedAt=%s -> WeKnora must sweep", insp2.Container.State.StartedAt))
|
||||
fmt.Sprintf("startedAt=%s -> Academy must sweep", insp2.Container.State.StartedAt))
|
||||
|
||||
checkCLIOrphan(ctx)
|
||||
|
||||
@@ -369,7 +369,7 @@ func checkCLIOrphan(ctx context.Context) {
|
||||
step("CLI orphan: skipped (docker CLI not on PATH)", nil, "")
|
||||
return
|
||||
}
|
||||
name := fmt.Sprintf("weknora-poc-orphan-%d", time.Now().UnixNano())
|
||||
name := fmt.Sprintf("academy-poc-orphan-%d", time.Now().UnixNano())
|
||||
runCtx, cancel := context.WithTimeout(ctx, 3*time.Second)
|
||||
defer cancel()
|
||||
cmd := exec.CommandContext(runCtx, "docker", "run", "--rm", "--name", name,
|
||||
|
||||
Reference in new issue
Block a user