diff --git a/.DS_Store b/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..68cd7343530a7c5143f5398429c9740475e226d0 Binary files /dev/null and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index 10fd0dd4fb40006acfc70aea9b2ffc6b495301e4..5d947ca8879f8a9072fe485c566204e3c2929e80 100644 --- a/.gitignore +++ b/.gitignore @@ -16,7 +16,3 @@ bin-release/ # Project files, i.e. `.project`, `.actionScriptProperties` and `.flexProperties` # should NOT be excluded as they contain compiler settings and other important # information for Eclipse / Flash Builder. - -# macOS -.DS_Store -**/.DS_Store diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f1292b815dec19bb5b1e8fe0742f0e52dd455807..f31a706a6e86188bdf03599e917db25ca9d8c7e6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -91,134 +91,29 @@ git remote add upstream https://gitee.com/OpenCloudOS/ai-agent-container.git #### 2.2 目录结构 -本仓库支持两种目录层级,**推荐使用三级结构**以支持多版本并存: - -**推荐(三级,多版本)** +每个 PR 需要提交以下文件: ``` frameworks/<框架名>/<版本号>/ ├── Dockerfile # 必须,基于 OC9 基础镜像 ├── README.md # 必须,框架说明文档 -├── test.sh # 可选(推荐),基础功能验证脚本 -└── build.conf # 三级目录必须提供(见下方说明) -``` - -> 三级目录中 CI 无法自动推断镜像名(目录名是版本号如 `0.10.2`,不适合作为镜像名),因此 **`build.conf` 为必填项**。 - -**二级(单版本,不推荐)** - -``` -frameworks/<框架名>/ -├── Dockerfile -├── README.md -├── test.sh # 可选 -└── build.conf # 可选;不提供时 IMAGE_NAME 默认取框架目录名,IMAGE_TAG 默认 latest -``` - -> 二级结构无法支持同一框架多版本并存,仅适合无需版本管理的场景,**不推荐使用**。 - -#### 2.2.1 build.conf 字段说明 - -`build.conf` 用于声明镜像构建参数,由 CI 自动读取。文件格式为 `KEY=VALUE`,支持 `#` 注释行。 - -| 字段 | 是否必填 | 默认值 | 说明 | -|------|---------|--------|------| -| `IMAGE_NAME` | 三级目录必填 | 目录名(basename) | Docker 镜像名,只允许小写字母、数字、`.`、`_`、`-`,以字母或数字开头 | -| `IMAGE_TAG` | 可选 | `latest` | 镜像标签,建议使用框架版本号(如 `0.10.2`) | -| `BUILD_CONTEXT` | 可选 | 空 | 额外构建上下文,格式:`key=相对路径`(用于多目录构建场景) | -| `GPU_TEST` | 可选 | `false` | 是否在 CI 中执行 GPU 专项测试(`torch.cuda.is_available()` 验证),设为 `true` 或 `false` | -| `EXTRA_IMAGES` | 可选 | 空 | 额外镜像列表,格式:`target1:name1 target2:name2`(用于多模块/多 target 项目,见下方说明) | - -**CPU 框架示例**(`frameworks/langchain/0.3.21/build.conf`): - -```ini -# langchain 0.3.21 on OpenCloudOS 9 -IMAGE_NAME=oc9-langchain -IMAGE_TAG=0.3.21 -GPU_TEST=false +└── test.sh # 必须,基础功能验证脚本 ``` -**GPU 框架示例**(`frameworks/vllm/0.10.2/build.conf`): + **多版本说明** :同一框架的不同版本各建一个子目录,例如: -```ini -# vllm 0.10.2 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-vllm -IMAGE_TAG=0.10.2 -GPU_TEST=true ``` - -> 合并后,CI 将以 `IMAGE_NAME:IMAGE_TAG` 为镜像名推送到 Docker Hub。请确保命名在整个仓库中唯一,避免与其他框架冲突。 - -#### 2.2.2 多模块项目(EXTRA_IMAGES 与 build.sh) - -对于包含多个模块/组件的项目(如 Langfuse 同时有 web 和 worker 两个镜像),CI 提供两种方式支持: - -**方式一:EXTRA_IMAGES 声明(推荐,简单场景)** - -在 `build.conf` 中通过 `EXTRA_IMAGES` 字段声明额外 target 和镜像名。CI 会自动执行 `docker build --target -t :` 构建额外镜像。 - -```ini -# langfuse 3.166.0 on OpenCloudOS 9(多模块) -IMAGE_NAME=oc9-langfuse-web -IMAGE_TAG=3.166.0 -GPU_TEST=false -EXTRA_IMAGES=worker-runner:oc9-langfuse-worker -``` - -> 格式:`:<镜像名>`,多个用空格分隔。所有额外镜像共享 `IMAGE_TAG`。 - -**方式二:自定义 build.sh(复杂场景)** - -如果构建逻辑更复杂(如需要 docker-compose、特殊构建参数等),可在框架目录下提供 `build.sh` 脚本。CI 检测到 `build.sh` 后会调用它替代默认的 `docker build`。 - -`build.sh` 运行时可用的环境变量: -| 变量 | 说明 | -|------|------| -| `IMAGE_NAME` | 主镜像名称(来自 build.conf) | -| `IMAGE_TAG` | 主镜像标签(来自 build.conf) | -| `LOCAL_TAG` | CI 期望的主镜像完整标签(如 `ci-test-oc9-langfuse-web:3.166.0`) | -| `TAG_PREFIX` | 镜像标签前缀(CI 中为 `ci-test-`,发布时为 `ci-pub-`),构建额外镜像时必须使用此前缀 | -| `EXTRA_IMAGES` | 额外镜像列表(来自 build.conf) | - -`build.sh` 编写要求: -- 必须构建主镜像并标记为 `$LOCAL_TAG` -- 额外镜像必须使用 `$TAG_PREFIX` 前缀命名(如 `${TAG_PREFIX}oc9-langfuse-worker:${IMAGE_TAG}`) -- 成功时 `exit 0`,失败时 `exit` 非零 -- 脚本以 root 权限运行(`sudo -E bash build.sh`),直接使用 `docker` 命令即可 - -**示例**(`frameworks/langfuse/3.166.0/build.sh`): - -```bash -#!/bin/bash -set -euo pipefail - -DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -echo "=== 构建 Langfuse Web 模块 ===" -docker build -t "${LOCAL_TAG}" "$DIR" - -echo "=== 构建 Langfuse Worker 模块 ===" -docker build --target worker-runner \ - -t "${TAG_PREFIX}oc9-langfuse-worker:${IMAGE_TAG}" "$DIR" - -echo "=== Langfuse 全部模块构建完成 ===" +frameworks/pytorch/2.10.0/ +frameworks/pytorch/2.11.0/ +frameworks/vllm/0.10.2/ +frameworks/vllm/0.18.0/ ``` -目录结构示例: - -``` -frameworks/langfuse/3.166.0/ -├── Dockerfile # 多阶段 Dockerfile(包含 web-runner 和 worker-runner target) -├── README.md -├── build.conf # 声明 IMAGE_NAME + EXTRA_IMAGES -├── build.sh # 自定义构建脚本(可选,二选一即可) -├── docker-compose.yml # 完整服务编排(用于本地开发和 test.sh) -└── test.sh # 测试脚本(可基于 docker-compose 验证) -``` +每个版本目录独立包含完整的 Dockerfile、README.md 和 test.sh。 #### 2.3 Dockerfile 规范 -> 完整的 Dockerfile 参考案例见本文档 👉 [附录:Dockerfile 参考案例](#附1 Dockerfile-参考案例) +> 完整的 Dockerfile 参考案例见本文档 👉 [附录:Dockerfile 参考案例](#附1:Dockerfile 参考案例) **CPU / 纯 Python 框架**(如 LangChain、Dify 等): @@ -283,14 +178,12 @@ docker run --rm oc9-<框架名>:<版本> python3 -c "import xxx; print(xxx.__ver - (如有) ``` -#### 2.3 test.sh 说明 +#### 2.3 tesh.sh说明 -> 我们希望贡献者提供一个简单的 Shell 测试脚本,覆盖框架的基础功能验证。脚本风格参考下方示例,不要求面面俱到,能验证核心功能即可。脚本要求传入构建好的镜像名:标签作为参数 `$1`。脚本需通过 `docker run` 方式验证镜像功能。 +> 我们希望贡献者提供一个简单的 Shell 测试脚本,覆盖框架的基础功能验证。脚本风格参考下方示例,不要求面面俱到,能验证核心功能即可。 **test.sh 编写要求**: - 脚本需 `#!/bin/bash` 开头,`set -e` 确保出错即停 -- 脚本接收参数 `$1` 为镜像名:标签(如 `ci-test-vllm:latest`) -- 通过 `docker run --rm "$IMAGE"` 方式在容器中执行验证 - 建议验证:① 框架可正常 import / 运行 ② 核心功能可用(如推理、API 服务等) - GPU 镜像建议增加 CUDA 环境检查(如 `nvidia-smi`、`nvcc --version`) - 输出清晰的 ✓/✗ 结果,方便 CI 判定 @@ -301,17 +194,15 @@ docker run --rm oc9-<框架名>:<版本> python3 -c "import xxx; print(xxx.__ver #!/bin/bash set -e -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" - echo "=== 基础功能测试 ===" # 1. 验证框架可正常导入 echo -n "检查 import... " -sudo docker run --rm "$IMAGE" python3 -c "import <框架名>; print(<框架名>.__version__)" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } +python3 -c "import <框架名>; print(<框架名>.__version__)" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } # 2. 验证核心功能(按框架实际情况编写) echo -n "检查核心功能... " -sudo docker run --rm "$IMAGE" python3 -c " +python3 -c " # 这里写具体的功能验证代码,例如: # from langchain_core.messages import HumanMessage # msg = HumanMessage(content='hello') @@ -322,32 +213,7 @@ print('核心功能正常') echo "=== 所有测试通过 ===" ``` -**GPU 镜像的 test.sh 示例**: - -```bash -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" - -echo "=== GPU 镜像功能测试 ===" - -# 1. 验证 CUDA 环境 -echo -n "检查 CUDA... " -sudo docker run --rm --gpus all "$IMAGE" python3 -c " -import torch -assert torch.cuda.is_available(), 'CUDA not available' -print(f'GPU: {torch.cuda.get_device_name(0)}') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证框架导入 -echo -n "检查框架 import... " -sudo docker run --rm "$IMAGE" python3 -c "import <框架名>; print(<框架名>.__version__)" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" -``` - -更完整的 CUDA 基础检查可参考仓库中的 [cuda_test.sh](./cuda_test.sh)。 +**GPU 镜像的 test.sh** 可额外加入 CUDA 基础检查(nvidia-smi、nvcc 版本、cuDNN 检测等),具体可参考仓库中的 [cuda_test.sh 示例](./cuda_test.sh)。 --- @@ -378,7 +244,7 @@ RUN dnf install -y --nogpgcheck \ RUN pip3 install --no-cache-dir uv \ && uv pip install --no-cache-dir browser-use[all] --system -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt +RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /tencentos_build_date.txt ``` ### 案例 2:GPU 镜像 — 以 vLLM 为例 @@ -400,7 +266,7 @@ RUN pip3 install --no-cache-dir uv \ # 4. 设置 GPU 环境变量 ENV NVIDIA_VISIBLE_DEVICES=all -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt +RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /tencentos_build_date.txt ``` ## 附2:README 参考案例 @@ -467,7 +333,7 @@ PR 提交后,CI 流水线将自动执行: 1. **Dockerfile 格式及运行测试**:检查 Dockerfile 格式,并扫描是否包含违规的内部凭证或硬编码源。测试`docker build` 是否成功。 2. **基础功能测试**:构建成功后,CI 会将镜像调度到配备真实 NVIDIA GPU 的节点上,挂载显卡执行您编写的 test.sh。 3. **异常反馈**: 如镜像测试未通过,CI会自动生成异常反馈(标记 CI pass、CI failed 和 CI running 状态),失败时可跳转查看日志。 -3. **镜像发布**: 一旦测试通过,社区 Maintainer 会进行 Code Review。Merge 后,内部同步流水线会自动触发镜像发布。发布结果同样以 PR 评论反馈,包含已发布的完整镜像列表(`docker.io/ocpub/:`)。 +3. **镜像发布**: 一旦测试通过,社区 Maintainer 会进行 Code Review。Merge 后,内部同步流水线会自动触发,将镜像推送至OpenCloudOS开发者共建Docker Hub ([opencloudosorg](https://hub.docker.com/u/opencloudosorg))。 --- diff --git a/README.md b/README.md index 8a2d6189f40336fe1446f2c29d47d22ae02d3b71..39532a03c3a73112444f1dafa35bb29f1ed65516 100644 --- a/README.md +++ b/README.md @@ -22,7 +22,6 @@ - [参与贡献前必读](#参与贡献前必读) - [仓库结构](#仓库结构) - [贡献流程](#贡献流程) -- [自动化 CI/CD 流水线](#自动化-cicd-流水线) - [适配框架清单](#适配框架清单) ## 参与贡献前必读 @@ -51,23 +50,19 @@ ## 仓库结构 ``` -ai-agent-container/ -├── README.md # 本文件 -├── CONTRIBUTING.md # 贡献指南(详细版) -├── FRAMEWORKS.md # 可适配的 AI 框架完整清单 -├── LICENSE -├── cuda_test.sh # GPU 基础环境检查参考模板 -└── frameworks/ # 各框架适配目录(按 PR 提交) +└── frameworks/ ├── vllm/ - │ └── 0.10.2/ - │ ├── Dockerfile - │ ├── README.md - │ ├── test.sh # 可选,基础功能验证脚本 - │ └── build.conf # 可选,构建参数配置 - ├── langchain/ - │ └── 1.2.14/ + │ ├── 0.10.2/ + │ │ ├── Dockerfile + │ │ ├── README.md + │ │ └── test.sh + │ └── 0.18.0/ │ └── ... - └── ... + ├── pytorch/ + │ ├── 2.10.0/ + │ └── 2.11.0/ + └── langchain/ + └── 1.2.15/ ``` ## 贡献流程 @@ -86,14 +81,14 @@ cd ai-agent-container **② 创建框架适配目录** ```bash -mkdir -p frameworks/vllm/0.19.0 +mkdir -p frameworks/vllm/ ``` **③ 编写 Dockerfile & 验证** ```bash # 构建镜像 -docker build -t oc9-vllm:0.19.0 frameworks/vllm/0.19.0/ +docker build -t oc9-vllm:0.19.0 frameworks/vllm/ # 运行基础验证 docker run --rm --gpus all oc9-vllm:0.19.0 python3.11 -c "import vllm; print(vllm.__version__)" @@ -106,7 +101,6 @@ git checkout -b feat/add-vllm git add frameworks/vllm/0.19.0/ git commit -m "feat: add vllm v0.19.0 container image for OC9" git push origin feat/add-vllm -# 在 Gitee 上发起 Pull Request ``` ### PR 提交要求 @@ -117,13 +111,7 @@ git push origin feat/add-vllm |------|------| | `frameworks/<框架名>/<版本号>/Dockerfile` | 基于 OC9 基础镜像(minimal、cuda-devel 或其他) | | `frameworks/<框架名>/<版本号>/README.md` | 框架简介、版本、构建命令、使用示例、已知问题 | - -每个 PR **推荐包含**: - -| 文件 | 说明 | -|------|------| -| `frameworks/<框架名>/<版本号>/test.sh` | 基础功能验证脚本(宿主机运行,接收 `$1` 为镜像名:标签) | -| `frameworks/<框架名>/<版本号>/build.conf` | 构建参数配置(镜像名、标签、是否需要 GPU 测试等) | +| `frameworks/<框架名>/<版本号>/test/` | 至少一个基础功能验证脚本、运行成功截图 | ### 验收标准 @@ -134,72 +122,6 @@ git push origin feat/add-vllm - ✅ README 文档完备 - ✅ 包含 test.sh 和运行成功截图 -## 自动化 CI/CD 流水线 - -本仓库配有两条自动化流水线,贡献者提交 PR 后无需手动操作,流水线会自动完成检查与发布,并将结果以评论形式反馈到 PR。 - -### 🔍 CI 门禁(PR 阶段) - -**触发时机**:PR 创建、更新(新 push)时自动触发;也可在 PR 评论中输入 `/retest` 手动重触发。 - -流水线仅检查**本次 PR 修改的目录**,分三个阶段依次执行: - -#### 阶段一:格式与配置校验 - -| 检查项 | 通过条件 | 失败影响 | -|--------|---------|---------| -| **必需文件** | 每个提交目录必须包含 `Dockerfile` 和 `README.md` | ❌ 阻断,PR 无法合并 | -| **build.conf 必填** | `frameworks/<框架>/<版本>/` 三级目录**必须**提供 `build.conf`,否则无法推断镜像名 | ❌ 阻断 | -| **IMAGE_NAME 格式** | 只允许小写字母、数字、`.`、`_`、`-`,且以字母或数字开头(`^[a-z0-9][a-z0-9._-]*$`) | ❌ 阻断 | -| **IMAGE_TAG 格式** | 允许字母、数字、`.`、`_`、`-`,且以字母或数字开头(`^[a-zA-Z0-9][a-zA-Z0-9._-]*$`) | ❌ 阻断 | -| **BUILD_CONTEXT 格式** | 若声明,须符合 `key=路径` 格式 | ❌ 阻断 | -| **GPU_TEST 合法值** | 只能是 `true` 或 `false` | ❌ 阻断 | -| **Hadolint lint** | Dockerfile 最佳实践检查(忽略 DL3008/DL3013/DL3059) | ⚠ 警告,不阻断 | - -> **提前规避**:`build.conf` 字段说明与示例见 [CONTRIBUTING.md §2.2.1](./CONTRIBUTING.md);常见 Hadolint 警告可在本地用 `hadolint Dockerfile` 提前检查。 - -#### 阶段二:构建验证 - -在 GPU 机器上执行 `docker build`,确认 Dockerfile 可以成功构建。 - -- 构建失败(语法错误、基础镜像拉取失败、依赖安装报错等)→ ❌ 阻断 - -#### 阶段三:功能测试 - -| 步骤 | 说明 | -|------|------| -| **基础测试** | 若提交了 `test.sh`,CI 会在 GPU 机器上执行 `bash test.sh <镜像名:标签>`,非零退出码即为失败 | -| **GPU 测试** | `build.conf` 中声明 `GPU_TEST=true` 时,额外运行 `torch.cuda.is_available()` 验证 CUDA 可用性 | - -> **test.sh 编写规范**:脚本必须以第一个参数 `$1` 接收镜像名:标签,通过 `docker run --rm "$1" ...` 验证容器功能,验证通过 `exit 0`,失败 `exit 1`。详见 [CONTRIBUTING.md](./CONTRIBUTING.md)。 - -#### CI 结果反馈 - -PR 页面将收到评论通知,同时打上状态标签: - -| 结果 | 标签 | 说明 | -|------|------|------| -| 检查中 | `ci_running` | 流水线运行中 | -| 全部通过 | `ci_passed` | 可以申请合并 | -| 存在失败 | `ci_failed` | 请查看评论中的日志链接,修复后重新 push 或评论 `/retest` | - ---- - -### 🚀 Publish 发布(合并后) - -**触发时机**:PR 被合并到 `master` 后自动触发。 - -流水线执行以下操作: -1. **重新构建**本次合并引入的镜像 -2. **推送**到 Docker Hub(命名空间 `ocpub`),镜像名和 tag 来自 `build.conf` 中的 `IMAGE_NAME` 和 `IMAGE_TAG` -3. **防覆盖保护**:若该 tag 在 Docker Hub 上已存在,跳过推送并在日志中告警 - -> **注意**:若 PR 合并时该 tag 已在 Docker Hub 存在(如之前有同名同版本发布),镜像**不会**被覆盖。如需重新发布,请联系管理员手动删除 Docker Hub 上的对应 tag。 - -发布结果同样以 PR 评论反馈,包含已发布的完整镜像列表(`docker.io/ocpub/:`)。 - ---- - ## 适配框架清单 > 完整清单(含各版本号、开源地址)请查看 👉 **[FRAMEWORKS.md](./FRAMEWORKS.md)** diff --git a/ci_log_128.txt b/ci_log_128.txt deleted file mode 100644 index 75a76c800a8fd8bac91a3f1e6988dc864824baa7..0000000000000000000000000000000000000000 --- a/ci_log_128.txt +++ /dev/null @@ -1,599 +0,0 @@ -[2026-05-06T13:41:20.853Z] + cd /data/jenkins_workspace/workspace/OC-Dockerfiles/CI/128/dockerfiles -[2026-05-06T13:41:20.853Z] + bash utils/gpu_test.sh . build_dirs_list.txt 43.173.75.230 **** jenkins_worker -[2026-05-06T13:41:20.853Z] --- [0/3] Probing SSH connectivity to 43.173.75.230 --- -[2026-05-06T13:41:25.008Z] ok -[2026-05-06T13:41:25.008Z] ✓ SSH connectivity OK -[2026-05-06T13:41:25.008Z] -[2026-05-06T13:41:25.008Z] === Remote Build & Test on 43.173.75.230 === -[2026-05-06T13:41:25.008Z] 框架列表: -[2026-05-06T13:41:25.008Z] - frameworks/crewai/1.13.0 -[2026-05-06T13:41:25.008Z] - frameworks/crewai/1.14.0 -[2026-05-06T13:41:25.008Z] - frameworks/crewai/1.14.1 -[2026-05-06T13:41:25.008Z] -[2026-05-06T13:41:25.008Z] --- [1/3] Packing source files --- -[2026-05-06T13:41:25.008Z] ✓ Packed: 204K -[2026-05-06T13:41:25.008Z] --- [2/3] Transferring to 43.173.75.230 --- -[2026-05-06T13:41:30.236Z] ✓ Transfer complete -[2026-05-06T13:41:30.236Z] --- [3/3] Executing remote build & test --- -[2026-05-06T13:41:34.388Z] Working directory: /tmp/ci-build-11923 -[2026-05-06T13:41:34.388Z] === Build & Test === -[2026-05-06T13:41:34.388Z] -[2026-05-06T13:41:34.388Z] === 构建: frameworks/crewai/1.13.0 === -[2026-05-06T13:41:34.388Z] 构建命令: sudo docker build -t ci-test-oc9-crewai:1.13.0 frameworks/crewai/1.13.0 -[2026-05-06T13:41:34.641Z] #0 building with "default" instance using docker driver -[2026-05-06T13:41:34.641Z] -[2026-05-06T13:41:34.641Z] #1 [internal] load build definition from Dockerfile -[2026-05-06T13:41:34.641Z] #1 transferring dockerfile: 1.09kB done -[2026-05-06T13:41:34.641Z] #1 DONE 0.0s -[2026-05-06T13:41:34.641Z] -[2026-05-06T13:41:34.641Z] #2 [auth] opencloudos/opencloudos9-minimal:pull token for registry-1.docker.io -[2026-05-06T13:41:34.641Z] #2 DONE 0.0s -[2026-05-06T13:41:34.641Z] -[2026-05-06T13:41:34.641Z] #3 [internal] load metadata for docker.io/opencloudos/opencloudos9-minimal:latest -[2026-05-06T13:41:34.895Z] #3 DONE 0.4s -[2026-05-06T13:41:34.895Z] -[2026-05-06T13:41:34.895Z] #4 [internal] load .dockerignore -[2026-05-06T13:41:34.895Z] #4 transferring context: 2B done -[2026-05-06T13:41:34.895Z] #4 DONE 0.0s -[2026-05-06T13:41:34.895Z] -[2026-05-06T13:41:34.895Z] #5 [1/9] FROM docker.io/opencloudos/opencloudos9-minimal:latest@sha256:f6d5562ffaa332e97445d0a21ef0820e35694c39c622ca08598794d4f62a6aaa -[2026-05-06T13:41:34.896Z] #5 DONE 0.0s -[2026-05-06T13:41:34.896Z] -[2026-05-06T13:41:34.896Z] #6 [2/9] RUN dnf install -y python3.11 python3.11-pip gcc gcc-c++ && dnf clean all && rm -rf /var/cache/yum/* -[2026-05-06T13:41:34.896Z] #6 CACHED -[2026-05-06T13:41:34.896Z] -[2026-05-06T13:41:34.896Z] #7 [3/9] RUN ln -sf /usr/bin/python3.11 /usr/bin/python3 && ln -sf /usr/bin/pip3.11 /usr/bin/pip3 -[2026-05-06T13:41:34.896Z] #7 CACHED -[2026-05-06T13:41:34.896Z] -[2026-05-06T13:41:34.896Z] #8 [internal] load build context -[2026-05-06T13:41:34.896Z] #8 transferring context: 1.81kB done -[2026-05-06T13:41:34.896Z] #8 DONE 0.0s -[2026-05-06T13:41:34.896Z] -[2026-05-06T13:41:34.896Z] #9 [4/9] RUN pip3.11 install --no-cache-dir crewai==1.13.0 -[2026-05-06T13:41:35.817Z] #9 0.889 Collecting crewai==1.13.0 -[2026-05-06T13:41:35.817Z] #9 0.926 Downloading crewai-1.13.0-py3-none-any.whl.metadata (36 kB) -[2026-05-06T13:41:35.817Z] #9 0.986 Collecting aiosqlite~=0.21.0 (from crewai==1.13.0) -[2026-05-06T13:41:35.817Z] #9 0.989 Downloading aiosqlite-0.21.0-py3-none-any.whl.metadata (4.3 kB) -[2026-05-06T13:41:35.817Z] #9 1.002 Collecting appdirs~=1.4.4 (from crewai==1.13.0) -[2026-05-06T13:41:35.817Z] #9 1.005 Downloading appdirs-1.4.4-py2.py3-none-any.whl.metadata (9.0 kB) -[2026-05-06T13:41:35.817Z] #9 1.068 Collecting chromadb~=1.1.0 (from crewai==1.13.0) -[2026-05-06T13:41:35.817Z] #9 1.072 Downloading chromadb-1.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (7.2 kB) -[2026-05-06T13:41:35.817Z] #9 1.098 Collecting click~=8.1.7 (from crewai==1.13.0) -[2026-05-06T13:41:36.071Z] #9 1.101 Downloading click-8.1.8-py3-none-any.whl.metadata (2.3 kB) -[2026-05-06T13:41:36.071Z] #9 1.131 Collecting httpx~=0.28.1 (from crewai==1.13.0) -[2026-05-06T13:41:36.071Z] #9 1.134 Downloading httpx-0.28.1-py3-none-any.whl.metadata (7.1 kB) -[2026-05-06T13:41:36.071Z] #9 1.178 Collecting instructor>=1.3.3 (from crewai==1.13.0) -[2026-05-06T13:41:36.071Z] #9 1.182 Downloading instructor-1.15.1-py3-none-any.whl.metadata (12 kB) -[2026-05-06T13:41:36.071Z] #9 1.243 Collecting json-repair~=0.25.2 (from crewai==1.13.0) -[2026-05-06T13:41:36.071Z] #9 1.247 Downloading json_repair-0.25.3-py3-none-any.whl.metadata (7.9 kB) -[2026-05-06T13:41:36.071Z] #9 1.271 Collecting json5~=0.10.0 (from crewai==1.13.0) -[2026-05-06T13:41:36.071Z] #9 1.276 Downloading json5-0.10.0-py3-none-any.whl.metadata (34 kB) -[2026-05-06T13:41:36.071Z] #9 1.295 Collecting jsonref~=1.1.0 (from crewai==1.13.0) -[2026-05-06T13:41:36.071Z] #9 1.298 Downloading jsonref-1.1.0-py3-none-any.whl.metadata (2.7 kB) -[2026-05-06T13:41:36.071Z] #9 1.352 Collecting lancedb<0.30.1,>=0.29.2 (from crewai==1.13.0) -[2026-05-06T13:41:36.325Z] #9 1.356 Downloading lancedb-0.30.0-cp39-abi3-manylinux_2_28_x86_64.whl.metadata (5.0 kB) -[2026-05-06T13:41:36.325Z] #9 1.382 Collecting mcp~=1.26.0 (from crewai==1.13.0) -[2026-05-06T13:41:36.325Z] #9 1.386 Downloading mcp-1.26.0-py3-none-any.whl.metadata (89 kB) -[2026-05-06T13:41:36.325Z] #9 1.389 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 89.5/89.5 kB 306.9 MB/s eta 0:00:00 -[2026-05-06T13:41:36.325Z] #9 1.512 Collecting openai<3,>=1.83.0 (from crewai==1.13.0) -[2026-05-06T13:41:36.579Z] #9 1.515 Downloading openai-2.34.0-py3-none-any.whl.metadata (31 kB) -[2026-05-06T13:41:36.579Z] #9 1.542 Collecting openpyxl~=3.1.5 (from crewai==1.13.0) -[2026-05-06T13:41:36.579Z] #9 1.545 Downloading openpyxl-3.1.5-py2.py3-none-any.whl.metadata (2.5 kB) -[2026-05-06T13:41:36.579Z] #9 1.578 Collecting opentelemetry-api~=1.34.0 (from crewai==1.13.0) -[2026-05-06T13:41:36.579Z] #9 1.582 Downloading opentelemetry_api-1.34.1-py3-none-any.whl.metadata (1.5 kB) -[2026-05-06T13:41:36.579Z] #9 1.608 Collecting opentelemetry-exporter-otlp-proto-http~=1.34.0 (from crewai==1.13.0) -[2026-05-06T13:41:36.579Z] #9 1.612 Downloading opentelemetry_exporter_otlp_proto_http-1.34.1-py3-none-any.whl.metadata (2.3 kB) -[2026-05-06T13:41:36.579Z] #9 1.645 Collecting opentelemetry-sdk~=1.34.0 (from crewai==1.13.0) -[2026-05-06T13:41:36.579Z] #9 1.650 Downloading opentelemetry_sdk-1.34.1-py3-none-any.whl.metadata (1.6 kB) -[2026-05-06T13:41:36.579Z] #9 1.673 Collecting pdfplumber~=0.11.4 (from crewai==1.13.0) -[2026-05-06T13:41:36.579Z] #9 1.676 Downloading pdfplumber-0.11.9-py3-none-any.whl.metadata (43 kB) -[2026-05-06T13:41:36.579Z] #9 1.678 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 43.6/43.6 kB 279.9 MB/s eta 0:00:00 -[2026-05-06T13:41:36.579Z] #9 1.721 Collecting portalocker~=2.7.0 (from crewai==1.13.0) -[2026-05-06T13:41:36.579Z] #9 1.725 Downloading portalocker-2.7.0-py2.py3-none-any.whl.metadata (6.8 kB) -[2026-05-06T13:41:36.579Z] #9 1.748 Collecting pydantic-settings~=2.10.1 (from crewai==1.13.0) -[2026-05-06T13:41:36.833Z] #9 1.751 Downloading pydantic_settings-2.10.1-py3-none-any.whl.metadata (3.4 kB) -[2026-05-06T13:41:36.833Z] #9 1.925 Collecting pydantic~=2.11.9 (from crewai==1.13.0) -[2026-05-06T13:41:36.833Z] #9 1.928 Downloading pydantic-2.11.10-py3-none-any.whl.metadata (68 kB) -[2026-05-06T13:41:36.833Z] #9 1.931 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 68.6/68.6 kB 302.6 MB/s eta 0:00:00 -[2026-05-06T13:41:36.833Z] #9 1.956 Collecting pyjwt<3,>=2.9.0 (from crewai==1.13.0) -[2026-05-06T13:41:36.833Z] #9 1.960 Downloading pyjwt-2.12.1-py3-none-any.whl.metadata (4.1 kB) -[2026-05-06T13:41:36.833Z] #9 1.982 Collecting python-dotenv~=1.1.1 (from crewai==1.13.0) -[2026-05-06T13:41:36.833Z] #9 1.985 Downloading python_dotenv-1.1.1-py3-none-any.whl.metadata (24 kB) -[2026-05-06T13:41:36.833Z] #9 2.035 Collecting pyyaml~=6.0 (from crewai==1.13.0) -[2026-05-06T13:41:37.087Z] #9 2.038 Downloading pyyaml-6.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (2.4 kB) -[2026-05-06T13:41:37.341Z] #9 2.560 Collecting regex~=2026.1.15 (from crewai==1.13.0) -[2026-05-06T13:41:37.595Z] #9 2.564 Downloading regex-2026.1.15-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (40 kB) -[2026-05-06T13:41:37.595Z] #9 2.566 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.5/40.5 kB 265.6 MB/s eta 0:00:00 -[2026-05-06T13:41:37.595Z] #9 2.659 Collecting textual>=7.5.0 (from crewai==1.13.0) -[2026-05-06T13:41:37.595Z] #9 2.664 Downloading textual-8.2.5-py3-none-any.whl.metadata (9.1 kB) -[2026-05-06T13:41:37.596Z] #9 2.854 Collecting tokenizers<1,>=0.21 (from crewai==1.13.0) -[2026-05-06T13:41:37.850Z] #9 2.857 Downloading tokenizers-0.23.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (9.8 kB) -[2026-05-06T13:41:37.850Z] #9 2.873 Collecting tomli-w~=1.1.0 (from crewai==1.13.0) -[2026-05-06T13:41:37.850Z] #9 2.876 Downloading tomli_w-1.1.0-py3-none-any.whl.metadata (5.7 kB) -[2026-05-06T13:41:37.850Z] #9 2.909 Collecting tomli~=2.0.2 (from crewai==1.13.0) -[2026-05-06T13:41:37.850Z] #9 2.911 Downloading tomli-2.0.2-py3-none-any.whl.metadata (10.0 kB) -[2026-05-06T13:41:38.104Z] #9 3.332 Collecting uv~=0.9.13 (from crewai==1.13.0) -[2026-05-06T13:41:38.358Z] #9 3.337 Downloading uv-0.9.30-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (11 kB) -[2026-05-06T13:41:38.358Z] #9 3.375 Collecting typing_extensions>=4.0 (from aiosqlite~=0.21.0->crewai==1.13.0) -[2026-05-06T13:41:38.358Z] #9 3.378 Downloading typing_extensions-4.15.0-py3-none-any.whl.metadata (3.3 kB) -[2026-05-06T13:41:38.358Z] #9 3.424 Collecting build>=1.0.3 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:38.358Z] #9 3.427 Downloading build-1.5.0-py3-none-any.whl.metadata (5.7 kB) -[2026-05-06T13:41:38.358Z] #9 3.567 Collecting pybase64>=1.4.1 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:38.611Z] #9 3.570 Downloading pybase64-1.4.3-cp311-cp311-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl.metadata (8.7 kB) -[2026-05-06T13:41:38.611Z] #9 3.612 Collecting uvicorn>=0.18.3 (from uvicorn[standard]>=0.18.3->chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:38.611Z] #9 3.615 Downloading uvicorn-0.46.0-py3-none-any.whl.metadata (6.7 kB) -[2026-05-06T13:41:38.866Z] #9 3.940 Collecting numpy>=1.22.5 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:38.866Z] #9 3.944 Downloading numpy-2.4.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (6.6 kB) -[2026-05-06T13:41:38.866Z] #9 4.006 Collecting posthog<6.0.0,>=2.4.0 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:38.866Z] #9 4.010 Downloading posthog-5.4.0-py3-none-any.whl.metadata (5.7 kB) -[2026-05-06T13:41:38.866Z] #9 4.095 Collecting onnxruntime>=1.14.1 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:39.120Z] #9 4.099 Downloading onnxruntime-1.25.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (5.3 kB) -[2026-05-06T13:41:39.120Z] #9 4.134 Collecting opentelemetry-exporter-otlp-proto-grpc>=1.2.0 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:39.120Z] #9 4.137 Downloading opentelemetry_exporter_otlp_proto_grpc-1.41.1-py3-none-any.whl.metadata (2.6 kB) -[2026-05-06T13:41:39.120Z] #9 4.176 Collecting pypika>=0.48.9 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:39.120Z] #9 4.180 Downloading pypika-0.51.1-py2.py3-none-any.whl.metadata (51 kB) -[2026-05-06T13:41:39.120Z] #9 4.182 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 52.0/52.0 kB 226.1 MB/s eta 0:00:00 -[2026-05-06T13:41:39.120Z] #9 4.244 Collecting tqdm>=4.65.0 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:39.375Z] #9 4.248 Downloading tqdm-4.67.3-py3-none-any.whl.metadata (57 kB) -[2026-05-06T13:41:39.375Z] #9 4.250 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.7/57.7 kB 294.0 MB/s eta 0:00:00 -[2026-05-06T13:41:39.375Z] #9 4.274 Collecting overrides>=7.3.1 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:39.375Z] #9 4.277 Downloading overrides-7.7.0-py3-none-any.whl.metadata (5.8 kB) -[2026-05-06T13:41:39.375Z] #9 4.316 Collecting importlib-resources (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:39.375Z] #9 4.319 Downloading importlib_resources-7.1.0-py3-none-any.whl.metadata (4.0 kB) -[2026-05-06T13:41:39.933Z] #9 5.046 Collecting grpcio>=1.58.0 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:39.933Z] #9 5.050 Downloading grpcio-1.80.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (3.8 kB) -[2026-05-06T13:41:39.933Z] #9 5.106 Collecting bcrypt>=4.0.1 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:39.933Z] #9 5.109 Downloading bcrypt-5.0.0-cp39-abi3-manylinux_2_34_x86_64.whl.metadata (10 kB) -[2026-05-06T13:41:39.933Z] #9 5.145 Collecting typer>=0.9.0 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:39.933Z] #9 5.148 Downloading typer-0.25.1-py3-none-any.whl.metadata (15 kB) -[2026-05-06T13:41:40.187Z] #9 5.183 Collecting kubernetes>=28.1.0 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:40.188Z] #9 5.186 Downloading kubernetes-35.0.0-py2.py3-none-any.whl.metadata (1.7 kB) -[2026-05-06T13:41:40.188Z] #9 5.208 Collecting tenacity>=8.2.3 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:40.188Z] #9 5.211 Downloading tenacity-9.1.4-py3-none-any.whl.metadata (1.2 kB) -[2026-05-06T13:41:40.188Z] #9 5.272 Collecting mmh3>=4.0.1 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:40.188Z] #9 5.275 Downloading mmh3-5.2.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.metadata (14 kB) -[2026-05-06T13:41:40.442Z] #9 5.721 Collecting orjson>=3.9.12 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:40.695Z] #9 5.724 Downloading orjson-3.11.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (41 kB) -[2026-05-06T13:41:40.696Z] #9 5.726 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 42.0/42.0 kB 235.8 MB/s eta 0:00:00 -[2026-05-06T13:41:40.696Z] #9 5.812 Collecting rich>=10.11.0 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:40.696Z] #9 5.815 Downloading rich-15.0.0-py3-none-any.whl.metadata (18 kB) -[2026-05-06T13:41:40.696Z] #9 5.853 Collecting jsonschema>=4.19.0 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:40.696Z] #9 5.856 Downloading jsonschema-4.26.0-py3-none-any.whl.metadata (7.6 kB) -[2026-05-06T13:41:40.696Z] #9 5.901 Collecting anyio (from httpx~=0.28.1->crewai==1.13.0) -[2026-05-06T13:41:40.696Z] #9 5.904 Downloading anyio-4.13.0-py3-none-any.whl.metadata (4.5 kB) -[2026-05-06T13:41:40.696Z] #9 5.930 Collecting certifi (from httpx~=0.28.1->crewai==1.13.0) -[2026-05-06T13:41:40.696Z] #9 5.933 Downloading certifi-2026.4.22-py3-none-any.whl.metadata (2.5 kB) -[2026-05-06T13:41:40.696Z] #9 5.960 Collecting httpcore==1.* (from httpx~=0.28.1->crewai==1.13.0) -[2026-05-06T13:41:40.950Z] #9 5.963 Downloading httpcore-1.0.9-py3-none-any.whl.metadata (21 kB) -[2026-05-06T13:41:40.950Z] #9 5.982 Collecting idna (from httpx~=0.28.1->crewai==1.13.0) -[2026-05-06T13:41:40.950Z] #9 5.985 Downloading idna-3.13-py3-none-any.whl.metadata (8.0 kB) -[2026-05-06T13:41:40.950Z] #9 6.005 Collecting h11>=0.16 (from httpcore==1.*->httpx~=0.28.1->crewai==1.13.0) -[2026-05-06T13:41:40.950Z] #9 6.008 Downloading h11-0.16.0-py3-none-any.whl.metadata (8.3 kB) -[2026-05-06T13:41:41.871Z] #9 6.865 Collecting aiohttp<4.0.0,>=3.9.1 (from instructor>=1.3.3->crewai==1.13.0) -[2026-05-06T13:41:41.871Z] #9 6.868 Downloading aiohttp-3.13.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (8.1 kB) -[2026-05-06T13:41:41.871Z] #9 6.884 Collecting docstring-parser<1.0,>=0.16 (from instructor>=1.3.3->crewai==1.13.0) -[2026-05-06T13:41:41.871Z] #9 6.888 Downloading docstring_parser-0.18.0-py3-none-any.whl.metadata (3.5 kB) -[2026-05-06T13:41:41.871Z] #9 6.911 Collecting jinja2<4.0.0,>=3.1.4 (from instructor>=1.3.3->crewai==1.13.0) -[2026-05-06T13:41:41.871Z] #9 6.914 Downloading jinja2-3.1.6-py3-none-any.whl.metadata (2.9 kB) -[2026-05-06T13:41:41.871Z] #9 7.020 Collecting jiter<0.14,>=0.6.1 (from instructor>=1.3.3->crewai==1.13.0) -[2026-05-06T13:41:42.125Z] #9 7.024 Downloading jiter-0.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (5.2 kB) -[2026-05-06T13:41:43.046Z] #9 8.131 Collecting pydantic-core<3.0.0,>=2.18.0 (from instructor>=1.3.3->crewai==1.13.0) -[2026-05-06T13:41:43.046Z] #9 8.137 Downloading pydantic_core-2.46.4-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.6 kB) -[2026-05-06T13:41:43.046Z] #9 8.198 Collecting requests<3.0.0,>=2.32.3 (from instructor>=1.3.3->crewai==1.13.0) -[2026-05-06T13:41:43.047Z] #9 8.201 Downloading requests-2.33.1-py3-none-any.whl.metadata (4.8 kB) -[2026-05-06T13:41:43.047Z] #9 8.225 Collecting rich>=10.11.0 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:43.047Z] #9 8.228 Downloading rich-14.3.4-py3-none-any.whl.metadata (18 kB) -[2026-05-06T13:41:43.047Z] #9 8.317 Collecting deprecation>=2.1.0 (from lancedb<0.30.1,>=0.29.2->crewai==1.13.0) -[2026-05-06T13:41:43.301Z] #9 8.320 Downloading deprecation-2.1.0-py2.py3-none-any.whl.metadata (4.6 kB) -[2026-05-06T13:41:43.301Z] #9 8.359 Collecting packaging>=23.0 (from lancedb<0.30.1,>=0.29.2->crewai==1.13.0) -[2026-05-06T13:41:43.301Z] #9 8.362 Downloading packaging-26.2-py3-none-any.whl.metadata (3.5 kB) -[2026-05-06T13:41:43.301Z] #9 8.474 Collecting pyarrow>=16 (from lancedb<0.30.1,>=0.29.2->crewai==1.13.0) -[2026-05-06T13:41:43.555Z] #9 8.477 Downloading pyarrow-24.0.0-cp311-cp311-manylinux_2_28_x86_64.whl.metadata (3.0 kB) -[2026-05-06T13:41:43.555Z] #9 8.528 Collecting lance-namespace>=0.3.2 (from lancedb<0.30.1,>=0.29.2->crewai==1.13.0) -[2026-05-06T13:41:43.555Z] #9 8.532 Downloading lance_namespace-0.7.6-py3-none-any.whl.metadata (1.6 kB) -[2026-05-06T13:41:43.555Z] #9 8.568 Collecting httpx-sse>=0.4 (from mcp~=1.26.0->crewai==1.13.0) -[2026-05-06T13:41:43.555Z] #9 8.571 Downloading httpx_sse-0.4.3-py3-none-any.whl.metadata (9.7 kB) -[2026-05-06T13:41:43.555Z] #9 8.626 Collecting python-multipart>=0.0.9 (from mcp~=1.26.0->crewai==1.13.0) -[2026-05-06T13:41:43.555Z] #9 8.629 Downloading python_multipart-0.0.27-py3-none-any.whl.metadata (2.1 kB) -[2026-05-06T13:41:43.555Z] #9 8.658 Collecting sse-starlette>=1.6.1 (from mcp~=1.26.0->crewai==1.13.0) -[2026-05-06T13:41:43.555Z] #9 8.661 Downloading sse_starlette-3.4.1-py3-none-any.whl.metadata (15 kB) -[2026-05-06T13:41:43.555Z] #9 8.710 Collecting starlette>=0.27 (from mcp~=1.26.0->crewai==1.13.0) -[2026-05-06T13:41:43.555Z] #9 8.714 Downloading starlette-1.0.0-py3-none-any.whl.metadata (6.3 kB) -[2026-05-06T13:41:43.555Z] #9 8.732 Collecting typing-inspection>=0.4.1 (from mcp~=1.26.0->crewai==1.13.0) -[2026-05-06T13:41:43.809Z] #9 8.735 Downloading typing_inspection-0.4.2-py3-none-any.whl.metadata (2.6 kB) -[2026-05-06T13:41:43.809Z] #9 8.783 Collecting distro<2,>=1.7.0 (from openai<3,>=1.83.0->crewai==1.13.0) -[2026-05-06T13:41:43.809Z] #9 8.786 Downloading distro-1.9.0-py3-none-any.whl.metadata (6.8 kB) -[2026-05-06T13:41:43.809Z] #9 8.806 Collecting sniffio (from openai<3,>=1.83.0->crewai==1.13.0) -[2026-05-06T13:41:43.809Z] #9 8.809 Downloading sniffio-1.3.1-py3-none-any.whl.metadata (3.9 kB) -[2026-05-06T13:41:43.809Z] #9 8.848 Collecting et-xmlfile (from openpyxl~=3.1.5->crewai==1.13.0) -[2026-05-06T13:41:43.809Z] #9 8.851 Downloading et_xmlfile-2.0.0-py3-none-any.whl.metadata (2.7 kB) -[2026-05-06T13:41:43.809Z] #9 8.916 Collecting importlib-metadata<8.8.0,>=6.0 (from opentelemetry-api~=1.34.0->crewai==1.13.0) -[2026-05-06T13:41:43.809Z] #9 8.919 Downloading importlib_metadata-8.7.1-py3-none-any.whl.metadata (4.7 kB) -[2026-05-06T13:41:43.809Z] #9 8.957 Collecting googleapis-common-protos~=1.52 (from opentelemetry-exporter-otlp-proto-http~=1.34.0->crewai==1.13.0) -[2026-05-06T13:41:44.063Z] #9 8.960 Downloading googleapis_common_protos-1.74.0-py3-none-any.whl.metadata (9.2 kB) -[2026-05-06T13:41:44.063Z] #9 8.986 Collecting opentelemetry-exporter-otlp-proto-common==1.34.1 (from opentelemetry-exporter-otlp-proto-http~=1.34.0->crewai==1.13.0) -[2026-05-06T13:41:44.063Z] #9 8.990 Downloading opentelemetry_exporter_otlp_proto_common-1.34.1-py3-none-any.whl.metadata (1.9 kB) -[2026-05-06T13:41:44.063Z] #9 9.020 Collecting opentelemetry-proto==1.34.1 (from opentelemetry-exporter-otlp-proto-http~=1.34.0->crewai==1.13.0) -[2026-05-06T13:41:44.063Z] #9 9.024 Downloading opentelemetry_proto-1.34.1-py3-none-any.whl.metadata (2.4 kB) -[2026-05-06T13:41:44.063Z] #9 9.280 Collecting protobuf<6.0,>=5.0 (from opentelemetry-proto==1.34.1->opentelemetry-exporter-otlp-proto-http~=1.34.0->crewai==1.13.0) -[2026-05-06T13:41:44.316Z] #9 9.284 Downloading protobuf-5.29.6-cp38-abi3-manylinux2014_x86_64.whl.metadata (592 bytes) -[2026-05-06T13:41:44.317Z] #9 9.323 Collecting opentelemetry-semantic-conventions==0.55b1 (from opentelemetry-sdk~=1.34.0->crewai==1.13.0) -[2026-05-06T13:41:44.317Z] #9 9.326 Downloading opentelemetry_semantic_conventions-0.55b1-py3-none-any.whl.metadata (2.5 kB) -[2026-05-06T13:41:44.317Z] #9 9.359 Collecting pdfminer.six==20251230 (from pdfplumber~=0.11.4->crewai==1.13.0) -[2026-05-06T13:41:44.317Z] #9 9.362 Downloading pdfminer_six-20251230-py3-none-any.whl.metadata (4.3 kB) -[2026-05-06T13:41:44.570Z] #9 9.607 Collecting Pillow>=9.1 (from pdfplumber~=0.11.4->crewai==1.13.0) -[2026-05-06T13:41:44.570Z] #9 9.611 Downloading pillow-12.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.metadata (8.8 kB) -[2026-05-06T13:41:44.570Z] #9 9.745 Collecting pypdfium2>=4.18.0 (from pdfplumber~=0.11.4->crewai==1.13.0) -[2026-05-06T13:41:44.824Z] #9 9.749 Downloading pypdfium2-5.8.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (68 kB) -[2026-05-06T13:41:44.824Z] #9 9.751 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 68.4/68.4 kB 274.9 MB/s eta 0:00:00 -[2026-05-06T13:41:44.824Z] #9 10.10 Collecting charset-normalizer>=2.0.0 (from pdfminer.six==20251230->pdfplumber~=0.11.4->crewai==1.13.0) -[2026-05-06T13:41:45.078Z] #9 10.10 Downloading charset_normalizer-3.4.7-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (40 kB) -[2026-05-06T13:41:45.078Z] #9 10.10 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 40.9/40.9 kB 269.7 MB/s eta 0:00:00 -[2026-05-06T13:41:45.332Z] #9 10.40 Collecting cryptography>=36.0.0 (from pdfminer.six==20251230->pdfplumber~=0.11.4->crewai==1.13.0) -[2026-05-06T13:41:45.332Z] #9 10.40 Downloading cryptography-48.0.0-cp311-abi3-manylinux_2_34_x86_64.whl.metadata (4.3 kB) -[2026-05-06T13:41:45.332Z] #9 10.44 Collecting annotated-types>=0.6.0 (from pydantic~=2.11.9->crewai==1.13.0) -[2026-05-06T13:41:45.332Z] #9 10.44 Downloading annotated_types-0.7.0-py3-none-any.whl.metadata (15 kB) -[2026-05-06T13:41:45.332Z] #9 10.46 Collecting pydantic-core<3.0.0,>=2.18.0 (from instructor>=1.3.3->crewai==1.13.0) -[2026-05-06T13:41:45.333Z] #9 10.46 Downloading pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (6.8 kB) -[2026-05-06T13:41:45.586Z] #9 10.63 Collecting markdown-it-py>=2.1.0 (from markdown-it-py[linkify]>=2.1.0->textual>=7.5.0->crewai==1.13.0) -[2026-05-06T13:41:45.586Z] #9 10.63 Downloading markdown_it_py-4.0.0-py3-none-any.whl.metadata (7.3 kB) -[2026-05-06T13:41:45.586Z] #9 10.65 Collecting mdit-py-plugins (from textual>=7.5.0->crewai==1.13.0) -[2026-05-06T13:41:45.586Z] #9 10.65 Downloading mdit_py_plugins-0.5.0-py3-none-any.whl.metadata (2.8 kB) -[2026-05-06T13:41:45.586Z] #9 10.68 Collecting platformdirs<5,>=3.6.0 (from textual>=7.5.0->crewai==1.13.0) -[2026-05-06T13:41:45.586Z] #9 10.69 Downloading platformdirs-4.9.6-py3-none-any.whl.metadata (4.7 kB) -[2026-05-06T13:41:45.586Z] #9 10.72 Collecting pygments<3.0.0,>=2.19.2 (from textual>=7.5.0->crewai==1.13.0) -[2026-05-06T13:41:45.586Z] #9 10.72 Downloading pygments-2.20.0-py3-none-any.whl.metadata (2.5 kB) -[2026-05-06T13:41:45.586Z] #9 10.85 Collecting huggingface-hub<2.0,>=0.16.4 (from tokenizers<1,>=0.21->crewai==1.13.0) -[2026-05-06T13:41:45.840Z] #9 10.86 Downloading huggingface_hub-1.13.0-py3-none-any.whl.metadata (14 kB) -[2026-05-06T13:41:45.840Z] #9 10.92 Collecting aiohappyeyeballs>=2.5.0 (from aiohttp<4.0.0,>=3.9.1->instructor>=1.3.3->crewai==1.13.0) -[2026-05-06T13:41:45.840Z] #9 10.93 Downloading aiohappyeyeballs-2.6.1-py3-none-any.whl.metadata (5.9 kB) -[2026-05-06T13:41:45.841Z] #9 10.94 Collecting aiosignal>=1.4.0 (from aiohttp<4.0.0,>=3.9.1->instructor>=1.3.3->crewai==1.13.0) -[2026-05-06T13:41:45.841Z] #9 10.94 Downloading aiosignal-1.4.0-py3-none-any.whl.metadata (3.7 kB) -[2026-05-06T13:41:45.841Z] #9 10.96 Collecting attrs>=17.3.0 (from aiohttp<4.0.0,>=3.9.1->instructor>=1.3.3->crewai==1.13.0) -[2026-05-06T13:41:46.095Z] #9 10.97 Downloading attrs-26.1.0-py3-none-any.whl.metadata (8.8 kB) -[2026-05-06T13:41:46.095Z] #9 11.06 Collecting frozenlist>=1.1.1 (from aiohttp<4.0.0,>=3.9.1->instructor>=1.3.3->crewai==1.13.0) -[2026-05-06T13:41:46.095Z] #9 11.06 Downloading frozenlist-1.8.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.metadata (20 kB) -[2026-05-06T13:41:46.095Z] #9 11.37 Collecting multidict<7.0,>=4.5 (from aiohttp<4.0.0,>=3.9.1->instructor>=1.3.3->crewai==1.13.0) -[2026-05-06T13:41:46.348Z] #9 11.38 Downloading multidict-6.7.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (5.3 kB) -[2026-05-06T13:41:46.348Z] #9 11.45 Collecting propcache>=0.2.0 (from aiohttp<4.0.0,>=3.9.1->instructor>=1.3.3->crewai==1.13.0) -[2026-05-06T13:41:46.348Z] #9 11.45 Downloading propcache-0.4.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (13 kB) -[2026-05-06T13:41:46.602Z] #9 11.78 Collecting yarl<2.0,>=1.17.0 (from aiohttp<4.0.0,>=3.9.1->instructor>=1.3.3->crewai==1.13.0) -[2026-05-06T13:41:46.856Z] #9 11.79 Downloading yarl-1.23.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (79 kB) -[2026-05-06T13:41:46.856Z] #9 11.79 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 79.6/79.6 kB 289.8 MB/s eta 0:00:00 -[2026-05-06T13:41:46.856Z] #9 11.86 Collecting pyproject_hooks (from build>=1.0.3->chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:46.856Z] #9 11.87 Downloading pyproject_hooks-1.2.0-py3-none-any.whl.metadata (1.3 kB) -[2026-05-06T13:41:46.856Z] #9 12.09 Collecting filelock>=3.10.0 (from huggingface-hub<2.0,>=0.16.4->tokenizers<1,>=0.21->crewai==1.13.0) -[2026-05-06T13:41:47.110Z] #9 12.09 Downloading filelock-3.29.0-py3-none-any.whl.metadata (2.0 kB) -[2026-05-06T13:41:47.110Z] #9 12.13 Collecting fsspec>=2023.5.0 (from huggingface-hub<2.0,>=0.16.4->tokenizers<1,>=0.21->crewai==1.13.0) -[2026-05-06T13:41:47.110Z] #9 12.13 Downloading fsspec-2026.4.0-py3-none-any.whl.metadata (10 kB) -[2026-05-06T13:41:47.110Z] #9 12.18 Collecting hf-xet<2.0.0,>=1.4.3 (from huggingface-hub<2.0,>=0.16.4->tokenizers<1,>=0.21->crewai==1.13.0) -[2026-05-06T13:41:47.110Z] #9 12.18 Downloading hf_xet-1.5.0-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (4.9 kB) -[2026-05-06T13:41:47.110Z] #9 12.27 Collecting zipp>=3.20 (from importlib-metadata<8.8.0,>=6.0->opentelemetry-api~=1.34.0->crewai==1.13.0) -[2026-05-06T13:41:47.364Z] #9 12.28 Downloading zipp-3.23.1-py3-none-any.whl.metadata (3.6 kB) -[2026-05-06T13:41:47.364Z] #9 12.35 Collecting MarkupSafe>=2.0 (from jinja2<4.0.0,>=3.1.4->instructor>=1.3.3->crewai==1.13.0) -[2026-05-06T13:41:47.364Z] #9 12.36 Downloading markupsafe-3.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (2.7 kB) -[2026-05-06T13:41:47.364Z] #9 12.41 Collecting jsonschema-specifications>=2023.03.6 (from jsonschema>=4.19.0->chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:47.364Z] #9 12.42 Downloading jsonschema_specifications-2025.9.1-py3-none-any.whl.metadata (2.9 kB) -[2026-05-06T13:41:47.364Z] #9 12.45 Collecting referencing>=0.28.4 (from jsonschema>=4.19.0->chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:47.365Z] #9 12.46 Downloading referencing-0.37.0-py3-none-any.whl.metadata (2.8 kB) -[2026-05-06T13:41:47.922Z] #9 13.06 Collecting rpds-py>=0.25.0 (from jsonschema>=4.19.0->chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:47.922Z] #9 13.06 Downloading rpds_py-0.30.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.1 kB) -[2026-05-06T13:41:47.923Z] #9 13.10 Collecting six>=1.9.0 (from kubernetes>=28.1.0->chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:47.923Z] #9 13.11 Downloading six-1.17.0-py2.py3-none-any.whl.metadata (1.7 kB) -[2026-05-06T13:41:47.923Z] #9 13.13 Collecting python-dateutil>=2.5.3 (from kubernetes>=28.1.0->chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:47.923Z] #9 13.13 Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl.metadata (8.4 kB) -[2026-05-06T13:41:47.923Z] #9 13.17 Collecting websocket-client!=0.40.0,!=0.41.*,!=0.42.*,>=0.32.0 (from kubernetes>=28.1.0->chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:48.177Z] #9 13.17 Downloading websocket_client-1.9.0-py3-none-any.whl.metadata (8.3 kB) -[2026-05-06T13:41:48.177Z] #9 13.19 Collecting requests-oauthlib (from kubernetes>=28.1.0->chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:48.177Z] #9 13.19 Downloading requests_oauthlib-2.0.0-py2.py3-none-any.whl.metadata (11 kB) -[2026-05-06T13:41:48.177Z] #9 13.24 Collecting urllib3!=2.6.0,>=1.24.2 (from kubernetes>=28.1.0->chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:48.177Z] #9 13.24 Downloading urllib3-2.6.3-py3-none-any.whl.metadata (6.9 kB) -[2026-05-06T13:41:48.177Z] #9 13.26 Collecting durationpy>=0.7 (from kubernetes>=28.1.0->chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:48.177Z] #9 13.26 Downloading durationpy-0.10-py3-none-any.whl.metadata (340 bytes) -[2026-05-06T13:41:48.177Z] #9 13.30 Collecting lance-namespace-urllib3-client==0.7.6 (from lance-namespace>=0.3.2->lancedb<0.30.1,>=0.29.2->crewai==1.13.0) -[2026-05-06T13:41:48.177Z] #9 13.30 Downloading lance_namespace_urllib3_client-0.7.6-py3-none-any.whl.metadata (28 kB) -[2026-05-06T13:41:48.177Z] #9 13.40 Collecting mdurl~=0.1 (from markdown-it-py>=2.1.0->markdown-it-py[linkify]>=2.1.0->textual>=7.5.0->crewai==1.13.0) -[2026-05-06T13:41:48.431Z] #9 13.41 Downloading mdurl-0.1.2-py3-none-any.whl.metadata (1.6 kB) -[2026-05-06T13:41:48.431Z] #9 13.45 Collecting linkify-it-py<3,>=1 (from markdown-it-py[linkify]>=2.1.0->textual>=7.5.0->crewai==1.13.0) -[2026-05-06T13:41:48.431Z] #9 13.45 Downloading linkify_it_py-2.1.0-py3-none-any.whl.metadata (8.5 kB) -[2026-05-06T13:41:48.431Z] #9 13.52 Collecting flatbuffers (from onnxruntime>=1.14.1->chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:48.431Z] #9 13.52 Downloading flatbuffers-25.12.19-py2.py3-none-any.whl.metadata (1.0 kB) -[2026-05-06T13:41:48.431Z] #9 13.57 INFO: pip is looking at multiple versions of opentelemetry-exporter-otlp-proto-grpc to determine which version is compatible with other requirements. This could take a while. -[2026-05-06T13:41:48.431Z] #9 13.58 Collecting opentelemetry-exporter-otlp-proto-grpc>=1.2.0 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:48.431Z] #9 13.58 Downloading opentelemetry_exporter_otlp_proto_grpc-1.41.0-py3-none-any.whl.metadata (2.6 kB) -[2026-05-06T13:41:48.431Z] #9 13.60 Downloading opentelemetry_exporter_otlp_proto_grpc-1.40.0-py3-none-any.whl.metadata (2.6 kB) -[2026-05-06T13:41:48.431Z] #9 13.62 Downloading opentelemetry_exporter_otlp_proto_grpc-1.39.1-py3-none-any.whl.metadata (2.5 kB) -[2026-05-06T13:41:48.685Z] #9 13.64 Downloading opentelemetry_exporter_otlp_proto_grpc-1.39.0-py3-none-any.whl.metadata (2.5 kB) -[2026-05-06T13:41:48.685Z] #9 13.66 Downloading opentelemetry_exporter_otlp_proto_grpc-1.38.0-py3-none-any.whl.metadata (2.4 kB) -[2026-05-06T13:41:48.685Z] #9 13.68 Downloading opentelemetry_exporter_otlp_proto_grpc-1.37.0-py3-none-any.whl.metadata (2.4 kB) -[2026-05-06T13:41:48.685Z] #9 13.70 Downloading opentelemetry_exporter_otlp_proto_grpc-1.36.0-py3-none-any.whl.metadata (2.4 kB) -[2026-05-06T13:41:48.685Z] #9 13.70 INFO: pip is still looking at multiple versions of opentelemetry-exporter-otlp-proto-grpc to determine which version is compatible with other requirements. This could take a while. -[2026-05-06T13:41:48.685Z] #9 13.72 Downloading opentelemetry_exporter_otlp_proto_grpc-1.35.0-py3-none-any.whl.metadata (2.4 kB) -[2026-05-06T13:41:48.685Z] #9 13.73 Downloading opentelemetry_exporter_otlp_proto_grpc-1.34.1-py3-none-any.whl.metadata (2.4 kB) -[2026-05-06T13:41:48.685Z] #9 13.90 Collecting backoff>=1.10.0 (from posthog<6.0.0,>=2.4.0->chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:48.939Z] #9 13.90 Downloading backoff-2.2.1-py3-none-any.whl.metadata (14 kB) -[2026-05-06T13:41:48.939Z] #9 14.23 INFO: pip is looking at multiple versions of typer to determine which version is compatible with other requirements. This could take a while. -[2026-05-06T13:41:49.193Z] #9 14.23 Collecting typer>=0.9.0 (from chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:49.193Z] #9 14.24 Downloading typer-0.25.0-py3-none-any.whl.metadata (15 kB) -[2026-05-06T13:41:49.193Z] #9 14.25 Downloading typer-0.24.2-py3-none-any.whl.metadata (15 kB) -[2026-05-06T13:41:49.193Z] #9 14.26 Downloading typer-0.24.1-py3-none-any.whl.metadata (16 kB) -[2026-05-06T13:41:49.193Z] #9 14.28 Downloading typer-0.24.0-py3-none-any.whl.metadata (16 kB) -[2026-05-06T13:41:49.193Z] #9 14.29 Downloading typer-0.23.2-py3-none-any.whl.metadata (16 kB) -[2026-05-06T13:41:49.193Z] #9 14.30 Downloading typer-0.23.1-py3-none-any.whl.metadata (16 kB) -[2026-05-06T13:41:49.193Z] #9 14.33 Collecting shellingham>=1.3.0 (from typer>=0.9.0->chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:49.448Z] #9 14.34 Downloading shellingham-1.5.4-py2.py3-none-any.whl.metadata (3.5 kB) -[2026-05-06T13:41:49.448Z] #9 14.35 Collecting annotated-doc>=0.0.2 (from typer>=0.9.0->chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:49.448Z] #9 14.35 Downloading annotated_doc-0.0.4-py3-none-any.whl.metadata (6.6 kB) -[2026-05-06T13:41:49.448Z] #9 14.49 Collecting httptools>=0.6.3 (from uvicorn[standard]>=0.18.3->chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:49.448Z] #9 14.49 Downloading httptools-0.7.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.metadata (3.5 kB) -[2026-05-06T13:41:49.448Z] #9 14.55 Collecting uvloop>=0.15.1 (from uvicorn[standard]>=0.18.3->chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:49.448Z] #9 14.55 Downloading uvloop-0.22.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl.metadata (4.9 kB) -[2026-05-06T13:41:49.448Z] #9 14.64 Collecting watchfiles>=0.20 (from uvicorn[standard]>=0.18.3->chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:49.702Z] #9 14.65 Downloading watchfiles-1.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (4.9 kB) -[2026-05-06T13:41:49.702Z] #9 14.76 Collecting websockets>=10.4 (from uvicorn[standard]>=0.18.3->chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:49.702Z] #9 14.77 Downloading websockets-16.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl.metadata (6.8 kB) -[2026-05-06T13:41:49.956Z] #9 15.11 Collecting cffi>=2.0.0 (from cryptography>=36.0.0->pdfminer.six==20251230->pdfplumber~=0.11.4->crewai==1.13.0) -[2026-05-06T13:41:50.210Z] #9 15.11 Downloading cffi-2.0.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl.metadata (2.6 kB) -[2026-05-06T13:41:50.210Z] #9 15.37 Collecting uc-micro-py (from linkify-it-py<3,>=1->markdown-it-py[linkify]>=2.1.0->textual>=7.5.0->crewai==1.13.0) -[2026-05-06T13:41:50.464Z] #9 15.37 Downloading uc_micro_py-2.0.0-py3-none-any.whl.metadata (2.2 kB) -[2026-05-06T13:41:50.718Z] #9 15.85 Collecting oauthlib>=3.0.0 (from requests-oauthlib->kubernetes>=28.1.0->chromadb~=1.1.0->crewai==1.13.0) -[2026-05-06T13:41:50.972Z] #9 15.86 Downloading oauthlib-3.3.1-py3-none-any.whl.metadata (7.9 kB) -[2026-05-06T13:41:50.972Z] #9 15.91 Collecting pycparser (from cffi>=2.0.0->cryptography>=36.0.0->pdfminer.six==20251230->pdfplumber~=0.11.4->crewai==1.13.0) -[2026-05-06T13:41:50.972Z] #9 15.91 Downloading pycparser-3.0-py3-none-any.whl.metadata (8.2 kB) -[2026-05-06T13:41:50.972Z] #9 16.01 Downloading crewai-1.13.0-py3-none-any.whl (1.0 MB) -[2026-05-06T13:41:50.972Z] #9 16.02 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.0/1.0 MB 150.8 MB/s eta 0:00:00 -[2026-05-06T13:41:50.972Z] #9 16.03 Downloading aiosqlite-0.21.0-py3-none-any.whl (15 kB) -[2026-05-06T13:41:50.972Z] #9 16.03 Downloading appdirs-1.4.4-py2.py3-none-any.whl (9.6 kB) -[2026-05-06T13:41:50.972Z] #9 16.04 Downloading chromadb-1.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (19.9 MB) -[2026-05-06T13:41:51.480Z] #9 16.40 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 19.9/19.9 MB 93.1 MB/s eta 0:00:00 -[2026-05-06T13:41:51.480Z] #9 16.40 Downloading click-8.1.8-py3-none-any.whl (98 kB) -[2026-05-06T13:41:51.480Z] #9 16.40 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 98.2/98.2 kB 344.4 MB/s eta 0:00:00 -[2026-05-06T13:41:51.480Z] #9 16.41 Downloading httpx-0.28.1-py3-none-any.whl (73 kB) -[2026-05-06T13:41:51.480Z] #9 16.41 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 73.5/73.5 kB 330.3 MB/s eta 0:00:00 -[2026-05-06T13:41:51.480Z] #9 16.41 Downloading httpcore-1.0.9-py3-none-any.whl (78 kB) -[2026-05-06T13:41:51.480Z] #9 16.41 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.8/78.8 kB 305.6 MB/s eta 0:00:00 -[2026-05-06T13:41:51.480Z] #9 16.42 Downloading instructor-1.15.1-py3-none-any.whl (178 kB) -[2026-05-06T13:41:51.480Z] #9 16.42 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 178.2/178.2 kB 389.1 MB/s eta 0:00:00 -[2026-05-06T13:41:51.480Z] #9 16.42 Downloading json_repair-0.25.3-py3-none-any.whl (12 kB) -[2026-05-06T13:41:51.480Z] #9 16.43 Downloading json5-0.10.0-py3-none-any.whl (34 kB) -[2026-05-06T13:41:51.480Z] #9 16.43 Downloading jsonref-1.1.0-py3-none-any.whl (9.4 kB) -[2026-05-06T13:41:51.480Z] #9 16.43 Downloading lancedb-0.30.0-cp39-abi3-manylinux_2_28_x86_64.whl (46.9 MB) -[2026-05-06T13:41:53.091Z] #9 17.93 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 46.9/46.9 MB 30.4 MB/s eta 0:00:00 -[2026-05-06T13:41:53.091Z] #9 17.94 Downloading mcp-1.26.0-py3-none-any.whl (233 kB) -[2026-05-06T13:41:53.091Z] #9 17.94 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 233.6/233.6 kB 360.6 MB/s eta 0:00:00 -[2026-05-06T13:41:53.091Z] #9 17.94 Downloading openai-2.34.0-py3-none-any.whl (1.3 MB) -[2026-05-06T13:41:53.091Z] #9 17.96 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.3/1.3 MB 87.4 MB/s eta 0:00:00 -[2026-05-06T13:41:53.091Z] #9 17.96 Downloading openpyxl-3.1.5-py2.py3-none-any.whl (250 kB) -[2026-05-06T13:41:53.091Z] #9 17.97 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 250.9/250.9 kB 376.0 MB/s eta 0:00:00 -[2026-05-06T13:41:53.091Z] #9 17.97 Downloading opentelemetry_api-1.34.1-py3-none-any.whl (65 kB) -[2026-05-06T13:41:53.091Z] #9 17.97 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 65.8/65.8 kB 305.5 MB/s eta 0:00:00 -[2026-05-06T13:41:53.091Z] #9 17.97 Downloading opentelemetry_exporter_otlp_proto_http-1.34.1-py3-none-any.whl (17 kB) -[2026-05-06T13:41:53.091Z] #9 17.98 Downloading opentelemetry_exporter_otlp_proto_common-1.34.1-py3-none-any.whl (18 kB) -[2026-05-06T13:41:53.091Z] #9 17.98 Downloading opentelemetry_proto-1.34.1-py3-none-any.whl (55 kB) -[2026-05-06T13:41:53.091Z] #9 17.98 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 55.7/55.7 kB 299.7 MB/s eta 0:00:00 -[2026-05-06T13:41:53.091Z] #9 17.99 Downloading opentelemetry_sdk-1.34.1-py3-none-any.whl (118 kB) -[2026-05-06T13:41:53.091Z] #9 17.99 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 118.5/118.5 kB 330.3 MB/s eta 0:00:00 -[2026-05-06T13:41:53.091Z] #9 17.99 Downloading opentelemetry_semantic_conventions-0.55b1-py3-none-any.whl (196 kB) -[2026-05-06T13:41:53.091Z] #9 17.99 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 196.2/196.2 kB 382.5 MB/s eta 0:00:00 -[2026-05-06T13:41:53.091Z] #9 18.00 Downloading pdfplumber-0.11.9-py3-none-any.whl (60 kB) -[2026-05-06T13:41:53.091Z] #9 18.00 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.0/60.0 kB 277.1 MB/s eta 0:00:00 -[2026-05-06T13:41:53.091Z] #9 18.00 Downloading pdfminer_six-20251230-py3-none-any.whl (6.6 MB) -[2026-05-06T13:41:53.599Z] #9 18.46 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.6/6.6 MB 14.4 MB/s eta 0:00:00 -[2026-05-06T13:41:53.599Z] #9 18.47 Downloading portalocker-2.7.0-py2.py3-none-any.whl (15 kB) -[2026-05-06T13:41:53.599Z] #9 18.47 Downloading pydantic-2.11.10-py3-none-any.whl (444 kB) -[2026-05-06T13:41:53.599Z] #9 18.48 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 444.8/444.8 kB 87.4 MB/s eta 0:00:00 -[2026-05-06T13:41:53.599Z] #9 18.48 Downloading pydantic_core-2.33.2-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (2.0 MB) -[2026-05-06T13:41:53.599Z] #9 18.50 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 124.6 MB/s eta 0:00:00 -[2026-05-06T13:41:53.599Z] #9 18.51 Downloading pydantic_settings-2.10.1-py3-none-any.whl (45 kB) -[2026-05-06T13:41:53.599Z] #9 18.51 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 45.2/45.2 kB 264.4 MB/s eta 0:00:00 -[2026-05-06T13:41:53.599Z] #9 18.51 Downloading pyjwt-2.12.1-py3-none-any.whl (29 kB) -[2026-05-06T13:41:53.599Z] #9 18.51 Downloading python_dotenv-1.1.1-py3-none-any.whl (20 kB) -[2026-05-06T13:41:53.599Z] #9 18.52 Downloading pyyaml-6.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (806 kB) -[2026-05-06T13:41:53.600Z] #9 18.52 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 806.6/806.6 kB 197.6 MB/s eta 0:00:00 -[2026-05-06T13:41:53.600Z] #9 18.53 Downloading regex-2026.1.15-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (800 kB) -[2026-05-06T13:41:53.600Z] #9 18.55 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 800.5/800.5 kB 40.4 MB/s eta 0:00:00 -[2026-05-06T13:41:53.600Z] #9 18.55 Downloading textual-8.2.5-py3-none-any.whl (727 kB) -[2026-05-06T13:41:53.600Z] #9 18.56 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 727.0/727.0 kB 228.3 MB/s eta 0:00:00 -[2026-05-06T13:41:53.600Z] #9 18.56 Downloading tokenizers-0.23.1-cp310-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.3 MB) -[2026-05-06T13:41:53.853Z] #9 18.81 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.3/3.3 MB 13.8 MB/s eta 0:00:00 -[2026-05-06T13:41:53.854Z] #9 18.81 Downloading tomli-2.0.2-py3-none-any.whl (13 kB) -[2026-05-06T13:41:53.854Z] #9 18.81 Downloading tomli_w-1.1.0-py3-none-any.whl (6.4 kB) -[2026-05-06T13:41:53.854Z] #9 18.82 Downloading uv-0.9.30-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (22.8 MB) -[2026-05-06T13:41:54.712Z] #9 19.60 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 22.8/22.8 MB 37.8 MB/s eta 0:00:00 -[2026-05-06T13:41:54.712Z] #9 19.61 Downloading aiohttp-3.13.5-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (1.8 MB) -[2026-05-06T13:41:54.966Z] #9 19.83 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.8/1.8 MB 7.8 MB/s eta 0:00:00 -[2026-05-06T13:41:54.966Z] #9 19.84 Downloading annotated_types-0.7.0-py3-none-any.whl (13 kB) -[2026-05-06T13:41:54.966Z] #9 19.84 Downloading anyio-4.13.0-py3-none-any.whl (114 kB) -[2026-05-06T13:41:54.966Z] #9 19.84 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 114.4/114.4 kB 356.6 MB/s eta 0:00:00 -[2026-05-06T13:41:54.966Z] #9 19.85 Downloading bcrypt-5.0.0-cp39-abi3-manylinux_2_34_x86_64.whl (278 kB) -[2026-05-06T13:41:54.966Z] #9 19.85 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 278.2/278.2 kB 344.2 MB/s eta 0:00:00 -[2026-05-06T13:41:54.966Z] #9 19.85 Downloading build-1.5.0-py3-none-any.whl (26 kB) -[2026-05-06T13:41:54.966Z] #9 19.86 Downloading deprecation-2.1.0-py2.py3-none-any.whl (11 kB) -[2026-05-06T13:41:54.966Z] #9 19.86 Downloading distro-1.9.0-py3-none-any.whl (20 kB) -[2026-05-06T13:41:54.966Z] #9 19.86 Downloading docstring_parser-0.18.0-py3-none-any.whl (22 kB) -[2026-05-06T13:41:54.966Z] #9 19.87 Downloading googleapis_common_protos-1.74.0-py3-none-any.whl (300 kB) -[2026-05-06T13:41:54.966Z] #9 19.87 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 300.7/300.7 kB 388.6 MB/s eta 0:00:00 -[2026-05-06T13:41:54.966Z] #9 19.87 Downloading grpcio-1.80.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (6.8 MB) -[2026-05-06T13:41:55.220Z] #9 20.17 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 6.8/6.8 MB 23.4 MB/s eta 0:00:00 -[2026-05-06T13:41:55.220Z] #9 20.17 Downloading httpx_sse-0.4.3-py3-none-any.whl (9.0 kB) -[2026-05-06T13:41:55.220Z] #9 20.17 Downloading huggingface_hub-1.13.0-py3-none-any.whl (660 kB) -[2026-05-06T13:41:55.220Z] #9 20.18 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 660.6/660.6 kB 359.8 MB/s eta 0:00:00 -[2026-05-06T13:41:55.220Z] #9 20.18 Downloading idna-3.13-py3-none-any.whl (68 kB) -[2026-05-06T13:41:55.220Z] #9 20.18 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 68.6/68.6 kB 321.4 MB/s eta 0:00:00 -[2026-05-06T13:41:55.220Z] #9 20.19 Downloading importlib_metadata-8.7.1-py3-none-any.whl (27 kB) -[2026-05-06T13:41:55.220Z] #9 20.19 Downloading jinja2-3.1.6-py3-none-any.whl (134 kB) -[2026-05-06T13:41:55.220Z] #9 20.19 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 134.9/134.9 kB 358.9 MB/s eta 0:00:00 -[2026-05-06T13:41:55.220Z] #9 20.20 Downloading jiter-0.13.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (362 kB) -[2026-05-06T13:41:55.220Z] #9 20.20 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 362.7/362.7 kB 282.7 MB/s eta 0:00:00 -[2026-05-06T13:41:55.220Z] #9 20.20 Downloading jsonschema-4.26.0-py3-none-any.whl (90 kB) -[2026-05-06T13:41:55.220Z] #9 20.20 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 90.6/90.6 kB 337.3 MB/s eta 0:00:00 -[2026-05-06T13:41:55.220Z] #9 20.21 Downloading kubernetes-35.0.0-py2.py3-none-any.whl (2.0 MB) -[2026-05-06T13:41:55.220Z] #9 20.22 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2.0/2.0 MB 285.6 MB/s eta 0:00:00 -[2026-05-06T13:41:55.220Z] #9 20.22 Downloading certifi-2026.4.22-py3-none-any.whl (135 kB) -[2026-05-06T13:41:55.220Z] #9 20.22 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 135.7/135.7 kB 369.8 MB/s eta 0:00:00 -[2026-05-06T13:41:55.220Z] #9 20.23 Downloading lance_namespace-0.7.6-py3-none-any.whl (12 kB) -[2026-05-06T13:41:55.220Z] #9 20.23 Downloading lance_namespace_urllib3_client-0.7.6-py3-none-any.whl (324 kB) -[2026-05-06T13:41:55.220Z] #9 20.23 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 324.6/324.6 kB 378.1 MB/s eta 0:00:00 -[2026-05-06T13:41:55.220Z] #9 20.24 Downloading markdown_it_py-4.0.0-py3-none-any.whl (87 kB) -[2026-05-06T13:41:55.220Z] #9 20.24 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 87.3/87.3 kB 321.0 MB/s eta 0:00:00 -[2026-05-06T13:41:55.220Z] #9 20.24 Downloading mmh3-5.2.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (103 kB) -[2026-05-06T13:41:55.220Z] #9 20.25 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 103.1/103.1 kB 347.0 MB/s eta 0:00:00 -[2026-05-06T13:41:55.220Z] #9 20.25 Downloading numpy-2.4.4-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (16.9 MB) -[2026-05-06T13:41:55.778Z] #9 20.84 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 16.9/16.9 MB 29.5 MB/s eta 0:00:00 -[2026-05-06T13:41:55.778Z] #9 20.84 Downloading onnxruntime-1.25.1-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (18.0 MB) -[2026-05-06T13:41:56.589Z] #9 21.61 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.0/18.0 MB 23.5 MB/s eta 0:00:00 -[2026-05-06T13:41:56.589Z] #9 21.61 Downloading opentelemetry_exporter_otlp_proto_grpc-1.34.1-py3-none-any.whl (18 kB) -[2026-05-06T13:41:56.589Z] #9 21.61 Downloading orjson-3.11.8-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (133 kB) -[2026-05-06T13:41:56.589Z] #9 21.62 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 133.6/133.6 kB 21.9 MB/s eta 0:00:00 -[2026-05-06T13:41:56.589Z] #9 21.62 Downloading overrides-7.7.0-py3-none-any.whl (17 kB) -[2026-05-06T13:41:56.589Z] #9 21.63 Downloading packaging-26.2-py3-none-any.whl (100 kB) -[2026-05-06T13:41:56.589Z] #9 21.63 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 100.2/100.2 kB 36.6 MB/s eta 0:00:00 -[2026-05-06T13:41:56.589Z] #9 21.63 Downloading pillow-12.2.0-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (7.1 MB) -[2026-05-06T13:41:56.843Z] #9 21.91 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 7.1/7.1 MB 26.0 MB/s eta 0:00:00 -[2026-05-06T13:41:56.843Z] #9 21.91 Downloading platformdirs-4.9.6-py3-none-any.whl (21 kB) -[2026-05-06T13:41:56.843Z] #9 21.92 Downloading posthog-5.4.0-py3-none-any.whl (105 kB) -[2026-05-06T13:41:56.843Z] #9 21.92 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 105.4/105.4 kB 39.7 MB/s eta 0:00:00 -[2026-05-06T13:41:56.843Z] #9 21.93 Downloading pyarrow-24.0.0-cp311-cp311-manylinux_2_28_x86_64.whl (48.8 MB) -[2026-05-06T13:41:58.976Z] #9 23.96 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.8/48.8 MB 23.2 MB/s eta 0:00:00 -[2026-05-06T13:41:58.976Z] #9 23.97 Downloading pybase64-1.4.3-cp311-cp311-manylinux1_x86_64.manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_5_x86_64.whl (71 kB) -[2026-05-06T13:41:58.976Z] #9 23.97 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 71.4/71.4 kB 47.8 MB/s eta 0:00:00 -[2026-05-06T13:41:58.976Z] #9 23.97 Downloading pygments-2.20.0-py3-none-any.whl (1.2 MB) -[2026-05-06T13:41:58.976Z] #9 24.01 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 1.2/1.2 MB 40.0 MB/s eta 0:00:00 -[2026-05-06T13:41:58.976Z] #9 24.01 Downloading pypdfium2-5.8.0-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (3.7 MB) -[2026-05-06T13:41:59.230Z] #9 24.17 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.7/3.7 MB 23.0 MB/s eta 0:00:00 -[2026-05-06T13:41:59.230Z] #9 24.18 Downloading pypika-0.51.1-py2.py3-none-any.whl (60 kB) -[2026-05-06T13:41:59.230Z] #9 24.18 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 60.6/60.6 kB 23.6 MB/s eta 0:00:00 -[2026-05-06T13:41:59.230Z] #9 24.18 Downloading python_multipart-0.0.27-py3-none-any.whl (29 kB) -[2026-05-06T13:41:59.230Z] #9 24.19 Downloading requests-2.33.1-py3-none-any.whl (64 kB) -[2026-05-06T13:41:59.230Z] #9 24.19 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 64.9/64.9 kB 21.1 MB/s eta 0:00:00 -[2026-05-06T13:41:59.230Z] #9 24.19 Downloading rich-14.3.4-py3-none-any.whl (310 kB) -[2026-05-06T13:41:59.230Z] #9 24.20 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 310.5/310.5 kB 34.9 MB/s eta 0:00:00 -[2026-05-06T13:41:59.230Z] #9 24.21 Downloading sse_starlette-3.4.1-py3-none-any.whl (16 kB) -[2026-05-06T13:41:59.230Z] #9 24.21 Downloading starlette-1.0.0-py3-none-any.whl (72 kB) -[2026-05-06T13:41:59.230Z] #9 24.21 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 72.7/72.7 kB 48.5 MB/s eta 0:00:00 -[2026-05-06T13:41:59.230Z] #9 24.22 Downloading tenacity-9.1.4-py3-none-any.whl (28 kB) -[2026-05-06T13:41:59.230Z] #9 24.22 Downloading tqdm-4.67.3-py3-none-any.whl (78 kB) -[2026-05-06T13:41:59.230Z] #9 24.22 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 78.4/78.4 kB 37.5 MB/s eta 0:00:00 -[2026-05-06T13:41:59.230Z] #9 24.23 Downloading typer-0.23.1-py3-none-any.whl (56 kB) -[2026-05-06T13:41:59.230Z] #9 24.23 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 56.8/56.8 kB 46.4 MB/s eta 0:00:00 -[2026-05-06T13:41:59.230Z] #9 24.23 Downloading typing_extensions-4.15.0-py3-none-any.whl (44 kB) -[2026-05-06T13:41:59.230Z] #9 24.24 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 44.6/44.6 kB 28.7 MB/s eta 0:00:00 -[2026-05-06T13:41:59.230Z] #9 24.24 Downloading typing_inspection-0.4.2-py3-none-any.whl (14 kB) -[2026-05-06T13:41:59.230Z] #9 24.24 Downloading uvicorn-0.46.0-py3-none-any.whl (70 kB) -[2026-05-06T13:41:59.230Z] #9 24.24 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 70.9/70.9 kB 47.1 MB/s eta 0:00:00 -[2026-05-06T13:41:59.230Z] #9 24.25 Downloading et_xmlfile-2.0.0-py3-none-any.whl (18 kB) -[2026-05-06T13:41:59.230Z] #9 24.25 Downloading importlib_resources-7.1.0-py3-none-any.whl (37 kB) -[2026-05-06T13:41:59.230Z] #9 24.25 Downloading mdit_py_plugins-0.5.0-py3-none-any.whl (57 kB) -[2026-05-06T13:41:59.230Z] #9 24.26 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 57.2/57.2 kB 39.2 MB/s eta 0:00:00 -[2026-05-06T13:41:59.230Z] #9 24.26 Downloading sniffio-1.3.1-py3-none-any.whl (10 kB) -[2026-05-06T13:41:59.230Z] #9 24.26 Downloading aiohappyeyeballs-2.6.1-py3-none-any.whl (15 kB) -[2026-05-06T13:41:59.230Z] #9 24.27 Downloading aiosignal-1.4.0-py3-none-any.whl (7.5 kB) -[2026-05-06T13:41:59.230Z] #9 24.27 Downloading annotated_doc-0.0.4-py3-none-any.whl (5.3 kB) -[2026-05-06T13:41:59.230Z] #9 24.27 Downloading attrs-26.1.0-py3-none-any.whl (67 kB) -[2026-05-06T13:41:59.230Z] #9 24.27 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 67.5/67.5 kB 54.7 MB/s eta 0:00:00 -[2026-05-06T13:41:59.230Z] #9 24.28 Downloading backoff-2.2.1-py3-none-any.whl (15 kB) -[2026-05-06T13:41:59.230Z] #9 24.28 Downloading charset_normalizer-3.4.7-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (214 kB) -[2026-05-06T13:41:59.230Z] #9 24.29 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 214.1/214.1 kB 44.8 MB/s eta 0:00:00 -[2026-05-06T13:41:59.230Z] #9 24.29 Downloading cryptography-48.0.0-cp311-abi3-manylinux_2_34_x86_64.whl (4.7 MB) -[2026-05-06T13:41:59.485Z] #9 24.43 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.7/4.7 MB 35.3 MB/s eta 0:00:00 -[2026-05-06T13:41:59.485Z] #9 24.43 Downloading durationpy-0.10-py3-none-any.whl (3.9 kB) -[2026-05-06T13:41:59.485Z] #9 24.43 Downloading filelock-3.29.0-py3-none-any.whl (39 kB) -[2026-05-06T13:41:59.485Z] #9 24.44 Downloading frozenlist-1.8.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (231 kB) -[2026-05-06T13:41:59.485Z] #9 24.45 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 231.1/231.1 kB 31.2 MB/s eta 0:00:00 -[2026-05-06T13:41:59.485Z] #9 24.45 Downloading fsspec-2026.4.0-py3-none-any.whl (203 kB) -[2026-05-06T13:41:59.485Z] #9 24.46 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 203.4/203.4 kB 40.5 MB/s eta 0:00:00 -[2026-05-06T13:41:59.485Z] #9 24.46 Downloading h11-0.16.0-py3-none-any.whl (37 kB) -[2026-05-06T13:41:59.485Z] #9 24.46 Downloading hf_xet-1.5.0-cp37-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (4.5 MB) -[2026-05-06T13:41:59.485Z] #9 24.62 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 4.5/4.5 MB 28.3 MB/s eta 0:00:00 -[2026-05-06T13:41:59.485Z] #9 24.63 Downloading httptools-0.7.1-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (456 kB) -[2026-05-06T13:41:59.485Z] #9 24.64 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 456.6/456.6 kB 29.4 MB/s eta 0:00:00 -[2026-05-06T13:41:59.485Z] #9 24.65 Downloading jsonschema_specifications-2025.9.1-py3-none-any.whl (18 kB) -[2026-05-06T13:41:59.485Z] #9 24.65 Downloading linkify_it_py-2.1.0-py3-none-any.whl (19 kB) -[2026-05-06T13:41:59.485Z] #9 24.65 Downloading markupsafe-3.0.3-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (22 kB) -[2026-05-06T13:41:59.485Z] #9 24.66 Downloading mdurl-0.1.2-py3-none-any.whl (10.0 kB) -[2026-05-06T13:41:59.485Z] #9 24.66 Downloading multidict-6.7.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (246 kB) -[2026-05-06T13:41:59.485Z] #9 24.67 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 246.3/246.3 kB 41.3 MB/s eta 0:00:00 -[2026-05-06T13:41:59.485Z] #9 24.67 Downloading propcache-0.4.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (210 kB) -[2026-05-06T13:41:59.485Z] #9 24.68 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 210.0/210.0 kB 44.6 MB/s eta 0:00:00 -[2026-05-06T13:41:59.485Z] #9 24.68 Downloading protobuf-5.29.6-cp38-abi3-manylinux2014_x86_64.whl (320 kB) -[2026-05-06T13:41:59.485Z] #9 24.69 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 320.5/320.5 kB 44.2 MB/s eta 0:00:00 -[2026-05-06T13:41:59.485Z] #9 24.69 Downloading python_dateutil-2.9.0.post0-py2.py3-none-any.whl (229 kB) -[2026-05-06T13:41:59.485Z] #9 24.70 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 229.9/229.9 kB 49.1 MB/s eta 0:00:00 -[2026-05-06T13:41:59.485Z] #9 24.70 Downloading referencing-0.37.0-py3-none-any.whl (26 kB) -[2026-05-06T13:41:59.485Z] #9 24.71 Downloading rpds_py-0.30.0-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (390 kB) -[2026-05-06T13:41:59.485Z] #9 24.71 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 390.8/390.8 kB 53.4 MB/s eta 0:00:00 -[2026-05-06T13:41:59.485Z] #9 24.72 Downloading shellingham-1.5.4-py2.py3-none-any.whl (9.8 kB) -[2026-05-06T13:41:59.485Z] #9 24.72 Downloading six-1.17.0-py2.py3-none-any.whl (11 kB) -[2026-05-06T13:41:59.485Z] #9 24.72 Downloading urllib3-2.6.3-py3-none-any.whl (131 kB) -[2026-05-06T13:41:59.739Z] #9 24.73 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 131.6/131.6 kB 52.4 MB/s eta 0:00:00 -[2026-05-06T13:41:59.739Z] #9 24.73 Downloading uvloop-0.22.1-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (3.8 MB) -[2026-05-06T13:41:59.993Z] #9 24.88 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 3.8/3.8 MB 25.9 MB/s eta 0:00:00 -[2026-05-06T13:41:59.993Z] #9 24.89 Downloading watchfiles-1.1.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (456 kB) -[2026-05-06T13:41:59.993Z] #9 24.90 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 456.1/456.1 kB 30.1 MB/s eta 0:00:00 -[2026-05-06T13:41:59.993Z] #9 24.91 Downloading websocket_client-1.9.0-py3-none-any.whl (82 kB) -[2026-05-06T13:41:59.993Z] #9 24.91 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 82.6/82.6 kB 30.4 MB/s eta 0:00:00 -[2026-05-06T13:41:59.993Z] #9 24.91 Downloading websockets-16.0-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl (184 kB) -[2026-05-06T13:41:59.993Z] #9 24.92 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 184.6/184.6 kB 50.2 MB/s eta 0:00:00 -[2026-05-06T13:41:59.993Z] #9 24.92 Downloading yarl-1.23.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl (102 kB) -[2026-05-06T13:41:59.993Z] #9 24.93 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 102.7/102.7 kB 45.3 MB/s eta 0:00:00 -[2026-05-06T13:41:59.993Z] #9 24.93 Downloading zipp-3.23.1-py3-none-any.whl (10 kB) -[2026-05-06T13:41:59.993Z] #9 24.93 Downloading flatbuffers-25.12.19-py2.py3-none-any.whl (26 kB) -[2026-05-06T13:41:59.993Z] #9 24.93 Downloading pyproject_hooks-1.2.0-py3-none-any.whl (10 kB) -[2026-05-06T13:41:59.993Z] #9 24.94 Downloading requests_oauthlib-2.0.0-py2.py3-none-any.whl (24 kB) -[2026-05-06T13:41:59.993Z] #9 24.94 Downloading cffi-2.0.0-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.whl (215 kB) -[2026-05-06T13:41:59.993Z] #9 24.95 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 215.6/215.6 kB 51.6 MB/s eta 0:00:00 -[2026-05-06T13:41:59.993Z] #9 24.95 Downloading oauthlib-3.3.1-py3-none-any.whl (160 kB) -[2026-05-06T13:41:59.993Z] #9 24.96 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 160.1/160.1 kB 55.3 MB/s eta 0:00:00 -[2026-05-06T13:41:59.993Z] #9 24.96 Downloading uc_micro_py-2.0.0-py3-none-any.whl (6.4 kB) -[2026-05-06T13:41:59.993Z] #9 24.96 Downloading pycparser-3.0-py3-none-any.whl (48 kB) -[2026-05-06T13:41:59.993Z] #9 24.97 ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 48.2/48.2 kB 283.0 MB/s eta 0:00:00 -[2026-05-06T13:42:01.872Z] #9 26.70 Installing collected packages: pypika, flatbuffers, durationpy, appdirs, zipp, websockets, websocket-client, uvloop, uv, urllib3, uc-micro-py, typing_extensions, tqdm, tomli-w, tomli, tenacity, sniffio, six, shellingham, rpds-py, regex, pyyaml, python-multipart, python-dotenv, pyproject_hooks, pypdfium2, pyjwt, pygments, pycparser, pybase64, pyarrow, protobuf, propcache, portalocker, platformdirs, Pillow, packaging, overrides, orjson, oauthlib, numpy, multidict, mmh3, mdurl, MarkupSafe, jsonref, json5, json-repair, jiter, importlib-resources, idna, httpx-sse, httptools, hf-xet, h11, fsspec, frozenlist, filelock, et-xmlfile, docstring-parser, distro, click, charset-normalizer, certifi, bcrypt, backoff, attrs, annotated-types, annotated-doc, aiohappyeyeballs, yarl, uvicorn, typing-inspection, requests, referencing, python-dateutil, pydantic-core, opentelemetry-proto, openpyxl, onnxruntime, markdown-it-py, linkify-it-py, jinja2, importlib-metadata, httpcore, grpcio, googleapis-common-protos, deprecation, cffi, build, anyio, aiosqlite, aiosignal, watchfiles, starlette, rich, requests-oauthlib, pydantic, posthog, opentelemetry-exporter-otlp-proto-common, opentelemetry-api, mdit-py-plugins, jsonschema-specifications, httpx, cryptography, aiohttp, typer, textual, sse-starlette, pydantic-settings, pdfminer.six, opentelemetry-semantic-conventions, openai, lance-namespace-urllib3-client, kubernetes, jsonschema, pdfplumber, opentelemetry-sdk, mcp, lance-namespace, instructor, huggingface-hub, tokenizers, opentelemetry-exporter-otlp-proto-http, opentelemetry-exporter-otlp-proto-grpc, lancedb, chromadb, crewai -[2026-05-06T13:42:23.731Z] #9 46.33 Successfully installed MarkupSafe-3.0.3 Pillow-12.2.0 aiohappyeyeballs-2.6.1 aiohttp-3.13.5 aiosignal-1.4.0 aiosqlite-0.21.0 annotated-doc-0.0.4 annotated-types-0.7.0 anyio-4.13.0 appdirs-1.4.4 attrs-26.1.0 backoff-2.2.1 bcrypt-5.0.0 build-1.5.0 certifi-2026.4.22 cffi-2.0.0 charset-normalizer-3.4.7 chromadb-1.1.1 click-8.1.8 crewai-1.13.0 cryptography-48.0.0 deprecation-2.1.0 distro-1.9.0 docstring-parser-0.18.0 durationpy-0.10 et-xmlfile-2.0.0 filelock-3.29.0 flatbuffers-25.12.19 frozenlist-1.8.0 fsspec-2026.4.0 googleapis-common-protos-1.74.0 grpcio-1.80.0 h11-0.16.0 hf-xet-1.5.0 httpcore-1.0.9 httptools-0.7.1 httpx-0.28.1 httpx-sse-0.4.3 huggingface-hub-1.13.0 idna-3.13 importlib-metadata-8.7.1 importlib-resources-7.1.0 instructor-1.15.1 jinja2-3.1.6 jiter-0.13.0 json-repair-0.25.3 json5-0.10.0 jsonref-1.1.0 jsonschema-4.26.0 jsonschema-specifications-2025.9.1 kubernetes-35.0.0 lance-namespace-0.7.6 lance-namespace-urllib3-client-0.7.6 lancedb-0.30.0 linkify-it-py-2.1.0 markdown-it-py-4.0.0 mcp-1.26.0 mdit-py-plugins-0.5.0 mdurl-0.1.2 mmh3-5.2.1 multidict-6.7.1 numpy-2.4.4 oauthlib-3.3.1 onnxruntime-1.25.1 openai-2.34.0 openpyxl-3.1.5 opentelemetry-api-1.34.1 opentelemetry-exporter-otlp-proto-common-1.34.1 opentelemetry-exporter-otlp-proto-grpc-1.34.1 opentelemetry-exporter-otlp-proto-http-1.34.1 opentelemetry-proto-1.34.1 opentelemetry-sdk-1.34.1 opentelemetry-semantic-conventions-0.55b1 orjson-3.11.8 overrides-7.7.0 packaging-26.2 pdfminer.six-20251230 pdfplumber-0.11.9 platformdirs-4.9.6 portalocker-2.7.0 posthog-5.4.0 propcache-0.4.1 protobuf-5.29.6 pyarrow-24.0.0 pybase64-1.4.3 pycparser-3.0 pydantic-2.11.10 pydantic-core-2.33.2 pydantic-settings-2.10.1 pygments-2.20.0 pyjwt-2.12.1 pypdfium2-5.8.0 pypika-0.51.1 pyproject_hooks-1.2.0 python-dateutil-2.9.0.post0 python-dotenv-1.1.1 python-multipart-0.0.27 pyyaml-6.0.3 referencing-0.37.0 regex-2026.1.15 requests-2.33.1 requests-oauthlib-2.0.0 rich-14.3.4 rpds-py-0.30.0 shellingham-1.5.4 six-1.17.0 sniffio-1.3.1 sse-starlette-3.4.1 starlette-1.0.0 tenacity-9.1.4 textual-8.2.5 tokenizers-0.23.1 tomli-2.0.2 tomli-w-1.1.0 tqdm-4.67.3 typer-0.23.1 typing-inspection-0.4.2 typing_extensions-4.15.0 uc-micro-py-2.0.0 urllib3-2.6.3 uv-0.9.30 uvicorn-0.46.0 uvloop-0.22.1 watchfiles-1.1.1 websocket-client-1.9.0 websockets-16.0 yarl-1.23.0 zipp-3.23.1 -[2026-05-06T13:42:23.732Z] #9 46.33 WARNING: Running pip as the 'root' user can result in broken permissions and conflicting behaviour with the system package manager. It is recommended to use a virtual environment instead: https://pip.pypa.io/warnings/venv -[2026-05-06T13:42:26.237Z] #9 DONE 51.4s -[2026-05-06T13:42:26.490Z] -[2026-05-06T13:42:26.490Z] #10 [5/9] RUN python3.11 -c "import crewai; print(f'CrewAI {crewai.__version__} installed successfully')" -[2026-05-06T13:42:28.994Z] #10 2.283 CrewAI 1.13.0 installed successfully -[2026-05-06T13:42:28.994Z] #10 DONE 2.5s -[2026-05-06T13:42:28.994Z] -[2026-05-06T13:42:28.994Z] #11 [6/9] RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /tencentos_build_date.txt -[2026-05-06T13:42:28.994Z] #11 DONE 0.2s -[2026-05-06T13:42:29.248Z] -[2026-05-06T13:42:29.248Z] #12 [7/9] COPY test.sh /workspace/test.sh -[2026-05-06T13:42:29.248Z] #12 DONE 0.0s -[2026-05-06T13:42:29.248Z] -[2026-05-06T13:42:29.248Z] #13 [8/9] RUN chmod +x /workspace/test.sh -[2026-05-06T13:42:29.248Z] #13 DONE 0.2s -[2026-05-06T13:42:29.502Z] -[2026-05-06T13:42:29.502Z] #14 [9/9] WORKDIR /workspace -[2026-05-06T13:42:29.502Z] #14 DONE 0.0s -[2026-05-06T13:42:29.502Z] -[2026-05-06T13:42:29.502Z] #15 exporting to image -[2026-05-06T13:42:29.502Z] #15 exporting layers -[2026-05-06T13:42:34.728Z] #15 exporting layers 5.3s done -[2026-05-06T13:42:34.728Z] #15 writing image sha256:0998e95ae2d7d55e09f92dc5cedbf807b3421942c76fc745a8c3f4a61fab43e7 done -[2026-05-06T13:42:34.728Z] #15 naming to docker.io/library/ci-test-oc9-crewai:1.13.0 done -[2026-05-06T13:42:34.728Z] #15 DONE 5.3s -[2026-05-06T13:42:34.728Z] ✓ 构建成功: frameworks/crewai/1.13.0 -[2026-05-06T13:42:34.728Z] -[2026-05-06T13:42:34.728Z] === 测试: frameworks/crewai/1.13.0/test.sh === -[2026-05-06T13:42:34.728Z] ========================================== -[2026-05-06T13:42:34.728Z] 测试镜像: ci-test-oc9-crewai:1.13.0 -[2026-05-06T13:42:34.728Z] ========================================== -[2026-05-06T13:42:34.728Z] 测试 1: 检查 crewai 导入... {crewai.__version__}: -c: line 2: unexpected EOF while looking for matching `"' -[2026-05-06T13:42:34.982Z] exit status 2 -[2026-05-06T13:42:34.982Z] ✗ 失败 -[2026-05-06T13:42:34.982Z] ✗ 测试失败: frameworks/crewai/1.13.0 -Build or test failed (exit 1) — 详细日志见上方 'Run GPU Build & Test' 步骤[2026-05-06T13:42:35.265Z] Caught exception: hudson.AbortException: hudson.AbortException: Build or test failed (exit 1) — 详细日志见上方 'Run GPU Build & Test' 步骤 -[2026-05-06T13:42:35.681Z] + cd /home/jenkins_worker/jenkins_workspace/workspace/OC-Dockerfiles/CI@5/128/dockerfiles -[2026-05-06T13:42:35.681Z] + FEEDBACK_SH=utils/gitee_feedback.sh -[2026-05-06T13:42:35.681Z] + '[' '!' -f utils/gitee_feedback.sh ']' -[2026-05-06T13:42:35.681Z] + RESULT=FAILURE -[2026-05-06T13:42:35.681Z] + '[' FAILURE = SUCCESS ']' -[2026-05-06T13:42:35.681Z] + '[' FAILURE = '' ']' -[2026-05-06T13:42:35.681Z] + '[' FAILURE = FAILURE ']' -[2026-05-06T13:42:35.681Z] + bash utils/gitee_feedback.sh set_label ci_failed -[2026-05-06T13:42:36.239Z] Label set: ci_failed -[2026-05-06T13:42:36.239Z] + '[' null = true ']' -[2026-05-06T13:42:36.239Z] + bash utils/gitee_feedback.sh comment '@null_743_7435 Dockerfile CI 检查失败! :x: 请查看日志修正错误: [#128](https://qa.opencloudos.tech/job/OC-Dockerfiles/job/CI/128/display/redirect) 修正后重新提交,或评论 /retest 重触发。' -[2026-05-06T13:42:37.160Z] Comment posted diff --git a/frameworks/.DS_Store b/frameworks/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..4f7a0aa36cdccb31a886d7566f81fed75d039984 Binary files /dev/null and b/frameworks/.DS_Store differ diff --git a/frameworks/ComfyUI/0.18.5/Dockerfile b/frameworks/ComfyUI/0.18.5/Dockerfile deleted file mode 100644 index 5589dcf0cef57137e170ea1670c5811fe0154e17..0000000000000000000000000000000000000000 --- a/frameworks/ComfyUI/0.18.5/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ - -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="stronking 363133710@qq.com" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="ComfyUI v0.18.5 (GPU) on OpenCloudOS 9" -ENV NVIDIA_VISIBLE_DEVICES=all -ARG COMFYUI_VERSION=0.18.5 - -ENV NVIDIA_VISIBLE_DEVICES=all \ - PYTHONUNBUFFERED=1 \ - PIP_DISABLE_PIP_VERSION_CHECK=1 \ - PIP_DEFAULT_TIMEOUT=120 - - -WORKDIR /opt - -RUN --mount=type=cache,target=/root/.cache/pip \ - wget -q -O /tmp/requirements.txt \ - https://raw.githubusercontent.com/Comfy-Org/ComfyUI/refs/tags/v${COMFYUI_VERSION}/requirements.txt && \ - python3 -m pip install --upgrade pip setuptools wheel && \ - python3 -m pip install -r /tmp/requirements.txt - -RUN wget -q -O /tmp/comfyui.zip \ - https://github.com/Comfy-Org/ComfyUI/archive/refs/tags/v${COMFYUI_VERSION}.zip && \ - unzip -q /tmp/comfyui.zip -d /opt && \ - mv /opt/ComfyUI-${COMFYUI_VERSION} /opt/ComfyUI && \ - rm -f /tmp/comfyui.zip /tmp/requirements.txt - -WORKDIR /opt/ComfyUI - -EXPOSE 8188 -CMD ["python3","main.py","--listen","0.0.0.0"] \ No newline at end of file diff --git a/frameworks/ComfyUI/0.18.5/README.md b/frameworks/ComfyUI/0.18.5/README.md deleted file mode 100644 index e2633955c37b5bdbbb42f086652fb0deaaa0f5b1..0000000000000000000000000000000000000000 --- a/frameworks/ComfyUI/0.18.5/README.md +++ /dev/null @@ -1,103 +0,0 @@ -# ComfyUI 0.18.5 on OpenCloudOS 9 - -## 基本信息 -- **框架版本**:v0.18.5 -- **基础镜像**:opencloudos9-cuda-devel:12.8 -- **Python 版本**:3.11 -- **CUDA 版本**: 12.x 或 更高 - -## 构建 - -docker build -t oc9-comfyui:0.18.5 . - -## 镜像启动命令 - -docker run -d --name oc9-comfyui --gpus all -p 8188:8188 oc9-comfyui:0.18.5 - -## 镜像测试命令 - -docker run --rm --gpus all -p 8188:8188 oc9-comfyui:0.18.5 bash test.sh - -## ComfyUI 版本对于python依赖说明 - -### 关键依赖变化时间线 -| tag / tag 范围 | 相对前一阶段的主要变化 | -| ------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | -| `v0.0.1`–`v0.0.2` | 最早基线:`torch`/`torchsde`/`torchvision`/`torchaudio`、`einops`、`transformers>=4.28.1`、`tokenizers>=0.13.3`、`safetensors>=0.4.2`、`aiohttp`、`pyyaml`、`Pillow`、`scipy`、`tqdm`、`psutil`;非核心依赖有 `kornia>=0.7.1`、`spandrel`、`soundfile`。([GitHub][1]) | -| `v0.0.3` | 特殊版本:把 `torch` 固定为 `2.3.1`,`torchvision==0.18.1`,`torchaudio==2.3.1`,并加入 `numpy<2.0.0`。([GitHub][2]) | -| `v0.0.4`–`v0.3.10` | 回到未固定 `torch`/`torchvision`/`torchaudio`,并且这一段没有 `numpy`。([GitHub][3]) | -| `v0.3.11`–`v0.3.14` | 加入 `numpy>=1.25.0`。 | -| `v0.3.15`–`v0.3.18` | `aiohttp` 变为 `aiohttp>=3.11.8`,新增 `yarl>=1.18.0`,并加入 `av`。([GitHub][4]) | -| `v0.3.19`–`v0.3.28` | 开始引入 `comfyui-frontend-package`,从 `1.10.17` 逐步升到 `1.15.13`。([GitHub][5]) | -| `v0.3.29` | 新增 `comfyui-workflow-templates==0.1.1`。 | -| `v0.3.30`–`v0.3.39` | 新增 `pydantic~=2.0`;`av` 被约束到 `>=14.1.0`,随后到 `>=14.2.0`;前端包和 workflow templates 继续频繁升级。([GitHub][6]) | -| `v0.3.40` | 新增 `comfyui-embedded-docs==0.2.0`。 | -| `v0.3.41` | 新增数据库迁移相关依赖 `alembic`、`SQLAlchemy`,并新增 `pydantic-settings~=2.0`。([GitHub][7]) | -| `v0.3.42`–`v0.3.62` | 主要是 `comfyui-frontend-package`、`comfyui-workflow-templates`、`comfyui-embedded-docs` 版本升级;`soundfile` 仍在。 | -| `v0.3.63` | 删除 `soundfile`;其他核心依赖不变。([GitHub][8]) | -| `v0.3.72` | `transformers` 下限从 `>=4.37.2` 提到 `>=4.50.3`;workflow templates 进入 `0.7.x`。([GitHub][9]) | -| `v0.4.0`–`v0.7.0` | 基本延续 `v0.3.72+` 的依赖结构,主要更新前端、模板、docs 包版本。 | -| `v0.8.0` | 新增 `comfy-kitchen>=0.2.3`。([GitHub][10]) | -| `v0.9.0`–`v0.10.0` | `comfy-kitchen` 从 `>=0.2.6` 升到 `>=0.2.7`;前端、模板继续升级。 | -| `v0.11.0` | 新增 `requests`。([GitHub][11]) | -| `v0.12.0` | 新增 `comfy-aimdo>=0.1.7`。([GitHub][12]) | -| `v0.13.0`–`v0.14.2` | 主要升级 Comfy 自家包:frontend、workflow templates、embedded docs、`comfy-aimdo`。 | -| `v0.15.0`–`v0.15.1` | 新增 GUI/OpenGL 相关:`PyOpenGL`、`PyOpenGL-accelerate`、`glfw`;`comfy-aimdo` 升至 `>=0.2.x`。([GitHub][13]) | -| `v0.16.0` | 移除 `PyOpenGL-accelerate`,保留 `PyOpenGL`、`glfw`;embedded docs 升到 `0.4.3`。([GitHub][14]) | -| `v0.16.4` | 新增 `simpleeval>=1.0.0`。([GitHub][15]) | -| `v0.17.0` | 新增 `filelock`、`blake3`;`comfy-kitchen>=0.2.8`、`comfy-aimdo>=0.2.10`。([GitHub][16]) | -| `v0.18.0`–`v0.18.5` | `comfy-aimdo` 升到 `>=0.2.12`;workflow templates 从 `0.9.26` 升到 `0.9.43`;前端为 `1.41.21`。([GitHub][17]) | -| `v0.19.0`–`v0.19.5` | 前端升到 `1.42.x`;workflow templates 从 `0.9.47` 升到 `0.9.61`;其他核心依赖基本不变。([GitHub][18]) | -| `latest` | 这是旧 tag,内容非常不同:有 `torchdiffeq`、`open-clip-torch`、`pytorch_lightning`、`accelerate`,`transformers>=4.25.1`,`safetensors>=0.3.0`;没有后来的 `torchvision`、`torchaudio`、`kornia`、`spandrel`、Comfy 自家前端包等。([GitHub][19]) | - -[1]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.1/requirements.txt "raw.githubusercontent.com" -[2]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.3/requirements.txt "raw.githubusercontent.com" -[3]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.4/requirements.txt "raw.githubusercontent.com" -[4]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.18/requirements.txt "raw.githubusercontent.com" -[5]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.19/requirements.txt "raw.githubusercontent.com" -[6]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.30/requirements.txt "raw.githubusercontent.com" -[7]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.41/requirements.txt "raw.githubusercontent.com" -[8]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.63/requirements.txt "raw.githubusercontent.com" -[9]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.72/requirements.txt "raw.githubusercontent.com" -[10]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.8.0/requirements.txt "raw.githubusercontent.com" -[11]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.11.0/requirements.txt "raw.githubusercontent.com" -[12]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.12.0/requirements.txt "raw.githubusercontent.com" -[13]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.15.0/requirements.txt "raw.githubusercontent.com" -[14]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.0/requirements.txt "raw.githubusercontent.com" -[15]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.4/requirements.txt "raw.githubusercontent.com" -[16]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.17.0/requirements.txt "raw.githubusercontent.com" -[17]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.18.0/requirements.txt "raw.githubusercontent.com" -[18]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.19.0/requirements.txt "raw.githubusercontent.com" -[19]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/latest/requirements.txt "raw.githubusercontent.com" - - - - - -### v0.19.x 逐 tag 差异 - -| tag | `comfyui-frontend-package` | `comfyui-workflow-templates` | 其他 | -| ------------------- | -------------------------: | ---------------------------: | ------------- | -| `v0.19.0` | `1.42.10` | `0.9.47` | 其余核心依赖同后续基本一致 | -| `v0.19.1`–`v0.19.2` | `1.42.11` | `0.9.54` | 无结构性新增/删除 | -| `v0.19.3` | `1.42.11` | `0.9.57` | 只升模板包 | -| `v0.19.4` | `1.42.14` | `0.9.57` | 只升前端包 | -| `v0.19.5` | `1.42.14` | `0.9.61` | 只升模板包 | - - - - -## 启动代码会自动设置的环境变量 - -| 环境变量 | 什么时候设置 | 作用/说明 | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| `HF_HUB_DISABLE_TELEMETRY=1` | 启动时自动设置 | 注释说明主要给 custom nodes 用,core ComfyUI 本身不依赖它。 | -| `DO_NOT_TRACK=1` | 启动时自动设置 | 同上,用于关闭/提示关闭追踪。 | -| `MIMALLOC_PURGE_DELAY=0` | Windows 下自动设置 | Windows 内存 allocator 相关。 | -| `TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1` | 直接运行 `main.py` 时设置 | ROCm/Torch 相关实验开关。 | -| `CUDA_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 NVIDIA CUDA 可见设备。 | -| `HIP_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 AMD HIP/ROCm 可见设备。 | -| `ASCEND_RT_VISIBLE_DEVICES` | 使用 `--cuda-device` 时设置 | 控制 Ascend NPU 可见设备。 | -| `ONEAPI_DEVICE_SELECTOR` | 使用 `--oneapi-device-selector` 时设置 | 控制 Intel oneAPI 设备选择。 | -| `CUBLAS_WORKSPACE_CONFIG=:4096:8` | 使用 `--deterministic` 且变量未预设时设置 | PyTorch 确定性计算相关。 | -| `OCL_SET_SVM_SIZE=262144` | 检测到 ROCm 版本时设置 | AMD ROCm 相关。 | diff --git a/frameworks/ComfyUI/0.18.5/build.conf b/frameworks/ComfyUI/0.18.5/build.conf deleted file mode 100644 index bd19c9a96572eeafa6efbcfea6a40222fede883e..0000000000000000000000000000000000000000 --- a/frameworks/ComfyUI/0.18.5/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ConfyUI 0.18.5 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-comfyui -IMAGE_TAG=0.18.5 -GPU_TEST=true \ No newline at end of file diff --git a/frameworks/ComfyUI/0.18.5/test.sh b/frameworks/ComfyUI/0.18.5/test.sh deleted file mode 100644 index 858dba6aa6628d61061ef1231a7117962a1dc5e2..0000000000000000000000000000000000000000 --- a/frameworks/ComfyUI/0.18.5/test.sh +++ /dev/null @@ -1,252 +0,0 @@ -#!/bin/bash - -set -e - -IMAGE="${1:-}" - -if [ -z "${IMAGE}" ]; then - echo "用法: bash test.sh <镜像名:标签>" - exit 1 -fi - -if ! command -v docker >/dev/null 2>&1; then - echo "✗ 未找到 docker" - exit 1 -fi - -echo "=== ComfyUI 容器基础功能测试 ===" -echo "测试镜像: ${IMAGE}" - -docker run --rm --gpus all "${IMAGE}" /bin/bash -lc ' -set -e -export CUDA_HOME=/usr/local/cuda -export PATH=/usr/local/cuda/bin:$PATH -export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH -echo "=== ComfyUI GPU 镜像基础功能测试 ===" - -COMFYUI_DIR="${COMFYUI_DIR:-/opt/ComfyUI}" -COMFYUI_HOST="${COMFYUI_HOST:-127.0.0.1}" -COMFYUI_PORT="${COMFYUI_PORT:-18188}" -STRICT_GPU="${STRICT_GPU:-1}" -LOG_FILE="/tmp/comfyui_test.log" - -pass() { - echo "✓ 通过" -} - -fail() { - echo "✗ 失败" - if [ -f "$LOG_FILE" ]; then - echo "------ ComfyUI 日志 ------" - tail -n 120 "$LOG_FILE" || true - echo "-------------------------" - fi - exit 1 -} - -echo -echo "=== 1. 检查 ComfyUI 目录 ===" -echo -n "检查目录 ${COMFYUI_DIR}... " -if [ -d "$COMFYUI_DIR" ] && [ -f "$COMFYUI_DIR/main.py" ]; then - pass -else - fail -fi - -cd "$COMFYUI_DIR" - -echo -echo "=== 2. 检查 CUDA 基础环境 ===" - -echo -n "检查 nvidia-smi... " -if command -v nvidia-smi >/dev/null 2>&1; then - nvidia-smi >/tmp/nvidia_smi_test.log 2>&1 && pass || fail -else - if [ "$STRICT_GPU" = "1" ]; then - echo "未找到 nvidia-smi" - fail - else - echo "跳过,未找到 nvidia-smi" - fi -fi - -echo -n "检查 nvcc --version... " -if command -v nvcc >/dev/null 2>&1; then - nvcc --version >/tmp/nvcc_test.log 2>&1 && pass || fail -else - if [ "$STRICT_GPU" = "1" ]; then - echo "未找到 nvcc" - fail - else - echo "跳过,未找到 nvcc" - fi -fi - -echo -echo "=== 3. 检查 Python / PyTorch / CUDA ===" - -echo -n "检查 Python 版本... " -python3 --version && pass || fail - -echo -n "检查 torch import 和 CUDA 可用性... " -python3 - <<'PY' -import sys -import torch - -print("torch version:", torch.__version__) -print("torch cuda version:", torch.version.cuda) -print("torch cuda available:", torch.cuda.is_available()) - -if not torch.cuda.is_available(): - raise RuntimeError("torch.cuda.is_available() 为 False,GPU 不可用") - -count = torch.cuda.device_count() -print("cuda device count:", count) - -if count < 1: - raise RuntimeError("未检测到 CUDA 设备") - -for i in range(count): - print(f"cuda device {i}:", torch.cuda.get_device_name(i)) - -x = torch.ones((2, 2), device="cuda") -y = x @ x -assert y.is_cuda -assert y.shape == (2, 2) - -print("torch CUDA tensor test ok") -PY -pass - -echo -echo "=== 4. 检查 ComfyUI 核心模块 import ===" - -echo -n "检查 ComfyUI Python 模块... " -python3 - <<'PY' -import os -import sys - -sys.path.insert(0, os.getcwd()) - -import comfy -import folder_paths -import nodes - -print("comfy import ok") -print("folder_paths import ok") -print("nodes import ok") -print("registered node classes:", len(nodes.NODE_CLASS_MAPPINGS)) - -if len(nodes.NODE_CLASS_MAPPINGS) <= 0: - raise RuntimeError("ComfyUI 节点注册数量异常") -PY -pass - -echo -echo "=== 5. 启动 ComfyUI API 服务 ===" - -rm -f "$LOG_FILE" - -echo -n "启动 ComfyUI 服务 ${COMFYUI_HOST}:${COMFYUI_PORT}... " -python3 main.py \ - --listen "$COMFYUI_HOST" \ - --port "$COMFYUI_PORT" \ - >"$LOG_FILE" 2>&1 & - -COMFYUI_PID=$! - -cleanup() { - if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then - kill "$COMFYUI_PID" >/dev/null 2>&1 || true - wait "$COMFYUI_PID" >/dev/null 2>&1 || true - fi -} -trap cleanup EXIT - -sleep 3 - -if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then - pass -else - fail -fi - -echo -n "等待 ComfyUI API 就绪... " -python3 - <=4.28.1`、`tokenizers>=0.13.3`、`safetensors>=0.4.2`、`aiohttp`、`pyyaml`、`Pillow`、`scipy`、`tqdm`、`psutil`;非核心依赖有 `kornia>=0.7.1`、`spandrel`、`soundfile`。([GitHub][1]) | -| `v0.0.3` | 特殊版本:把 `torch` 固定为 `2.3.1`,`torchvision==0.18.1`,`torchaudio==2.3.1`,并加入 `numpy<2.0.0`。([GitHub][2]) | -| `v0.0.4`–`v0.3.10` | 回到未固定 `torch`/`torchvision`/`torchaudio`,并且这一段没有 `numpy`。([GitHub][3]) | -| `v0.3.11`–`v0.3.14` | 加入 `numpy>=1.25.0`。 | -| `v0.3.15`–`v0.3.18` | `aiohttp` 变为 `aiohttp>=3.11.8`,新增 `yarl>=1.18.0`,并加入 `av`。([GitHub][4]) | -| `v0.3.19`–`v0.3.28` | 开始引入 `comfyui-frontend-package`,从 `1.10.17` 逐步升到 `1.15.13`。([GitHub][5]) | -| `v0.3.29` | 新增 `comfyui-workflow-templates==0.1.1`。 | -| `v0.3.30`–`v0.3.39` | 新增 `pydantic~=2.0`;`av` 被约束到 `>=14.1.0`,随后到 `>=14.2.0`;前端包和 workflow templates 继续频繁升级。([GitHub][6]) | -| `v0.3.40` | 新增 `comfyui-embedded-docs==0.2.0`。 | -| `v0.3.41` | 新增数据库迁移相关依赖 `alembic`、`SQLAlchemy`,并新增 `pydantic-settings~=2.0`。([GitHub][7]) | -| `v0.3.42`–`v0.3.62` | 主要是 `comfyui-frontend-package`、`comfyui-workflow-templates`、`comfyui-embedded-docs` 版本升级;`soundfile` 仍在。 | -| `v0.3.63` | 删除 `soundfile`;其他核心依赖不变。([GitHub][8]) | -| `v0.3.72` | `transformers` 下限从 `>=4.37.2` 提到 `>=4.50.3`;workflow templates 进入 `0.7.x`。([GitHub][9]) | -| `v0.4.0`–`v0.7.0` | 基本延续 `v0.3.72+` 的依赖结构,主要更新前端、模板、docs 包版本。 | -| `v0.8.0` | 新增 `comfy-kitchen>=0.2.3`。([GitHub][10]) | -| `v0.9.0`–`v0.10.0` | `comfy-kitchen` 从 `>=0.2.6` 升到 `>=0.2.7`;前端、模板继续升级。 | -| `v0.11.0` | 新增 `requests`。([GitHub][11]) | -| `v0.12.0` | 新增 `comfy-aimdo>=0.1.7`。([GitHub][12]) | -| `v0.13.0`–`v0.14.2` | 主要升级 Comfy 自家包:frontend、workflow templates、embedded docs、`comfy-aimdo`。 | -| `v0.15.0`–`v0.15.1` | 新增 GUI/OpenGL 相关:`PyOpenGL`、`PyOpenGL-accelerate`、`glfw`;`comfy-aimdo` 升至 `>=0.2.x`。([GitHub][13]) | -| `v0.16.0` | 移除 `PyOpenGL-accelerate`,保留 `PyOpenGL`、`glfw`;embedded docs 升到 `0.4.3`。([GitHub][14]) | -| `v0.16.4` | 新增 `simpleeval>=1.0.0`。([GitHub][15]) | -| `v0.17.0` | 新增 `filelock`、`blake3`;`comfy-kitchen>=0.2.8`、`comfy-aimdo>=0.2.10`。([GitHub][16]) | -| `v0.18.0`–`v0.18.5` | `comfy-aimdo` 升到 `>=0.2.12`;workflow templates 从 `0.9.26` 升到 `0.9.43`;前端为 `1.41.21`。([GitHub][17]) | -| `v0.19.0`–`v0.19.5` | 前端升到 `1.42.x`;workflow templates 从 `0.9.47` 升到 `0.9.61`;其他核心依赖基本不变。([GitHub][18]) | -| `latest` | 这是旧 tag,内容非常不同:有 `torchdiffeq`、`open-clip-torch`、`pytorch_lightning`、`accelerate`,`transformers>=4.25.1`,`safetensors>=0.3.0`;没有后来的 `torchvision`、`torchaudio`、`kornia`、`spandrel`、Comfy 自家前端包等。([GitHub][19]) | - -[1]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.1/requirements.txt "raw.githubusercontent.com" -[2]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.3/requirements.txt "raw.githubusercontent.com" -[3]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.4/requirements.txt "raw.githubusercontent.com" -[4]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.18/requirements.txt "raw.githubusercontent.com" -[5]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.19/requirements.txt "raw.githubusercontent.com" -[6]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.30/requirements.txt "raw.githubusercontent.com" -[7]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.41/requirements.txt "raw.githubusercontent.com" -[8]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.63/requirements.txt "raw.githubusercontent.com" -[9]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.72/requirements.txt "raw.githubusercontent.com" -[10]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.8.0/requirements.txt "raw.githubusercontent.com" -[11]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.11.0/requirements.txt "raw.githubusercontent.com" -[12]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.12.0/requirements.txt "raw.githubusercontent.com" -[13]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.15.0/requirements.txt "raw.githubusercontent.com" -[14]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.0/requirements.txt "raw.githubusercontent.com" -[15]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.4/requirements.txt "raw.githubusercontent.com" -[16]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.17.0/requirements.txt "raw.githubusercontent.com" -[17]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.18.0/requirements.txt "raw.githubusercontent.com" -[18]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.19.0/requirements.txt "raw.githubusercontent.com" -[19]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/latest/requirements.txt "raw.githubusercontent.com" - - - - - -### v0.19.x 逐 tag 差异 - -| tag | `comfyui-frontend-package` | `comfyui-workflow-templates` | 其他 | -| ------------------- | -------------------------: | ---------------------------: | ------------- | -| `v0.19.0` | `1.42.10` | `0.9.47` | 其余核心依赖同后续基本一致 | -| `v0.19.1`–`v0.19.2` | `1.42.11` | `0.9.54` | 无结构性新增/删除 | -| `v0.19.3` | `1.42.11` | `0.9.57` | 只升模板包 | -| `v0.19.4` | `1.42.14` | `0.9.57` | 只升前端包 | -| `v0.19.5` | `1.42.14` | `0.9.61` | 只升模板包 | - - - - -## 启动代码会自动设置的环境变量 - -| 环境变量 | 什么时候设置 | 作用/说明 | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| `HF_HUB_DISABLE_TELEMETRY=1` | 启动时自动设置 | 注释说明主要给 custom nodes 用,core ComfyUI 本身不依赖它。 | -| `DO_NOT_TRACK=1` | 启动时自动设置 | 同上,用于关闭/提示关闭追踪。 | -| `MIMALLOC_PURGE_DELAY=0` | Windows 下自动设置 | Windows 内存 allocator 相关。 | -| `TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1` | 直接运行 `main.py` 时设置 | ROCm/Torch 相关实验开关。 | -| `CUDA_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 NVIDIA CUDA 可见设备。 | -| `HIP_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 AMD HIP/ROCm 可见设备。 | -| `ASCEND_RT_VISIBLE_DEVICES` | 使用 `--cuda-device` 时设置 | 控制 Ascend NPU 可见设备。 | -| `ONEAPI_DEVICE_SELECTOR` | 使用 `--oneapi-device-selector` 时设置 | 控制 Intel oneAPI 设备选择。 | -| `CUBLAS_WORKSPACE_CONFIG=:4096:8` | 使用 `--deterministic` 且变量未预设时设置 | PyTorch 确定性计算相关。 | -| `OCL_SET_SVM_SIZE=262144` | 检测到 ROCm 版本时设置 | AMD ROCm 相关。 | diff --git a/frameworks/ComfyUI/0.19.0/build.conf b/frameworks/ComfyUI/0.19.0/build.conf deleted file mode 100644 index 5a5c534e298be4b59f928da10c9f6e1573634d4c..0000000000000000000000000000000000000000 --- a/frameworks/ComfyUI/0.19.0/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ConfyUI 0.19.0 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-comfyui -IMAGE_TAG=0.19.0 -GPU_TEST=true \ No newline at end of file diff --git a/frameworks/ComfyUI/0.19.0/test.sh b/frameworks/ComfyUI/0.19.0/test.sh deleted file mode 100644 index 858dba6aa6628d61061ef1231a7117962a1dc5e2..0000000000000000000000000000000000000000 --- a/frameworks/ComfyUI/0.19.0/test.sh +++ /dev/null @@ -1,252 +0,0 @@ -#!/bin/bash - -set -e - -IMAGE="${1:-}" - -if [ -z "${IMAGE}" ]; then - echo "用法: bash test.sh <镜像名:标签>" - exit 1 -fi - -if ! command -v docker >/dev/null 2>&1; then - echo "✗ 未找到 docker" - exit 1 -fi - -echo "=== ComfyUI 容器基础功能测试 ===" -echo "测试镜像: ${IMAGE}" - -docker run --rm --gpus all "${IMAGE}" /bin/bash -lc ' -set -e -export CUDA_HOME=/usr/local/cuda -export PATH=/usr/local/cuda/bin:$PATH -export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH -echo "=== ComfyUI GPU 镜像基础功能测试 ===" - -COMFYUI_DIR="${COMFYUI_DIR:-/opt/ComfyUI}" -COMFYUI_HOST="${COMFYUI_HOST:-127.0.0.1}" -COMFYUI_PORT="${COMFYUI_PORT:-18188}" -STRICT_GPU="${STRICT_GPU:-1}" -LOG_FILE="/tmp/comfyui_test.log" - -pass() { - echo "✓ 通过" -} - -fail() { - echo "✗ 失败" - if [ -f "$LOG_FILE" ]; then - echo "------ ComfyUI 日志 ------" - tail -n 120 "$LOG_FILE" || true - echo "-------------------------" - fi - exit 1 -} - -echo -echo "=== 1. 检查 ComfyUI 目录 ===" -echo -n "检查目录 ${COMFYUI_DIR}... " -if [ -d "$COMFYUI_DIR" ] && [ -f "$COMFYUI_DIR/main.py" ]; then - pass -else - fail -fi - -cd "$COMFYUI_DIR" - -echo -echo "=== 2. 检查 CUDA 基础环境 ===" - -echo -n "检查 nvidia-smi... " -if command -v nvidia-smi >/dev/null 2>&1; then - nvidia-smi >/tmp/nvidia_smi_test.log 2>&1 && pass || fail -else - if [ "$STRICT_GPU" = "1" ]; then - echo "未找到 nvidia-smi" - fail - else - echo "跳过,未找到 nvidia-smi" - fi -fi - -echo -n "检查 nvcc --version... " -if command -v nvcc >/dev/null 2>&1; then - nvcc --version >/tmp/nvcc_test.log 2>&1 && pass || fail -else - if [ "$STRICT_GPU" = "1" ]; then - echo "未找到 nvcc" - fail - else - echo "跳过,未找到 nvcc" - fi -fi - -echo -echo "=== 3. 检查 Python / PyTorch / CUDA ===" - -echo -n "检查 Python 版本... " -python3 --version && pass || fail - -echo -n "检查 torch import 和 CUDA 可用性... " -python3 - <<'PY' -import sys -import torch - -print("torch version:", torch.__version__) -print("torch cuda version:", torch.version.cuda) -print("torch cuda available:", torch.cuda.is_available()) - -if not torch.cuda.is_available(): - raise RuntimeError("torch.cuda.is_available() 为 False,GPU 不可用") - -count = torch.cuda.device_count() -print("cuda device count:", count) - -if count < 1: - raise RuntimeError("未检测到 CUDA 设备") - -for i in range(count): - print(f"cuda device {i}:", torch.cuda.get_device_name(i)) - -x = torch.ones((2, 2), device="cuda") -y = x @ x -assert y.is_cuda -assert y.shape == (2, 2) - -print("torch CUDA tensor test ok") -PY -pass - -echo -echo "=== 4. 检查 ComfyUI 核心模块 import ===" - -echo -n "检查 ComfyUI Python 模块... " -python3 - <<'PY' -import os -import sys - -sys.path.insert(0, os.getcwd()) - -import comfy -import folder_paths -import nodes - -print("comfy import ok") -print("folder_paths import ok") -print("nodes import ok") -print("registered node classes:", len(nodes.NODE_CLASS_MAPPINGS)) - -if len(nodes.NODE_CLASS_MAPPINGS) <= 0: - raise RuntimeError("ComfyUI 节点注册数量异常") -PY -pass - -echo -echo "=== 5. 启动 ComfyUI API 服务 ===" - -rm -f "$LOG_FILE" - -echo -n "启动 ComfyUI 服务 ${COMFYUI_HOST}:${COMFYUI_PORT}... " -python3 main.py \ - --listen "$COMFYUI_HOST" \ - --port "$COMFYUI_PORT" \ - >"$LOG_FILE" 2>&1 & - -COMFYUI_PID=$! - -cleanup() { - if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then - kill "$COMFYUI_PID" >/dev/null 2>&1 || true - wait "$COMFYUI_PID" >/dev/null 2>&1 || true - fi -} -trap cleanup EXIT - -sleep 3 - -if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then - pass -else - fail -fi - -echo -n "等待 ComfyUI API 就绪... " -python3 - <=4.28.1`、`tokenizers>=0.13.3`、`safetensors>=0.4.2`、`aiohttp`、`pyyaml`、`Pillow`、`scipy`、`tqdm`、`psutil`;非核心依赖有 `kornia>=0.7.1`、`spandrel`、`soundfile`。([GitHub][1]) | -| `v0.0.3` | 特殊版本:把 `torch` 固定为 `2.3.1`,`torchvision==0.18.1`,`torchaudio==2.3.1`,并加入 `numpy<2.0.0`。([GitHub][2]) | -| `v0.0.4`–`v0.3.10` | 回到未固定 `torch`/`torchvision`/`torchaudio`,并且这一段没有 `numpy`。([GitHub][3]) | -| `v0.3.11`–`v0.3.14` | 加入 `numpy>=1.25.0`。 | -| `v0.3.15`–`v0.3.18` | `aiohttp` 变为 `aiohttp>=3.11.8`,新增 `yarl>=1.18.0`,并加入 `av`。([GitHub][4]) | -| `v0.3.19`–`v0.3.28` | 开始引入 `comfyui-frontend-package`,从 `1.10.17` 逐步升到 `1.15.13`。([GitHub][5]) | -| `v0.3.29` | 新增 `comfyui-workflow-templates==0.1.1`。 | -| `v0.3.30`–`v0.3.39` | 新增 `pydantic~=2.0`;`av` 被约束到 `>=14.1.0`,随后到 `>=14.2.0`;前端包和 workflow templates 继续频繁升级。([GitHub][6]) | -| `v0.3.40` | 新增 `comfyui-embedded-docs==0.2.0`。 | -| `v0.3.41` | 新增数据库迁移相关依赖 `alembic`、`SQLAlchemy`,并新增 `pydantic-settings~=2.0`。([GitHub][7]) | -| `v0.3.42`–`v0.3.62` | 主要是 `comfyui-frontend-package`、`comfyui-workflow-templates`、`comfyui-embedded-docs` 版本升级;`soundfile` 仍在。 | -| `v0.3.63` | 删除 `soundfile`;其他核心依赖不变。([GitHub][8]) | -| `v0.3.72` | `transformers` 下限从 `>=4.37.2` 提到 `>=4.50.3`;workflow templates 进入 `0.7.x`。([GitHub][9]) | -| `v0.4.0`–`v0.7.0` | 基本延续 `v0.3.72+` 的依赖结构,主要更新前端、模板、docs 包版本。 | -| `v0.8.0` | 新增 `comfy-kitchen>=0.2.3`。([GitHub][10]) | -| `v0.9.0`–`v0.10.0` | `comfy-kitchen` 从 `>=0.2.6` 升到 `>=0.2.7`;前端、模板继续升级。 | -| `v0.11.0` | 新增 `requests`。([GitHub][11]) | -| `v0.12.0` | 新增 `comfy-aimdo>=0.1.7`。([GitHub][12]) | -| `v0.13.0`–`v0.14.2` | 主要升级 Comfy 自家包:frontend、workflow templates、embedded docs、`comfy-aimdo`。 | -| `v0.15.0`–`v0.15.1` | 新增 GUI/OpenGL 相关:`PyOpenGL`、`PyOpenGL-accelerate`、`glfw`;`comfy-aimdo` 升至 `>=0.2.x`。([GitHub][13]) | -| `v0.16.0` | 移除 `PyOpenGL-accelerate`,保留 `PyOpenGL`、`glfw`;embedded docs 升到 `0.4.3`。([GitHub][14]) | -| `v0.16.4` | 新增 `simpleeval>=1.0.0`。([GitHub][15]) | -| `v0.17.0` | 新增 `filelock`、`blake3`;`comfy-kitchen>=0.2.8`、`comfy-aimdo>=0.2.10`。([GitHub][16]) | -| `v0.18.0`–`v0.18.5` | `comfy-aimdo` 升到 `>=0.2.12`;workflow templates 从 `0.9.26` 升到 `0.9.43`;前端为 `1.41.21`。([GitHub][17]) | -| `v0.19.0`–`v0.19.5` | 前端升到 `1.42.x`;workflow templates 从 `0.9.47` 升到 `0.9.61`;其他核心依赖基本不变。([GitHub][18]) | -| `latest` | 这是旧 tag,内容非常不同:有 `torchdiffeq`、`open-clip-torch`、`pytorch_lightning`、`accelerate`,`transformers>=4.25.1`,`safetensors>=0.3.0`;没有后来的 `torchvision`、`torchaudio`、`kornia`、`spandrel`、Comfy 自家前端包等。([GitHub][19]) | - -[1]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.1/requirements.txt "raw.githubusercontent.com" -[2]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.3/requirements.txt "raw.githubusercontent.com" -[3]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.4/requirements.txt "raw.githubusercontent.com" -[4]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.18/requirements.txt "raw.githubusercontent.com" -[5]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.19/requirements.txt "raw.githubusercontent.com" -[6]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.30/requirements.txt "raw.githubusercontent.com" -[7]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.41/requirements.txt "raw.githubusercontent.com" -[8]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.63/requirements.txt "raw.githubusercontent.com" -[9]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.72/requirements.txt "raw.githubusercontent.com" -[10]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.8.0/requirements.txt "raw.githubusercontent.com" -[11]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.11.0/requirements.txt "raw.githubusercontent.com" -[12]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.12.0/requirements.txt "raw.githubusercontent.com" -[13]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.15.0/requirements.txt "raw.githubusercontent.com" -[14]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.0/requirements.txt "raw.githubusercontent.com" -[15]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.4/requirements.txt "raw.githubusercontent.com" -[16]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.17.0/requirements.txt "raw.githubusercontent.com" -[17]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.18.0/requirements.txt "raw.githubusercontent.com" -[18]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.19.0/requirements.txt "raw.githubusercontent.com" -[19]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/latest/requirements.txt "raw.githubusercontent.com" - - - - - -### v0.19.x 逐 tag 差异 - -| tag | `comfyui-frontend-package` | `comfyui-workflow-templates` | 其他 | -| ------------------- | -------------------------: | ---------------------------: | ------------- | -| `v0.19.0` | `1.42.10` | `0.9.47` | 其余核心依赖同后续基本一致 | -| `v0.19.1`–`v0.19.2` | `1.42.11` | `0.9.54` | 无结构性新增/删除 | -| `v0.19.3` | `1.42.11` | `0.9.57` | 只升模板包 | -| `v0.19.4` | `1.42.14` | `0.9.57` | 只升前端包 | -| `v0.19.5` | `1.42.14` | `0.9.61` | 只升模板包 | - - - - -## 启动代码会自动设置的环境变量 - -| 环境变量 | 什么时候设置 | 作用/说明 | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| `HF_HUB_DISABLE_TELEMETRY=1` | 启动时自动设置 | 注释说明主要给 custom nodes 用,core ComfyUI 本身不依赖它。 | -| `DO_NOT_TRACK=1` | 启动时自动设置 | 同上,用于关闭/提示关闭追踪。 | -| `MIMALLOC_PURGE_DELAY=0` | Windows 下自动设置 | Windows 内存 allocator 相关。 | -| `TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1` | 直接运行 `main.py` 时设置 | ROCm/Torch 相关实验开关。 | -| `CUDA_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 NVIDIA CUDA 可见设备。 | -| `HIP_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 AMD HIP/ROCm 可见设备。 | -| `ASCEND_RT_VISIBLE_DEVICES` | 使用 `--cuda-device` 时设置 | 控制 Ascend NPU 可见设备。 | -| `ONEAPI_DEVICE_SELECTOR` | 使用 `--oneapi-device-selector` 时设置 | 控制 Intel oneAPI 设备选择。 | -| `CUBLAS_WORKSPACE_CONFIG=:4096:8` | 使用 `--deterministic` 且变量未预设时设置 | PyTorch 确定性计算相关。 | -| `OCL_SET_SVM_SIZE=262144` | 检测到 ROCm 版本时设置 | AMD ROCm 相关。 | diff --git a/frameworks/ComfyUI/0.19.1/build.conf b/frameworks/ComfyUI/0.19.1/build.conf deleted file mode 100644 index 64d70867c87c71717d2aef083b935305bcc37e3f..0000000000000000000000000000000000000000 --- a/frameworks/ComfyUI/0.19.1/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ConfyUI 0.19.1 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-comfyui -IMAGE_TAG=0.19.1 -GPU_TEST=true \ No newline at end of file diff --git a/frameworks/ComfyUI/0.19.1/test.sh b/frameworks/ComfyUI/0.19.1/test.sh deleted file mode 100644 index 858dba6aa6628d61061ef1231a7117962a1dc5e2..0000000000000000000000000000000000000000 --- a/frameworks/ComfyUI/0.19.1/test.sh +++ /dev/null @@ -1,252 +0,0 @@ -#!/bin/bash - -set -e - -IMAGE="${1:-}" - -if [ -z "${IMAGE}" ]; then - echo "用法: bash test.sh <镜像名:标签>" - exit 1 -fi - -if ! command -v docker >/dev/null 2>&1; then - echo "✗ 未找到 docker" - exit 1 -fi - -echo "=== ComfyUI 容器基础功能测试 ===" -echo "测试镜像: ${IMAGE}" - -docker run --rm --gpus all "${IMAGE}" /bin/bash -lc ' -set -e -export CUDA_HOME=/usr/local/cuda -export PATH=/usr/local/cuda/bin:$PATH -export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH -echo "=== ComfyUI GPU 镜像基础功能测试 ===" - -COMFYUI_DIR="${COMFYUI_DIR:-/opt/ComfyUI}" -COMFYUI_HOST="${COMFYUI_HOST:-127.0.0.1}" -COMFYUI_PORT="${COMFYUI_PORT:-18188}" -STRICT_GPU="${STRICT_GPU:-1}" -LOG_FILE="/tmp/comfyui_test.log" - -pass() { - echo "✓ 通过" -} - -fail() { - echo "✗ 失败" - if [ -f "$LOG_FILE" ]; then - echo "------ ComfyUI 日志 ------" - tail -n 120 "$LOG_FILE" || true - echo "-------------------------" - fi - exit 1 -} - -echo -echo "=== 1. 检查 ComfyUI 目录 ===" -echo -n "检查目录 ${COMFYUI_DIR}... " -if [ -d "$COMFYUI_DIR" ] && [ -f "$COMFYUI_DIR/main.py" ]; then - pass -else - fail -fi - -cd "$COMFYUI_DIR" - -echo -echo "=== 2. 检查 CUDA 基础环境 ===" - -echo -n "检查 nvidia-smi... " -if command -v nvidia-smi >/dev/null 2>&1; then - nvidia-smi >/tmp/nvidia_smi_test.log 2>&1 && pass || fail -else - if [ "$STRICT_GPU" = "1" ]; then - echo "未找到 nvidia-smi" - fail - else - echo "跳过,未找到 nvidia-smi" - fi -fi - -echo -n "检查 nvcc --version... " -if command -v nvcc >/dev/null 2>&1; then - nvcc --version >/tmp/nvcc_test.log 2>&1 && pass || fail -else - if [ "$STRICT_GPU" = "1" ]; then - echo "未找到 nvcc" - fail - else - echo "跳过,未找到 nvcc" - fi -fi - -echo -echo "=== 3. 检查 Python / PyTorch / CUDA ===" - -echo -n "检查 Python 版本... " -python3 --version && pass || fail - -echo -n "检查 torch import 和 CUDA 可用性... " -python3 - <<'PY' -import sys -import torch - -print("torch version:", torch.__version__) -print("torch cuda version:", torch.version.cuda) -print("torch cuda available:", torch.cuda.is_available()) - -if not torch.cuda.is_available(): - raise RuntimeError("torch.cuda.is_available() 为 False,GPU 不可用") - -count = torch.cuda.device_count() -print("cuda device count:", count) - -if count < 1: - raise RuntimeError("未检测到 CUDA 设备") - -for i in range(count): - print(f"cuda device {i}:", torch.cuda.get_device_name(i)) - -x = torch.ones((2, 2), device="cuda") -y = x @ x -assert y.is_cuda -assert y.shape == (2, 2) - -print("torch CUDA tensor test ok") -PY -pass - -echo -echo "=== 4. 检查 ComfyUI 核心模块 import ===" - -echo -n "检查 ComfyUI Python 模块... " -python3 - <<'PY' -import os -import sys - -sys.path.insert(0, os.getcwd()) - -import comfy -import folder_paths -import nodes - -print("comfy import ok") -print("folder_paths import ok") -print("nodes import ok") -print("registered node classes:", len(nodes.NODE_CLASS_MAPPINGS)) - -if len(nodes.NODE_CLASS_MAPPINGS) <= 0: - raise RuntimeError("ComfyUI 节点注册数量异常") -PY -pass - -echo -echo "=== 5. 启动 ComfyUI API 服务 ===" - -rm -f "$LOG_FILE" - -echo -n "启动 ComfyUI 服务 ${COMFYUI_HOST}:${COMFYUI_PORT}... " -python3 main.py \ - --listen "$COMFYUI_HOST" \ - --port "$COMFYUI_PORT" \ - >"$LOG_FILE" 2>&1 & - -COMFYUI_PID=$! - -cleanup() { - if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then - kill "$COMFYUI_PID" >/dev/null 2>&1 || true - wait "$COMFYUI_PID" >/dev/null 2>&1 || true - fi -} -trap cleanup EXIT - -sleep 3 - -if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then - pass -else - fail -fi - -echo -n "等待 ComfyUI API 就绪... " -python3 - <=4.28.1`、`tokenizers>=0.13.3`、`safetensors>=0.4.2`、`aiohttp`、`pyyaml`、`Pillow`、`scipy`、`tqdm`、`psutil`;非核心依赖有 `kornia>=0.7.1`、`spandrel`、`soundfile`。([GitHub][1]) | -| `v0.0.3` | 特殊版本:把 `torch` 固定为 `2.3.1`,`torchvision==0.18.1`,`torchaudio==2.3.1`,并加入 `numpy<2.0.0`。([GitHub][2]) | -| `v0.0.4`–`v0.3.10` | 回到未固定 `torch`/`torchvision`/`torchaudio`,并且这一段没有 `numpy`。([GitHub][3]) | -| `v0.3.11`–`v0.3.14` | 加入 `numpy>=1.25.0`。 | -| `v0.3.15`–`v0.3.18` | `aiohttp` 变为 `aiohttp>=3.11.8`,新增 `yarl>=1.18.0`,并加入 `av`。([GitHub][4]) | -| `v0.3.19`–`v0.3.28` | 开始引入 `comfyui-frontend-package`,从 `1.10.17` 逐步升到 `1.15.13`。([GitHub][5]) | -| `v0.3.29` | 新增 `comfyui-workflow-templates==0.1.1`。 | -| `v0.3.30`–`v0.3.39` | 新增 `pydantic~=2.0`;`av` 被约束到 `>=14.1.0`,随后到 `>=14.2.0`;前端包和 workflow templates 继续频繁升级。([GitHub][6]) | -| `v0.3.40` | 新增 `comfyui-embedded-docs==0.2.0`。 | -| `v0.3.41` | 新增数据库迁移相关依赖 `alembic`、`SQLAlchemy`,并新增 `pydantic-settings~=2.0`。([GitHub][7]) | -| `v0.3.42`–`v0.3.62` | 主要是 `comfyui-frontend-package`、`comfyui-workflow-templates`、`comfyui-embedded-docs` 版本升级;`soundfile` 仍在。 | -| `v0.3.63` | 删除 `soundfile`;其他核心依赖不变。([GitHub][8]) | -| `v0.3.72` | `transformers` 下限从 `>=4.37.2` 提到 `>=4.50.3`;workflow templates 进入 `0.7.x`。([GitHub][9]) | -| `v0.4.0`–`v0.7.0` | 基本延续 `v0.3.72+` 的依赖结构,主要更新前端、模板、docs 包版本。 | -| `v0.8.0` | 新增 `comfy-kitchen>=0.2.3`。([GitHub][10]) | -| `v0.9.0`–`v0.10.0` | `comfy-kitchen` 从 `>=0.2.6` 升到 `>=0.2.7`;前端、模板继续升级。 | -| `v0.11.0` | 新增 `requests`。([GitHub][11]) | -| `v0.12.0` | 新增 `comfy-aimdo>=0.1.7`。([GitHub][12]) | -| `v0.13.0`–`v0.14.2` | 主要升级 Comfy 自家包:frontend、workflow templates、embedded docs、`comfy-aimdo`。 | -| `v0.15.0`–`v0.15.1` | 新增 GUI/OpenGL 相关:`PyOpenGL`、`PyOpenGL-accelerate`、`glfw`;`comfy-aimdo` 升至 `>=0.2.x`。([GitHub][13]) | -| `v0.16.0` | 移除 `PyOpenGL-accelerate`,保留 `PyOpenGL`、`glfw`;embedded docs 升到 `0.4.3`。([GitHub][14]) | -| `v0.16.4` | 新增 `simpleeval>=1.0.0`。([GitHub][15]) | -| `v0.17.0` | 新增 `filelock`、`blake3`;`comfy-kitchen>=0.2.8`、`comfy-aimdo>=0.2.10`。([GitHub][16]) | -| `v0.18.0`–`v0.18.5` | `comfy-aimdo` 升到 `>=0.2.12`;workflow templates 从 `0.9.26` 升到 `0.9.43`;前端为 `1.41.21`。([GitHub][17]) | -| `v0.19.0`–`v0.19.5` | 前端升到 `1.42.x`;workflow templates 从 `0.9.47` 升到 `0.9.61`;其他核心依赖基本不变。([GitHub][18]) | -| `latest` | 这是旧 tag,内容非常不同:有 `torchdiffeq`、`open-clip-torch`、`pytorch_lightning`、`accelerate`,`transformers>=4.25.1`,`safetensors>=0.3.0`;没有后来的 `torchvision`、`torchaudio`、`kornia`、`spandrel`、Comfy 自家前端包等。([GitHub][19]) | - -[1]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.1/requirements.txt "raw.githubusercontent.com" -[2]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.3/requirements.txt "raw.githubusercontent.com" -[3]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.4/requirements.txt "raw.githubusercontent.com" -[4]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.18/requirements.txt "raw.githubusercontent.com" -[5]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.19/requirements.txt "raw.githubusercontent.com" -[6]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.30/requirements.txt "raw.githubusercontent.com" -[7]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.41/requirements.txt "raw.githubusercontent.com" -[8]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.63/requirements.txt "raw.githubusercontent.com" -[9]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.72/requirements.txt "raw.githubusercontent.com" -[10]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.8.0/requirements.txt "raw.githubusercontent.com" -[11]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.11.0/requirements.txt "raw.githubusercontent.com" -[12]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.12.0/requirements.txt "raw.githubusercontent.com" -[13]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.15.0/requirements.txt "raw.githubusercontent.com" -[14]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.0/requirements.txt "raw.githubusercontent.com" -[15]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.4/requirements.txt "raw.githubusercontent.com" -[16]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.17.0/requirements.txt "raw.githubusercontent.com" -[17]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.18.0/requirements.txt "raw.githubusercontent.com" -[18]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.19.0/requirements.txt "raw.githubusercontent.com" -[19]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/latest/requirements.txt "raw.githubusercontent.com" - - - - - -### v0.19.x 逐 tag 差异 - -| tag | `comfyui-frontend-package` | `comfyui-workflow-templates` | 其他 | -| ------------------- | -------------------------: | ---------------------------: | ------------- | -| `v0.19.0` | `1.42.10` | `0.9.47` | 其余核心依赖同后续基本一致 | -| `v0.19.1`–`v0.19.2` | `1.42.11` | `0.9.54` | 无结构性新增/删除 | -| `v0.19.3` | `1.42.11` | `0.9.57` | 只升模板包 | -| `v0.19.4` | `1.42.14` | `0.9.57` | 只升前端包 | -| `v0.19.5` | `1.42.14` | `0.9.61` | 只升模板包 | - - - - -## 启动代码会自动设置的环境变量 - -| 环境变量 | 什么时候设置 | 作用/说明 | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| `HF_HUB_DISABLE_TELEMETRY=1` | 启动时自动设置 | 注释说明主要给 custom nodes 用,core ComfyUI 本身不依赖它。 | -| `DO_NOT_TRACK=1` | 启动时自动设置 | 同上,用于关闭/提示关闭追踪。 | -| `MIMALLOC_PURGE_DELAY=0` | Windows 下自动设置 | Windows 内存 allocator 相关。 | -| `TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1` | 直接运行 `main.py` 时设置 | ROCm/Torch 相关实验开关。 | -| `CUDA_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 NVIDIA CUDA 可见设备。 | -| `HIP_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 AMD HIP/ROCm 可见设备。 | -| `ASCEND_RT_VISIBLE_DEVICES` | 使用 `--cuda-device` 时设置 | 控制 Ascend NPU 可见设备。 | -| `ONEAPI_DEVICE_SELECTOR` | 使用 `--oneapi-device-selector` 时设置 | 控制 Intel oneAPI 设备选择。 | -| `CUBLAS_WORKSPACE_CONFIG=:4096:8` | 使用 `--deterministic` 且变量未预设时设置 | PyTorch 确定性计算相关。 | -| `OCL_SET_SVM_SIZE=262144` | 检测到 ROCm 版本时设置 | AMD ROCm 相关。 | diff --git a/frameworks/ComfyUI/0.19.2/build.conf b/frameworks/ComfyUI/0.19.2/build.conf deleted file mode 100644 index 76a24a0c3049ef29174334aee7cb4a96d46ad878..0000000000000000000000000000000000000000 --- a/frameworks/ComfyUI/0.19.2/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ConfyUI 0.19.2 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-comfyui -IMAGE_TAG=0.19.2 -GPU_TEST=true \ No newline at end of file diff --git a/frameworks/ComfyUI/0.19.2/test.sh b/frameworks/ComfyUI/0.19.2/test.sh deleted file mode 100644 index 858dba6aa6628d61061ef1231a7117962a1dc5e2..0000000000000000000000000000000000000000 --- a/frameworks/ComfyUI/0.19.2/test.sh +++ /dev/null @@ -1,252 +0,0 @@ -#!/bin/bash - -set -e - -IMAGE="${1:-}" - -if [ -z "${IMAGE}" ]; then - echo "用法: bash test.sh <镜像名:标签>" - exit 1 -fi - -if ! command -v docker >/dev/null 2>&1; then - echo "✗ 未找到 docker" - exit 1 -fi - -echo "=== ComfyUI 容器基础功能测试 ===" -echo "测试镜像: ${IMAGE}" - -docker run --rm --gpus all "${IMAGE}" /bin/bash -lc ' -set -e -export CUDA_HOME=/usr/local/cuda -export PATH=/usr/local/cuda/bin:$PATH -export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH -echo "=== ComfyUI GPU 镜像基础功能测试 ===" - -COMFYUI_DIR="${COMFYUI_DIR:-/opt/ComfyUI}" -COMFYUI_HOST="${COMFYUI_HOST:-127.0.0.1}" -COMFYUI_PORT="${COMFYUI_PORT:-18188}" -STRICT_GPU="${STRICT_GPU:-1}" -LOG_FILE="/tmp/comfyui_test.log" - -pass() { - echo "✓ 通过" -} - -fail() { - echo "✗ 失败" - if [ -f "$LOG_FILE" ]; then - echo "------ ComfyUI 日志 ------" - tail -n 120 "$LOG_FILE" || true - echo "-------------------------" - fi - exit 1 -} - -echo -echo "=== 1. 检查 ComfyUI 目录 ===" -echo -n "检查目录 ${COMFYUI_DIR}... " -if [ -d "$COMFYUI_DIR" ] && [ -f "$COMFYUI_DIR/main.py" ]; then - pass -else - fail -fi - -cd "$COMFYUI_DIR" - -echo -echo "=== 2. 检查 CUDA 基础环境 ===" - -echo -n "检查 nvidia-smi... " -if command -v nvidia-smi >/dev/null 2>&1; then - nvidia-smi >/tmp/nvidia_smi_test.log 2>&1 && pass || fail -else - if [ "$STRICT_GPU" = "1" ]; then - echo "未找到 nvidia-smi" - fail - else - echo "跳过,未找到 nvidia-smi" - fi -fi - -echo -n "检查 nvcc --version... " -if command -v nvcc >/dev/null 2>&1; then - nvcc --version >/tmp/nvcc_test.log 2>&1 && pass || fail -else - if [ "$STRICT_GPU" = "1" ]; then - echo "未找到 nvcc" - fail - else - echo "跳过,未找到 nvcc" - fi -fi - -echo -echo "=== 3. 检查 Python / PyTorch / CUDA ===" - -echo -n "检查 Python 版本... " -python3 --version && pass || fail - -echo -n "检查 torch import 和 CUDA 可用性... " -python3 - <<'PY' -import sys -import torch - -print("torch version:", torch.__version__) -print("torch cuda version:", torch.version.cuda) -print("torch cuda available:", torch.cuda.is_available()) - -if not torch.cuda.is_available(): - raise RuntimeError("torch.cuda.is_available() 为 False,GPU 不可用") - -count = torch.cuda.device_count() -print("cuda device count:", count) - -if count < 1: - raise RuntimeError("未检测到 CUDA 设备") - -for i in range(count): - print(f"cuda device {i}:", torch.cuda.get_device_name(i)) - -x = torch.ones((2, 2), device="cuda") -y = x @ x -assert y.is_cuda -assert y.shape == (2, 2) - -print("torch CUDA tensor test ok") -PY -pass - -echo -echo "=== 4. 检查 ComfyUI 核心模块 import ===" - -echo -n "检查 ComfyUI Python 模块... " -python3 - <<'PY' -import os -import sys - -sys.path.insert(0, os.getcwd()) - -import comfy -import folder_paths -import nodes - -print("comfy import ok") -print("folder_paths import ok") -print("nodes import ok") -print("registered node classes:", len(nodes.NODE_CLASS_MAPPINGS)) - -if len(nodes.NODE_CLASS_MAPPINGS) <= 0: - raise RuntimeError("ComfyUI 节点注册数量异常") -PY -pass - -echo -echo "=== 5. 启动 ComfyUI API 服务 ===" - -rm -f "$LOG_FILE" - -echo -n "启动 ComfyUI 服务 ${COMFYUI_HOST}:${COMFYUI_PORT}... " -python3 main.py \ - --listen "$COMFYUI_HOST" \ - --port "$COMFYUI_PORT" \ - >"$LOG_FILE" 2>&1 & - -COMFYUI_PID=$! - -cleanup() { - if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then - kill "$COMFYUI_PID" >/dev/null 2>&1 || true - wait "$COMFYUI_PID" >/dev/null 2>&1 || true - fi -} -trap cleanup EXIT - -sleep 3 - -if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then - pass -else - fail -fi - -echo -n "等待 ComfyUI API 就绪... " -python3 - <=4.28.1`、`tokenizers>=0.13.3`、`safetensors>=0.4.2`、`aiohttp`、`pyyaml`、`Pillow`、`scipy`、`tqdm`、`psutil`;非核心依赖有 `kornia>=0.7.1`、`spandrel`、`soundfile`。([GitHub][1]) | -| `v0.0.3` | 特殊版本:把 `torch` 固定为 `2.3.1`,`torchvision==0.18.1`,`torchaudio==2.3.1`,并加入 `numpy<2.0.0`。([GitHub][2]) | -| `v0.0.4`–`v0.3.10` | 回到未固定 `torch`/`torchvision`/`torchaudio`,并且这一段没有 `numpy`。([GitHub][3]) | -| `v0.3.11`–`v0.3.14` | 加入 `numpy>=1.25.0`。 | -| `v0.3.15`–`v0.3.18` | `aiohttp` 变为 `aiohttp>=3.11.8`,新增 `yarl>=1.18.0`,并加入 `av`。([GitHub][4]) | -| `v0.3.19`–`v0.3.28` | 开始引入 `comfyui-frontend-package`,从 `1.10.17` 逐步升到 `1.15.13`。([GitHub][5]) | -| `v0.3.29` | 新增 `comfyui-workflow-templates==0.1.1`。 | -| `v0.3.30`–`v0.3.39` | 新增 `pydantic~=2.0`;`av` 被约束到 `>=14.1.0`,随后到 `>=14.2.0`;前端包和 workflow templates 继续频繁升级。([GitHub][6]) | -| `v0.3.40` | 新增 `comfyui-embedded-docs==0.2.0`。 | -| `v0.3.41` | 新增数据库迁移相关依赖 `alembic`、`SQLAlchemy`,并新增 `pydantic-settings~=2.0`。([GitHub][7]) | -| `v0.3.42`–`v0.3.62` | 主要是 `comfyui-frontend-package`、`comfyui-workflow-templates`、`comfyui-embedded-docs` 版本升级;`soundfile` 仍在。 | -| `v0.3.63` | 删除 `soundfile`;其他核心依赖不变。([GitHub][8]) | -| `v0.3.72` | `transformers` 下限从 `>=4.37.2` 提到 `>=4.50.3`;workflow templates 进入 `0.7.x`。([GitHub][9]) | -| `v0.4.0`–`v0.7.0` | 基本延续 `v0.3.72+` 的依赖结构,主要更新前端、模板、docs 包版本。 | -| `v0.8.0` | 新增 `comfy-kitchen>=0.2.3`。([GitHub][10]) | -| `v0.9.0`–`v0.10.0` | `comfy-kitchen` 从 `>=0.2.6` 升到 `>=0.2.7`;前端、模板继续升级。 | -| `v0.11.0` | 新增 `requests`。([GitHub][11]) | -| `v0.12.0` | 新增 `comfy-aimdo>=0.1.7`。([GitHub][12]) | -| `v0.13.0`–`v0.14.2` | 主要升级 Comfy 自家包:frontend、workflow templates、embedded docs、`comfy-aimdo`。 | -| `v0.15.0`–`v0.15.1` | 新增 GUI/OpenGL 相关:`PyOpenGL`、`PyOpenGL-accelerate`、`glfw`;`comfy-aimdo` 升至 `>=0.2.x`。([GitHub][13]) | -| `v0.16.0` | 移除 `PyOpenGL-accelerate`,保留 `PyOpenGL`、`glfw`;embedded docs 升到 `0.4.3`。([GitHub][14]) | -| `v0.16.4` | 新增 `simpleeval>=1.0.0`。([GitHub][15]) | -| `v0.17.0` | 新增 `filelock`、`blake3`;`comfy-kitchen>=0.2.8`、`comfy-aimdo>=0.2.10`。([GitHub][16]) | -| `v0.18.0`–`v0.18.5` | `comfy-aimdo` 升到 `>=0.2.12`;workflow templates 从 `0.9.26` 升到 `0.9.43`;前端为 `1.41.21`。([GitHub][17]) | -| `v0.19.0`–`v0.19.5` | 前端升到 `1.42.x`;workflow templates 从 `0.9.47` 升到 `0.9.61`;其他核心依赖基本不变。([GitHub][18]) | -| `latest` | 这是旧 tag,内容非常不同:有 `torchdiffeq`、`open-clip-torch`、`pytorch_lightning`、`accelerate`,`transformers>=4.25.1`,`safetensors>=0.3.0`;没有后来的 `torchvision`、`torchaudio`、`kornia`、`spandrel`、Comfy 自家前端包等。([GitHub][19]) | - -[1]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.1/requirements.txt "raw.githubusercontent.com" -[2]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.3/requirements.txt "raw.githubusercontent.com" -[3]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.4/requirements.txt "raw.githubusercontent.com" -[4]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.18/requirements.txt "raw.githubusercontent.com" -[5]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.19/requirements.txt "raw.githubusercontent.com" -[6]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.30/requirements.txt "raw.githubusercontent.com" -[7]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.41/requirements.txt "raw.githubusercontent.com" -[8]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.63/requirements.txt "raw.githubusercontent.com" -[9]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.72/requirements.txt "raw.githubusercontent.com" -[10]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.8.0/requirements.txt "raw.githubusercontent.com" -[11]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.11.0/requirements.txt "raw.githubusercontent.com" -[12]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.12.0/requirements.txt "raw.githubusercontent.com" -[13]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.15.0/requirements.txt "raw.githubusercontent.com" -[14]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.0/requirements.txt "raw.githubusercontent.com" -[15]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.4/requirements.txt "raw.githubusercontent.com" -[16]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.17.0/requirements.txt "raw.githubusercontent.com" -[17]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.18.0/requirements.txt "raw.githubusercontent.com" -[18]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.19.0/requirements.txt "raw.githubusercontent.com" -[19]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/latest/requirements.txt "raw.githubusercontent.com" - - - - - -### v0.19.x 逐 tag 差异 - -| tag | `comfyui-frontend-package` | `comfyui-workflow-templates` | 其他 | -| ------------------- | -------------------------: | ---------------------------: | ------------- | -| `v0.19.0` | `1.42.10` | `0.9.47` | 其余核心依赖同后续基本一致 | -| `v0.19.1`–`v0.19.2` | `1.42.11` | `0.9.54` | 无结构性新增/删除 | -| `v0.19.3` | `1.42.11` | `0.9.57` | 只升模板包 | -| `v0.19.4` | `1.42.14` | `0.9.57` | 只升前端包 | -| `v0.19.5` | `1.42.14` | `0.9.61` | 只升模板包 | - - - - -## 启动代码会自动设置的环境变量 - -| 环境变量 | 什么时候设置 | 作用/说明 | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| `HF_HUB_DISABLE_TELEMETRY=1` | 启动时自动设置 | 注释说明主要给 custom nodes 用,core ComfyUI 本身不依赖它。 | -| `DO_NOT_TRACK=1` | 启动时自动设置 | 同上,用于关闭/提示关闭追踪。 | -| `MIMALLOC_PURGE_DELAY=0` | Windows 下自动设置 | Windows 内存 allocator 相关。 | -| `TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1` | 直接运行 `main.py` 时设置 | ROCm/Torch 相关实验开关。 | -| `CUDA_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 NVIDIA CUDA 可见设备。 | -| `HIP_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 AMD HIP/ROCm 可见设备。 | -| `ASCEND_RT_VISIBLE_DEVICES` | 使用 `--cuda-device` 时设置 | 控制 Ascend NPU 可见设备。 | -| `ONEAPI_DEVICE_SELECTOR` | 使用 `--oneapi-device-selector` 时设置 | 控制 Intel oneAPI 设备选择。 | -| `CUBLAS_WORKSPACE_CONFIG=:4096:8` | 使用 `--deterministic` 且变量未预设时设置 | PyTorch 确定性计算相关。 | -| `OCL_SET_SVM_SIZE=262144` | 检测到 ROCm 版本时设置 | AMD ROCm 相关。 | diff --git a/frameworks/ComfyUI/0.19.3/build.conf b/frameworks/ComfyUI/0.19.3/build.conf deleted file mode 100644 index e22eee33376452951ed6962dfa916ed12690b53d..0000000000000000000000000000000000000000 --- a/frameworks/ComfyUI/0.19.3/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ConfyUI 0.19.3 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-comfyui -IMAGE_TAG=0.19.3 -GPU_TEST=true \ No newline at end of file diff --git a/frameworks/ComfyUI/0.19.3/test.sh b/frameworks/ComfyUI/0.19.3/test.sh deleted file mode 100644 index 858dba6aa6628d61061ef1231a7117962a1dc5e2..0000000000000000000000000000000000000000 --- a/frameworks/ComfyUI/0.19.3/test.sh +++ /dev/null @@ -1,252 +0,0 @@ -#!/bin/bash - -set -e - -IMAGE="${1:-}" - -if [ -z "${IMAGE}" ]; then - echo "用法: bash test.sh <镜像名:标签>" - exit 1 -fi - -if ! command -v docker >/dev/null 2>&1; then - echo "✗ 未找到 docker" - exit 1 -fi - -echo "=== ComfyUI 容器基础功能测试 ===" -echo "测试镜像: ${IMAGE}" - -docker run --rm --gpus all "${IMAGE}" /bin/bash -lc ' -set -e -export CUDA_HOME=/usr/local/cuda -export PATH=/usr/local/cuda/bin:$PATH -export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH -echo "=== ComfyUI GPU 镜像基础功能测试 ===" - -COMFYUI_DIR="${COMFYUI_DIR:-/opt/ComfyUI}" -COMFYUI_HOST="${COMFYUI_HOST:-127.0.0.1}" -COMFYUI_PORT="${COMFYUI_PORT:-18188}" -STRICT_GPU="${STRICT_GPU:-1}" -LOG_FILE="/tmp/comfyui_test.log" - -pass() { - echo "✓ 通过" -} - -fail() { - echo "✗ 失败" - if [ -f "$LOG_FILE" ]; then - echo "------ ComfyUI 日志 ------" - tail -n 120 "$LOG_FILE" || true - echo "-------------------------" - fi - exit 1 -} - -echo -echo "=== 1. 检查 ComfyUI 目录 ===" -echo -n "检查目录 ${COMFYUI_DIR}... " -if [ -d "$COMFYUI_DIR" ] && [ -f "$COMFYUI_DIR/main.py" ]; then - pass -else - fail -fi - -cd "$COMFYUI_DIR" - -echo -echo "=== 2. 检查 CUDA 基础环境 ===" - -echo -n "检查 nvidia-smi... " -if command -v nvidia-smi >/dev/null 2>&1; then - nvidia-smi >/tmp/nvidia_smi_test.log 2>&1 && pass || fail -else - if [ "$STRICT_GPU" = "1" ]; then - echo "未找到 nvidia-smi" - fail - else - echo "跳过,未找到 nvidia-smi" - fi -fi - -echo -n "检查 nvcc --version... " -if command -v nvcc >/dev/null 2>&1; then - nvcc --version >/tmp/nvcc_test.log 2>&1 && pass || fail -else - if [ "$STRICT_GPU" = "1" ]; then - echo "未找到 nvcc" - fail - else - echo "跳过,未找到 nvcc" - fi -fi - -echo -echo "=== 3. 检查 Python / PyTorch / CUDA ===" - -echo -n "检查 Python 版本... " -python3 --version && pass || fail - -echo -n "检查 torch import 和 CUDA 可用性... " -python3 - <<'PY' -import sys -import torch - -print("torch version:", torch.__version__) -print("torch cuda version:", torch.version.cuda) -print("torch cuda available:", torch.cuda.is_available()) - -if not torch.cuda.is_available(): - raise RuntimeError("torch.cuda.is_available() 为 False,GPU 不可用") - -count = torch.cuda.device_count() -print("cuda device count:", count) - -if count < 1: - raise RuntimeError("未检测到 CUDA 设备") - -for i in range(count): - print(f"cuda device {i}:", torch.cuda.get_device_name(i)) - -x = torch.ones((2, 2), device="cuda") -y = x @ x -assert y.is_cuda -assert y.shape == (2, 2) - -print("torch CUDA tensor test ok") -PY -pass - -echo -echo "=== 4. 检查 ComfyUI 核心模块 import ===" - -echo -n "检查 ComfyUI Python 模块... " -python3 - <<'PY' -import os -import sys - -sys.path.insert(0, os.getcwd()) - -import comfy -import folder_paths -import nodes - -print("comfy import ok") -print("folder_paths import ok") -print("nodes import ok") -print("registered node classes:", len(nodes.NODE_CLASS_MAPPINGS)) - -if len(nodes.NODE_CLASS_MAPPINGS) <= 0: - raise RuntimeError("ComfyUI 节点注册数量异常") -PY -pass - -echo -echo "=== 5. 启动 ComfyUI API 服务 ===" - -rm -f "$LOG_FILE" - -echo -n "启动 ComfyUI 服务 ${COMFYUI_HOST}:${COMFYUI_PORT}... " -python3 main.py \ - --listen "$COMFYUI_HOST" \ - --port "$COMFYUI_PORT" \ - >"$LOG_FILE" 2>&1 & - -COMFYUI_PID=$! - -cleanup() { - if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then - kill "$COMFYUI_PID" >/dev/null 2>&1 || true - wait "$COMFYUI_PID" >/dev/null 2>&1 || true - fi -} -trap cleanup EXIT - -sleep 3 - -if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then - pass -else - fail -fi - -echo -n "等待 ComfyUI API 就绪... " -python3 - <=4.28.1`、`tokenizers>=0.13.3`、`safetensors>=0.4.2`、`aiohttp`、`pyyaml`、`Pillow`、`scipy`、`tqdm`、`psutil`;非核心依赖有 `kornia>=0.7.1`、`spandrel`、`soundfile`。([GitHub][1]) | -| `v0.0.3` | 特殊版本:把 `torch` 固定为 `2.3.1`,`torchvision==0.18.1`,`torchaudio==2.3.1`,并加入 `numpy<2.0.0`。([GitHub][2]) | -| `v0.0.4`–`v0.3.10` | 回到未固定 `torch`/`torchvision`/`torchaudio`,并且这一段没有 `numpy`。([GitHub][3]) | -| `v0.3.11`–`v0.3.14` | 加入 `numpy>=1.25.0`。 | -| `v0.3.15`–`v0.3.18` | `aiohttp` 变为 `aiohttp>=3.11.8`,新增 `yarl>=1.18.0`,并加入 `av`。([GitHub][4]) | -| `v0.3.19`–`v0.3.28` | 开始引入 `comfyui-frontend-package`,从 `1.10.17` 逐步升到 `1.15.13`。([GitHub][5]) | -| `v0.3.29` | 新增 `comfyui-workflow-templates==0.1.1`。 | -| `v0.3.30`–`v0.3.39` | 新增 `pydantic~=2.0`;`av` 被约束到 `>=14.1.0`,随后到 `>=14.2.0`;前端包和 workflow templates 继续频繁升级。([GitHub][6]) | -| `v0.3.40` | 新增 `comfyui-embedded-docs==0.2.0`。 | -| `v0.3.41` | 新增数据库迁移相关依赖 `alembic`、`SQLAlchemy`,并新增 `pydantic-settings~=2.0`。([GitHub][7]) | -| `v0.3.42`–`v0.3.62` | 主要是 `comfyui-frontend-package`、`comfyui-workflow-templates`、`comfyui-embedded-docs` 版本升级;`soundfile` 仍在。 | -| `v0.3.63` | 删除 `soundfile`;其他核心依赖不变。([GitHub][8]) | -| `v0.3.72` | `transformers` 下限从 `>=4.37.2` 提到 `>=4.50.3`;workflow templates 进入 `0.7.x`。([GitHub][9]) | -| `v0.4.0`–`v0.7.0` | 基本延续 `v0.3.72+` 的依赖结构,主要更新前端、模板、docs 包版本。 | -| `v0.8.0` | 新增 `comfy-kitchen>=0.2.3`。([GitHub][10]) | -| `v0.9.0`–`v0.10.0` | `comfy-kitchen` 从 `>=0.2.6` 升到 `>=0.2.7`;前端、模板继续升级。 | -| `v0.11.0` | 新增 `requests`。([GitHub][11]) | -| `v0.12.0` | 新增 `comfy-aimdo>=0.1.7`。([GitHub][12]) | -| `v0.13.0`–`v0.14.2` | 主要升级 Comfy 自家包:frontend、workflow templates、embedded docs、`comfy-aimdo`。 | -| `v0.15.0`–`v0.15.1` | 新增 GUI/OpenGL 相关:`PyOpenGL`、`PyOpenGL-accelerate`、`glfw`;`comfy-aimdo` 升至 `>=0.2.x`。([GitHub][13]) | -| `v0.16.0` | 移除 `PyOpenGL-accelerate`,保留 `PyOpenGL`、`glfw`;embedded docs 升到 `0.4.3`。([GitHub][14]) | -| `v0.16.4` | 新增 `simpleeval>=1.0.0`。([GitHub][15]) | -| `v0.17.0` | 新增 `filelock`、`blake3`;`comfy-kitchen>=0.2.8`、`comfy-aimdo>=0.2.10`。([GitHub][16]) | -| `v0.18.0`–`v0.18.5` | `comfy-aimdo` 升到 `>=0.2.12`;workflow templates 从 `0.9.26` 升到 `0.9.43`;前端为 `1.41.21`。([GitHub][17]) | -| `v0.19.0`–`v0.19.5` | 前端升到 `1.42.x`;workflow templates 从 `0.9.47` 升到 `0.9.61`;其他核心依赖基本不变。([GitHub][18]) | -| `latest` | 这是旧 tag,内容非常不同:有 `torchdiffeq`、`open-clip-torch`、`pytorch_lightning`、`accelerate`,`transformers>=4.25.1`,`safetensors>=0.3.0`;没有后来的 `torchvision`、`torchaudio`、`kornia`、`spandrel`、Comfy 自家前端包等。([GitHub][19]) | - -[1]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.1/requirements.txt "raw.githubusercontent.com" -[2]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.3/requirements.txt "raw.githubusercontent.com" -[3]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.0.4/requirements.txt "raw.githubusercontent.com" -[4]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.18/requirements.txt "raw.githubusercontent.com" -[5]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.19/requirements.txt "raw.githubusercontent.com" -[6]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.30/requirements.txt "raw.githubusercontent.com" -[7]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.41/requirements.txt "raw.githubusercontent.com" -[8]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.63/requirements.txt "raw.githubusercontent.com" -[9]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.3.72/requirements.txt "raw.githubusercontent.com" -[10]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.8.0/requirements.txt "raw.githubusercontent.com" -[11]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.11.0/requirements.txt "raw.githubusercontent.com" -[12]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.12.0/requirements.txt "raw.githubusercontent.com" -[13]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.15.0/requirements.txt "raw.githubusercontent.com" -[14]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.0/requirements.txt "raw.githubusercontent.com" -[15]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.16.4/requirements.txt "raw.githubusercontent.com" -[16]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.17.0/requirements.txt "raw.githubusercontent.com" -[17]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.18.0/requirements.txt "raw.githubusercontent.com" -[18]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/v0.19.0/requirements.txt "raw.githubusercontent.com" -[19]: https://github.com/Comfy-Org/ComfyUI/raw/refs/tags/latest/requirements.txt "raw.githubusercontent.com" - - - - - -### v0.19.x 逐 tag 差异 - -| tag | `comfyui-frontend-package` | `comfyui-workflow-templates` | 其他 | -| ------------------- | -------------------------: | ---------------------------: | ------------- | -| `v0.19.0` | `1.42.10` | `0.9.47` | 其余核心依赖同后续基本一致 | -| `v0.19.1`–`v0.19.2` | `1.42.11` | `0.9.54` | 无结构性新增/删除 | -| `v0.19.3` | `1.42.11` | `0.9.57` | 只升模板包 | -| `v0.19.4` | `1.42.14` | `0.9.57` | 只升前端包 | -| `v0.19.5` | `1.42.14` | `0.9.61` | 只升模板包 | - - - - -## 启动代码会自动设置的环境变量 - -| 环境变量 | 什么时候设置 | 作用/说明 | -| ------------------------------------------- | ------------------------------------------- | ------------------------------------------- | -| `HF_HUB_DISABLE_TELEMETRY=1` | 启动时自动设置 | 注释说明主要给 custom nodes 用,core ComfyUI 本身不依赖它。 | -| `DO_NOT_TRACK=1` | 启动时自动设置 | 同上,用于关闭/提示关闭追踪。 | -| `MIMALLOC_PURGE_DELAY=0` | Windows 下自动设置 | Windows 内存 allocator 相关。 | -| `TORCH_ROCM_AOTRITON_ENABLE_EXPERIMENTAL=1` | 直接运行 `main.py` 时设置 | ROCm/Torch 相关实验开关。 | -| `CUDA_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 NVIDIA CUDA 可见设备。 | -| `HIP_VISIBLE_DEVICES` | 使用 `--cuda-device` 或 `--default-device` 时设置 | 控制 AMD HIP/ROCm 可见设备。 | -| `ASCEND_RT_VISIBLE_DEVICES` | 使用 `--cuda-device` 时设置 | 控制 Ascend NPU 可见设备。 | -| `ONEAPI_DEVICE_SELECTOR` | 使用 `--oneapi-device-selector` 时设置 | 控制 Intel oneAPI 设备选择。 | -| `CUBLAS_WORKSPACE_CONFIG=:4096:8` | 使用 `--deterministic` 且变量未预设时设置 | PyTorch 确定性计算相关。 | -| `OCL_SET_SVM_SIZE=262144` | 检测到 ROCm 版本时设置 | AMD ROCm 相关。 | diff --git a/frameworks/ComfyUI/0.19.4/build.conf b/frameworks/ComfyUI/0.19.4/build.conf deleted file mode 100644 index 82b7153838d09c5b04f1aa1627f90944a5b92909..0000000000000000000000000000000000000000 --- a/frameworks/ComfyUI/0.19.4/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ConfyUI 0.19.4 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-comfyui -IMAGE_TAG=0.19.4 -GPU_TEST=true \ No newline at end of file diff --git a/frameworks/ComfyUI/0.19.4/test.sh b/frameworks/ComfyUI/0.19.4/test.sh deleted file mode 100644 index 858dba6aa6628d61061ef1231a7117962a1dc5e2..0000000000000000000000000000000000000000 --- a/frameworks/ComfyUI/0.19.4/test.sh +++ /dev/null @@ -1,252 +0,0 @@ -#!/bin/bash - -set -e - -IMAGE="${1:-}" - -if [ -z "${IMAGE}" ]; then - echo "用法: bash test.sh <镜像名:标签>" - exit 1 -fi - -if ! command -v docker >/dev/null 2>&1; then - echo "✗ 未找到 docker" - exit 1 -fi - -echo "=== ComfyUI 容器基础功能测试 ===" -echo "测试镜像: ${IMAGE}" - -docker run --rm --gpus all "${IMAGE}" /bin/bash -lc ' -set -e -export CUDA_HOME=/usr/local/cuda -export PATH=/usr/local/cuda/bin:$PATH -export LD_LIBRARY_PATH=/usr/local/cuda/lib64:$LD_LIBRARY_PATH -echo "=== ComfyUI GPU 镜像基础功能测试 ===" - -COMFYUI_DIR="${COMFYUI_DIR:-/opt/ComfyUI}" -COMFYUI_HOST="${COMFYUI_HOST:-127.0.0.1}" -COMFYUI_PORT="${COMFYUI_PORT:-18188}" -STRICT_GPU="${STRICT_GPU:-1}" -LOG_FILE="/tmp/comfyui_test.log" - -pass() { - echo "✓ 通过" -} - -fail() { - echo "✗ 失败" - if [ -f "$LOG_FILE" ]; then - echo "------ ComfyUI 日志 ------" - tail -n 120 "$LOG_FILE" || true - echo "-------------------------" - fi - exit 1 -} - -echo -echo "=== 1. 检查 ComfyUI 目录 ===" -echo -n "检查目录 ${COMFYUI_DIR}... " -if [ -d "$COMFYUI_DIR" ] && [ -f "$COMFYUI_DIR/main.py" ]; then - pass -else - fail -fi - -cd "$COMFYUI_DIR" - -echo -echo "=== 2. 检查 CUDA 基础环境 ===" - -echo -n "检查 nvidia-smi... " -if command -v nvidia-smi >/dev/null 2>&1; then - nvidia-smi >/tmp/nvidia_smi_test.log 2>&1 && pass || fail -else - if [ "$STRICT_GPU" = "1" ]; then - echo "未找到 nvidia-smi" - fail - else - echo "跳过,未找到 nvidia-smi" - fi -fi - -echo -n "检查 nvcc --version... " -if command -v nvcc >/dev/null 2>&1; then - nvcc --version >/tmp/nvcc_test.log 2>&1 && pass || fail -else - if [ "$STRICT_GPU" = "1" ]; then - echo "未找到 nvcc" - fail - else - echo "跳过,未找到 nvcc" - fi -fi - -echo -echo "=== 3. 检查 Python / PyTorch / CUDA ===" - -echo -n "检查 Python 版本... " -python3 --version && pass || fail - -echo -n "检查 torch import 和 CUDA 可用性... " -python3 - <<'PY' -import sys -import torch - -print("torch version:", torch.__version__) -print("torch cuda version:", torch.version.cuda) -print("torch cuda available:", torch.cuda.is_available()) - -if not torch.cuda.is_available(): - raise RuntimeError("torch.cuda.is_available() 为 False,GPU 不可用") - -count = torch.cuda.device_count() -print("cuda device count:", count) - -if count < 1: - raise RuntimeError("未检测到 CUDA 设备") - -for i in range(count): - print(f"cuda device {i}:", torch.cuda.get_device_name(i)) - -x = torch.ones((2, 2), device="cuda") -y = x @ x -assert y.is_cuda -assert y.shape == (2, 2) - -print("torch CUDA tensor test ok") -PY -pass - -echo -echo "=== 4. 检查 ComfyUI 核心模块 import ===" - -echo -n "检查 ComfyUI Python 模块... " -python3 - <<'PY' -import os -import sys - -sys.path.insert(0, os.getcwd()) - -import comfy -import folder_paths -import nodes - -print("comfy import ok") -print("folder_paths import ok") -print("nodes import ok") -print("registered node classes:", len(nodes.NODE_CLASS_MAPPINGS)) - -if len(nodes.NODE_CLASS_MAPPINGS) <= 0: - raise RuntimeError("ComfyUI 节点注册数量异常") -PY -pass - -echo -echo "=== 5. 启动 ComfyUI API 服务 ===" - -rm -f "$LOG_FILE" - -echo -n "启动 ComfyUI 服务 ${COMFYUI_HOST}:${COMFYUI_PORT}... " -python3 main.py \ - --listen "$COMFYUI_HOST" \ - --port "$COMFYUI_PORT" \ - >"$LOG_FILE" 2>&1 & - -COMFYUI_PID=$! - -cleanup() { - if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then - kill "$COMFYUI_PID" >/dev/null 2>&1 || true - wait "$COMFYUI_PID" >/dev/null 2>&1 || true - fi -} -trap cleanup EXIT - -sleep 3 - -if kill -0 "$COMFYUI_PID" >/dev/null 2>&1; then - pass -else - fail -fi - -echo -n "等待 ComfyUI API 就绪... " -python3 - <" - exit 1 -fi - -if ! command -v docker >/dev/null 2>&1; then - echo "✗ 未找到 docker" - exit 1 -fi - -echo "=== Ray 2.54.0 容器基础功能测试 ===" -echo "测试镜像: ${IMAGE}" - -docker run --rm --gpus all --entrypoint python3 "${IMAGE}" /home/test_ray.py --full --require-gpu \ No newline at end of file diff --git a/frameworks/Ray/2.54.0/test_ray.py b/frameworks/Ray/2.54.0/test_ray.py deleted file mode 100644 index 7054a443e1332f5806d0e8025fd3cca6fd04d198..0000000000000000000000000000000000000000 --- a/frameworks/Ray/2.54.0/test_ray.py +++ /dev/null @@ -1,784 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -""" -verify_ray_full_fixed.py - -Ray 全组件验证脚本,适配 Ray 2.55.x。 - -验证内容: -- Ray Core: init / remote task / actor / object store / wait / runtime_env / placement group -- GPU: Ray GPU scheduling / CUDA_VISIBLE_DEVICES / nvidia-smi / PyTorch CUDA -- Ray Data -- Ray Tune -- Ray Train TorchTrainer -- Ray Serve -- RLlib,可用 --full 开启 - -常用运行方式: - python verify_ray_full_fixed.py - - python verify_ray_full_fixed.py --full - - python verify_ray_full_fixed.py --require-gpu - - python verify_ray_full_fixed.py --address auto - - python verify_ray_full_fixed.py --address ray://127.0.0.1:10001 - -Docker GPU 示例: - docker run --rm -it \ - --gpus all \ - --shm-size=8g \ - your-ray-image \ - python /app/verify_ray_full_fixed.py --full --require-gpu -""" - -from __future__ import annotations - -import argparse -import importlib.util -import json -import os -import socket -import subprocess -import sys -import tempfile -import time -import traceback -from dataclasses import dataclass -from pathlib import Path -from typing import Callable, Any - - -# Ray Train V2 在新版本 Ray 中是默认方向。 -# 这里显式设置,方便结果稳定,也避免部分迁移提示。 -os.environ.setdefault("RAY_TRAIN_V2_ENABLED", "1") - - -class SkipTest(Exception): - """表示当前环境不满足该组件测试条件,测试跳过。""" - - -@dataclass -class TestResult: - name: str - status: str - message: str - seconds: float - - -def module_exists(name: str) -> bool: - return importlib.util.find_spec(name) is not None - - -def print_json(title: str, data: Any) -> None: - print(f"\n{title}") - print(json.dumps(data, indent=2, ensure_ascii=False, default=str)) - - -def run_test(name: str, func: Callable[[], str]) -> TestResult: - start = time.time() - - try: - msg = func() - seconds = time.time() - start - print(f"[PASS] {name} - {msg}") - return TestResult(name, "PASS", msg, seconds) - - except SkipTest as exc: - seconds = time.time() - start - print(f"[SKIP] {name} - {exc}") - return TestResult(name, "SKIP", str(exc), seconds) - - except Exception as exc: - seconds = time.time() - start - print(f"[FAIL] {name} - {exc}") - traceback.print_exc() - return TestResult(name, "FAIL", str(exc), seconds) - - -def parse_args() -> argparse.Namespace: - parser = argparse.ArgumentParser(description="Verify Ray full installation and runtime.") - - parser.add_argument( - "--address", - default=os.environ.get("RAY_ADDRESS"), - help=( - "Ray 地址。留空表示本地启动;" - "auto 表示连接已有本地 Ray 集群;" - "ray://host:10001 表示 Ray Client。" - ), - ) - - parser.add_argument( - "--full", - action="store_true", - help="开启更重的测试,例如 RLlib PPO。", - ) - - parser.add_argument( - "--require-gpu", - action="store_true", - help="要求 Ray 和 PyTorch 必须检测到 GPU,否则 GPU 测试失败。", - ) - - parser.add_argument( - "--train-workers", - type=int, - default=1, - help="Ray Train 使用的 worker 数量,默认 1。", - ) - - parser.add_argument( - "--train-use-gpu", - action="store_true", - help="Ray Train 测试是否使用 GPU。需要 Ray 检测到足够 GPU。", - ) - - parser.add_argument( - "--skip-data", - action="store_true", - help="跳过 Ray Data 测试。", - ) - - parser.add_argument( - "--skip-tune", - action="store_true", - help="跳过 Ray Tune 测试。", - ) - - parser.add_argument( - "--skip-train", - action="store_true", - help="跳过 Ray Train 测试。", - ) - - parser.add_argument( - "--skip-serve", - action="store_true", - help="跳过 Ray Serve 测试。", - ) - - parser.add_argument( - "--skip-rllib", - action="store_true", - help="跳过 RLlib 测试。", - ) - - return parser.parse_args() - - -def main() -> None: - args = parse_args() - - print("=" * 80) - print("Ray Full Verification - Fixed for Ray 2.55.x") - print("=" * 80) - print(f"Python: {sys.version}") - print(f"Host: {socket.gethostname()}") - print(f"PID: {os.getpid()}") - print(f"RAY_ADDRESS: {args.address or ''}") - print(f"RAY_TRAIN_V2_ENABLED: {os.environ.get('RAY_TRAIN_V2_ENABLED')}") - - if not module_exists("ray"): - print("\n[ERROR] 未安装 Ray。可执行:") - print(' pip install -U "ray[all]"') - sys.exit(2) - - import ray - - print(f"Ray version: {ray.__version__}") - - print("\n初始化 Ray ...") - - if args.address: - ray_info = ray.init(address=args.address) - else: - ray_info = ray.init() - - print(f"Ray initialized: {ray.is_initialized()}") - - try: - dashboard_url = getattr(ray_info, "dashboard_url", None) - if dashboard_url: - print(f"Dashboard URL: {dashboard_url}") - except Exception: - pass - - print_json("Cluster resources:", ray.cluster_resources()) - print_json("Available resources:", ray.available_resources()) - - results: list[TestResult] = [] - - # ------------------------------------------------------------------------- - # Ray Core - # ------------------------------------------------------------------------- - - def test_core_task() -> str: - @ray.remote - def square(x: int) -> int: - return x * x - - refs = [square.remote(i) for i in range(10)] - values = ray.get(refs) - expected = [i * i for i in range(10)] - - assert values == expected, f"✗ 失败||结果不符合预期: {values}" - - return f"✓ 通过||remote task 正常,结果={values}" - - results.append(run_test("Ray Core - Remote Task", test_core_task)) - - def test_actor() -> str: - @ray.remote - class Counter: - def __init__(self) -> None: - self.value = 0 - - def inc(self, n: int = 1) -> int: - self.value += n - return self.value - - def get(self) -> int: - return self.value - - counter = Counter.remote() - - assert ray.get(counter.inc.remote()) == 1 - assert ray.get(counter.inc.remote(5)) == 6 - assert ray.get(counter.get.remote()) == 6 - - return "✓ 通过||actor 状态保持正常" - - results.append(run_test("Ray Core - Actor", test_actor)) - - def test_object_store() -> str: - payload = { - "message": "hello ray object store", - "numbers": list(range(1000)), - } - - ref = ray.put(payload) - got = ray.get(ref) - - assert got == payload - - return f"✓ 通过|| ray.put/ray.get 正常,numbers={len(got['numbers'])}" - - results.append(run_test("Ray Core - Object Store", test_object_store)) - - def test_wait() -> str: - @ray.remote - def slow_identity(x: str, delay: float) -> str: - import time - - time.sleep(delay) - return x - - refs = [ - slow_identity.remote("fast", 0.2), - slow_identity.remote("slow", 1.0), - ] - - ready, remaining = ray.wait(refs, num_returns=1, timeout=5) - - assert len(ready) == 1 - assert len(remaining) == 1 - - first = ray.get(ready[0]) - assert first == "fast" - - ray.get(remaining) - - return "✓ 通过|| ray.wait 正常" - - results.append(run_test("Ray Core - ray.wait", test_wait)) - - def test_runtime_env() -> str: - @ray.remote(runtime_env={"env_vars": {"RAY_VERIFY_ENV": "OK"}}) - def read_env() -> str | None: - import os - - return os.environ.get("RAY_VERIFY_ENV") - - value = ray.get(read_env.remote()) - - assert value == "OK", f"runtime_env env_vars 未生效: {value}" - - return "✓ 通过|| runtime_env env_vars 正常" - - results.append(run_test("Ray Core - runtime_env", test_runtime_env)) - - def test_placement_group() -> str: - total_cpu = float(ray.cluster_resources().get("CPU", 0)) - - if total_cpu < 1: - raise SkipTest("集群 CPU 资源小于 1,跳过 placement group 测试") - - from ray.util.placement_group import placement_group, remove_placement_group - - pg = placement_group([{"CPU": 1}], strategy="PACK") - ray.get(pg.ready(), timeout=20) - - @ray.remote(num_cpus=1) - def pg_task() -> dict[str, Any]: - import os - - return { - "pid": os.getpid(), - "ok": True, - } - - try: - ref = pg_task.options(placement_group=pg).remote() - result = ray.get(ref) - finally: - remove_placement_group(pg) - - assert result["ok"] is True - - return f"✓ 通过|| placement group 正常,task pid={result['pid']}" - - results.append(run_test("Ray Core - Placement Group", test_placement_group)) - - # ------------------------------------------------------------------------- - # GPU - # ------------------------------------------------------------------------- - - def test_ray_gpu_scheduling() -> str: - gpu_count = float(ray.cluster_resources().get("GPU", 0)) - - if gpu_count <= 0: - if args.require_gpu: - raise RuntimeError("要求 GPU,但 Ray cluster_resources() 没有检测到 GPU") - raise SkipTest("Ray 未检测到 GPU,跳过 GPU 调度测试") - - @ray.remote(num_gpus=1) - def gpu_task() -> dict[str, Any]: - import os - import subprocess - - info: dict[str, Any] = { - "CUDA_VISIBLE_DEVICES": os.environ.get("CUDA_VISIBLE_DEVICES"), - "nvidia_smi": None, - "torch_cuda_available": None, - "torch_device_count": None, - "torch_device_name": None, - } - - try: - out = subprocess.check_output( - ["nvidia-smi"], - stderr=subprocess.STDOUT, - timeout=10, - ).decode("utf-8", errors="ignore") - info["nvidia_smi"] = out.splitlines()[0] if out else "EMPTY" - except Exception as exc: - info["nvidia_smi"] = f"nvidia-smi failed: {exc}" - - try: - import torch - - info["torch_cuda_available"] = torch.cuda.is_available() - info["torch_device_count"] = torch.cuda.device_count() - - if torch.cuda.is_available(): - info["torch_device_name"] = torch.cuda.get_device_name(0) - - except Exception as exc: - info["torch_cuda_available"] = f"torch unavailable: {exc}" - - return info - - info = ray.get(gpu_task.remote()) - - if not info.get("CUDA_VISIBLE_DEVICES"): - raise RuntimeError(f"Ray 分配了 GPU,但 CUDA_VISIBLE_DEVICES 为空: {info}") - - return f"✓ 通过|| Ray GPU 调度正常: {info}" - - results.append(run_test("GPU - Ray GPU Scheduling", test_ray_gpu_scheduling)) - - def test_driver_torch_cuda() -> str: - if not module_exists("torch"): - if args.require_gpu: - raise RuntimeError("要求 GPU,但未安装 torch,无法验证 PyTorch CUDA") - raise SkipTest("未安装 torch,跳过 PyTorch CUDA 测试") - - import torch - - if not torch.cuda.is_available(): - if args.require_gpu: - raise RuntimeError("要求 GPU,但 torch.cuda.is_available() = False") - raise SkipTest("torch 已安装,但当前 driver 进程未检测到 CUDA") - - return ( - f"PyTorch CUDA 正常,device_count={torch.cuda.device_count()}, " - f"device_name={torch.cuda.get_device_name(0)}" - ) - - results.append(run_test("GPU - PyTorch CUDA", test_driver_torch_cuda)) - - # ------------------------------------------------------------------------- - # Ray Data - # ------------------------------------------------------------------------- - - if not args.skip_data: - - def test_ray_data() -> str: - if not module_exists("ray.data"): - raise SkipTest("未安装 Ray Data,请安装 ray[data] 或 ray[all]") - - import ray.data - - ds = ray.data.from_items([{"x": i} for i in range(10)]) - mapped = ds.map(lambda row: {"x": row["x"], "y": row["x"] * 2}) - rows = mapped.take_all() - - total_y = sum(int(row["y"]) for row in rows) - - assert len(rows) == 10 - assert total_y == 90 - - return f"✓ 通过|| Ray Data 正常,rows={len(rows)}, sum_y={total_y}" - - results.append(run_test("Ray Data", test_ray_data)) - - # ------------------------------------------------------------------------- - # Ray Tune - # ------------------------------------------------------------------------- - - if not args.skip_tune: - - def test_ray_tune() -> str: - if not module_exists("ray.tune"): - raise SkipTest("未安装 Ray Tune,请安装 ray[tune] 或 ray[all]") - - from ray import tune - from ray.tune import RunConfig - - temp_dir = tempfile.mkdtemp(prefix="ray_verify_tune_") - - def trainable(config: dict[str, Any]) -> None: - # 在 Ray 2.5x 中,Tune function trainable 推荐使用 ray.train.report。 - from ray import tune - - score = config["x"] * 2 - tune.report({"score": score}) - - tuner = tune.Tuner( - trainable, - param_space={ - "x": tune.grid_search([1, 2, 3]), - }, - run_config=RunConfig( - name="ray_verify_tune", - storage_path=temp_dir - ), - ) - - result_grid = tuner.fit() - - if result_grid.errors: - raise RuntimeError(f"Tune trials 出现错误: {result_grid.errors}") - - best = result_grid.get_best_result(metric="score", mode="max") - best_score = best.metrics.get("score") - - assert best_score == 6, f"best_score 不符合预期: {best_score}" - - return f"✓ 通过|| Ray Tune 正常,best_score={best_score}, path={temp_dir}" - - results.append(run_test("Ray Tune", test_ray_tune)) - - # ------------------------------------------------------------------------- - # Ray Train - # ------------------------------------------------------------------------- - - if not args.skip_train: - - def test_ray_train_torch() -> str: - if not module_exists("ray.train"): - raise SkipTest("未安装 Ray Train,请安装 ray[train] 或 ray[all]") - - if not module_exists("torch"): - raise SkipTest("未安装 torch,跳过 TorchTrainer 测试") - - import torch - from ray.train import Checkpoint, RunConfig, ScalingConfig - from ray.train.torch import TorchTrainer - - total_cpu = int(float(ray.cluster_resources().get("CPU", 1))) - num_workers = max(1, min(args.train_workers, max(1, total_cpu))) - - use_gpu = bool(args.train_use_gpu) - - if use_gpu: - gpu_count = float(ray.cluster_resources().get("GPU", 0)) - - if gpu_count < num_workers: - raise RuntimeError( - f"Ray GPU 数量不足,要求 train_workers={num_workers}, " - f"实际 GPU={gpu_count}" - ) - - temp_dir = tempfile.mkdtemp(prefix="ray_verify_train_") - - def train_loop_per_worker(config: dict[str, Any] | None = None) -> None: - import os - import tempfile - import torch - - from ray import train - from ray.train import Checkpoint - - ctx = train.get_context() - world_rank = ctx.get_world_rank() - - x = torch.tensor([[0.0], [1.0], [2.0], [3.0]]) - y = 2.0 * x + 1.0 - - device = torch.device("cuda" if torch.cuda.is_available() else "cpu") - - model = torch.nn.Linear(1, 1).to(device) - optimizer = torch.optim.SGD(model.parameters(), lr=0.05) - loss_fn = torch.nn.MSELoss() - - x = x.to(device) - y = y.to(device) - - last_loss = None - - for _ in range(50): - pred = model(x) - loss = loss_fn(pred, y) - - optimizer.zero_grad() - loss.backward() - optimizer.step() - - last_loss = float(loss.detach().cpu().item()) - - metrics = { - "loss": last_loss, - "device": str(device), - "world_rank": world_rank, - } - - # Ray Train V2 对 metrics 的持久化更依赖 checkpoint。 - # rank 0 保存 checkpoint,并把 loss 写进 checkpoint 文件,外部可稳定读取。 - if world_rank == 0: - with tempfile.TemporaryDirectory() as checkpoint_dir: - checkpoint_path = os.path.join(checkpoint_dir, "state.pt") - torch.save(metrics, checkpoint_path) - - train.report( - metrics, - checkpoint=Checkpoint.from_directory(checkpoint_dir), - ) - else: - train.report(metrics) - - trainer = TorchTrainer( - train_loop_per_worker=train_loop_per_worker, - scaling_config=ScalingConfig( - num_workers=num_workers, - use_gpu=use_gpu, - ), - run_config=RunConfig( - name="ray_verify_train", - storage_path=temp_dir, - ), - ) - - result = trainer.fit() - - metrics = getattr(result, "metrics", {}) or {} - loss = metrics.get("loss") - device = metrics.get("device") - - # 某些 Ray Train V2 场景下 result.metrics 可能为空; - # 因此从 checkpoint 中兜底读取 loss。 - if loss is None: - checkpoint = getattr(result, "checkpoint", None) - - if checkpoint is not None: - with checkpoint.as_directory() as checkpoint_dir: - checkpoint_path = Path(checkpoint_dir) / "state.pt" - - if checkpoint_path.exists(): - payload = torch.load( - checkpoint_path, - map_location="cpu", - weights_only=False, - ) - - if isinstance(payload, dict): - loss = payload.get("loss") - device = payload.get("device") - - if loss is None: - raise RuntimeError( - f"Train 结果中没有 loss,metrics={metrics}, " - f"checkpoint={getattr(result, 'checkpoint', None)}" - ) - - if float(loss) > 1.0: - raise RuntimeError(f"训练 loss 偏高,loss={loss}") - - return ( - f"✓ 通过|| Ray Train TorchTrainer 正常,workers={num_workers}, " - f"use_gpu={use_gpu}, device={device}, loss={float(loss):.6f}, " - f"path={temp_dir}" - ) - - results.append(run_test("Ray Train - TorchTrainer", test_ray_train_torch)) - - # ------------------------------------------------------------------------- - # Ray Serve - # ------------------------------------------------------------------------- - - if not args.skip_serve: - - def test_ray_serve() -> str: - if not module_exists("ray.serve"): - raise SkipTest("未安装 Ray Serve,请安装 ray[serve] 或 ray[all]") - - from ray import serve - - try: - serve.shutdown() - except Exception: - pass - - @serve.deployment(ray_actor_options={"num_cpus": 0}) - class EchoDeployment: - async def __call__(self, value: str = "hello") -> str: - return f"serve:{value}" - - handle = serve.run( - EchoDeployment.bind(), - name="ray_verify_serve_app", - route_prefix="/ray-verify", - ) - - # 新版 Ray Serve 的 handle.remote() 返回 DeploymentResponse, - # 不是普通 ObjectRef,因此不能 ray.get(handle.remote(...))。 - response = handle.remote("ok") - result = response.result(timeout_s=30) - - try: - serve.shutdown() - except Exception: - pass - - assert result == "serve:ok", f"Serve 返回不符合预期: {result}" - - return "✓ 通过|| Ray Serve 正常,DeploymentResponse.result() 调用成功" - - results.append(run_test("Ray Serve", test_ray_serve)) - - # ------------------------------------------------------------------------- - # RLlib - # ------------------------------------------------------------------------- - - if not args.skip_rllib: - - def test_rllib() -> str: - if not args.full: - raise SkipTest("RLlib 测试较重,使用 --full 开启") - - if not module_exists("ray.rllib"): - raise SkipTest("未安装 RLlib,请安装 ray[rllib] 或 ray[all]") - - if not module_exists("gymnasium"): - raise SkipTest("未安装 gymnasium,RLlib CartPole 测试跳过") - - if not module_exists("torch"): - raise SkipTest("未安装 torch,RLlib PPO torch 测试跳过") - - from ray.rllib.algorithms.ppo import PPOConfig - - config = PPOConfig() - config = config.environment("CartPole-v1") - - if hasattr(config, "framework"): - config = config.framework("torch") - - # Ray 2.55 默认使用新 API stack。 - # 新版本用 env_runners;旧版本用 rollouts。 - if hasattr(config, "env_runners"): - config = config.env_runners(num_env_runners=0) - else: - config = config.rollouts(num_rollout_workers=0) - - # 兼容新旧训练参数命名。 - try: - config = config.training( - train_batch_size_per_learner=64, - minibatch_size=32, - num_epochs=1, - lr=1e-3, - ) - except TypeError: - config = config.training( - train_batch_size=64, - sgd_minibatch_size=32, - num_sgd_iter=1, - lr=1e-3, - ) - - if hasattr(config, "build_algo"): - algo = config.build_algo() - else: - algo = config.build() - - try: - train_result = algo.train() - finally: - algo.stop() - - episode_reward_mean = train_result.get("episode_reward_mean") - - return ( - "✓ 通过|| RLlib PPO 正常完成一次训练," - f"episode_reward_mean={episode_reward_mean}" - ) - - results.append(run_test("RLlib", test_rllib)) - - # ------------------------------------------------------------------------- - # Summary - # ------------------------------------------------------------------------- - - print("\n" + "=" * 80) - print("验证结果汇总") - print("=" * 80) - - status_counts = { - "PASS": sum(1 for r in results if r.status == "PASS"), - "SKIP": sum(1 for r in results if r.status == "SKIP"), - "FAIL": sum(1 for r in results if r.status == "FAIL"), - } - - for r in results: - print(f"{r.status:4} | {r.seconds:7.2f}s | {r.name} | {r.message}") - - print_json("Status counts:", status_counts) - - try: - ray.shutdown() - except Exception: - pass - - if status_counts["FAIL"] > 0: - print("\n✗ 失败|| 最终结果:FAILED") - sys.exit(1) - - print("\n✓ 通过|| 最终结果:PASSED") - sys.exit(0) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/frameworks/Ray/2.54.0/test_result.png b/frameworks/Ray/2.54.0/test_result.png deleted file mode 100644 index 79d62ee63e66dc5feee9dab21ce147449c48f422..0000000000000000000000000000000000000000 Binary files a/frameworks/Ray/2.54.0/test_result.png and /dev/null differ diff --git a/frameworks/Ray/2.54.1/Dockerfile b/frameworks/Ray/2.54.1/Dockerfile deleted file mode 100644 index 95b9540611f482b44d18947cb6e1a38708240d09..0000000000000000000000000000000000000000 --- a/frameworks/Ray/2.54.1/Dockerfile +++ /dev/null @@ -1,93 +0,0 @@ -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="stronking 363133710@qq.com" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="Ray all components + Torch GPU on OpenCloudOS 9 CUDA 12.8" - -# ========================= -# 版本参数 -# ========================= -ARG RAY_VERSION=2.54.1 -ARG TORCH_VERSION=2.11.0 -ARG TORCHVISION_VERSION=0.26.0 -ARG TORCHAUDIO_VERSION=2.11.0 -ARG PYTORCH_INDEX_URL=https://download.pytorch.org/whl/cu128 - -# ========================= -# 基础环境变量 -# ========================= -ENV PYTHONUNBUFFERED=1 \ - PIP_NO_CACHE_DIR=1 \ - PIP_DISABLE_PIP_VERSION_CHECK=1 \ - NVIDIA_VISIBLE_DEVICES=all \ - NVIDIA_DRIVER_CAPABILITIES=compute,utility \ - RAY_DISABLE_USAGE_STATS=1 \ - NVIDIA_VISIBLE_DEVICES=all - -# ========================= -# Ray 集群默认环境变量 -# 这些变量会被 start-ray.sh 使用 -# ========================= -ENV RAY_NODE_TYPE=single \ - RAY_HEAD_ADDRESS="" \ - RAY_NODE_IP_ADDRESS="" \ - RAY_HEAD_PORT=6379 \ - RAY_DASHBOARD_HOST=0.0.0.0 \ - RAY_DASHBOARD_PORT=8265 \ - RAY_CLIENT_SERVER_PORT=10001 \ - RAY_SERVE_HTTP_PORT=8000 \ - RAY_NODE_MANAGER_PORT=8076 \ - RAY_OBJECT_MANAGER_PORT=8077 \ - RAY_RUNTIME_ENV_AGENT_PORT=8078 \ - RAY_DASHBOARD_AGENT_GRPC_PORT=8079 \ - RAY_DASHBOARD_AGENT_LISTEN_PORT=8080 \ - RAY_METRICS_EXPORT_PORT=8081 \ - RAY_MIN_WORKER_PORT=10002 \ - RAY_MAX_WORKER_PORT=10100 \ - RAY_TEMP_DIR=/tmp/ray \ - RAY_NUM_CPUS="" \ - RAY_NUM_GPUS="" \ - RAY_OBJECT_STORE_MEMORY="" \ - RAY_RESOURCES="" - -WORKDIR /home - -# ========================= -# 安装 Ray 全组件 -# ========================= -RUN python3 -m pip install \ - "ray[all,client,serve-grpc]==${RAY_VERSION}" - -# ========================= -# 安装 PyTorch GPU 版本 -# 注意:如果 torch==2.11.0 / torchvision==0.26.0 当前源里不存在,构建会失败。 -# 可以通过 docker build --build-arg 修改版本。 -# ========================= -RUN python3 -m pip install \ - torch==${TORCH_VERSION} \ - torchvision==${TORCHVISION_VERSION} \ - torchaudio==${TORCHAUDIO_VERSION} \ - --index-url ${PYTORCH_INDEX_URL} - -# ========================= -# 拷贝测试脚本和启动脚本 -# ========================= -COPY ./test_ray.py /home/test_ray.py -COPY ./start-ray.sh /usr/local/bin/start-ray.sh - -RUN chmod +x /usr/local/bin/start-ray.sh - - -# ========================= -# Ray 常用端口 -# 6379 : Ray Head / GCS -# 8265 : Ray Dashboard -# 10001 : Ray Client -# 8000 : Ray Serve HTTP -# 8076-8081 : 固定 Ray 内部组件端口 -# 10002-10100 : Ray Worker 端口范围 -# ========================= -EXPOSE 6379 8265 10001 8000 8076 8077 8078 8079 8080 8081 10002-10100 - -#ENTRYPOINT ["/usr/local/bin/start-ray.sh"] 在正式merge后,需要将这行注释打开 -CMD ["/usr/local/bin/start-ray.sh"] \ No newline at end of file diff --git a/frameworks/Ray/2.54.1/README.md b/frameworks/Ray/2.54.1/README.md deleted file mode 100644 index ec7d14a69e3f9b2962eefe26ee7b2cd56eae6ba6..0000000000000000000000000000000000000000 --- a/frameworks/Ray/2.54.1/README.md +++ /dev/null @@ -1,409 +0,0 @@ -# Ray 2.54.1 + Torch 2.11.0 on OpenCloudOS 9 - -## 基本信息 - -- **Ray 版本**:v2.54.1 -- **Torch 版本**:v2.11.0 -- **TorchVision 版本**:v0.26.0 -- **TorchAudio 版本**:v2.11.0 -- **基础镜像**:opencloudos/opencloudos9-cuda-devel:12.8 -- **Python 版本**:3.11 -- **CUDA 版本**:12.8 -- **GPU 支持**:NVIDIA GPU / CUDA -- **Ray 安装组件**:ray[all,client,serve-grpc] - -## 适用场景 - -- Ray 单机任务调度 -- Ray 多机集群任务调度 -- Ray Data 数据处理 -- Ray Train 分布式训练 -- Ray Tune 参数调优 -- Ray Serve 模型服务 -- Ray RLlib 强化学习 -- PyTorch GPU 训练 / 推理 - ---- - -## 构建 - -```bash -docker build -t oc9-ray:2.54.1 . -``` - -也可以通过构建参数指定 Ray 和 Torch 版本: - -```bash -docker build \ - --build-arg RAY_VERSION=2.54.1 \ - --build-arg TORCH_VERSION=2.11.0 \ - --build-arg TORCHVISION_VERSION=0.26.0 \ - --build-arg TORCHAUDIO_VERSION=2.11.0 \ - -t oc9-ray:2.54.1 . -``` - ---- - -## 镜像启动命令 - -### 单机模式启动 - -单机模式会在当前容器内启动一个 Ray Head 节点,适合本地开发、单机测试、单机 GPU 任务。 - -```bash -docker run -d \ - --gpus all \ - --shm-size=8g \ - --name oc9-ray-single \ - -e RAY_NODE_TYPE=single \ - -p 6379:6379 \ - -p 8265:8265 \ - -p 10001:10001 \ - -p 8000:8000 \ - oc9-ray:2.54.1 -``` - -查看 Ray Dashboard: - -```text -http://宿主机IP:8265 -``` - -进入容器: - -```bash -docker exec -it oc9-ray-single bash -``` - -查看 Ray 集群状态: - -```bash -ray status -``` - ---- - -### 多机集群模式启动 - -Ray 多机集群由一个 Head 节点和多个 Worker 节点组成。 - -推荐使用 `--network=host`,避免 Docker bridge 网络导致 Ray 节点之间无法互相访问。 - -假设机器 IP 如下: - -| 角色 | IP | -|---|---| -| Head 节点 | 192.168.1.10 | -| Worker 节点 1 | 192.168.1.11 | -| Worker 节点 2 | 192.168.1.12 | - ---- - -#### 启动 Head 节点 - -在 `192.168.1.10` 上执行: - -```bash -docker run -d \ - --gpus all \ - --network=host \ - --shm-size=8g \ - --name oc9-ray-head \ - -e RAY_NODE_TYPE=head \ - -e RAY_NODE_IP_ADDRESS=192.168.1.10 \ - -e RAY_NUM_GPUS=1 \ - oc9-ray:2.54.1 -``` - -查看 Head 节点日志: - -```bash -docker logs -f oc9-ray-head -``` - -查看 Dashboard: - -```text -http://192.168.1.10:8265 -``` - ---- - -#### 启动 Worker 节点 - -在 `192.168.1.11` 上执行: - -```bash -docker run -d \ - --gpus all \ - --network=host \ - --shm-size=8g \ - --name oc9-ray-worker-1 \ - -e RAY_NODE_TYPE=worker \ - -e RAY_HEAD_ADDRESS=192.168.1.10:6379 \ - -e RAY_NODE_IP_ADDRESS=192.168.1.11 \ - -e RAY_NUM_GPUS=1 \ - oc9-ray:2.54.1 -``` - -在 `192.168.1.12` 上执行: - -```bash -docker run -d \ - --gpus all \ - --network=host \ - --shm-size=8g \ - --name oc9-ray-worker-2 \ - -e RAY_NODE_TYPE=worker \ - -e RAY_HEAD_ADDRESS=192.168.1.10:6379 \ - -e RAY_NODE_IP_ADDRESS=192.168.1.12 \ - -e RAY_NUM_GPUS=1 \ - oc9-ray:2.54.1 -``` - -查看 Worker 节点日志: - -```bash -docker logs -f oc9-ray-worker-1 -docker logs -f oc9-ray-worker-2 -``` - ---- - -## 镜像测试命令 - -### 单机完整测试 - -```bash -docker run --rm \ - --gpus all \ - --shm-size=8g \ - -e RAY_NODE_TYPE=test \ - oc9-ray:2.54.1 \ - python3 test_ray.py --full --require-gpu -``` - -### 在已有 Head 节点中测试 - -```bash -docker exec -it oc9-ray-head bash -python3 /home/test_ray.py --address auto --full --require-gpu -``` - -### 通过 Ray Client 连接测试 - -```bash -python3 test_ray.py --address ray://192.168.1.10:10001 --full --require-gpu -``` - ---- - -## 常用端口 - -| 端口 | 说明 | -|---:|---| -| 6379 | Ray Head / GCS 端口 | -| 8265 | Ray Dashboard 端口 | -| 10001 | Ray Client 端口 | -| 8000 | Ray Serve HTTP 端口 | -| 8076 | Ray Node Manager 端口 | -| 8077 | Ray Object Manager 端口 | -| 8078 | Ray Runtime Env Agent 端口 | -| 8079 | Ray Dashboard Agent gRPC 端口 | -| 8080 | Ray Dashboard Agent HTTP 端口 | -| 8081 | Ray Metrics Export 端口 | -| 10002-10100 | Ray Worker 进程端口范围 | - ---- - -## 环境变量说明 - -| 环境变量 | 默认值 | 示例 | 说明 | -|---|---|---|---| -| `RAY_NODE_TYPE` | `single` | `head` / `worker` / `single` / `test` | 容器启动模式。`head` 表示 Head 节点,`worker` 表示 Worker 节点,`single` 表示单机模式,`test` 表示执行测试脚本 | -| `RAY_HEAD_ADDRESS` | 空 | `192.168.1.10:6379` | Worker 节点连接 Head 节点的地址。`RAY_NODE_TYPE=worker` 时必填 | -| `RAY_NODE_IP_ADDRESS` | 自动获取 | `192.168.1.11` | 当前节点对其他 Ray 节点可访问的 IP。多机部署时建议显式指定 | -| `RAY_HEAD_PORT` | `6379` | `6379` | Ray Head / GCS 监听端口 | -| `RAY_DASHBOARD_HOST` | `0.0.0.0` | `0.0.0.0` | Ray Dashboard 监听地址。容器中建议设置为 `0.0.0.0` | -| `RAY_DASHBOARD_PORT` | `8265` | `8265` | Ray Dashboard 端口 | -| `RAY_CLIENT_SERVER_PORT` | `10001` | `10001` | Ray Client 连接端口 | -| `RAY_SERVE_HTTP_PORT` | `8000` | `8000` | Ray Serve HTTP 服务端口 | -| `RAY_NODE_MANAGER_PORT` | `8076` | `8076` | Ray Node Manager 固定端口 | -| `RAY_OBJECT_MANAGER_PORT` | `8077` | `8077` | Ray Object Manager 固定端口 | -| `RAY_RUNTIME_ENV_AGENT_PORT` | `8078` | `8078` | Ray Runtime Env Agent 固定端口 | -| `RAY_DASHBOARD_AGENT_GRPC_PORT` | `8079` | `8079` | Ray Dashboard Agent gRPC 端口 | -| `RAY_DASHBOARD_AGENT_LISTEN_PORT` | `8080` | `8080` | Ray Dashboard Agent HTTP 端口 | -| `RAY_METRICS_EXPORT_PORT` | `8081` | `8081` | Ray Metrics 指标暴露端口 | -| `RAY_MIN_WORKER_PORT` | `10002` | `10002` | Ray Worker 进程端口范围下限 | -| `RAY_MAX_WORKER_PORT` | `10100` | `10100` | Ray Worker 进程端口范围上限 | -| `RAY_NUM_CPUS` | 自动检测 | `20` | 手动指定当前节点可用 CPU 数量 | -| `RAY_NUM_GPUS` | 自动检测 | `1` | 手动指定当前节点可用 GPU 数量 | -| `RAY_OBJECT_STORE_MEMORY` | 自动计算 | `8589934592` | Ray Object Store 内存大小,单位为 bytes | -| `RAY_RESOURCES` | 空 | `'{"worker": 1}'` | 自定义 Ray 资源标签 | -| `RAY_TEMP_DIR` | `/tmp/ray` | `/tmp/ray` | Ray 临时文件目录 | -| `RAY_DISABLE_USAGE_STATS` | `1` | `1` | 禁用 Ray 使用统计上报 | -| `NVIDIA_VISIBLE_DEVICES` | `all` | `all` / `0` / `0,1` | 指定容器可见 GPU | -| `NVIDIA_DRIVER_CAPABILITIES` | `compute,utility` | `compute,utility` | NVIDIA 容器运行能力,GPU 计算通常需要 `compute`,`nvidia-smi` 需要 `utility` | - ---- - -## 多机协同任务测试 - -进入 Head 容器: - -```bash -docker exec -it oc9-ray-head bash -``` - -执行: - -```bash -python3 - <<'PY' -import socket -import ray - -ray.init(address="auto") - -@ray.remote -def task(i): - return { - "task": i, - "host": socket.gethostname(), - "node_id": ray.get_runtime_context().get_node_id(), - } - -refs = [task.remote(i) for i in range(50)] -results = ray.get(refs) - -for item in results[:20]: - print(item) - -print("cluster_resources:", ray.cluster_resources()) -PY -``` - -如果 Worker 节点加入成功,`cluster_resources` 中会显示多台节点的 CPU / GPU 资源。 - ---- - -## GPU 验证 - -```bash -docker run --rm \ - --gpus all \ - --shm-size=8g \ - oc9-ray:2.55.1 \ - bash -c "nvidia-smi && python3 -c 'import torch; print(torch.__version__); print(torch.cuda.is_available()); print(torch.cuda.get_device_name(0))'" -``` - -预期输出中应包含: - -```text -True -NVIDIA ... -``` - ---- - -## 版本检查 - -进入容器后执行: - -```bash -python3 - <<'PY' -import ray -import torch - -print("Ray:", ray.__version__) -print("Torch:", torch.__version__) -print("Torch CUDA:", torch.version.cuda) -print("CUDA available:", torch.cuda.is_available()) - -if torch.cuda.is_available(): - print("GPU:", torch.cuda.get_device_name(0)) -PY -``` - ---- - -## 注意事项 - -1. Docker 默认 `/dev/shm` 只有 64MB,Ray Object Store 会受到影响,建议启动容器时增加: - -```bash ---shm-size=8g -``` - -2. 多机部署建议使用: - -```bash ---network=host -``` - -3. Head 和 Worker 节点的 Ray 版本、Python 版本、CUDA 版本、PyTorch 版本应保持一致。 - -4. Worker 节点必须能访问 Head 节点的 `6379` 端口。 - -5. 多机 Docker bridge 网络模式下,Ray 可能识别到容器内网 IP,导致其他机器无法访问,因此生产部署建议显式设置: - -```bash --e RAY_NODE_IP_ADDRESS=当前宿主机IP -``` - -6. 生产环境建议固定 Ray 内部端口和 Worker 端口范围,便于配置防火墙、安全组和网络策略。 - -7. 使用 GPU 时,宿主机必须安装 NVIDIA Driver 和 NVIDIA Container Toolkit。 - -8. 如果 Ray Dashboard 无法访问,请确认启动参数中包含: - -```bash --e RAY_DASHBOARD_HOST=0.0.0.0 -``` - -9. 如果 Worker 节点无法加入集群,请优先检查: - - Head 节点 IP 是否正确 - - `RAY_HEAD_ADDRESS` 是否正确 - - 防火墙是否放通 `6379` - - 是否使用了 `--network=host` - - `RAY_NODE_IP_ADDRESS` 是否设置为宿主机可访问 IP - ---- - -## 常见命令 - -查看 Ray 状态: - -```bash -ray status -``` - -查看 Ray 任务: - -```bash -ray list tasks -``` - -查看 Ray 节点: - -```bash -ray list nodes -``` - -停止 Ray: - -```bash -ray stop --force -``` - -查看容器日志: - -```bash -docker logs -f oc9-ray-head -docker logs -f oc9-ray-worker-1 -``` - -删除容器: - -```bash -docker rm -f oc9-ray-head oc9-ray-worker-1 oc9-ray-worker-2 -``` \ No newline at end of file diff --git a/frameworks/Ray/2.54.1/build.conf b/frameworks/Ray/2.54.1/build.conf deleted file mode 100644 index 1e89c00e63a3f3e05097cdfaeb611ab0e0e0ec44..0000000000000000000000000000000000000000 --- a/frameworks/Ray/2.54.1/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# Ray 2.54.1 + PyTorch 2.11.0 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-ray -IMAGE_TAG=2.54.1 -GPU_TEST=true \ No newline at end of file diff --git a/frameworks/Ray/2.54.1/start-ray.sh b/frameworks/Ray/2.54.1/start-ray.sh deleted file mode 100644 index fe9d7a1750dda9f6fd6655ad7962ea36d7d166b7..0000000000000000000000000000000000000000 --- a/frameworks/Ray/2.54.1/start-ray.sh +++ /dev/null @@ -1,143 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -echo "============================================================" -echo "Ray Container Startup" -echo "============================================================" -echo "RAY_NODE_TYPE=${RAY_NODE_TYPE:-single}" -echo "RAY_HEAD_ADDRESS=${RAY_HEAD_ADDRESS:-}" -echo "RAY_NODE_IP_ADDRESS=${RAY_NODE_IP_ADDRESS:-}" -echo "RAY_HEAD_PORT=${RAY_HEAD_PORT:-6379}" -echo "RAY_DASHBOARD_PORT=${RAY_DASHBOARD_PORT:-8265}" -echo "RAY_CLIENT_SERVER_PORT=${RAY_CLIENT_SERVER_PORT:-10001}" -echo "RAY_MIN_WORKER_PORT=${RAY_MIN_WORKER_PORT:-10002}" -echo "RAY_MAX_WORKER_PORT=${RAY_MAX_WORKER_PORT:-10100}" -echo "NVIDIA_VISIBLE_DEVICES=${NVIDIA_VISIBLE_DEVICES:-}" -echo "============================================================" - -get_node_ip() { - if [[ -n "${RAY_NODE_IP_ADDRESS:-}" ]]; then - echo "${RAY_NODE_IP_ADDRESS}" - else - hostname -I | awk '{print $1}' - fi -} - -build_common_ray_args() { - local args=() - - args+=("--node-ip-address=$(get_node_ip)") - args+=("--node-manager-port=${RAY_NODE_MANAGER_PORT:-8076}") - args+=("--object-manager-port=${RAY_OBJECT_MANAGER_PORT:-8077}") - args+=("--runtime-env-agent-port=${RAY_RUNTIME_ENV_AGENT_PORT:-8078}") - args+=("--dashboard-agent-grpc-port=${RAY_DASHBOARD_AGENT_GRPC_PORT:-8079}") - args+=("--dashboard-agent-listen-port=${RAY_DASHBOARD_AGENT_LISTEN_PORT:-8080}") - args+=("--metrics-export-port=${RAY_METRICS_EXPORT_PORT:-8081}") - args+=("--min-worker-port=${RAY_MIN_WORKER_PORT:-10002}") - args+=("--max-worker-port=${RAY_MAX_WORKER_PORT:-10100}") - args+=("--temp-dir=${RAY_TEMP_DIR:-/tmp/ray}") - - if [[ -n "${RAY_NUM_CPUS:-}" ]]; then - args+=("--num-cpus=${RAY_NUM_CPUS}") - fi - - if [[ -n "${RAY_NUM_GPUS:-}" ]]; then - args+=("--num-gpus=${RAY_NUM_GPUS}") - fi - - if [[ -n "${RAY_OBJECT_STORE_MEMORY:-}" ]]; then - args+=("--object-store-memory=${RAY_OBJECT_STORE_MEMORY}") - fi - - if [[ -n "${RAY_RESOURCES:-}" ]]; then - args+=("--resources=${RAY_RESOURCES}") - fi - - printf '%s\n' "${args[@]}" -} - -start_head() { - echo "[INFO] Starting Ray HEAD node..." - - ray stop --force || true - - mapfile -t COMMON_ARGS < <(build_common_ray_args) - - exec ray start \ - --head \ - --port="${RAY_HEAD_PORT:-6379}" \ - --dashboard-host="${RAY_DASHBOARD_HOST:-0.0.0.0}" \ - --dashboard-port="${RAY_DASHBOARD_PORT:-8265}" \ - --ray-client-server-port="${RAY_CLIENT_SERVER_PORT:-10001}" \ - "${COMMON_ARGS[@]}" \ - --block -} - -start_worker() { - echo "[INFO] Starting Ray WORKER node..." - - if [[ -z "${RAY_HEAD_ADDRESS:-}" ]]; then - echo "[ERROR] RAY_HEAD_ADDRESS is required for worker node." - echo "Example: RAY_HEAD_ADDRESS=192.168.1.10:6379" - exit 1 - fi - - ray stop --force || true - - mapfile -t COMMON_ARGS < <(build_common_ray_args) - - exec ray start \ - --address="${RAY_HEAD_ADDRESS}" \ - "${COMMON_ARGS[@]}" \ - --block -} - -start_single() { - echo "[INFO] Starting Ray SINGLE node..." - - ray stop --force || true - - mapfile -t COMMON_ARGS < <(build_common_ray_args) - - exec ray start \ - --head \ - --port="${RAY_HEAD_PORT:-6379}" \ - --dashboard-host="${RAY_DASHBOARD_HOST:-0.0.0.0}" \ - --dashboard-port="${RAY_DASHBOARD_PORT:-8265}" \ - --ray-client-server-port="${RAY_CLIENT_SERVER_PORT:-10001}" \ - "${COMMON_ARGS[@]}" \ - --block -} - -run_test() { - echo "[INFO] Running Ray test script..." - python3 /home/test_ray.py "$@" -} - -case "${RAY_NODE_TYPE:-single}" in - head) - start_head - ;; - - worker) - start_worker - ;; - - single) - start_single - ;; - - test) - shift || true - run_test "$@" - ;; - - bash|shell) - exec /bin/bash - ;; - - *) - echo "[INFO] Executing custom command: $*" - exec "$@" - ;; -esac \ No newline at end of file diff --git a/frameworks/Ray/2.54.1/test.sh b/frameworks/Ray/2.54.1/test.sh deleted file mode 100644 index 00bb47c4995c855b1a5aeaf9aa7103954cbeb971..0000000000000000000000000000000000000000 --- a/frameworks/Ray/2.54.1/test.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:-}" - -if [ -z "${IMAGE}" ]; then - echo "用法: bash test.sh <镜像名:标签>" - exit 1 -fi - -if ! command -v docker >/dev/null 2>&1; then - echo "✗ 未找到 docker" - exit 1 -fi - -echo "=== Ray 2.54.1 容器基础功能测试 ===" - -echo "测试镜像: ${IMAGE}" - -docker run --rm --gpus all --entrypoint python3 "${IMAGE}" /home/test_ray.py --full --require-gpu \ No newline at end of file diff --git a/frameworks/Ray/2.54.1/test_ray.py b/frameworks/Ray/2.54.1/test_ray.py deleted file mode 100644 index 7054a443e1332f5806d0e8025fd3cca6fd04d198..0000000000000000000000000000000000000000 --- a/frameworks/Ray/2.54.1/test_ray.py +++ /dev/null @@ -1,784 +0,0 @@ -#!/usr/bin/env python3 -# -*- coding: utf-8 -*- - -""" -verify_ray_full_fixed.py - -Ray 全组件验证脚本,适配 Ray 2.55.x。 - -验证内容: -- Ray Core: init / remote task / actor / object store / wait / runtime_env / placement group -- GPU: Ray GPU scheduling / CUDA_VISIBLE_DEVICES / nvidia-smi / PyTorch CUDA -- Ray Data -- Ray Tune -- Ray Train TorchTrainer -- Ray Serve -- RLlib,可用 --full 开启 - -常用运行方式: - python verify_ray_full_fixed.py - - python verify_ray_full_fixed.py --full - - python verify_ray_full_fixed.py --require-gpu - - python verify_ray_full_fixed.py --address auto - - python verify_ray_full_fixed.py --address ray://127.0.0.1:10001 - -Docker GPU 示例: - docker run --rm -it \ - --gpus all \ - --shm-size=8g \ - your-ray-image \ - python /app/verify_ray_full_fixed.py --full --require-gpu -""" - -from __future__ import annotations - -import argparse -import importlib.util -import json -import os -import socket -import subprocess -import sys -import tempfile -import time -import traceback -from dataclasses import dataclass -from pathlib import Path -from typing import Callable, Any - - -# Ray Train V2 在新版本 Ray 中是默认方向。 -# 这里显式设置,方便结果稳定,也避免部分迁移提示。 -os.environ.setdefault("RAY_TRAIN_V2_ENABLED", "1") - - -class SkipTest(Exception): - """表示当前环境不满足该组件测试条件,测试跳过。""" - - -@dataclass -class TestResult: - name: str - status: str - message: str - seconds: float - - -def module_exists(name: str) -> bool: - return importlib.util.find_spec(name) is not None - - -def print_json(title: str, data: Any) -> None: - print(f"\n{title}") - print(json.dumps(data, indent=2, ensure_ascii=False, default=str)) - - -def run_test(name: str, func: Callable[[], str]) -> TestResult: - start = time.time() - - try: - msg = func() - seconds = time.time() - start - print(f"[PASS] {name} - {msg}") - return TestResult(name, "PASS", msg, seconds) - - except SkipTest as exc: - seconds = time.time() - start - print(f"[SKIP] {name} - {exc}") - return TestResult(name, "SKIP", str(exc), seconds) - - except Exception as exc: - seconds = time.time() - start - print(f"[FAIL] {name} - {exc}") - traceback.print_exc() - return TestResult(name, "FAIL", str(exc), seconds) - - -def parse_args() -> argparse.Namespace: - parser = argparse.ArgumentParser(description="Verify Ray full installation and runtime.") - - parser.add_argument( - "--address", - default=os.environ.get("RAY_ADDRESS"), - help=( - "Ray 地址。留空表示本地启动;" - "auto 表示连接已有本地 Ray 集群;" - "ray://host:10001 表示 Ray Client。" - ), - ) - - parser.add_argument( - "--full", - action="store_true", - help="开启更重的测试,例如 RLlib PPO。", - ) - - parser.add_argument( - "--require-gpu", - action="store_true", - help="要求 Ray 和 PyTorch 必须检测到 GPU,否则 GPU 测试失败。", - ) - - parser.add_argument( - "--train-workers", - type=int, - default=1, - help="Ray Train 使用的 worker 数量,默认 1。", - ) - - parser.add_argument( - "--train-use-gpu", - action="store_true", - help="Ray Train 测试是否使用 GPU。需要 Ray 检测到足够 GPU。", - ) - - parser.add_argument( - "--skip-data", - action="store_true", - help="跳过 Ray Data 测试。", - ) - - parser.add_argument( - "--skip-tune", - action="store_true", - help="跳过 Ray Tune 测试。", - ) - - parser.add_argument( - "--skip-train", - action="store_true", - help="跳过 Ray Train 测试。", - ) - - parser.add_argument( - "--skip-serve", - action="store_true", - help="跳过 Ray Serve 测试。", - ) - - parser.add_argument( - "--skip-rllib", - action="store_true", - help="跳过 RLlib 测试。", - ) - - return parser.parse_args() - - -def main() -> None: - args = parse_args() - - print("=" * 80) - print("Ray Full Verification - Fixed for Ray 2.55.x") - print("=" * 80) - print(f"Python: {sys.version}") - print(f"Host: {socket.gethostname()}") - print(f"PID: {os.getpid()}") - print(f"RAY_ADDRESS: {args.address or ''}") - print(f"RAY_TRAIN_V2_ENABLED: {os.environ.get('RAY_TRAIN_V2_ENABLED')}") - - if not module_exists("ray"): - print("\n[ERROR] 未安装 Ray。可执行:") - print(' pip install -U "ray[all]"') - sys.exit(2) - - import ray - - print(f"Ray version: {ray.__version__}") - - print("\n初始化 Ray ...") - - if args.address: - ray_info = ray.init(address=args.address) - else: - ray_info = ray.init() - - print(f"Ray initialized: {ray.is_initialized()}") - - try: - dashboard_url = getattr(ray_info, "dashboard_url", None) - if dashboard_url: - print(f"Dashboard URL: {dashboard_url}") - except Exception: - pass - - print_json("Cluster resources:", ray.cluster_resources()) - print_json("Available resources:", ray.available_resources()) - - results: list[TestResult] = [] - - # ------------------------------------------------------------------------- - # Ray Core - # ------------------------------------------------------------------------- - - def test_core_task() -> str: - @ray.remote - def square(x: int) -> int: - return x * x - - refs = [square.remote(i) for i in range(10)] - values = ray.get(refs) - expected = [i * i for i in range(10)] - - assert values == expected, f"✗ 失败||结果不符合预期: {values}" - - return f"✓ 通过||remote task 正常,结果={values}" - - results.append(run_test("Ray Core - Remote Task", test_core_task)) - - def test_actor() -> str: - @ray.remote - class Counter: - def __init__(self) -> None: - self.value = 0 - - def inc(self, n: int = 1) -> int: - self.value += n - return self.value - - def get(self) -> int: - return self.value - - counter = Counter.remote() - - assert ray.get(counter.inc.remote()) == 1 - assert ray.get(counter.inc.remote(5)) == 6 - assert ray.get(counter.get.remote()) == 6 - - return "✓ 通过||actor 状态保持正常" - - results.append(run_test("Ray Core - Actor", test_actor)) - - def test_object_store() -> str: - payload = { - "message": "hello ray object store", - "numbers": list(range(1000)), - } - - ref = ray.put(payload) - got = ray.get(ref) - - assert got == payload - - return f"✓ 通过|| ray.put/ray.get 正常,numbers={len(got['numbers'])}" - - results.append(run_test("Ray Core - Object Store", test_object_store)) - - def test_wait() -> str: - @ray.remote - def slow_identity(x: str, delay: float) -> str: - import time - - time.sleep(delay) - return x - - refs = [ - slow_identity.remote("fast", 0.2), - slow_identity.remote("slow", 1.0), - ] - - ready, remaining = ray.wait(refs, num_returns=1, timeout=5) - - assert len(ready) == 1 - assert len(remaining) == 1 - - first = ray.get(ready[0]) - assert first == "fast" - - ray.get(remaining) - - return "✓ 通过|| ray.wait 正常" - - results.append(run_test("Ray Core - ray.wait", test_wait)) - - def test_runtime_env() -> str: - @ray.remote(runtime_env={"env_vars": {"RAY_VERIFY_ENV": "OK"}}) - def read_env() -> str | None: - import os - - return os.environ.get("RAY_VERIFY_ENV") - - value = ray.get(read_env.remote()) - - assert value == "OK", f"runtime_env env_vars 未生效: {value}" - - return "✓ 通过|| runtime_env env_vars 正常" - - results.append(run_test("Ray Core - runtime_env", test_runtime_env)) - - def test_placement_group() -> str: - total_cpu = float(ray.cluster_resources().get("CPU", 0)) - - if total_cpu < 1: - raise SkipTest("集群 CPU 资源小于 1,跳过 placement group 测试") - - from ray.util.placement_group import placement_group, remove_placement_group - - pg = placement_group([{"CPU": 1}], strategy="PACK") - ray.get(pg.ready(), timeout=20) - - @ray.remote(num_cpus=1) - def pg_task() -> dict[str, Any]: - import os - - return { - "pid": os.getpid(), - "ok": True, - } - - try: - ref = pg_task.options(placement_group=pg).remote() - result = ray.get(ref) - finally: - remove_placement_group(pg) - - assert result["ok"] is True - - return f"✓ 通过|| placement group 正常,task pid={result['pid']}" - - results.append(run_test("Ray Core - Placement Group", test_placement_group)) - - # ------------------------------------------------------------------------- - # GPU - # ------------------------------------------------------------------------- - - def test_ray_gpu_scheduling() -> str: - gpu_count = float(ray.cluster_resources().get("GPU", 0)) - - if gpu_count <= 0: - if args.require_gpu: - raise RuntimeError("要求 GPU,但 Ray cluster_resources() 没有检测到 GPU") - raise SkipTest("Ray 未检测到 GPU,跳过 GPU 调度测试") - - @ray.remote(num_gpus=1) - def gpu_task() -> dict[str, Any]: - import os - import subprocess - - info: dict[str, Any] = { - "CUDA_VISIBLE_DEVICES": os.environ.get("CUDA_VISIBLE_DEVICES"), - "nvidia_smi": None, - "torch_cuda_available": None, - "torch_device_count": None, - "torch_device_name": None, - } - - try: - out = subprocess.check_output( - ["nvidia-smi"], - stderr=subprocess.STDOUT, - timeout=10, - ).decode("utf-8", errors="ignore") - info["nvidia_smi"] = out.splitlines()[0] if out else "EMPTY" - except Exception as exc: - info["nvidia_smi"] = f"nvidia-smi failed: {exc}" - - try: - import torch - - info["torch_cuda_available"] = torch.cuda.is_available() - info["torch_device_count"] = torch.cuda.device_count() - - if torch.cuda.is_available(): - info["torch_device_name"] = torch.cuda.get_device_name(0) - - except Exception as exc: - info["torch_cuda_available"] = f"torch unavailable: {exc}" - - return info - - info = ray.get(gpu_task.remote()) - - if not info.get("CUDA_VISIBLE_DEVICES"): - raise RuntimeError(f"Ray 分配了 GPU,但 CUDA_VISIBLE_DEVICES 为空: {info}") - - return f"✓ 通过|| Ray GPU 调度正常: {info}" - - results.append(run_test("GPU - Ray GPU Scheduling", test_ray_gpu_scheduling)) - - def test_driver_torch_cuda() -> str: - if not module_exists("torch"): - if args.require_gpu: - raise RuntimeError("要求 GPU,但未安装 torch,无法验证 PyTorch CUDA") - raise SkipTest("未安装 torch,跳过 PyTorch CUDA 测试") - - import torch - - if not torch.cuda.is_available(): - if args.require_gpu: - raise RuntimeError("要求 GPU,但 torch.cuda.is_available() = False") - raise SkipTest("torch 已安装,但当前 driver 进程未检测到 CUDA") - - return ( - f"PyTorch CUDA 正常,device_count={torch.cuda.device_count()}, " - f"device_name={torch.cuda.get_device_name(0)}" - ) - - results.append(run_test("GPU - PyTorch CUDA", test_driver_torch_cuda)) - - # ------------------------------------------------------------------------- - # Ray Data - # ------------------------------------------------------------------------- - - if not args.skip_data: - - def test_ray_data() -> str: - if not module_exists("ray.data"): - raise SkipTest("未安装 Ray Data,请安装 ray[data] 或 ray[all]") - - import ray.data - - ds = ray.data.from_items([{"x": i} for i in range(10)]) - mapped = ds.map(lambda row: {"x": row["x"], "y": row["x"] * 2}) - rows = mapped.take_all() - - total_y = sum(int(row["y"]) for row in rows) - - assert len(rows) == 10 - assert total_y == 90 - - return f"✓ 通过|| Ray Data 正常,rows={len(rows)}, sum_y={total_y}" - - results.append(run_test("Ray Data", test_ray_data)) - - # ------------------------------------------------------------------------- - # Ray Tune - # ------------------------------------------------------------------------- - - if not args.skip_tune: - - def test_ray_tune() -> str: - if not module_exists("ray.tune"): - raise SkipTest("未安装 Ray Tune,请安装 ray[tune] 或 ray[all]") - - from ray import tune - from ray.tune import RunConfig - - temp_dir = tempfile.mkdtemp(prefix="ray_verify_tune_") - - def trainable(config: dict[str, Any]) -> None: - # 在 Ray 2.5x 中,Tune function trainable 推荐使用 ray.train.report。 - from ray import tune - - score = config["x"] * 2 - tune.report({"score": score}) - - tuner = tune.Tuner( - trainable, - param_space={ - "x": tune.grid_search([1, 2, 3]), - }, - run_config=RunConfig( - name="ray_verify_tune", - storage_path=temp_dir - ), - ) - - result_grid = tuner.fit() - - if result_grid.errors: - raise RuntimeError(f"Tune trials 出现错误: {result_grid.errors}") - - best = result_grid.get_best_result(metric="score", mode="max") - best_score = best.metrics.get("score") - - assert best_score == 6, f"best_score 不符合预期: {best_score}" - - return f"✓ 通过|| Ray Tune 正常,best_score={best_score}, path={temp_dir}" - - results.append(run_test("Ray Tune", test_ray_tune)) - - # ------------------------------------------------------------------------- - # Ray Train - # ------------------------------------------------------------------------- - - if not args.skip_train: - - def test_ray_train_torch() -> str: - if not module_exists("ray.train"): - raise SkipTest("未安装 Ray Train,请安装 ray[train] 或 ray[all]") - - if not module_exists("torch"): - raise SkipTest("未安装 torch,跳过 TorchTrainer 测试") - - import torch - from ray.train import Checkpoint, RunConfig, ScalingConfig - from ray.train.torch import TorchTrainer - - total_cpu = int(float(ray.cluster_resources().get("CPU", 1))) - num_workers = max(1, min(args.train_workers, max(1, total_cpu))) - - use_gpu = bool(args.train_use_gpu) - - if use_gpu: - gpu_count = float(ray.cluster_resources().get("GPU", 0)) - - if gpu_count < num_workers: - raise RuntimeError( - f"Ray GPU 数量不足,要求 train_workers={num_workers}, " - f"实际 GPU={gpu_count}" - ) - - temp_dir = tempfile.mkdtemp(prefix="ray_verify_train_") - - def train_loop_per_worker(config: dict[str, Any] | None = None) -> None: - import os - import tempfile - import torch - - from ray import train - from ray.train import Checkpoint - - ctx = train.get_context() - world_rank = ctx.get_world_rank() - - x = torch.tensor([[0.0], [1.0], [2.0], [3.0]]) - y = 2.0 * x + 1.0 - - device = torch.device("cuda" if torch.cuda.is_available() else "cpu") - - model = torch.nn.Linear(1, 1).to(device) - optimizer = torch.optim.SGD(model.parameters(), lr=0.05) - loss_fn = torch.nn.MSELoss() - - x = x.to(device) - y = y.to(device) - - last_loss = None - - for _ in range(50): - pred = model(x) - loss = loss_fn(pred, y) - - optimizer.zero_grad() - loss.backward() - optimizer.step() - - last_loss = float(loss.detach().cpu().item()) - - metrics = { - "loss": last_loss, - "device": str(device), - "world_rank": world_rank, - } - - # Ray Train V2 对 metrics 的持久化更依赖 checkpoint。 - # rank 0 保存 checkpoint,并把 loss 写进 checkpoint 文件,外部可稳定读取。 - if world_rank == 0: - with tempfile.TemporaryDirectory() as checkpoint_dir: - checkpoint_path = os.path.join(checkpoint_dir, "state.pt") - torch.save(metrics, checkpoint_path) - - train.report( - metrics, - checkpoint=Checkpoint.from_directory(checkpoint_dir), - ) - else: - train.report(metrics) - - trainer = TorchTrainer( - train_loop_per_worker=train_loop_per_worker, - scaling_config=ScalingConfig( - num_workers=num_workers, - use_gpu=use_gpu, - ), - run_config=RunConfig( - name="ray_verify_train", - storage_path=temp_dir, - ), - ) - - result = trainer.fit() - - metrics = getattr(result, "metrics", {}) or {} - loss = metrics.get("loss") - device = metrics.get("device") - - # 某些 Ray Train V2 场景下 result.metrics 可能为空; - # 因此从 checkpoint 中兜底读取 loss。 - if loss is None: - checkpoint = getattr(result, "checkpoint", None) - - if checkpoint is not None: - with checkpoint.as_directory() as checkpoint_dir: - checkpoint_path = Path(checkpoint_dir) / "state.pt" - - if checkpoint_path.exists(): - payload = torch.load( - checkpoint_path, - map_location="cpu", - weights_only=False, - ) - - if isinstance(payload, dict): - loss = payload.get("loss") - device = payload.get("device") - - if loss is None: - raise RuntimeError( - f"Train 结果中没有 loss,metrics={metrics}, " - f"checkpoint={getattr(result, 'checkpoint', None)}" - ) - - if float(loss) > 1.0: - raise RuntimeError(f"训练 loss 偏高,loss={loss}") - - return ( - f"✓ 通过|| Ray Train TorchTrainer 正常,workers={num_workers}, " - f"use_gpu={use_gpu}, device={device}, loss={float(loss):.6f}, " - f"path={temp_dir}" - ) - - results.append(run_test("Ray Train - TorchTrainer", test_ray_train_torch)) - - # ------------------------------------------------------------------------- - # Ray Serve - # ------------------------------------------------------------------------- - - if not args.skip_serve: - - def test_ray_serve() -> str: - if not module_exists("ray.serve"): - raise SkipTest("未安装 Ray Serve,请安装 ray[serve] 或 ray[all]") - - from ray import serve - - try: - serve.shutdown() - except Exception: - pass - - @serve.deployment(ray_actor_options={"num_cpus": 0}) - class EchoDeployment: - async def __call__(self, value: str = "hello") -> str: - return f"serve:{value}" - - handle = serve.run( - EchoDeployment.bind(), - name="ray_verify_serve_app", - route_prefix="/ray-verify", - ) - - # 新版 Ray Serve 的 handle.remote() 返回 DeploymentResponse, - # 不是普通 ObjectRef,因此不能 ray.get(handle.remote(...))。 - response = handle.remote("ok") - result = response.result(timeout_s=30) - - try: - serve.shutdown() - except Exception: - pass - - assert result == "serve:ok", f"Serve 返回不符合预期: {result}" - - return "✓ 通过|| Ray Serve 正常,DeploymentResponse.result() 调用成功" - - results.append(run_test("Ray Serve", test_ray_serve)) - - # ------------------------------------------------------------------------- - # RLlib - # ------------------------------------------------------------------------- - - if not args.skip_rllib: - - def test_rllib() -> str: - if not args.full: - raise SkipTest("RLlib 测试较重,使用 --full 开启") - - if not module_exists("ray.rllib"): - raise SkipTest("未安装 RLlib,请安装 ray[rllib] 或 ray[all]") - - if not module_exists("gymnasium"): - raise SkipTest("未安装 gymnasium,RLlib CartPole 测试跳过") - - if not module_exists("torch"): - raise SkipTest("未安装 torch,RLlib PPO torch 测试跳过") - - from ray.rllib.algorithms.ppo import PPOConfig - - config = PPOConfig() - config = config.environment("CartPole-v1") - - if hasattr(config, "framework"): - config = config.framework("torch") - - # Ray 2.55 默认使用新 API stack。 - # 新版本用 env_runners;旧版本用 rollouts。 - if hasattr(config, "env_runners"): - config = config.env_runners(num_env_runners=0) - else: - config = config.rollouts(num_rollout_workers=0) - - # 兼容新旧训练参数命名。 - try: - config = config.training( - train_batch_size_per_learner=64, - minibatch_size=32, - num_epochs=1, - lr=1e-3, - ) - except TypeError: - config = config.training( - train_batch_size=64, - sgd_minibatch_size=32, - num_sgd_iter=1, - lr=1e-3, - ) - - if hasattr(config, "build_algo"): - algo = config.build_algo() - else: - algo = config.build() - - try: - train_result = algo.train() - finally: - algo.stop() - - episode_reward_mean = train_result.get("episode_reward_mean") - - return ( - "✓ 通过|| RLlib PPO 正常完成一次训练," - f"episode_reward_mean={episode_reward_mean}" - ) - - results.append(run_test("RLlib", test_rllib)) - - # ------------------------------------------------------------------------- - # Summary - # ------------------------------------------------------------------------- - - print("\n" + "=" * 80) - print("验证结果汇总") - print("=" * 80) - - status_counts = { - "PASS": sum(1 for r in results if r.status == "PASS"), - "SKIP": sum(1 for r in results if r.status == "SKIP"), - "FAIL": sum(1 for r in results if r.status == "FAIL"), - } - - for r in results: - print(f"{r.status:4} | {r.seconds:7.2f}s | {r.name} | {r.message}") - - print_json("Status counts:", status_counts) - - try: - ray.shutdown() - except Exception: - pass - - if status_counts["FAIL"] > 0: - print("\n✗ 失败|| 最终结果:FAILED") - sys.exit(1) - - print("\n✓ 通过|| 最终结果:PASSED") - sys.exit(0) - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/frameworks/Ray/2.54.1/test_result.png b/frameworks/Ray/2.54.1/test_result.png deleted file mode 100644 index 79d62ee63e66dc5feee9dab21ce147449c48f422..0000000000000000000000000000000000000000 Binary files a/frameworks/Ray/2.54.1/test_result.png and /dev/null differ diff --git a/frameworks/accelerate/1.12.0/Dockerfile b/frameworks/accelerate/1.12.0/Dockerfile deleted file mode 100644 index 9527fc21d5935f57d8194d48c74154b31022f493..0000000000000000000000000000000000000000 --- a/frameworks/accelerate/1.12.0/Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="Anstarc " -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="Hugging Face Accelerate 1.12.0 GPU on OpenCloudOS 9" - -# 安装系统依赖 -RUN dnf install -y \ - python3.11 \ - python3.11-pip \ - git \ - wget \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 设置工作目录 -WORKDIR /app - -# 安装 Accelerate 及核心依赖 -RUN pip3 install --no-cache-dir \ - torch torchvision \ - --index-url https://download.pytorch.org/whl/cu128 - -RUN pip3.11 install --no-cache-dir \ - accelerate==1.12.0 \ - transformers \ - datasets \ - evaluate \ - timm - -# 设置 GPU 环境变量 -ENV NVIDIA_VISIBLE_DEVICES=all -ENV CUDA_MODULE_LOADING=LAZY - -# 默认命令 -CMD ["python3.11", "-c", "import accelerate; print(f'Accelerate {accelerate.__version__} ready')"] diff --git a/frameworks/accelerate/1.12.0/README.md b/frameworks/accelerate/1.12.0/README.md deleted file mode 100644 index ca5b1c69ae1246282fc3e516d3dea89a5697690a..0000000000000000000000000000000000000000 --- a/frameworks/accelerate/1.12.0/README.md +++ /dev/null @@ -1,108 +0,0 @@ -# Hugging Face Accelerate 1.12.0 GPU on OpenCloudOS 9 - -Accelerate 是 Hugging Face 开源的分布式训练加速库,简化 PyTorch 模型在多 GPU、多节点环境下的训练和推理。 - -## 基本信息 - -- **基础镜像**: opencloudos/opencloudos9-cuda-devel:12.8 -- **Python 版本**: 3.11 -- **CUDA 版本**: 12.8 -- **Accelerate 版本**: 1.12.0 -- **PyTorch 版本**: 最新稳定版 -- **Transformers 版本**: 最新稳定版 - -## 构建 - -```bash -docker build -t oc9-accelerate:1.12.0 . -``` - -## 测试 - -```bash -./test.sh oc9-accelerate:1.12.0 -``` - -测试项包括: -- Python 和 CUDA 环境 -- Accelerate 版本验证 -- GPU 训练功能 -- 混合精度支持 -- 分布式训练准备 -- NLP 和 CV 示例验证 - -## 使用示例 - -### 基本使用 - -```bash -# 查看版本信息 -docker run --rm oc9-accelerate:1.12.0 python3.11 -c "import accelerate; print(accelerate.__version__)" - -# 查看可用设备 -docker run --rm --gpus all oc9-accelerate:1.12.0 python3.11 -c "import torch; print(f'CUDA available: {torch.cuda.is_available()}')" -``` - -### GPU 训练 - -```python -from accelerate import Accelerator -import torch -import torch.nn as nn - -# 初始化 Accelerator -accelerator = Accelerator() - -# 定义模型和优化器 -model = nn.Linear(10, 2) -optimizer = torch.optim.Adam(model.parameters()) - -# 自动处理设备分配 -model, optimizer = accelerator.prepare(model, optimizer) - -# 训练循环 -for batch in dataloader: - optimizer.zero_grad() - outputs = model(batch) - loss = criterion(outputs) - accelerator.backward(loss) - optimizer.step() -``` - -### 分布式训练 - -```bash -# 单机多卡训练 -docker run --rm --gpus all -v $(pwd):/workspace oc9-accelerate:1.12.0 \ - accelerate launch --multi_gpu --num_processes=2 train.py - -# 混合精度训练 -docker run --rm --gpus all -v $(pwd):/workspace oc9-accelerate:1.12.0 \ - accelerate launch --mixed_precision=fp16 train.py -``` - -### 交互式使用 - -```bash -docker run --rm -it --gpus all oc9-accelerate:1.12.0 bash -``` - -## 支持的功能 - -- **多 GPU 训练**: DataParallel, DistributedDataParallel -- **混合精度**: FP16, BF16 -- **梯度累积**: 自动处理小批量训练 -- **DeepSpeed 集成**: ZeRO 优化 -- **FSDP 支持**: PyTorch 原生分布式训练 -- **自动设备管理**: CPU/GPU 自动迁移 - -## 系统要求 - -- **GPU**: NVIDIA GPU with CUDA 12.x support -- **显存**: 建议 8GB+ (取决于模型大小) -- **Docker**: 19.03+ with nvidia-docker2 - -## 参考资源 - -- [Accelerate 官方文档](https://huggingface.co/docs/accelerate) -- [Accelerate GitHub](https://github.com/huggingface/accelerate) diff --git a/frameworks/accelerate/1.12.0/build.conf b/frameworks/accelerate/1.12.0/build.conf deleted file mode 100644 index b2a1a818a6cdf99240d2256f79403412c7b4b5c6..0000000000000000000000000000000000000000 --- a/frameworks/accelerate/1.12.0/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# Hugging Face Accelerate 1.12.0 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-accelerate -IMAGE_TAG=1.12.0 -GPU_TEST=true diff --git a/frameworks/accelerate/1.12.0/test.sh b/frameworks/accelerate/1.12.0/test.sh deleted file mode 100755 index e580ce838b9a22ca3592ba1d2b15ffe06b452cb0..0000000000000000000000000000000000000000 --- a/frameworks/accelerate/1.12.0/test.sh +++ /dev/null @@ -1,266 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:-oc9-accelerate:1.12.0}" - -echo "==========================================" -echo "测试 Accelerate 1.12.0 GPU 镜像" -echo "镜像: $IMAGE" -echo "==========================================" - -# 测试 1: Python 环境 -echo -n "测试 1: Python 环境... " -docker run --rm "$IMAGE" python3.11 --version > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 --version - exit 1 -fi - -# 测试 2: Accelerate 版本 -echo -n "测试 2: Accelerate 版本... " -VERSION=$(docker run --rm "$IMAGE" python3.11 -c "import accelerate; print(accelerate.__version__)") -if [ "$VERSION" = "1.12.0" ]; then - echo "✓ (版本: $VERSION)" -else - echo "✗ (期望: 1.12.0, 实际: $VERSION)" - exit 1 -fi - -# 测试 3: 核心依赖 -echo -n "测试 3: 核心依赖 (torch, transformers)... " -docker run --rm "$IMAGE" python3.11 -c "import torch; import transformers" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c "import torch; import transformers" - exit 1 -fi - -# 测试 4: CUDA 环境 -echo -n "测试 4: CUDA 环境... " -GPU_INFO=$(docker run --rm --gpus all "$IMAGE" python3.11 -c " -import torch -assert torch.cuda.is_available(), 'CUDA not available' -print(torch.cuda.get_device_name(0)) -") -if [ $? -eq 0 ]; then - echo "✓" - echo " GPU: $GPU_INFO" -else - echo "✗" - exit 1 -fi - -# 测试 5: Accelerator 初始化 -echo -n "测试 5: Accelerator 初始化... " -docker run --rm --gpus all "$IMAGE" python3.11 -c " -from accelerate import Accelerator -accelerator = Accelerator() -assert 'cuda' in str(accelerator.device), 'GPU not detected' -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm --gpus all "$IMAGE" python3.11 -c " -from accelerate import Accelerator -accelerator = Accelerator() -print(f'Device: {accelerator.device}') -" - exit 1 -fi - -# 测试 6: 模型准备功能 -echo -n "测试 6: 模型准备功能... " -docker run --rm --gpus all "$IMAGE" python3.11 -c " -import torch -from accelerate import Accelerator -accelerator = Accelerator() -model = torch.nn.Linear(10, 2) -optimizer = torch.optim.Adam(model.parameters()) -model, optimizer = accelerator.prepare(model, optimizer) -assert 'cuda' in str(next(model.parameters()).device), 'Model not on GPU' -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm --gpus all "$IMAGE" python3.11 -c " -import torch -from accelerate import Accelerator -accelerator = Accelerator() -model = torch.nn.Linear(10, 2) -optimizer = torch.optim.Adam(model.parameters()) -model, optimizer = accelerator.prepare(model, optimizer) -print(f'Model device: {next(model.parameters()).device}') -" - exit 1 -fi - -# 测试 7: 训练循环 -echo -n "测试 7: 训练循环... " -docker run --rm --gpus all "$IMAGE" python3.11 -c " -import torch -from accelerate import Accelerator - -accelerator = Accelerator() - -# 创建简单模型和数据 -model = torch.nn.Linear(10, 2) -optimizer = torch.optim.Adam(model.parameters()) -dataloader = torch.utils.data.DataLoader( - [(torch.randn(10), torch.randint(0, 2, (1,))) for _ in range(10)], - batch_size=2 -) - -# 使用 Accelerator 准备 -model, optimizer, dataloader = accelerator.prepare(model, optimizer, dataloader) - -# 简单训练步骤 -model.train() -for batch_idx, (inputs, labels) in enumerate(dataloader): - outputs = model(inputs) - loss = torch.nn.functional.cross_entropy(outputs, labels.squeeze()) - accelerator.backward(loss) - optimizer.step() - optimizer.zero_grad() - if batch_idx >= 2: - break -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm --gpus all "$IMAGE" python3.11 -c " -import torch -from accelerate import Accelerator - -accelerator = Accelerator() -model = torch.nn.Linear(10, 2) -optimizer = torch.optim.Adam(model.parameters()) -dataloader = torch.utils.data.DataLoader( - [(torch.randn(10), torch.randint(0, 2, (1,))) for _ in range(10)], - batch_size=2 -) -model, optimizer, dataloader = accelerator.prepare(model, optimizer, dataloader) -model.train() -for batch_idx, (inputs, labels) in enumerate(dataloader): - outputs = model(inputs) - loss = torch.nn.functional.cross_entropy(outputs, labels.squeeze()) - accelerator.backward(loss) - optimizer.step() - optimizer.zero_grad() - if batch_idx >= 2: - break -print('Training loop OK') -" - exit 1 -fi - -# 测试 8: 混合精度训练 -echo -n "测试 8: 混合精度训练 (fp16)... " -docker run --rm --gpus all "$IMAGE" python3.11 -c " -import torch -from accelerate import Accelerator - -accelerator = Accelerator(mixed_precision='fp16') - -model = torch.nn.Linear(10, 2) -optimizer = torch.optim.Adam(model.parameters()) -model, optimizer = accelerator.prepare(model, optimizer) - -# 简单前向传播 -inputs = torch.randn(4, 10).to(accelerator.device) -outputs = model(inputs) -loss = outputs.sum() -accelerator.backward(loss) -optimizer.step() -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm --gpus all "$IMAGE" python3.11 -c " -import torch -from accelerate import Accelerator - -accelerator = Accelerator(mixed_precision='fp16') -model = torch.nn.Linear(10, 2) -optimizer = torch.optim.Adam(model.parameters()) -model, optimizer = accelerator.prepare(model, optimizer) -inputs = torch.randn(4, 10).to(accelerator.device) -outputs = model(inputs) -loss = outputs.sum() -accelerator.backward(loss) -optimizer.step() -print(f'Mixed precision: {accelerator.mixed_precision}') -" - exit 1 -fi - -# 测试 9: 梯度累积 -echo -n "测试 9: 梯度累积... " -docker run --rm --gpus all "$IMAGE" python3.11 -c " -import torch -from accelerate import Accelerator - -accelerator = Accelerator(gradient_accumulation_steps=2) - -model = torch.nn.Linear(10, 2) -optimizer = torch.optim.Adam(model.parameters()) -model, optimizer = accelerator.prepare(model, optimizer) - -# 模拟梯度累积 -for step in range(4): - with accelerator.accumulate(model): - inputs = torch.randn(2, 10).to(accelerator.device) - outputs = model(inputs) - loss = outputs.sum() - accelerator.backward(loss) - optimizer.step() - optimizer.zero_grad() -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm --gpus all "$IMAGE" python3.11 -c " -import torch -from accelerate import Accelerator - -accelerator = Accelerator(gradient_accumulation_steps=2) -model = torch.nn.Linear(10, 2) -optimizer = torch.optim.Adam(model.parameters()) -model, optimizer = accelerator.prepare(model, optimizer) -for step in range(4): - with accelerator.accumulate(model): - inputs = torch.randn(2, 10).to(accelerator.device) - outputs = model(inputs) - loss = outputs.sum() - accelerator.backward(loss) - optimizer.step() - optimizer.zero_grad() -print('Gradient accumulation OK') -" - exit 1 -fi - -# 测试 10: Examples 依赖 -echo -n "测试 10: Examples 依赖 (datasets, evaluate)... " -docker run --rm "$IMAGE" python3.11 -c "import datasets; import evaluate" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c "import datasets; import evaluate" - exit 1 -fi - -echo "" -echo "==========================================" -echo "所有测试通过!" -echo "==========================================" diff --git a/frameworks/accelerate/1.13.0/Dockerfile b/frameworks/accelerate/1.13.0/Dockerfile deleted file mode 100644 index 75834ade00efca8488693a332579036bcdb4de82..0000000000000000000000000000000000000000 --- a/frameworks/accelerate/1.13.0/Dockerfile +++ /dev/null @@ -1,36 +0,0 @@ -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="Anstarc " -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="Hugging Face Accelerate 1.13.0 GPU on OpenCloudOS 9" - -# 安装系统依赖 -RUN dnf install -y \ - python3.11 \ - python3.11-pip \ - git \ - wget \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 设置工作目录 -WORKDIR /app - -# 安装 Accelerate 及核心依赖 -RUN pip3 install --no-cache-dir \ - torch torchvision \ - --index-url https://download.pytorch.org/whl/cu128 - -RUN pip3.11 install --no-cache-dir \ - accelerate==1.13.0 \ - transformers \ - datasets \ - evaluate \ - timm - -# 设置 GPU 环境变量 -ENV NVIDIA_VISIBLE_DEVICES=all -ENV CUDA_MODULE_LOADING=LAZY - -# 默认命令 -CMD ["python3.11", "-c", "import accelerate; print(f'Accelerate {accelerate.__version__} ready')"] diff --git a/frameworks/accelerate/1.13.0/README.md b/frameworks/accelerate/1.13.0/README.md deleted file mode 100644 index 639f90e56b51521a1e86efe9bba765641eb73d4b..0000000000000000000000000000000000000000 --- a/frameworks/accelerate/1.13.0/README.md +++ /dev/null @@ -1,108 +0,0 @@ -# Hugging Face Accelerate 1.13.0 GPU on OpenCloudOS 9 - -Accelerate 是 Hugging Face 开源的分布式训练加速库,简化 PyTorch 模型在多 GPU、多节点环境下的训练和推理。 - -## 基本信息 - -- **基础镜像**: opencloudos/opencloudos9-cuda-devel:12.8 -- **Python 版本**: 3.11 -- **CUDA 版本**: 12.8 -- **Accelerate 版本**: 1.13.0 -- **PyTorch 版本**: 最新稳定版 -- **Transformers 版本**: 最新稳定版 - -## 构建 - -```bash -docker build -t oc9-accelerate:1.13.0 . -``` - -## 测试 - -```bash -./test.sh oc9-accelerate:1.13.0 -``` - -测试项包括: -- Python 和 CUDA 环境 -- Accelerate 版本验证 -- GPU 训练功能 -- 混合精度支持 -- 分布式训练准备 -- NLP 和 CV 示例验证 - -## 使用示例 - -### 基本使用 - -```bash -# 查看版本信息 -docker run --rm oc9-accelerate:1.13.0 python3.11 -c "import accelerate; print(accelerate.__version__)" - -# 查看可用设备 -docker run --rm --gpus all oc9-accelerate:1.13.0 python3.11 -c "import torch; print(f'CUDA available: {torch.cuda.is_available()}')" -``` - -### GPU 训练 - -```python -from accelerate import Accelerator -import torch -import torch.nn as nn - -# 初始化 Accelerator -accelerator = Accelerator() - -# 定义模型和优化器 -model = nn.Linear(10, 2) -optimizer = torch.optim.Adam(model.parameters()) - -# 自动处理设备分配 -model, optimizer = accelerator.prepare(model, optimizer) - -# 训练循环 -for batch in dataloader: - optimizer.zero_grad() - outputs = model(batch) - loss = criterion(outputs) - accelerator.backward(loss) - optimizer.step() -``` - -### 分布式训练 - -```bash -# 单机多卡训练 -docker run --rm --gpus all -v $(pwd):/workspace oc9-accelerate:1.13.0 \ - accelerate launch --multi_gpu --num_processes=2 train.py - -# 混合精度训练 -docker run --rm --gpus all -v $(pwd):/workspace oc9-accelerate:1.13.0 \ - accelerate launch --mixed_precision=fp16 train.py -``` - -### 交互式使用 - -```bash -docker run --rm -it --gpus all oc9-accelerate:1.13.0 bash -``` - -## 支持的功能 - -- **多 GPU 训练**: DataParallel, DistributedDataParallel -- **混合精度**: FP16, BF16 -- **梯度累积**: 自动处理小批量训练 -- **DeepSpeed 集成**: ZeRO 优化 -- **FSDP 支持**: PyTorch 原生分布式训练 -- **自动设备管理**: CPU/GPU 自动迁移 - -## 系统要求 - -- **GPU**: NVIDIA GPU with CUDA 12.x support -- **显存**: 建议 8GB+ (取决于模型大小) -- **Docker**: 19.03+ with nvidia-docker2 - -## 参考资源 - -- [Accelerate 官方文档](https://huggingface.co/docs/accelerate) -- [Accelerate GitHub](https://github.com/huggingface/accelerate) diff --git a/frameworks/accelerate/1.13.0/build.conf b/frameworks/accelerate/1.13.0/build.conf deleted file mode 100644 index b32944ee7d1a99083855ef4052e151bd98184d53..0000000000000000000000000000000000000000 --- a/frameworks/accelerate/1.13.0/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# Hugging Face Accelerate 1.13.0 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-accelerate -IMAGE_TAG=1.13.0 -GPU_TEST=true diff --git a/frameworks/accelerate/1.13.0/test.sh b/frameworks/accelerate/1.13.0/test.sh deleted file mode 100755 index 1ad989eeadf91ffe917f3c8cf2f1bbc0b673dafd..0000000000000000000000000000000000000000 --- a/frameworks/accelerate/1.13.0/test.sh +++ /dev/null @@ -1,266 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:-oc9-accelerate:1.13.0}" - -echo "==========================================" -echo "测试 Accelerate 1.13.0 GPU 镜像" -echo "镜像: $IMAGE" -echo "==========================================" - -# 测试 1: Python 环境 -echo -n "测试 1: Python 环境... " -docker run --rm "$IMAGE" python3.11 --version > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 --version - exit 1 -fi - -# 测试 2: Accelerate 版本 -echo -n "测试 2: Accelerate 版本... " -VERSION=$(docker run --rm "$IMAGE" python3.11 -c "import accelerate; print(accelerate.__version__)") -if [ "$VERSION" = "1.13.0" ]; then - echo "✓ (版本: $VERSION)" -else - echo "✗ (期望: 1.13.0, 实际: $VERSION)" - exit 1 -fi - -# 测试 3: 核心依赖 -echo -n "测试 3: 核心依赖 (torch, transformers)... " -docker run --rm "$IMAGE" python3.11 -c "import torch; import transformers" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c "import torch; import transformers" - exit 1 -fi - -# 测试 4: CUDA 环境 -echo -n "测试 4: CUDA 环境... " -GPU_INFO=$(docker run --rm --gpus all "$IMAGE" python3.11 -c " -import torch -assert torch.cuda.is_available(), 'CUDA not available' -print(torch.cuda.get_device_name(0)) -") -if [ $? -eq 0 ]; then - echo "✓" - echo " GPU: $GPU_INFO" -else - echo "✗" - exit 1 -fi - -# 测试 5: Accelerator 初始化 -echo -n "测试 5: Accelerator 初始化... " -docker run --rm --gpus all "$IMAGE" python3.11 -c " -from accelerate import Accelerator -accelerator = Accelerator() -assert 'cuda' in str(accelerator.device), 'GPU not detected' -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm --gpus all "$IMAGE" python3.11 -c " -from accelerate import Accelerator -accelerator = Accelerator() -print(f'Device: {accelerator.device}') -" - exit 1 -fi - -# 测试 6: 模型准备功能 -echo -n "测试 6: 模型准备功能... " -docker run --rm --gpus all "$IMAGE" python3.11 -c " -import torch -from accelerate import Accelerator -accelerator = Accelerator() -model = torch.nn.Linear(10, 2) -optimizer = torch.optim.Adam(model.parameters()) -model, optimizer = accelerator.prepare(model, optimizer) -assert 'cuda' in str(next(model.parameters()).device), 'Model not on GPU' -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm --gpus all "$IMAGE" python3.11 -c " -import torch -from accelerate import Accelerator -accelerator = Accelerator() -model = torch.nn.Linear(10, 2) -optimizer = torch.optim.Adam(model.parameters()) -model, optimizer = accelerator.prepare(model, optimizer) -print(f'Model device: {next(model.parameters()).device}') -" - exit 1 -fi - -# 测试 7: 训练循环 -echo -n "测试 7: 训练循环... " -docker run --rm --gpus all "$IMAGE" python3.11 -c " -import torch -from accelerate import Accelerator - -accelerator = Accelerator() - -# 创建简单模型和数据 -model = torch.nn.Linear(10, 2) -optimizer = torch.optim.Adam(model.parameters()) -dataloader = torch.utils.data.DataLoader( - [(torch.randn(10), torch.randint(0, 2, (1,))) for _ in range(10)], - batch_size=2 -) - -# 使用 Accelerator 准备 -model, optimizer, dataloader = accelerator.prepare(model, optimizer, dataloader) - -# 简单训练步骤 -model.train() -for batch_idx, (inputs, labels) in enumerate(dataloader): - outputs = model(inputs) - loss = torch.nn.functional.cross_entropy(outputs, labels.squeeze()) - accelerator.backward(loss) - optimizer.step() - optimizer.zero_grad() - if batch_idx >= 2: - break -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm --gpus all "$IMAGE" python3.11 -c " -import torch -from accelerate import Accelerator - -accelerator = Accelerator() -model = torch.nn.Linear(10, 2) -optimizer = torch.optim.Adam(model.parameters()) -dataloader = torch.utils.data.DataLoader( - [(torch.randn(10), torch.randint(0, 2, (1,))) for _ in range(10)], - batch_size=2 -) -model, optimizer, dataloader = accelerator.prepare(model, optimizer, dataloader) -model.train() -for batch_idx, (inputs, labels) in enumerate(dataloader): - outputs = model(inputs) - loss = torch.nn.functional.cross_entropy(outputs, labels.squeeze()) - accelerator.backward(loss) - optimizer.step() - optimizer.zero_grad() - if batch_idx >= 2: - break -print('Training loop OK') -" - exit 1 -fi - -# 测试 8: 混合精度训练 -echo -n "测试 8: 混合精度训练 (fp16)... " -docker run --rm --gpus all "$IMAGE" python3.11 -c " -import torch -from accelerate import Accelerator - -accelerator = Accelerator(mixed_precision='fp16') - -model = torch.nn.Linear(10, 2) -optimizer = torch.optim.Adam(model.parameters()) -model, optimizer = accelerator.prepare(model, optimizer) - -# 简单前向传播 -inputs = torch.randn(4, 10).to(accelerator.device) -outputs = model(inputs) -loss = outputs.sum() -accelerator.backward(loss) -optimizer.step() -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm --gpus all "$IMAGE" python3.11 -c " -import torch -from accelerate import Accelerator - -accelerator = Accelerator(mixed_precision='fp16') -model = torch.nn.Linear(10, 2) -optimizer = torch.optim.Adam(model.parameters()) -model, optimizer = accelerator.prepare(model, optimizer) -inputs = torch.randn(4, 10).to(accelerator.device) -outputs = model(inputs) -loss = outputs.sum() -accelerator.backward(loss) -optimizer.step() -print(f'Mixed precision: {accelerator.mixed_precision}') -" - exit 1 -fi - -# 测试 9: 梯度累积 -echo -n "测试 9: 梯度累积... " -docker run --rm --gpus all "$IMAGE" python3.11 -c " -import torch -from accelerate import Accelerator - -accelerator = Accelerator(gradient_accumulation_steps=2) - -model = torch.nn.Linear(10, 2) -optimizer = torch.optim.Adam(model.parameters()) -model, optimizer = accelerator.prepare(model, optimizer) - -# 模拟梯度累积 -for step in range(4): - with accelerator.accumulate(model): - inputs = torch.randn(2, 10).to(accelerator.device) - outputs = model(inputs) - loss = outputs.sum() - accelerator.backward(loss) - optimizer.step() - optimizer.zero_grad() -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm --gpus all "$IMAGE" python3.11 -c " -import torch -from accelerate import Accelerator - -accelerator = Accelerator(gradient_accumulation_steps=2) -model = torch.nn.Linear(10, 2) -optimizer = torch.optim.Adam(model.parameters()) -model, optimizer = accelerator.prepare(model, optimizer) -for step in range(4): - with accelerator.accumulate(model): - inputs = torch.randn(2, 10).to(accelerator.device) - outputs = model(inputs) - loss = outputs.sum() - accelerator.backward(loss) - optimizer.step() - optimizer.zero_grad() -print('Gradient accumulation OK') -" - exit 1 -fi - -# 测试 10: Examples 依赖 -echo -n "测试 10: Examples 依赖 (datasets, evaluate)... " -docker run --rm "$IMAGE" python3.11 -c "import datasets; import evaluate" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c "import datasets; import evaluate" - exit 1 -fi - -echo "" -echo "==========================================" -echo "所有测试通过!" -echo "==========================================" diff --git a/frameworks/llama_index/0.14.16/.DS_Store b/frameworks/crewai/.DS_Store similarity index 92% rename from frameworks/llama_index/0.14.16/.DS_Store rename to frameworks/crewai/.DS_Store index 5008ddfcf53c02e82d7eee2e57c38e5672ef89f6..27db837e4a33ba3d2823989ac9009457758c1bf5 100644 Binary files a/frameworks/llama_index/0.14.16/.DS_Store and b/frameworks/crewai/.DS_Store differ diff --git a/frameworks/crewai/1.13.0/Dockerfile b/frameworks/crewai/1.13.0/Dockerfile index 392730bb92d4b83ca6b9ffde76ba3db151beac9b..8d749b90f6b09ceb677b0aa6bccbd5bb0d6f9068 100644 --- a/frameworks/crewai/1.13.0/Dockerfile +++ b/frameworks/crewai/1.13.0/Dockerfile @@ -13,19 +13,17 @@ RUN dnf install -y \ && dnf clean all \ && rm -rf /var/cache/yum/* -# 设置 python3 指向 python3.11,确保 pip 和 python 一致 -RUN ln -sf /usr/bin/python3.11 /usr/bin/python3 \ - && ln -sf /usr/bin/pip3.11 /usr/bin/pip3 - -# 安装 CrewAI(使用 pip3.11 确保安装到正确的 Python 环境) -RUN pip3.11 install --no-cache-dir crewai==1.13.0 - -# 验证安装 -RUN python3.11 -c "import crewai; print(f'CrewAI {crewai.__version__} installed successfully')" +# 安装 Python 包管理器和 CrewAI +RUN pip3.11 install --no-cache-dir uv \ + && uv pip install --no-cache-dir crewai==1.13.0 --system # 记录构建时间 RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /tencentos_build_date.txt +# 复制测试脚本到镜像 +COPY test.sh /workspace/test.sh +RUN chmod +x /workspace/test.sh + WORKDIR /workspace CMD ["python3.11"] diff --git a/frameworks/crewai/1.13.0/build.conf b/frameworks/crewai/1.13.0/build.conf deleted file mode 100644 index 21afb7ed2e7956cf4b9d53f125f1ceac9471e4a1..0000000000000000000000000000000000000000 --- a/frameworks/crewai/1.13.0/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# CrewAI 1.13.0 on OpenCloudOS 9 -IMAGE_NAME=oc9-crewai -IMAGE_TAG=1.13.0 -GPU_TEST=false diff --git a/frameworks/crewai/1.13.0/test.sh b/frameworks/crewai/1.13.0/test.sh index 6564617408344a435809ba0c20241eee4c50fd7b..3bc18cca6b6e77ee1ee6e87e0d3316ada5964355 100644 --- a/frameworks/crewai/1.13.0/test.sh +++ b/frameworks/crewai/1.13.0/test.sh @@ -1,35 +1,33 @@ #!/bin/bash set -e -IMAGE_NAME="${1:?用法: $0 <镜像名:标签>}" - echo "=== CrewAI 基础功能测试 ===" -echo "镜像: $IMAGE_NAME" -echo "时间: $(date '+%Y-%m-%d %H:%M:%S')" +echo "测试时间: $(date '+%Y-%m-%d %H:%M:%S')" +echo "CrewAI 版本: 1.13.0" echo "" -PYTHON=python3.11 - # 1. 验证框架可正常导入 echo -n "检查 crewai 导入... " -docker run --rm "$IMAGE_NAME" $PYTHON -c "import crewai; print(crewai.__version__)" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } +python3.11 -c "import crewai; print(crewai.__version__)" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } # 2. 验证核心类可正常导入 echo -n "检查核心类导入... " -docker run --rm "$IMAGE_NAME" $PYTHON -c " +python3.11 -c " from crewai import Agent, Task, Crew, Process print('核心类导入正常') " && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } # 3. 验证基础功能(使用环境变量禁用默认 LLM) echo -n "检查基础功能... " -docker run --rm "$IMAGE_NAME" $PYTHON -c " +python3.11 -c " import os +# 设置环境变量避免 CrewAI 尝试连接 OpenAI os.environ['OPENAI_API_KEY'] = 'sk-test-key-for-validation-only' os.environ['CREWAI_DISABLE_TELEMETRY'] = 'true' from crewai import Agent, Task, Crew, Process +# 创建测试智能体 agent = Agent( role='测试员', goal='验证 CrewAI 安装', @@ -38,12 +36,14 @@ agent = Agent( verbose=False ) +# 创建测试任务 task = Task( description='执行基础功能测试', expected_output='测试通过', agent=agent ) +# 创建团队 crew = Crew( agents=[agent], tasks=[task], @@ -56,7 +56,7 @@ print('基础功能正常') # 4. 验证工具模块可导入 echo -n "检查工具模块... " -docker run --rm "$IMAGE_NAME" $PYTHON -c " +python3.11 -c " from crewai.tools import tool print('工具模块导入正常') " && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } diff --git a/frameworks/crewai/1.14.0/.DS_Store b/frameworks/crewai/1.14.0/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..3c5c2994009d41cad41382083e8932c5d2217e8a Binary files /dev/null and b/frameworks/crewai/1.14.0/.DS_Store differ diff --git a/frameworks/crewai/1.14.0/Dockerfile b/frameworks/crewai/1.14.0/Dockerfile index 6bc510f3151ea6f59e3ba8e5c7ef9decb0a5da90..68972c9198e6a489849e6ea232506470c561cf56 100644 --- a/frameworks/crewai/1.14.0/Dockerfile +++ b/frameworks/crewai/1.14.0/Dockerfile @@ -13,19 +13,17 @@ RUN dnf install -y \ && dnf clean all \ && rm -rf /var/cache/yum/* -# 设置 python3 指向 python3.11,确保 pip 和 python 一致 -RUN ln -sf /usr/bin/python3.11 /usr/bin/python3 \ - && ln -sf /usr/bin/pip3.11 /usr/bin/pip3 - -# 安装 CrewAI(使用 pip3.11 确保安装到正确的 Python 环境) -RUN pip3.11 install --no-cache-dir crewai==1.14.0 - -# 验证安装 -RUN python3.11 -c "import crewai; print(f'CrewAI {crewai.__version__} installed successfully')" +# 安装 Python 包管理器和 CrewAI +RUN pip3.11 install --no-cache-dir uv \ + && uv pip install --no-cache-dir crewai==1.14.0 --system # 记录构建时间 RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /tencentos_build_date.txt +# 复制测试脚本到镜像 +COPY test.sh /workspace/test.sh +RUN chmod +x /workspace/test.sh + WORKDIR /workspace CMD ["python3.11"] diff --git a/frameworks/crewai/1.14.0/build.conf b/frameworks/crewai/1.14.0/build.conf deleted file mode 100644 index 30c300d42961b40e9adcaad865dc16b1c7e11a54..0000000000000000000000000000000000000000 --- a/frameworks/crewai/1.14.0/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# CrewAI 1.14.0 on OpenCloudOS 9 -IMAGE_NAME=oc9-crewai -IMAGE_TAG=1.14.0 -GPU_TEST=false diff --git a/frameworks/crewai/1.14.0/test.sh b/frameworks/crewai/1.14.0/test.sh index 6564617408344a435809ba0c20241eee4c50fd7b..4a3fa536c70ddd89e1291da0ec3ce3cf7faf6c80 100644 --- a/frameworks/crewai/1.14.0/test.sh +++ b/frameworks/crewai/1.14.0/test.sh @@ -1,35 +1,33 @@ #!/bin/bash set -e -IMAGE_NAME="${1:?用法: $0 <镜像名:标签>}" - echo "=== CrewAI 基础功能测试 ===" -echo "镜像: $IMAGE_NAME" -echo "时间: $(date '+%Y-%m-%d %H:%M:%S')" +echo "测试时间: $(date '+%Y-%m-%d %H:%M:%S')" +echo "CrewAI 版本: 1.14.0" echo "" -PYTHON=python3.11 - # 1. 验证框架可正常导入 echo -n "检查 crewai 导入... " -docker run --rm "$IMAGE_NAME" $PYTHON -c "import crewai; print(crewai.__version__)" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } +python3.11 -c "import crewai; print(crewai.__version__)" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } # 2. 验证核心类可正常导入 echo -n "检查核心类导入... " -docker run --rm "$IMAGE_NAME" $PYTHON -c " +python3.11 -c " from crewai import Agent, Task, Crew, Process print('核心类导入正常') " && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } # 3. 验证基础功能(使用环境变量禁用默认 LLM) echo -n "检查基础功能... " -docker run --rm "$IMAGE_NAME" $PYTHON -c " +python3.11 -c " import os +# 设置环境变量避免 CrewAI 尝试连接 OpenAI os.environ['OPENAI_API_KEY'] = 'sk-test-key-for-validation-only' os.environ['CREWAI_DISABLE_TELEMETRY'] = 'true' from crewai import Agent, Task, Crew, Process +# 创建测试智能体 agent = Agent( role='测试员', goal='验证 CrewAI 安装', @@ -38,12 +36,14 @@ agent = Agent( verbose=False ) +# 创建测试任务 task = Task( description='执行基础功能测试', expected_output='测试通过', agent=agent ) +# 创建团队 crew = Crew( agents=[agent], tasks=[task], @@ -56,7 +56,7 @@ print('基础功能正常') # 4. 验证工具模块可导入 echo -n "检查工具模块... " -docker run --rm "$IMAGE_NAME" $PYTHON -c " +python3.11 -c " from crewai.tools import tool print('工具模块导入正常') " && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } diff --git a/frameworks/crewai/1.14.1/.DS_Store b/frameworks/crewai/1.14.1/.DS_Store new file mode 100644 index 0000000000000000000000000000000000000000..aa42b679a260a0162c1847305ebce2d592cb0c45 Binary files /dev/null and b/frameworks/crewai/1.14.1/.DS_Store differ diff --git a/frameworks/crewai/1.14.1/Dockerfile b/frameworks/crewai/1.14.1/Dockerfile index 08ae460f419eab4b774bf8c02b4ed8cfd397a26b..6289cd5a4781dadeca5ff1cd656e808460b7b579 100644 --- a/frameworks/crewai/1.14.1/Dockerfile +++ b/frameworks/crewai/1.14.1/Dockerfile @@ -13,19 +13,17 @@ RUN dnf install -y \ && dnf clean all \ && rm -rf /var/cache/yum/* -# 设置 python3 指向 python3.11,确保 pip 和 python 一致 -RUN ln -sf /usr/bin/python3.11 /usr/bin/python3 \ - && ln -sf /usr/bin/pip3.11 /usr/bin/pip3 - -# 安装 CrewAI(使用 pip3.11 确保安装到正确的 Python 环境) -RUN pip3.11 install --no-cache-dir crewai==1.14.1 - -# 验证安装 -RUN python3.11 -c "import crewai; print(f'CrewAI {crewai.__version__} installed successfully')" +# 安装 Python 包管理器和 CrewAI +RUN pip3.11 install --no-cache-dir uv \ + && uv pip install --no-cache-dir crewai==1.14.1 --system # 记录构建时间 RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /tencentos_build_date.txt +# 复制测试脚本到镜像 +COPY test.sh /workspace/test.sh +RUN chmod +x /workspace/test.sh + WORKDIR /workspace CMD ["python3.11"] diff --git a/frameworks/crewai/1.14.1/build.conf b/frameworks/crewai/1.14.1/build.conf deleted file mode 100644 index c75712a6369bdf96201622d148473ce4d9133f02..0000000000000000000000000000000000000000 --- a/frameworks/crewai/1.14.1/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# CrewAI 1.14.1 on OpenCloudOS 9 -IMAGE_NAME=oc9-crewai -IMAGE_TAG=1.14.1 -GPU_TEST=false diff --git a/frameworks/crewai/1.14.1/test.sh b/frameworks/crewai/1.14.1/test.sh index 6564617408344a435809ba0c20241eee4c50fd7b..eae1253f1ad9bcf321399eab544eb7aa29e5f2e2 100644 --- a/frameworks/crewai/1.14.1/test.sh +++ b/frameworks/crewai/1.14.1/test.sh @@ -1,35 +1,33 @@ #!/bin/bash set -e -IMAGE_NAME="${1:?用法: $0 <镜像名:标签>}" - echo "=== CrewAI 基础功能测试 ===" -echo "镜像: $IMAGE_NAME" -echo "时间: $(date '+%Y-%m-%d %H:%M:%S')" +echo "测试时间: $(date '+%Y-%m-%d %H:%M:%S')" +echo "CrewAI 版本: 1.14.1" echo "" -PYTHON=python3.11 - # 1. 验证框架可正常导入 echo -n "检查 crewai 导入... " -docker run --rm "$IMAGE_NAME" $PYTHON -c "import crewai; print(crewai.__version__)" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } +python3.11 -c "import crewai; print(crewai.__version__)" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } # 2. 验证核心类可正常导入 echo -n "检查核心类导入... " -docker run --rm "$IMAGE_NAME" $PYTHON -c " +python3.11 -c " from crewai import Agent, Task, Crew, Process print('核心类导入正常') " && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } # 3. 验证基础功能(使用环境变量禁用默认 LLM) echo -n "检查基础功能... " -docker run --rm "$IMAGE_NAME" $PYTHON -c " +python3.11 -c " import os +# 设置环境变量避免 CrewAI 尝试连接 OpenAI os.environ['OPENAI_API_KEY'] = 'sk-test-key-for-validation-only' os.environ['CREWAI_DISABLE_TELEMETRY'] = 'true' from crewai import Agent, Task, Crew, Process +# 创建测试智能体 agent = Agent( role='测试员', goal='验证 CrewAI 安装', @@ -38,12 +36,14 @@ agent = Agent( verbose=False ) +# 创建测试任务 task = Task( description='执行基础功能测试', expected_output='测试通过', agent=agent ) +# 创建团队 crew = Crew( agents=[agent], tasks=[task], @@ -56,7 +56,7 @@ print('基础功能正常') # 4. 验证工具模块可导入 echo -n "检查工具模块... " -docker run --rm "$IMAGE_NAME" $PYTHON -c " +python3.11 -c " from crewai.tools import tool print('工具模块导入正常') " && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } diff --git a/frameworks/dspy/3.1.3/Dockerfile b/frameworks/dspy/3.1.3/Dockerfile deleted file mode 100644 index a9c71ff26f8d7a33896b3f43a5ea8cc2947f0822..0000000000000000000000000000000000000000 --- a/frameworks/dspy/3.1.3/Dockerfile +++ /dev/null @@ -1,11 +0,0 @@ -FROM opencloudos/opencloudos9-minimal:latest - -LABEL maintainer="contributor " -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="DSPy 3.1.3 on OpenCloudOS 9" - -RUN dnf --setopt=sslverify=false install -y ca-certificates python3-pip && dnf clean all && rm -rf /var/cache/yum/* - -RUN pip3 install --no-cache-dir dspy==3.1.3 - -CMD ["python3"] diff --git a/frameworks/dspy/3.1.3/README.md b/frameworks/dspy/3.1.3/README.md deleted file mode 100644 index 27a355aee7909041f64bd2670a05099126fe905b..0000000000000000000000000000000000000000 --- a/frameworks/dspy/3.1.3/README.md +++ /dev/null @@ -1,48 +0,0 @@ -# DSPy on OpenCloudOS 9 - -## 基本信息 - -| 项目 | 详情 | -|------|------| -| **框架版本** | 3.1.3 | -| **基础镜像** | opencloudos/opencloudos9-minimal:latest | -| **Python 版本** | 3.11 | -| **CUDA 版本** | N/A(纯 CPU) | -| **开源地址** | https://github.com/stanfordnlp/dspy | - -## 框架简介 - -DSPy(Declarative Self-improving Python)是由 Stanford NLP 开发的框架,用于以编程方式(而非提示词)构建模块化 AI 系统。支持构建分类器、RAG 管道和 Agent 循环,并提供自动优化 prompt 和权重的算法。 - -## 构建 - -```bash -docker build -t oc9-dspy:3.1.3 . -``` - -## 使用示例 - -```bash -# 验证安装 -docker run --rm oc9-dspy:3.1.3 python3.11 -c "import dspy; print(dspy.__version__)" - -# 交互式使用 -docker run -it --rm oc9-dspy:3.1.3 python3.11 -``` - -```python -import dspy - -# 配置 LM(以 OpenAI 为例) -lm = dspy.LM('openai/gpt-4o-mini', api_key='your-api-key') -dspy.configure(lm=lm) - -# 定义 Signature 并调用 -qa = dspy.Predict('question -> answer') -result = qa(question="What is OpenCloudOS?") -print(result.answer) -``` - -## 已知问题 - -- 无 diff --git a/frameworks/dspy/3.1.3/build.conf b/frameworks/dspy/3.1.3/build.conf deleted file mode 100644 index 78a5a82ecbebce9bb9e0f663c03888feb92e902e..0000000000000000000000000000000000000000 --- a/frameworks/dspy/3.1.3/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# dspy 3.1.3 on OpenCloudOS 9 -IMAGE_NAME=oc9-dspy -IMAGE_TAG=3.1.3 -GPU_TEST=false diff --git a/frameworks/dspy/3.1.3/test.sh b/frameworks/dspy/3.1.3/test.sh deleted file mode 100755 index 29c2267fb8076206f008816310d2af731ba2e88c..0000000000000000000000000000000000000000 --- a/frameworks/dspy/3.1.3/test.sh +++ /dev/null @@ -1,44 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" - -echo "=== DSPy 3.1.3 基础功能测试 ===" - -# 1. 验证框架可正常导入并检查版本 -echo -n "检查 import 和版本... " -sudo docker run --rm "$IMAGE" python3 -c "import dspy; v = dspy.__version__; assert v == '3.1.3', f'版本不匹配: {v}'; print(v)" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证 Signature 定义 -echo -n "检查 Signature 定义... " -sudo docker run --rm "$IMAGE" python3 -c " -from dspy import Signature, InputField, OutputField - -class BasicQA(Signature): - question = InputField(desc='a question') - answer = OutputField(desc='an answer') - -assert 'question' in BasicQA.input_fields -assert 'answer' in BasicQA.output_fields -print('Signature 正常') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 3. 验证 Predict 模块创建 -echo -n "检查 Predict 模块... " -sudo docker run --rm "$IMAGE" python3 -c " -import dspy -predictor = dspy.Predict('question -> answer') -assert predictor is not None -print('Predict 模块正常') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 4. 验证 ChainOfThought 模块 -echo -n "检查 ChainOfThought 模块... " -sudo docker run --rm "$IMAGE" python3 -c " -import dspy -cot = dspy.ChainOfThought('question -> answer') -assert cot is not None -print('ChainOfThought 模块正常') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" diff --git "a/frameworks/fastgpt/4.14.10.1/4.14.10.1\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" "b/frameworks/fastgpt/4.14.10.1/4.14.10.1\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" deleted file mode 100644 index 26a97254e15b7d9a4becdc9edf0e4d124596f6ec..0000000000000000000000000000000000000000 Binary files "a/frameworks/fastgpt/4.14.10.1/4.14.10.1\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" and /dev/null differ diff --git a/frameworks/fastgpt/4.14.10.1/Dockerfile b/frameworks/fastgpt/4.14.10.1/Dockerfile deleted file mode 100644 index 12fcd67ae29001af7f49a1c07120d079b8f9344b..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.10.1/Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -# 基础镜像:OpenCloudOS 9 极简版(FastGPT 为 Next.js Web 应用,从源码构建) -FROM opencloudos/opencloudos9-minimal:latest - -# 镜像元信息 -LABEL maintainer="pangxb666" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="FastGPT 4.14.10.1 on OpenCloudOS 9" - -ARG FASTGPT_VERSION=4.14.10.1 -ARG NODE_VERSION=20.18.1 -# TARGETARCH 由 BuildKit 自动注入:amd64 / arm64 / ... -ARG TARGETARCH - -# 安装系统依赖:git/curl/tar/xz/ca-certificates,并清理缓存 -RUN dnf install -y --nogpgcheck \ - git \ - curl \ - tar \ - xz \ - ca-certificates \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 根据目标架构自动选择对应的 Node.js 官方二进制(linux-x64 / linux-arm64) -# 同时确保动态链接器路径存在(minimal 镜像 /lib64 可能缺失,建立符号链接以兼容 qemu user-mode 模拟) -RUN set -eux; \ - case "${TARGETARCH:-amd64}" in \ - amd64) NODE_ARCH="x64" ;; \ - arm64) NODE_ARCH="arm64" ;; \ - *) echo "ERROR: 不支持的架构 TARGETARCH=${TARGETARCH}"; exit 1 ;; \ - esac; \ - echo "构建目标架构: ${TARGETARCH}, 下载 Node.js linux-${NODE_ARCH}"; \ - [ -e /lib64 ] || ln -s /usr/lib64 /lib64; \ - curl -fsSL "https://mirrors.tuna.tsinghua.edu.cn/nodejs-release/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \ - -o /tmp/node.tar.xz; \ - tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1; \ - rm -f /tmp/node.tar.xz; \ - node --version; \ - npm --version; \ - npm config set registry https://registry.npmmirror.com; \ - npm install -g pnpm@9 - -# 拉取指定版本源码 -# 默认走 ghfast.top 代理加速国内访问 GitHub,离境构建可通过 --build-arg GIT_PROXY="" 关闭 -ARG GIT_PROXY=https://ghfast.top/ -WORKDIR /app -RUN git config --global http.lowSpeedLimit 1000 \ - && git config --global http.lowSpeedTime 60 \ - && git config --global http.postBuffer 524288000 \ - && git clone --depth=1 --branch "v${FASTGPT_VERSION}" \ - "${GIT_PROXY}https://github.com/labring/FastGPT.git" /tmp/fastgpt \ - && cp -a /tmp/fastgpt/. /app/ \ - && rm -rf /tmp/fastgpt - -# 安装依赖(使用 npmmirror 加速) -RUN pnpm install --registry=https://registry.npmmirror.com - -# 构建 app 子项目(Next.js standalone 输出) -ENV NODE_OPTIONS="--max-old-space-size=4096" -RUN pnpm --filter=app build - -# 运行时环境变量 -ENV NODE_ENV=production -ENV NEXT_TELEMETRY_DISABLED=1 -ENV PORT=3000 -EXPOSE 3000 - -# 记录镜像构建时间,便于追溯 -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -# 默认从 standalone 输出启动 Next.js 服务 -WORKDIR /app/projects/app -CMD ["node", ".next/standalone/projects/app/server.js"] diff --git a/frameworks/fastgpt/4.14.10.1/README.md b/frameworks/fastgpt/4.14.10.1/README.md deleted file mode 100644 index 9f98af692653fd4062ddc1f9f423905d7cf88fb8..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.10.1/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# FastGPT 4.14.10.1 on OpenCloudOS 9 - -## 基本信息 - -- **框架版本**:4.14.10.1 -- **基础镜像**:opencloudos/opencloudos9-minimal:latest -- **Node.js 版本**:20.18.1(按 TARGETARCH 自动选择 linux-x64 / linux-arm64) -- **CUDA 版本**:N/A -- **开源地址**:https://github.com/labring/FastGPT - -## 简介 - -FastGPT 是 labring 开源的基于 LLM 的 RAG 知识库问答与 AI 工作流编排平台,主项目为 Next.js + TypeScript Monorepo(pnpm workspace)。本镜像在 OpenCloudOS 9 上从源码构建 `projects/app`(Next.js standalone 输出),运行依赖 MongoDB、PostgreSQL+pgvector 等外部服务(生产环境通过 docker-compose 编排)。 - -## 构建 - -```bash -# 默认按宿主机架构构建(推荐) -docker build -t oc9-fastgpt:4.14.10.1 . - -# 显式指定目标架构(适用于跨架构构建) -docker buildx build --platform linux/amd64 -t oc9-fastgpt:4.14.10.1 . --load -docker buildx build --platform linux/arm64 -t oc9-fastgpt:4.14.10.1-arm64 . --load -``` - -> 提示:FastGPT 是 monorepo 项目,构建过程包含 `pnpm install` 和 `pnpm --filter=app build`,国内网络下首次构建预计 15-30 分钟,最终镜像体积较大(GB 级)。 - -## 使用示例 - -```bash -# 1. 验证镜像可启动 + 检查 Next.js standalone 产物存在 -bash test.sh oc9-fastgpt:4.14.10.1 - -# 2. 完整运行(需自备 MongoDB + PostgreSQL+pgvector) -docker run -d --name fastgpt -p 3000:3000 \ - -e MONGODB_URI="mongodb://:@:27017/fastgpt?authSource=admin" \ - -e PG_URL="postgresql://:@:5432/postgres" \ - -e CHAT_API_KEY="" \ - -v $(pwd)/config.json:/app/data/config.json \ - oc9-fastgpt:4.14.10.1 -``` - -更完整的部署方式(含 MongoDB / PG / MinIO / Redis 编排)参见 FastGPT 官方文档: - -## 测试环境 - -镜像已在以下两种架构验证通过: - -| 架构 | 操作系统 | 内核 | Docker | 状态 | -|------|---------|------|--------|------| -| x86_64 (amd64) | Ubuntu 22.04.4 LTS (Jammy) | 5.15.0-113-generic | 29.4.1 | ✓ 通过 | -| arm64 (aarch64) | macOS (Apple Silicon) | Darwin 25.x | Docker Desktop | ✓ 通过(开发自测) | - -构建时 `Dockerfile` 通过 BuildKit 注入的 `TARGETARCH` 自动选择对应的 Node.js 二进制(`linux-x64` / `linux-arm64`),同一份 Dockerfile 可在两种架构原生构建。 - -## 已知问题 - -- 单容器无 MongoDB/PostgreSQL 时,启动后会因连不上 DB 而退出,属预期行为;本镜像 `test.sh` 仅做启动产物校验,不做完整服务可用性测试。 -- 由于 monorepo 体积较大,构建时建议为 Docker 分配 ≥ 8GB 内存。 -- macOS Apple Silicon 上若以 `--platform=linux/amd64` 构建会走 qemu 模拟,速度慢且偶现兼容性问题;本机原生 `linux/arm64` 构建可正常完成,CI 仍以 `linux/amd64` 为准。 diff --git a/frameworks/fastgpt/4.14.10.1/build.conf b/frameworks/fastgpt/4.14.10.1/build.conf deleted file mode 100644 index 3fcdadd4477f283c68ba1cd5ba388ae2d5ef076b..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.10.1/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# FastGPT 4.14.10.1 on OpenCloudOS 9 -IMAGE_NAME=oc9-fastgpt -IMAGE_TAG=4.14.10.1 -GPU_TEST=false diff --git a/frameworks/fastgpt/4.14.10.1/test.sh b/frameworks/fastgpt/4.14.10.1/test.sh deleted file mode 100755 index d8ddc473ed3a18a5f60c447e897fef5b5ce5219a..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.10.1/test.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" -EXPECTED_VERSION="4.14.10.1" - -echo "=== FastGPT ${EXPECTED_VERSION} 基础功能测试 ===" - -# 1. 验证 Node.js 运行时 -echo -n "检查 Node.js 运行时... " -sudo docker run --rm "$IMAGE" node --version && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证 package.json 存在并打印版本(FastGPT 内部 version 字段可能滞后于 git tag,仅打印不强校验) -echo -n "检查 package.json 版本字段... " -sudo docker run --rm "$IMAGE" node -e " -const pkg = require('/app/package.json'); -console.log('package.json version:', pkg.version); -if (!pkg.version) { console.error('版本字段缺失'); process.exit(1); } -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 3. 验证 Next.js standalone 构建产物存在 -echo -n "检查 Next.js standalone 构建产物... " -sudo docker run --rm "$IMAGE" sh -c " -test -f /app/projects/app/.next/standalone/projects/app/server.js \ - && test -d /app/projects/app/.next/static \ - && echo 'standalone server.js + static 已生成' -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 4. 验证 server.js 可被 Node.js 解析(语法层面冒烟测试,不实际监听) -echo -n "检查 server.js 可加载(语法)... " -sudo docker run --rm "$IMAGE" node --check /app/projects/app/.next/standalone/projects/app/server.js \ - && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" diff --git "a/frameworks/fastgpt/4.14.10.2/4.14.10.2\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" "b/frameworks/fastgpt/4.14.10.2/4.14.10.2\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" deleted file mode 100644 index f5bf8887f227e3fa6ed1b85c22c74f3e1af6317e..0000000000000000000000000000000000000000 Binary files "a/frameworks/fastgpt/4.14.10.2/4.14.10.2\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" and /dev/null differ diff --git a/frameworks/fastgpt/4.14.10.2/Dockerfile b/frameworks/fastgpt/4.14.10.2/Dockerfile deleted file mode 100644 index 5861b86f24faac17a49fbf2775b06c6eadbc34c7..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.10.2/Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -# 基础镜像:OpenCloudOS 9 极简版(FastGPT 为 Next.js Web 应用,从源码构建) -FROM opencloudos/opencloudos9-minimal:latest - -# 镜像元信息 -LABEL maintainer="pangxb666" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="FastGPT 4.14.10.2 on OpenCloudOS 9" - -ARG FASTGPT_VERSION=4.14.10.2 -ARG NODE_VERSION=20.18.1 -# TARGETARCH 由 BuildKit 自动注入:amd64 / arm64 / ... -ARG TARGETARCH - -# 安装系统依赖:git/curl/tar/xz/ca-certificates,并清理缓存 -RUN dnf install -y --nogpgcheck \ - git \ - curl \ - tar \ - xz \ - ca-certificates \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 根据目标架构自动选择对应的 Node.js 官方二进制(linux-x64 / linux-arm64) -# 同时确保动态链接器路径存在(minimal 镜像 /lib64 可能缺失,建立符号链接以兼容 qemu user-mode 模拟) -RUN set -eux; \ - case "${TARGETARCH:-amd64}" in \ - amd64) NODE_ARCH="x64" ;; \ - arm64) NODE_ARCH="arm64" ;; \ - *) echo "ERROR: 不支持的架构 TARGETARCH=${TARGETARCH}"; exit 1 ;; \ - esac; \ - echo "构建目标架构: ${TARGETARCH}, 下载 Node.js linux-${NODE_ARCH}"; \ - [ -e /lib64 ] || ln -s /usr/lib64 /lib64; \ - curl -fsSL "https://mirrors.tuna.tsinghua.edu.cn/nodejs-release/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \ - -o /tmp/node.tar.xz; \ - tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1; \ - rm -f /tmp/node.tar.xz; \ - node --version; \ - npm --version; \ - npm config set registry https://registry.npmmirror.com; \ - npm install -g pnpm@9 - -# 拉取指定版本源码 -# 默认走 ghfast.top 代理加速国内访问 GitHub,离境构建可通过 --build-arg GIT_PROXY="" 关闭 -ARG GIT_PROXY=https://ghfast.top/ -WORKDIR /app -RUN git config --global http.lowSpeedLimit 1000 \ - && git config --global http.lowSpeedTime 60 \ - && git config --global http.postBuffer 524288000 \ - && git clone --depth=1 --branch "v${FASTGPT_VERSION}" \ - "${GIT_PROXY}https://github.com/labring/FastGPT.git" /tmp/fastgpt \ - && cp -a /tmp/fastgpt/. /app/ \ - && rm -rf /tmp/fastgpt - -# 安装依赖(使用 npmmirror 加速) -RUN pnpm install --registry=https://registry.npmmirror.com - -# 构建 app 子项目(Next.js standalone 输出) -ENV NODE_OPTIONS="--max-old-space-size=4096" -RUN pnpm --filter=app build - -# 运行时环境变量 -ENV NODE_ENV=production -ENV NEXT_TELEMETRY_DISABLED=1 -ENV PORT=3000 -EXPOSE 3000 - -# 记录镜像构建时间,便于追溯 -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -# 默认从 standalone 输出启动 Next.js 服务 -WORKDIR /app/projects/app -CMD ["node", ".next/standalone/projects/app/server.js"] diff --git a/frameworks/fastgpt/4.14.10.2/README.md b/frameworks/fastgpt/4.14.10.2/README.md deleted file mode 100644 index bf053ee0618bc9b9e9d3b80d7548b58acccf9a13..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.10.2/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# FastGPT 4.14.10.2 on OpenCloudOS 9 - -## 基本信息 - -- **框架版本**:4.14.10.2 -- **基础镜像**:opencloudos/opencloudos9-minimal:latest -- **Node.js 版本**:20.18.1(按 TARGETARCH 自动选择 linux-x64 / linux-arm64) -- **CUDA 版本**:N/A -- **开源地址**:https://github.com/labring/FastGPT - -## 简介 - -FastGPT 是 labring 开源的基于 LLM 的 RAG 知识库问答与 AI 工作流编排平台,主项目为 Next.js + TypeScript Monorepo(pnpm workspace)。本镜像在 OpenCloudOS 9 上从源码构建 `projects/app`(Next.js standalone 输出),运行依赖 MongoDB、PostgreSQL+pgvector 等外部服务(生产环境通过 docker-compose 编排)。 - -## 构建 - -```bash -# 默认按宿主机架构构建(推荐) -docker build -t oc9-fastgpt:4.14.10.2 . - -# 显式指定目标架构(适用于跨架构构建) -docker buildx build --platform linux/amd64 -t oc9-fastgpt:4.14.10.2 . --load -docker buildx build --platform linux/arm64 -t oc9-fastgpt:4.14.10.2-arm64 . --load -``` - -> 提示:FastGPT 是 monorepo 项目,构建过程包含 `pnpm install` 和 `pnpm --filter=app build`,国内网络下首次构建预计 15-30 分钟,最终镜像体积较大(GB 级)。 - -## 使用示例 - -```bash -# 1. 验证镜像可启动 + 检查 Next.js standalone 产物存在 -bash test.sh oc9-fastgpt:4.14.10.2 - -# 2. 完整运行(需自备 MongoDB + PostgreSQL+pgvector) -docker run -d --name fastgpt -p 3000:3000 \ - -e MONGODB_URI="mongodb://:@:27017/fastgpt?authSource=admin" \ - -e PG_URL="postgresql://:@:5432/postgres" \ - -e CHAT_API_KEY="" \ - -v $(pwd)/config.json:/app/data/config.json \ - oc9-fastgpt:4.14.10.2 -``` - -更完整的部署方式(含 MongoDB / PG / MinIO / Redis 编排)参见 FastGPT 官方文档: - -## 测试环境 - -镜像已在以下两种架构验证通过: - -| 架构 | 操作系统 | 内核 | Docker | 状态 | -|------|---------|------|--------|------| -| x86_64 (amd64) | Ubuntu 22.04.4 LTS (Jammy) | 5.15.0-113-generic | 29.4.1 | ✓ 通过 | -| arm64 (aarch64) | macOS (Apple Silicon) | Darwin 25.x | Docker Desktop | ✓ 通过(开发自测) | - -构建时 `Dockerfile` 通过 BuildKit 注入的 `TARGETARCH` 自动选择对应的 Node.js 二进制(`linux-x64` / `linux-arm64`),同一份 Dockerfile 可在两种架构原生构建。 - -## 已知问题 - -- 单容器无 MongoDB/PostgreSQL 时,启动后会因连不上 DB 而退出,属预期行为;本镜像 `test.sh` 仅做启动产物校验,不做完整服务可用性测试。 -- 由于 monorepo 体积较大,构建时建议为 Docker 分配 ≥ 8GB 内存。 -- macOS Apple Silicon 上若以 `--platform=linux/amd64` 构建会走 qemu 模拟,速度慢且偶现兼容性问题;本机原生 `linux/arm64` 构建可正常完成,CI 仍以 `linux/amd64` 为准。 diff --git a/frameworks/fastgpt/4.14.10.2/build.conf b/frameworks/fastgpt/4.14.10.2/build.conf deleted file mode 100644 index 8e7b77e3f61222ec1e077ff3e5f51b1a7ae2f031..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.10.2/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# FastGPT 4.14.10.2 on OpenCloudOS 9 -IMAGE_NAME=oc9-fastgpt -IMAGE_TAG=4.14.10.2 -GPU_TEST=false diff --git a/frameworks/fastgpt/4.14.10.2/test.sh b/frameworks/fastgpt/4.14.10.2/test.sh deleted file mode 100755 index e7b216f493992198aa73b95d3d61fd79bf36851d..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.10.2/test.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" -EXPECTED_VERSION="4.14.10.2" - -echo "=== FastGPT ${EXPECTED_VERSION} 基础功能测试 ===" - -# 1. 验证 Node.js 运行时 -echo -n "检查 Node.js 运行时... " -sudo docker run --rm "$IMAGE" node --version && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证 package.json 存在并打印版本(FastGPT 内部 version 字段可能滞后于 git tag,仅打印不强校验) -echo -n "检查 package.json 版本字段... " -sudo docker run --rm "$IMAGE" node -e " -const pkg = require('/app/package.json'); -console.log('package.json version:', pkg.version); -if (!pkg.version) { console.error('版本字段缺失'); process.exit(1); } -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 3. 验证 Next.js standalone 构建产物存在 -echo -n "检查 Next.js standalone 构建产物... " -sudo docker run --rm "$IMAGE" sh -c " -test -f /app/projects/app/.next/standalone/projects/app/server.js \ - && test -d /app/projects/app/.next/static \ - && echo 'standalone server.js + static 已生成' -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 4. 验证 server.js 可被 Node.js 解析(语法层面冒烟测试,不实际监听) -echo -n "检查 server.js 可加载(语法)... " -sudo docker run --rm "$IMAGE" node --check /app/projects/app/.next/standalone/projects/app/server.js \ - && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" diff --git "a/frameworks/fastgpt/4.14.10.3/4.14.10.3\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" "b/frameworks/fastgpt/4.14.10.3/4.14.10.3\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" deleted file mode 100644 index c7d9ba149b2d38d1d31e5328d5b7befbc30aa440..0000000000000000000000000000000000000000 Binary files "a/frameworks/fastgpt/4.14.10.3/4.14.10.3\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" and /dev/null differ diff --git a/frameworks/fastgpt/4.14.10.3/Dockerfile b/frameworks/fastgpt/4.14.10.3/Dockerfile deleted file mode 100644 index 13ddaeca543db5984d6b8fa8117370c32d16e82e..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.10.3/Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -# 基础镜像:OpenCloudOS 9 极简版(FastGPT 为 Next.js Web 应用,从源码构建) -FROM opencloudos/opencloudos9-minimal:latest - -# 镜像元信息 -LABEL maintainer="pangxb666" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="FastGPT 4.14.10.3 on OpenCloudOS 9" - -ARG FASTGPT_VERSION=4.14.10.3 -ARG NODE_VERSION=20.18.1 -# TARGETARCH 由 BuildKit 自动注入:amd64 / arm64 / ... -ARG TARGETARCH - -# 安装系统依赖:git/curl/tar/xz/ca-certificates,并清理缓存 -RUN dnf install -y --nogpgcheck \ - git \ - curl \ - tar \ - xz \ - ca-certificates \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 根据目标架构自动选择对应的 Node.js 官方二进制(linux-x64 / linux-arm64) -# 同时确保动态链接器路径存在(minimal 镜像 /lib64 可能缺失,建立符号链接以兼容 qemu user-mode 模拟) -RUN set -eux; \ - case "${TARGETARCH:-amd64}" in \ - amd64) NODE_ARCH="x64" ;; \ - arm64) NODE_ARCH="arm64" ;; \ - *) echo "ERROR: 不支持的架构 TARGETARCH=${TARGETARCH}"; exit 1 ;; \ - esac; \ - echo "构建目标架构: ${TARGETARCH}, 下载 Node.js linux-${NODE_ARCH}"; \ - [ -e /lib64 ] || ln -s /usr/lib64 /lib64; \ - curl -fsSL "https://mirrors.tuna.tsinghua.edu.cn/nodejs-release/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \ - -o /tmp/node.tar.xz; \ - tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1; \ - rm -f /tmp/node.tar.xz; \ - node --version; \ - npm --version; \ - npm config set registry https://registry.npmmirror.com; \ - npm install -g pnpm@9 - -# 拉取指定版本源码 -# 默认走 ghfast.top 代理加速国内访问 GitHub,离境构建可通过 --build-arg GIT_PROXY="" 关闭 -ARG GIT_PROXY=https://ghfast.top/ -WORKDIR /app -RUN git config --global http.lowSpeedLimit 1000 \ - && git config --global http.lowSpeedTime 60 \ - && git config --global http.postBuffer 524288000 \ - && git clone --depth=1 --branch "v${FASTGPT_VERSION}" \ - "${GIT_PROXY}https://github.com/labring/FastGPT.git" /tmp/fastgpt \ - && cp -a /tmp/fastgpt/. /app/ \ - && rm -rf /tmp/fastgpt - -# 安装依赖(使用 npmmirror 加速) -RUN pnpm install --registry=https://registry.npmmirror.com - -# 构建 app 子项目(Next.js standalone 输出) -ENV NODE_OPTIONS="--max-old-space-size=4096" -RUN pnpm --filter=app build - -# 运行时环境变量 -ENV NODE_ENV=production -ENV NEXT_TELEMETRY_DISABLED=1 -ENV PORT=3000 -EXPOSE 3000 - -# 记录镜像构建时间,便于追溯 -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -# 默认从 standalone 输出启动 Next.js 服务 -WORKDIR /app/projects/app -CMD ["node", ".next/standalone/projects/app/server.js"] diff --git a/frameworks/fastgpt/4.14.10.3/README.md b/frameworks/fastgpt/4.14.10.3/README.md deleted file mode 100644 index e33522a23f43a1556b464c9d67e8ece737d71179..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.10.3/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# FastGPT 4.14.10.3 on OpenCloudOS 9 - -## 基本信息 - -- **框架版本**:4.14.10.3 -- **基础镜像**:opencloudos/opencloudos9-minimal:latest -- **Node.js 版本**:20.18.1(按 TARGETARCH 自动选择 linux-x64 / linux-arm64) -- **CUDA 版本**:N/A -- **开源地址**:https://github.com/labring/FastGPT - -## 简介 - -FastGPT 是 labring 开源的基于 LLM 的 RAG 知识库问答与 AI 工作流编排平台,主项目为 Next.js + TypeScript Monorepo(pnpm workspace)。本镜像在 OpenCloudOS 9 上从源码构建 `projects/app`(Next.js standalone 输出),运行依赖 MongoDB、PostgreSQL+pgvector 等外部服务(生产环境通过 docker-compose 编排)。 - -## 构建 - -```bash -# 默认按宿主机架构构建(推荐) -docker build -t oc9-fastgpt:4.14.10.3 . - -# 显式指定目标架构(适用于跨架构构建) -docker buildx build --platform linux/amd64 -t oc9-fastgpt:4.14.10.3 . --load -docker buildx build --platform linux/arm64 -t oc9-fastgpt:4.14.10.3-arm64 . --load -``` - -> 提示:FastGPT 是 monorepo 项目,构建过程包含 `pnpm install` 和 `pnpm --filter=app build`,国内网络下首次构建预计 15-30 分钟,最终镜像体积较大(GB 级)。 - -## 使用示例 - -```bash -# 1. 验证镜像可启动 + 检查 Next.js standalone 产物存在 -bash test.sh oc9-fastgpt:4.14.10.3 - -# 2. 完整运行(需自备 MongoDB + PostgreSQL+pgvector) -docker run -d --name fastgpt -p 3000:3000 \ - -e MONGODB_URI="mongodb://:@:27017/fastgpt?authSource=admin" \ - -e PG_URL="postgresql://:@:5432/postgres" \ - -e CHAT_API_KEY="" \ - -v $(pwd)/config.json:/app/data/config.json \ - oc9-fastgpt:4.14.10.3 -``` - -更完整的部署方式(含 MongoDB / PG / MinIO / Redis 编排)参见 FastGPT 官方文档: - -## 测试环境 - -镜像已在以下两种架构验证通过: - -| 架构 | 操作系统 | 内核 | Docker | 状态 | -|------|---------|------|--------|------| -| x86_64 (amd64) | Ubuntu 22.04.4 LTS (Jammy) | 5.15.0-113-generic | 29.4.1 | ✓ 通过 | -| arm64 (aarch64) | macOS (Apple Silicon) | Darwin 25.x | Docker Desktop | ✓ 通过(开发自测) | - -构建时 `Dockerfile` 通过 BuildKit 注入的 `TARGETARCH` 自动选择对应的 Node.js 二进制(`linux-x64` / `linux-arm64`),同一份 Dockerfile 可在两种架构原生构建。 - -## 已知问题 - -- 单容器无 MongoDB/PostgreSQL 时,启动后会因连不上 DB 而退出,属预期行为;本镜像 `test.sh` 仅做启动产物校验,不做完整服务可用性测试。 -- 由于 monorepo 体积较大,构建时建议为 Docker 分配 ≥ 8GB 内存。 -- macOS Apple Silicon 上若以 `--platform=linux/amd64` 构建会走 qemu 模拟,速度慢且偶现兼容性问题;本机原生 `linux/arm64` 构建可正常完成,CI 仍以 `linux/amd64` 为准。 diff --git a/frameworks/fastgpt/4.14.10.3/build.conf b/frameworks/fastgpt/4.14.10.3/build.conf deleted file mode 100644 index 26950c2a6bdaefcd4d4b64131d48c4a24aa1ef63..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.10.3/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# FastGPT 4.14.10.3 on OpenCloudOS 9 -IMAGE_NAME=oc9-fastgpt -IMAGE_TAG=4.14.10.3 -GPU_TEST=false diff --git a/frameworks/fastgpt/4.14.10.3/test.sh b/frameworks/fastgpt/4.14.10.3/test.sh deleted file mode 100755 index 1ab443436ab5f52f590b016cff40b68fb4169f41..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.10.3/test.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" -EXPECTED_VERSION="4.14.10.3" - -echo "=== FastGPT ${EXPECTED_VERSION} 基础功能测试 ===" - -# 1. 验证 Node.js 运行时 -echo -n "检查 Node.js 运行时... " -sudo docker run --rm "$IMAGE" node --version && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证 package.json 存在并打印版本(FastGPT 内部 version 字段可能滞后于 git tag,仅打印不强校验) -echo -n "检查 package.json 版本字段... " -sudo docker run --rm "$IMAGE" node -e " -const pkg = require('/app/package.json'); -console.log('package.json version:', pkg.version); -if (!pkg.version) { console.error('版本字段缺失'); process.exit(1); } -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 3. 验证 Next.js standalone 构建产物存在 -echo -n "检查 Next.js standalone 构建产物... " -sudo docker run --rm "$IMAGE" sh -c " -test -f /app/projects/app/.next/standalone/projects/app/server.js \ - && test -d /app/projects/app/.next/static \ - && echo 'standalone server.js + static 已生成' -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 4. 验证 server.js 可被 Node.js 解析(语法层面冒烟测试,不实际监听) -echo -n "检查 server.js 可加载(语法)... " -sudo docker run --rm "$IMAGE" node --check /app/projects/app/.next/standalone/projects/app/server.js \ - && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" diff --git "a/frameworks/fastgpt/4.14.10/4.14.10\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" "b/frameworks/fastgpt/4.14.10/4.14.10\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" deleted file mode 100644 index 2bb4fa45b9824562ad7410ee2b9bc2ffd5632a3a..0000000000000000000000000000000000000000 Binary files "a/frameworks/fastgpt/4.14.10/4.14.10\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" and /dev/null differ diff --git a/frameworks/fastgpt/4.14.10/Dockerfile b/frameworks/fastgpt/4.14.10/Dockerfile deleted file mode 100644 index 929ce232df6ae35017ad420dfdfa52d3f0085fb4..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.10/Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -# 基础镜像:OpenCloudOS 9 极简版(FastGPT 为 Next.js Web 应用,从源码构建) -FROM opencloudos/opencloudos9-minimal:latest - -# 镜像元信息 -LABEL maintainer="pangxb666" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="FastGPT 4.14.10 on OpenCloudOS 9" - -ARG FASTGPT_VERSION=4.14.10 -ARG NODE_VERSION=20.18.1 -# TARGETARCH 由 BuildKit 自动注入:amd64 / arm64 / ... -ARG TARGETARCH - -# 安装系统依赖:git/curl/tar/xz/ca-certificates,并清理缓存 -RUN dnf install -y --nogpgcheck \ - git \ - curl \ - tar \ - xz \ - ca-certificates \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 根据目标架构自动选择对应的 Node.js 官方二进制(linux-x64 / linux-arm64) -# 同时确保动态链接器路径存在(minimal 镜像 /lib64 可能缺失,建立符号链接以兼容 qemu user-mode 模拟) -RUN set -eux; \ - case "${TARGETARCH:-amd64}" in \ - amd64) NODE_ARCH="x64" ;; \ - arm64) NODE_ARCH="arm64" ;; \ - *) echo "ERROR: 不支持的架构 TARGETARCH=${TARGETARCH}"; exit 1 ;; \ - esac; \ - echo "构建目标架构: ${TARGETARCH}, 下载 Node.js linux-${NODE_ARCH}"; \ - [ -e /lib64 ] || ln -s /usr/lib64 /lib64; \ - curl -fsSL "https://mirrors.tuna.tsinghua.edu.cn/nodejs-release/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \ - -o /tmp/node.tar.xz; \ - tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1; \ - rm -f /tmp/node.tar.xz; \ - node --version; \ - npm --version; \ - npm config set registry https://registry.npmmirror.com; \ - npm install -g pnpm@9 - -# 拉取指定版本源码 -# 默认走 ghfast.top 代理加速国内访问 GitHub,离境构建可通过 --build-arg GIT_PROXY="" 关闭 -ARG GIT_PROXY=https://ghfast.top/ -WORKDIR /app -RUN git config --global http.lowSpeedLimit 1000 \ - && git config --global http.lowSpeedTime 60 \ - && git config --global http.postBuffer 524288000 \ - && git clone --depth=1 --branch "v${FASTGPT_VERSION}" \ - "${GIT_PROXY}https://github.com/labring/FastGPT.git" /tmp/fastgpt \ - && cp -a /tmp/fastgpt/. /app/ \ - && rm -rf /tmp/fastgpt - -# 安装依赖(使用 npmmirror 加速) -RUN pnpm install --registry=https://registry.npmmirror.com - -# 构建 app 子项目(Next.js standalone 输出) -ENV NODE_OPTIONS="--max-old-space-size=4096" -RUN pnpm --filter=app build - -# 运行时环境变量 -ENV NODE_ENV=production -ENV NEXT_TELEMETRY_DISABLED=1 -ENV PORT=3000 -EXPOSE 3000 - -# 记录镜像构建时间,便于追溯 -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -# 默认从 standalone 输出启动 Next.js 服务 -WORKDIR /app/projects/app -CMD ["node", ".next/standalone/projects/app/server.js"] diff --git a/frameworks/fastgpt/4.14.10/README.md b/frameworks/fastgpt/4.14.10/README.md deleted file mode 100644 index 79db27fd9f997aeaa40b324f2f9a4a133ae8d000..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.10/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# FastGPT 4.14.10 on OpenCloudOS 9 - -## 基本信息 - -- **框架版本**:4.14.10 -- **基础镜像**:opencloudos/opencloudos9-minimal:latest -- **Node.js 版本**:20.18.1(按 TARGETARCH 自动选择 linux-x64 / linux-arm64) -- **CUDA 版本**:N/A -- **开源地址**:https://github.com/labring/FastGPT - -## 简介 - -FastGPT 是 labring 开源的基于 LLM 的 RAG 知识库问答与 AI 工作流编排平台,主项目为 Next.js + TypeScript Monorepo(pnpm workspace)。本镜像在 OpenCloudOS 9 上从源码构建 `projects/app`(Next.js standalone 输出),运行依赖 MongoDB、PostgreSQL+pgvector 等外部服务(生产环境通过 docker-compose 编排)。 - -## 构建 - -```bash -# 默认按宿主机架构构建(推荐) -docker build -t oc9-fastgpt:4.14.10 . - -# 显式指定目标架构(适用于跨架构构建) -docker buildx build --platform linux/amd64 -t oc9-fastgpt:4.14.10 . --load -docker buildx build --platform linux/arm64 -t oc9-fastgpt:4.14.10-arm64 . --load -``` - -> 提示:FastGPT 是 monorepo 项目,构建过程包含 `pnpm install` 和 `pnpm --filter=app build`,国内网络下首次构建预计 15-30 分钟,最终镜像体积较大(GB 级)。 - -## 使用示例 - -```bash -# 1. 验证镜像可启动 + 检查 Next.js standalone 产物存在 -bash test.sh oc9-fastgpt:4.14.10 - -# 2. 完整运行(需自备 MongoDB + PostgreSQL+pgvector) -docker run -d --name fastgpt -p 3000:3000 \ - -e MONGODB_URI="mongodb://:@:27017/fastgpt?authSource=admin" \ - -e PG_URL="postgresql://:@:5432/postgres" \ - -e CHAT_API_KEY="" \ - -v $(pwd)/config.json:/app/data/config.json \ - oc9-fastgpt:4.14.10 -``` - -更完整的部署方式(含 MongoDB / PG / MinIO / Redis 编排)参见 FastGPT 官方文档: - -## 测试环境 - -镜像已在以下两种架构验证通过: - -| 架构 | 操作系统 | 内核 | Docker | 状态 | -|------|---------|------|--------|------| -| x86_64 (amd64) | Ubuntu 22.04.4 LTS (Jammy) | 5.15.0-113-generic | 29.4.1 | ✓ 通过 | -| arm64 (aarch64) | macOS (Apple Silicon) | Darwin 25.x | Docker Desktop | ✓ 通过(开发自测) | - -构建时 `Dockerfile` 通过 BuildKit 注入的 `TARGETARCH` 自动选择对应的 Node.js 二进制(`linux-x64` / `linux-arm64`),同一份 Dockerfile 可在两种架构原生构建。 - -## 已知问题 - -- 单容器无 MongoDB/PostgreSQL 时,启动后会因连不上 DB 而退出,属预期行为;本镜像 `test.sh` 仅做启动产物校验,不做完整服务可用性测试。 -- 由于 monorepo 体积较大,构建时建议为 Docker 分配 ≥ 8GB 内存。 -- macOS Apple Silicon 上若以 `--platform=linux/amd64` 构建会走 qemu 模拟,速度慢且偶现兼容性问题;本机原生 `linux/arm64` 构建可正常完成,CI 仍以 `linux/amd64` 为准。 diff --git a/frameworks/fastgpt/4.14.10/build.conf b/frameworks/fastgpt/4.14.10/build.conf deleted file mode 100644 index 9d0d4c5dbcc351cb9491efb561129c8b114461fb..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.10/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# FastGPT 4.14.10 on OpenCloudOS 9 -IMAGE_NAME=oc9-fastgpt -IMAGE_TAG=4.14.10 -GPU_TEST=false diff --git a/frameworks/fastgpt/4.14.10/test.sh b/frameworks/fastgpt/4.14.10/test.sh deleted file mode 100755 index eec242e7bc7607ac59db8a64af4aa1ba8c6cec14..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.10/test.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" -EXPECTED_VERSION="4.14.10" - -echo "=== FastGPT ${EXPECTED_VERSION} 基础功能测试 ===" - -# 1. 验证 Node.js 运行时 -echo -n "检查 Node.js 运行时... " -sudo docker run --rm "$IMAGE" node --version && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证 package.json 存在并打印版本(FastGPT 内部 version 字段可能滞后于 git tag,仅打印不强校验) -echo -n "检查 package.json 版本字段... " -sudo docker run --rm "$IMAGE" node -e " -const pkg = require('/app/package.json'); -console.log('package.json version:', pkg.version); -if (!pkg.version) { console.error('版本字段缺失'); process.exit(1); } -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 3. 验证 Next.js standalone 构建产物存在 -echo -n "检查 Next.js standalone 构建产物... " -sudo docker run --rm "$IMAGE" sh -c " -test -f /app/projects/app/.next/standalone/projects/app/server.js \ - && test -d /app/projects/app/.next/static \ - && echo 'standalone server.js + static 已生成' -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 4. 验证 server.js 可被 Node.js 解析(语法层面冒烟测试,不实际监听) -echo -n "检查 server.js 可加载(语法)... " -sudo docker run --rm "$IMAGE" node --check /app/projects/app/.next/standalone/projects/app/server.js \ - && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" diff --git "a/frameworks/fastgpt/4.14.9.3/4.14.9.3\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" "b/frameworks/fastgpt/4.14.9.3/4.14.9.3\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" deleted file mode 100644 index c21b051c41aa5bbbb6c8c3ed1239d93483d02937..0000000000000000000000000000000000000000 Binary files "a/frameworks/fastgpt/4.14.9.3/4.14.9.3\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" and /dev/null differ diff --git a/frameworks/fastgpt/4.14.9.3/Dockerfile b/frameworks/fastgpt/4.14.9.3/Dockerfile deleted file mode 100644 index 76053c2e044408f73263d80b672f35779a472fde..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.9.3/Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -# 基础镜像:OpenCloudOS 9 极简版(FastGPT 为 Next.js Web 应用,从源码构建) -FROM opencloudos/opencloudos9-minimal:latest - -# 镜像元信息 -LABEL maintainer="pangxb666" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="FastGPT 4.14.9.3 on OpenCloudOS 9" - -ARG FASTGPT_VERSION=4.14.9.3 -ARG NODE_VERSION=20.18.1 -# TARGETARCH 由 BuildKit 自动注入:amd64 / arm64 / ... -ARG TARGETARCH - -# 安装系统依赖:git/curl/tar/xz/ca-certificates,并清理缓存 -RUN dnf install -y --nogpgcheck \ - git \ - curl \ - tar \ - xz \ - ca-certificates \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 根据目标架构自动选择对应的 Node.js 官方二进制(linux-x64 / linux-arm64) -# 同时确保动态链接器路径存在(minimal 镜像 /lib64 可能缺失,建立符号链接以兼容 qemu user-mode 模拟) -RUN set -eux; \ - case "${TARGETARCH:-amd64}" in \ - amd64) NODE_ARCH="x64" ;; \ - arm64) NODE_ARCH="arm64" ;; \ - *) echo "ERROR: 不支持的架构 TARGETARCH=${TARGETARCH}"; exit 1 ;; \ - esac; \ - echo "构建目标架构: ${TARGETARCH}, 下载 Node.js linux-${NODE_ARCH}"; \ - [ -e /lib64 ] || ln -s /usr/lib64 /lib64; \ - curl -fsSL "https://mirrors.tuna.tsinghua.edu.cn/nodejs-release/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \ - -o /tmp/node.tar.xz; \ - tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1; \ - rm -f /tmp/node.tar.xz; \ - node --version; \ - npm --version; \ - npm config set registry https://registry.npmmirror.com; \ - npm install -g pnpm@9 - -# 拉取指定版本源码 -# 默认走 ghfast.top 代理加速国内访问 GitHub,离境构建可通过 --build-arg GIT_PROXY="" 关闭 -ARG GIT_PROXY=https://ghfast.top/ -WORKDIR /app -RUN git config --global http.lowSpeedLimit 1000 \ - && git config --global http.lowSpeedTime 60 \ - && git config --global http.postBuffer 524288000 \ - && git clone --depth=1 --branch "v${FASTGPT_VERSION}" \ - "${GIT_PROXY}https://github.com/labring/FastGPT.git" /tmp/fastgpt \ - && cp -a /tmp/fastgpt/. /app/ \ - && rm -rf /tmp/fastgpt - -# 安装依赖(使用 npmmirror 加速) -RUN pnpm install --registry=https://registry.npmmirror.com - -# 构建 app 子项目(Next.js standalone 输出) -ENV NODE_OPTIONS="--max-old-space-size=4096" -RUN pnpm --filter=app build - -# 运行时环境变量 -ENV NODE_ENV=production -ENV NEXT_TELEMETRY_DISABLED=1 -ENV PORT=3000 -EXPOSE 3000 - -# 记录镜像构建时间,便于追溯 -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -# 默认从 standalone 输出启动 Next.js 服务 -WORKDIR /app/projects/app -CMD ["node", ".next/standalone/projects/app/server.js"] diff --git a/frameworks/fastgpt/4.14.9.3/README.md b/frameworks/fastgpt/4.14.9.3/README.md deleted file mode 100644 index 899bf22faa5ecc0c52a62ba7142173d06fa09c3d..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.9.3/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# FastGPT 4.14.9.3 on OpenCloudOS 9 - -## 基本信息 - -- **框架版本**:4.14.9.3 -- **基础镜像**:opencloudos/opencloudos9-minimal:latest -- **Node.js 版本**:20.18.1(按 TARGETARCH 自动选择 linux-x64 / linux-arm64) -- **CUDA 版本**:N/A -- **开源地址**:https://github.com/labring/FastGPT - -## 简介 - -FastGPT 是 labring 开源的基于 LLM 的 RAG 知识库问答与 AI 工作流编排平台,主项目为 Next.js + TypeScript Monorepo(pnpm workspace)。本镜像在 OpenCloudOS 9 上从源码构建 `projects/app`(Next.js standalone 输出),运行依赖 MongoDB、PostgreSQL+pgvector 等外部服务(生产环境通过 docker-compose 编排)。 - -## 构建 - -```bash -# 默认按宿主机架构构建(推荐) -docker build -t oc9-fastgpt:4.14.9.3 . - -# 显式指定目标架构(适用于跨架构构建) -docker buildx build --platform linux/amd64 -t oc9-fastgpt:4.14.9.3 . --load -docker buildx build --platform linux/arm64 -t oc9-fastgpt:4.14.9.3-arm64 . --load -``` - -> 提示:FastGPT 是 monorepo 项目,构建过程包含 `pnpm install` 和 `pnpm --filter=app build`,国内网络下首次构建预计 15-30 分钟,最终镜像体积较大(GB 级)。 - -## 使用示例 - -```bash -# 1. 验证镜像可启动 + 检查 Next.js standalone 产物存在 -bash test.sh oc9-fastgpt:4.14.9.3 - -# 2. 完整运行(需自备 MongoDB + PostgreSQL+pgvector) -docker run -d --name fastgpt -p 3000:3000 \ - -e MONGODB_URI="mongodb://:@:27017/fastgpt?authSource=admin" \ - -e PG_URL="postgresql://:@:5432/postgres" \ - -e CHAT_API_KEY="" \ - -v $(pwd)/config.json:/app/data/config.json \ - oc9-fastgpt:4.14.9.3 -``` - -更完整的部署方式(含 MongoDB / PG / MinIO / Redis 编排)参见 FastGPT 官方文档: - -## 测试环境 - -镜像已在以下两种架构验证通过: - -| 架构 | 操作系统 | 内核 | Docker | 状态 | -|------|---------|------|--------|------| -| x86_64 (amd64) | Ubuntu 22.04.4 LTS (Jammy) | 5.15.0-113-generic | 29.4.1 | ✓ 通过 | -| arm64 (aarch64) | macOS (Apple Silicon) | Darwin 25.x | Docker Desktop | ✓ 通过(开发自测) | - -构建时 `Dockerfile` 通过 BuildKit 注入的 `TARGETARCH` 自动选择对应的 Node.js 二进制(`linux-x64` / `linux-arm64`),同一份 Dockerfile 可在两种架构原生构建。 - -## 已知问题 - -- 单容器无 MongoDB/PostgreSQL 时,启动后会因连不上 DB 而退出,属预期行为;本镜像 `test.sh` 仅做启动产物校验,不做完整服务可用性测试。 -- 由于 monorepo 体积较大,构建时建议为 Docker 分配 ≥ 8GB 内存。 -- macOS Apple Silicon 上若以 `--platform=linux/amd64` 构建会走 qemu 模拟,速度慢且偶现兼容性问题;本机原生 `linux/arm64` 构建可正常完成,CI 仍以 `linux/amd64` 为准。 diff --git a/frameworks/fastgpt/4.14.9.3/build.conf b/frameworks/fastgpt/4.14.9.3/build.conf deleted file mode 100644 index 0c4df11577ecb482067fc074dd8cee920560dfc3..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.9.3/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# FastGPT 4.14.9.3 on OpenCloudOS 9 -IMAGE_NAME=oc9-fastgpt -IMAGE_TAG=4.14.9.3 -GPU_TEST=false diff --git a/frameworks/fastgpt/4.14.9.3/test.sh b/frameworks/fastgpt/4.14.9.3/test.sh deleted file mode 100755 index ea3d6d52184be59d3b4f0e98e45ff3e6e15b9721..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.9.3/test.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" -EXPECTED_VERSION="4.14.9.3" - -echo "=== FastGPT ${EXPECTED_VERSION} 基础功能测试 ===" - -# 1. 验证 Node.js 运行时 -echo -n "检查 Node.js 运行时... " -sudo docker run --rm "$IMAGE" node --version && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证 package.json 存在并打印版本(FastGPT 内部 version 字段可能滞后于 git tag,仅打印不强校验) -echo -n "检查 package.json 版本字段... " -sudo docker run --rm "$IMAGE" node -e " -const pkg = require('/app/package.json'); -console.log('package.json version:', pkg.version); -if (!pkg.version) { console.error('版本字段缺失'); process.exit(1); } -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 3. 验证 Next.js standalone 构建产物存在 -echo -n "检查 Next.js standalone 构建产物... " -sudo docker run --rm "$IMAGE" sh -c " -test -f /app/projects/app/.next/standalone/projects/app/server.js \ - && test -d /app/projects/app/.next/static \ - && echo 'standalone server.js + static 已生成' -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 4. 验证 server.js 可被 Node.js 解析(语法层面冒烟测试,不实际监听) -echo -n "检查 server.js 可加载(语法)... " -sudo docker run --rm "$IMAGE" node --check /app/projects/app/.next/standalone/projects/app/server.js \ - && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" diff --git "a/frameworks/fastgpt/4.14.9.4/4.14.9.4\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" "b/frameworks/fastgpt/4.14.9.4/4.14.9.4\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" deleted file mode 100644 index a2998d5e97ac52128ebf7c6dc12a97d70cd491ec..0000000000000000000000000000000000000000 Binary files "a/frameworks/fastgpt/4.14.9.4/4.14.9.4\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" and /dev/null differ diff --git a/frameworks/fastgpt/4.14.9.4/Dockerfile b/frameworks/fastgpt/4.14.9.4/Dockerfile deleted file mode 100644 index ad1348ef69c86ba0243dad1df3db134b14ee8e13..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.9.4/Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -# 基础镜像:OpenCloudOS 9 极简版(FastGPT 为 Next.js Web 应用,从源码构建) -FROM opencloudos/opencloudos9-minimal:latest - -# 镜像元信息 -LABEL maintainer="pangxb666" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="FastGPT 4.14.9.4 on OpenCloudOS 9" - -ARG FASTGPT_VERSION=4.14.9.4 -ARG NODE_VERSION=20.18.1 -# TARGETARCH 由 BuildKit 自动注入:amd64 / arm64 / ... -ARG TARGETARCH - -# 安装系统依赖:git/curl/tar/xz/ca-certificates,并清理缓存 -RUN dnf install -y --nogpgcheck \ - git \ - curl \ - tar \ - xz \ - ca-certificates \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 根据目标架构自动选择对应的 Node.js 官方二进制(linux-x64 / linux-arm64) -# 同时确保动态链接器路径存在(minimal 镜像 /lib64 可能缺失,建立符号链接以兼容 qemu user-mode 模拟) -RUN set -eux; \ - case "${TARGETARCH:-amd64}" in \ - amd64) NODE_ARCH="x64" ;; \ - arm64) NODE_ARCH="arm64" ;; \ - *) echo "ERROR: 不支持的架构 TARGETARCH=${TARGETARCH}"; exit 1 ;; \ - esac; \ - echo "构建目标架构: ${TARGETARCH}, 下载 Node.js linux-${NODE_ARCH}"; \ - [ -e /lib64 ] || ln -s /usr/lib64 /lib64; \ - curl -fsSL "https://mirrors.tuna.tsinghua.edu.cn/nodejs-release/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \ - -o /tmp/node.tar.xz; \ - tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1; \ - rm -f /tmp/node.tar.xz; \ - node --version; \ - npm --version; \ - npm config set registry https://registry.npmmirror.com; \ - npm install -g pnpm@9 - -# 拉取指定版本源码 -# 默认走 ghfast.top 代理加速国内访问 GitHub,离境构建可通过 --build-arg GIT_PROXY="" 关闭 -ARG GIT_PROXY=https://ghfast.top/ -WORKDIR /app -RUN git config --global http.lowSpeedLimit 1000 \ - && git config --global http.lowSpeedTime 60 \ - && git config --global http.postBuffer 524288000 \ - && git clone --depth=1 --branch "v${FASTGPT_VERSION}" \ - "${GIT_PROXY}https://github.com/labring/FastGPT.git" /tmp/fastgpt \ - && cp -a /tmp/fastgpt/. /app/ \ - && rm -rf /tmp/fastgpt - -# 安装依赖(使用 npmmirror 加速) -RUN pnpm install --registry=https://registry.npmmirror.com - -# 构建 app 子项目(Next.js standalone 输出) -ENV NODE_OPTIONS="--max-old-space-size=4096" -RUN pnpm --filter=app build - -# 运行时环境变量 -ENV NODE_ENV=production -ENV NEXT_TELEMETRY_DISABLED=1 -ENV PORT=3000 -EXPOSE 3000 - -# 记录镜像构建时间,便于追溯 -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -# 默认从 standalone 输出启动 Next.js 服务 -WORKDIR /app/projects/app -CMD ["node", ".next/standalone/projects/app/server.js"] diff --git a/frameworks/fastgpt/4.14.9.4/README.md b/frameworks/fastgpt/4.14.9.4/README.md deleted file mode 100644 index 45fef2c2be58186d6c19289e2505ab90fab7c4be..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.9.4/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# FastGPT 4.14.9.4 on OpenCloudOS 9 - -## 基本信息 - -- **框架版本**:4.14.9.4 -- **基础镜像**:opencloudos/opencloudos9-minimal:latest -- **Node.js 版本**:20.18.1(按 TARGETARCH 自动选择 linux-x64 / linux-arm64) -- **CUDA 版本**:N/A -- **开源地址**:https://github.com/labring/FastGPT - -## 简介 - -FastGPT 是 labring 开源的基于 LLM 的 RAG 知识库问答与 AI 工作流编排平台,主项目为 Next.js + TypeScript Monorepo(pnpm workspace)。本镜像在 OpenCloudOS 9 上从源码构建 `projects/app`(Next.js standalone 输出),运行依赖 MongoDB、PostgreSQL+pgvector 等外部服务(生产环境通过 docker-compose 编排)。 - -## 构建 - -```bash -# 默认按宿主机架构构建(推荐) -docker build -t oc9-fastgpt:4.14.9.4 . - -# 显式指定目标架构(适用于跨架构构建) -docker buildx build --platform linux/amd64 -t oc9-fastgpt:4.14.9.4 . --load -docker buildx build --platform linux/arm64 -t oc9-fastgpt:4.14.9.4-arm64 . --load -``` - -> 提示:FastGPT 是 monorepo 项目,构建过程包含 `pnpm install` 和 `pnpm --filter=app build`,国内网络下首次构建预计 15-30 分钟,最终镜像体积较大(GB 级)。 - -## 使用示例 - -```bash -# 1. 验证镜像可启动 + 检查 Next.js standalone 产物存在 -bash test.sh oc9-fastgpt:4.14.9.4 - -# 2. 完整运行(需自备 MongoDB + PostgreSQL+pgvector) -docker run -d --name fastgpt -p 3000:3000 \ - -e MONGODB_URI="mongodb://:@:27017/fastgpt?authSource=admin" \ - -e PG_URL="postgresql://:@:5432/postgres" \ - -e CHAT_API_KEY="" \ - -v $(pwd)/config.json:/app/data/config.json \ - oc9-fastgpt:4.14.9.4 -``` - -更完整的部署方式(含 MongoDB / PG / MinIO / Redis 编排)参见 FastGPT 官方文档: - -## 测试环境 - -镜像已在以下两种架构验证通过: - -| 架构 | 操作系统 | 内核 | Docker | 状态 | -|------|---------|------|--------|------| -| x86_64 (amd64) | Ubuntu 22.04.4 LTS (Jammy) | 5.15.0-113-generic | 29.4.1 | ✓ 通过 | -| arm64 (aarch64) | macOS (Apple Silicon) | Darwin 25.x | Docker Desktop | ✓ 通过(开发自测) | - -构建时 `Dockerfile` 通过 BuildKit 注入的 `TARGETARCH` 自动选择对应的 Node.js 二进制(`linux-x64` / `linux-arm64`),同一份 Dockerfile 可在两种架构原生构建。 - -## 已知问题 - -- 单容器无 MongoDB/PostgreSQL 时,启动后会因连不上 DB 而退出,属预期行为;本镜像 `test.sh` 仅做启动产物校验,不做完整服务可用性测试。 -- 由于 monorepo 体积较大,构建时建议为 Docker 分配 ≥ 8GB 内存。 -- macOS Apple Silicon 上若以 `--platform=linux/amd64` 构建会走 qemu 模拟,速度慢且偶现兼容性问题;本机原生 `linux/arm64` 构建可正常完成,CI 仍以 `linux/amd64` 为准。 diff --git a/frameworks/fastgpt/4.14.9.4/build.conf b/frameworks/fastgpt/4.14.9.4/build.conf deleted file mode 100644 index df79efcf0022fd03db9e1ccd4ff2b657cf1ac0ee..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.9.4/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# FastGPT 4.14.9.4 on OpenCloudOS 9 -IMAGE_NAME=oc9-fastgpt -IMAGE_TAG=4.14.9.4 -GPU_TEST=false diff --git a/frameworks/fastgpt/4.14.9.4/test.sh b/frameworks/fastgpt/4.14.9.4/test.sh deleted file mode 100755 index 014423ae3a693e44e676e3ee310cf2e563da3c4a..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.9.4/test.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" -EXPECTED_VERSION="4.14.9.4" - -echo "=== FastGPT ${EXPECTED_VERSION} 基础功能测试 ===" - -# 1. 验证 Node.js 运行时 -echo -n "检查 Node.js 运行时... " -sudo docker run --rm "$IMAGE" node --version && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证 package.json 存在并打印版本(FastGPT 内部 version 字段可能滞后于 git tag,仅打印不强校验) -echo -n "检查 package.json 版本字段... " -sudo docker run --rm "$IMAGE" node -e " -const pkg = require('/app/package.json'); -console.log('package.json version:', pkg.version); -if (!pkg.version) { console.error('版本字段缺失'); process.exit(1); } -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 3. 验证 Next.js standalone 构建产物存在 -echo -n "检查 Next.js standalone 构建产物... " -sudo docker run --rm "$IMAGE" sh -c " -test -f /app/projects/app/.next/standalone/projects/app/server.js \ - && test -d /app/projects/app/.next/static \ - && echo 'standalone server.js + static 已生成' -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 4. 验证 server.js 可被 Node.js 解析(语法层面冒烟测试,不实际监听) -echo -n "检查 server.js 可加载(语法)... " -sudo docker run --rm "$IMAGE" node --check /app/projects/app/.next/standalone/projects/app/server.js \ - && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" diff --git "a/frameworks/fastgpt/4.14.9.5/4.14.9.5\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" "b/frameworks/fastgpt/4.14.9.5/4.14.9.5\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" deleted file mode 100644 index 5d7e34c66ab0464b4480a2adcde262b6da12dcd6..0000000000000000000000000000000000000000 Binary files "a/frameworks/fastgpt/4.14.9.5/4.14.9.5\346\236\204\345\273\272\345\217\212\346\265\213\350\257\225\346\210\252\345\233\276.png" and /dev/null differ diff --git a/frameworks/fastgpt/4.14.9.5/Dockerfile b/frameworks/fastgpt/4.14.9.5/Dockerfile deleted file mode 100644 index 8d455b170adea777ac96a95a4926d69483e4861f..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.9.5/Dockerfile +++ /dev/null @@ -1,73 +0,0 @@ -# 基础镜像:OpenCloudOS 9 极简版(FastGPT 为 Next.js Web 应用,从源码构建) -FROM opencloudos/opencloudos9-minimal:latest - -# 镜像元信息 -LABEL maintainer="pangxb666" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="FastGPT 4.14.9.5 on OpenCloudOS 9" - -ARG FASTGPT_VERSION=4.14.9.5 -ARG NODE_VERSION=20.18.1 -# TARGETARCH 由 BuildKit 自动注入:amd64 / arm64 / ... -ARG TARGETARCH - -# 安装系统依赖:git/curl/tar/xz/ca-certificates,并清理缓存 -RUN dnf install -y --nogpgcheck \ - git \ - curl \ - tar \ - xz \ - ca-certificates \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 根据目标架构自动选择对应的 Node.js 官方二进制(linux-x64 / linux-arm64) -# 同时确保动态链接器路径存在(minimal 镜像 /lib64 可能缺失,建立符号链接以兼容 qemu user-mode 模拟) -RUN set -eux; \ - case "${TARGETARCH:-amd64}" in \ - amd64) NODE_ARCH="x64" ;; \ - arm64) NODE_ARCH="arm64" ;; \ - *) echo "ERROR: 不支持的架构 TARGETARCH=${TARGETARCH}"; exit 1 ;; \ - esac; \ - echo "构建目标架构: ${TARGETARCH}, 下载 Node.js linux-${NODE_ARCH}"; \ - [ -e /lib64 ] || ln -s /usr/lib64 /lib64; \ - curl -fsSL "https://mirrors.tuna.tsinghua.edu.cn/nodejs-release/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${NODE_ARCH}.tar.xz" \ - -o /tmp/node.tar.xz; \ - tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1; \ - rm -f /tmp/node.tar.xz; \ - node --version; \ - npm --version; \ - npm config set registry https://registry.npmmirror.com; \ - npm install -g pnpm@9 - -# 拉取指定版本源码 -# 默认走 ghfast.top 代理加速国内访问 GitHub,离境构建可通过 --build-arg GIT_PROXY="" 关闭 -ARG GIT_PROXY=https://ghfast.top/ -WORKDIR /app -RUN git config --global http.lowSpeedLimit 1000 \ - && git config --global http.lowSpeedTime 60 \ - && git config --global http.postBuffer 524288000 \ - && git clone --depth=1 --branch "v${FASTGPT_VERSION}" \ - "${GIT_PROXY}https://github.com/labring/FastGPT.git" /tmp/fastgpt \ - && cp -a /tmp/fastgpt/. /app/ \ - && rm -rf /tmp/fastgpt - -# 安装依赖(使用 npmmirror 加速) -RUN pnpm install --registry=https://registry.npmmirror.com - -# 构建 app 子项目(Next.js standalone 输出) -ENV NODE_OPTIONS="--max-old-space-size=4096" -RUN pnpm --filter=app build - -# 运行时环境变量 -ENV NODE_ENV=production -ENV NEXT_TELEMETRY_DISABLED=1 -ENV PORT=3000 -EXPOSE 3000 - -# 记录镜像构建时间,便于追溯 -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -# 默认从 standalone 输出启动 Next.js 服务 -WORKDIR /app/projects/app -CMD ["node", ".next/standalone/projects/app/server.js"] diff --git a/frameworks/fastgpt/4.14.9.5/README.md b/frameworks/fastgpt/4.14.9.5/README.md deleted file mode 100644 index fbd5f4c1989352d9a3e5f467dba0ffa69a225864..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.9.5/README.md +++ /dev/null @@ -1,60 +0,0 @@ -# FastGPT 4.14.9.5 on OpenCloudOS 9 - -## 基本信息 - -- **框架版本**:4.14.9.5 -- **基础镜像**:opencloudos/opencloudos9-minimal:latest -- **Node.js 版本**:20.18.1(按 TARGETARCH 自动选择 linux-x64 / linux-arm64) -- **CUDA 版本**:N/A -- **开源地址**:https://github.com/labring/FastGPT - -## 简介 - -FastGPT 是 labring 开源的基于 LLM 的 RAG 知识库问答与 AI 工作流编排平台,主项目为 Next.js + TypeScript Monorepo(pnpm workspace)。本镜像在 OpenCloudOS 9 上从源码构建 `projects/app`(Next.js standalone 输出),运行依赖 MongoDB、PostgreSQL+pgvector 等外部服务(生产环境通过 docker-compose 编排)。 - -## 构建 - -```bash -# 默认按宿主机架构构建(推荐) -docker build -t oc9-fastgpt:4.14.9.5 . - -# 显式指定目标架构(适用于跨架构构建) -docker buildx build --platform linux/amd64 -t oc9-fastgpt:4.14.9.5 . --load -docker buildx build --platform linux/arm64 -t oc9-fastgpt:4.14.9.5-arm64 . --load -``` - -> 提示:FastGPT 是 monorepo 项目,构建过程包含 `pnpm install` 和 `pnpm --filter=app build`,国内网络下首次构建预计 15-30 分钟,最终镜像体积较大(GB 级)。 - -## 使用示例 - -```bash -# 1. 验证镜像可启动 + 检查 Next.js standalone 产物存在 -bash test.sh oc9-fastgpt:4.14.9.5 - -# 2. 完整运行(需自备 MongoDB + PostgreSQL+pgvector) -docker run -d --name fastgpt -p 3000:3000 \ - -e MONGODB_URI="mongodb://:@:27017/fastgpt?authSource=admin" \ - -e PG_URL="postgresql://:@:5432/postgres" \ - -e CHAT_API_KEY="" \ - -v $(pwd)/config.json:/app/data/config.json \ - oc9-fastgpt:4.14.9.5 -``` - -更完整的部署方式(含 MongoDB / PG / MinIO / Redis 编排)参见 FastGPT 官方文档: - -## 测试环境 - -镜像已在以下两种架构验证通过: - -| 架构 | 操作系统 | 内核 | Docker | 状态 | -|------|---------|------|--------|------| -| x86_64 (amd64) | Ubuntu 22.04.4 LTS (Jammy) | 5.15.0-113-generic | 29.4.1 | ✓ 通过 | -| arm64 (aarch64) | macOS (Apple Silicon) | Darwin 25.x | Docker Desktop | ✓ 通过(开发自测) | - -构建时 `Dockerfile` 通过 BuildKit 注入的 `TARGETARCH` 自动选择对应的 Node.js 二进制(`linux-x64` / `linux-arm64`),同一份 Dockerfile 可在两种架构原生构建。 - -## 已知问题 - -- 单容器无 MongoDB/PostgreSQL 时,启动后会因连不上 DB 而退出,属预期行为;本镜像 `test.sh` 仅做启动产物校验,不做完整服务可用性测试。 -- 由于 monorepo 体积较大,构建时建议为 Docker 分配 ≥ 8GB 内存。 -- macOS Apple Silicon 上若以 `--platform=linux/amd64` 构建会走 qemu 模拟,速度慢且偶现兼容性问题;本机原生 `linux/arm64` 构建可正常完成,CI 仍以 `linux/amd64` 为准。 diff --git a/frameworks/fastgpt/4.14.9.5/build.conf b/frameworks/fastgpt/4.14.9.5/build.conf deleted file mode 100644 index 217b0699db5ccc115b20d8dc0a1da4ea790cd9cd..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.9.5/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# FastGPT 4.14.9.5 on OpenCloudOS 9 -IMAGE_NAME=oc9-fastgpt -IMAGE_TAG=4.14.9.5 -GPU_TEST=false diff --git a/frameworks/fastgpt/4.14.9.5/test.sh b/frameworks/fastgpt/4.14.9.5/test.sh deleted file mode 100755 index b5a20c4d8788f45e8785488906d7f94746cf6ef3..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.9.5/test.sh +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" -EXPECTED_VERSION="4.14.9.5" - -echo "=== FastGPT ${EXPECTED_VERSION} 基础功能测试 ===" - -# 1. 验证 Node.js 运行时 -echo -n "检查 Node.js 运行时... " -sudo docker run --rm "$IMAGE" node --version && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证 package.json 存在并打印版本(FastGPT 内部 version 字段可能滞后于 git tag,仅打印不强校验) -echo -n "检查 package.json 版本字段... " -sudo docker run --rm "$IMAGE" node -e " -const pkg = require('/app/package.json'); -console.log('package.json version:', pkg.version); -if (!pkg.version) { console.error('版本字段缺失'); process.exit(1); } -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 3. 验证 Next.js standalone 构建产物存在 -echo -n "检查 Next.js standalone 构建产物... " -sudo docker run --rm "$IMAGE" sh -c " -test -f /app/projects/app/.next/standalone/projects/app/server.js \ - && test -d /app/projects/app/.next/static \ - && echo 'standalone server.js + static 已生成' -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 4. 验证 server.js 可被 Node.js 解析(语法层面冒烟测试,不实际监听) -echo -n "检查 server.js 可加载(语法)... " -sudo docker run --rm "$IMAGE" node --check /app/projects/app/.next/standalone/projects/app/server.js \ - && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" diff --git a/frameworks/fastgpt/4.14.9/Dockerfile b/frameworks/fastgpt/4.14.9/Dockerfile deleted file mode 100644 index 5625be0098b987d56167eaaa08f6344edb9e77cf..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.9/Dockerfile +++ /dev/null @@ -1,108 +0,0 @@ -# ========== Stage 1: Builder ========== -FROM opencloudos/opencloudos9-minimal:latest AS builder - -LABEL maintainer="OpenCloudOS Community" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="FastGPT on OpenCloudOS 9 (builder)" - -# Install system dependencies -RUN dnf install -y \ - git \ - curl \ - ca-certificates \ - xz \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# Install Node.js 20.x LTS -# Use official binary tarball (NodeSource RPM repo only has 20.5.1, Next.js needs >=20.9.0) -RUN NODE_VERSION="20.20.2" \ - && ARCH=$(uname -m) \ - && case "$ARCH" in aarch64) ARCH="arm64" ;; x86_64) ARCH="x64" ;; esac \ - && curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${ARCH}.tar.xz" \ - -o /tmp/node.tar.xz \ - && tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1 \ - && rm -f /tmp/node.tar.xz - -# Install pnpm 9.x -RUN npm install -g pnpm@9 - -# Clone FastGPT v4.14.9 source code -WORKDIR /build -RUN git clone --depth 1 --branch v4.14.9 https://github.com/labring/FastGPT.git . - -# Install dependencies -RUN pnpm install --frozen-lockfile || pnpm install - -# Build the application -ENV NODE_OPTIONS="--max-old-space-size=4096" -RUN pnpm --filter=app build - -# Clean up build-time-only packages from standalone output -# NOTE: @next/rspack-binding-* and @rspack/binding-* are kept — -# Next.js 16 instrumentation.js requires them at runtime. -# NOTE: @img/sharp-libvips-* is kept — sharp needs its native vips binding at runtime. -RUN cd projects/app/.next/standalone && rm -rf \ - node_modules/typescript@* - -# ========== Stage 2: Runner ========== -FROM opencloudos/opencloudos9-minimal:latest - -LABEL maintainer="OpenCloudOS Community" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="FastGPT v4.14.9 on OpenCloudOS 9" - -# Install runtime dependencies -RUN dnf install -y \ - curl \ - ca-certificates \ - xz \ - && dnf clean all \ - && rm -rf /var/cache/yum/* \ - && update-ca-trust - -# Install Node.js 20.x LTS (runtime only) -# Use official binary tarball (NodeSource RPM repo only has 20.5.1, Next.js needs >=20.9.0) -RUN NODE_VERSION="20.20.2" \ - && ARCH=$(uname -m) \ - && case "$ARCH" in aarch64) ARCH="arm64" ;; x86_64) ARCH="x64" ;; esac \ - && curl -fsSL "https://nodejs.org/dist/v${NODE_VERSION}/node-v${NODE_VERSION}-linux-${ARCH}.tar.xz" \ - -o /tmp/node.tar.xz \ - && tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1 \ - && rm -f /tmp/node.tar.xz - -# Create non-root user -RUN groupadd --system --gid 1001 nodejs \ - && useradd --system --uid 1001 nextjs - -WORKDIR /app - -# Copy standalone Next.js output -COPY --from=builder --chown=nextjs:nodejs /build/projects/app/.next/standalone /app -COPY --from=builder --chown=nextjs:nodejs /build/projects/app/.next/static /app/projects/app/.next/static -COPY --from=builder --chown=nextjs:nodejs /build/projects/app/public /app/projects/app/public -COPY --from=builder --chown=root:root /build/projects/app/next.config.ts /app/projects/app/next.config.ts -COPY --from=builder --chown=nextjs:nodejs /build/projects/app/worker /app/projects/app/worker -COPY --from=builder --chown=root:root /build/projects/app/package.json /app/package.json - -# Copy data files (config.json, GeoLite2-City.mmdb, etc.) -COPY --from=builder --chown=nextjs:nodejs /build/projects/app/data /app/data - -# Copy optional runtime dependencies (dynamically imported) -COPY --from=builder --chown=root:root /build/node_modules/tiktoken /app/node_modules/tiktoken -COPY --from=builder --chown=root:root /build/node_modules/@zilliz/milvus2-sdk-node /app/node_modules/@zilliz/milvus2-sdk-node - -# Clean up tiktoken encoders (loaded on-demand, saves ~30MB) -RUN rm -rf /app/node_modules/tiktoken/encoders - -# Environment variables -ENV NODE_ENV=production -ENV NEXT_TELEMETRY_DISABLED=1 -ENV PORT=3000 -ENV serverPath=./projects/app/server.js - -EXPOSE 3000 - -USER nextjs - -ENTRYPOINT ["sh", "-c", "node --max-old-space-size=4096 ${serverPath}"] \ No newline at end of file diff --git a/frameworks/fastgpt/4.14.9/README.md b/frameworks/fastgpt/4.14.9/README.md deleted file mode 100644 index f56156eda49ffa81caf88e4d828e15b3855bf036..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.9/README.md +++ /dev/null @@ -1,152 +0,0 @@ -# FastGPT on OpenCloudOS 9 - -## 基本信息 -- **框架版本**:v4.14.9 -- **基础镜像**:opencloudos9-minimal:latest -- **Node.js 版本**:20.x -- **pnpm 版本**:9.x -- **框架类型**:大模型开发与编排平台(Next.js) -- **CUDA 版本**:N/A(CPU 框架) - -## 构建 - -```bash -docker build -t oc9-fastgpt:4.14.9 frameworks/fastgpt/4.14.9/ -``` - -> 构建需要 ≥4GB 内存(Node.js `--max-old-space-size=4096`)。 - -## 使用示例 - -FastGPT 需要配合以下外部服务一起部署: - -| 服务 | 说明 | -|------|------| -| **MongoDB** | 主数据库(≥5.0) | -| **Redis** | 缓存(≥7.0) | -| **PGVector** | 向量数据库(PostgreSQL + pgvector 扩展) | -| **MinIO** | 对象存储(S3 兼容) | - -### docker-compose 部署示例 - -```yaml -services: - fastgpt: - image: oc9-fastgpt:4.14.9 - container_name: fastgpt - restart: always - ports: - - "3000:3000" - volumes: - - ./config.json:/app/data/config.json - environment: - # 数据库 - - MONGODB_URI=mongodb://myusername:mypassword@mongo:27017/fastgpt?authSource=admin - - DB_MAX_LINK=5 - - REDIS_URL=redis://default:mypassword@redis:6379 - # 向量数据库(PGVector) - - PG_URL=postgresql://username:password@pg:5432/postgres - # 对象存储 - - STORAGE_VENDOR=minio - - STORAGE_REGION=us-east-1 - - STORAGE_ACCESS_KEY_ID=minioadmin - - STORAGE_SECRET_ACCESS_KEY=minioadmin - - STORAGE_PUBLIC_BUCKET=fastgpt-public - - STORAGE_PRIVATE_BUCKET=fastgpt-private - - STORAGE_S3_ENDPOINT=http://fastgpt-minio:9000 - - STORAGE_S3_FORCE_PATH_STYLE=true - # 应用配置 - - FE_DOMAIN=http://localhost:3000 - - ROOT_KEY=your-root-key - - TOKEN_KEY=your-token-key - - FILE_TOKEN_KEY=your-file-token-key - - AES256_SECRET_KEY=your-aes256-secret - - DEFAULT_ROOT_PSW=1234 - depends_on: - - mongo - - redis - - pg - - mongo: - image: mongo:5.0.32 - container_name: mongo - restart: always - volumes: - - ./mongo/data:/data/db - environment: - - MONGO_INITDB_ROOT_USERNAME=myusername - - MONGO_INITDB_ROOT_PASSWORD=mypassword - - redis: - image: redis:7.2-alpine - container_name: redis - restart: always - volumes: - - ./redis/data:/data - command: redis-server --requirepass mypassword --appendonly yes - - pg: - image: pgvector/pgvector:0.8.0-pg15 - container_name: pg - restart: always - volumes: - - ./pg/data:/var/lib/postgresql/data - environment: - - POSTGRES_USER=username - - POSTGRES_PASSWORD=password - - POSTGRES_DB=postgres - - fastgpt-minio: - image: minio/minio - container_name: fastgpt-minio - restart: always - ports: - - "9000:9000" - - "9001:9001" - volumes: - - ./minio/data:/data - environment: - - MINIO_ROOT_USER=minioadmin - - MINIO_ROOT_PASSWORD=minioadmin - command: server /data --console-address ":9001" -``` - -启动后访问 `http://localhost:3000`,默认账号 `root`,默认密码 `1234`。 - -## 主要环境变量 - -| 变量 | 说明 | 默认值 | -|------|------|--------| -| `MONGODB_URI` | MongoDB 连接串 | 必填 | -| `REDIS_URL` | Redis 连接串 | 必填 | -| `PG_URL` | PostgreSQL (PGVector) 连接串 | 必填 | -| `STORAGE_VENDOR` | 存储提供商 (minio/aws-s3/cos/oss) | `minio` | -| `STORAGE_S3_ENDPOINT` | S3 兼容存储端点 | 必填 | -| `ROOT_KEY` | 最高权限密钥 | 必填 | -| `TOKEN_KEY` | Token 签名密钥 | 必填 | -| `AES256_SECRET_KEY` | AES-256 加密密钥 | 必填 | -| `FE_DOMAIN` | 前端访问地址 | `http://localhost:3000` | -| `DEFAULT_ROOT_PSW` | 默认 root 密码 | `1234` | -| `UPLOAD_FILE_MAX_SIZE` | 最大上传文件大小 (MB) | `1000` | -| `WORKFLOW_MAX_RUN_TIMES` | 最大工作流执行次数 | `1000` | - -完整环境变量列表参见官方 [`.env.template`](https://github.com/labring/FastGPT/blob/v4.14.9/projects/app/.env.template)。 - -## 测试验证 - -```bash -bash test.sh oc9-fastgpt:4.14.9 -``` - -测试脚本会验证以下内容: -- Node.js 版本 ≥ 20 -- 应用目录结构完整性 -- 关键运行时依赖(tiktoken) -- server.js 模块可解析 - -## 已知问题 - -- 构建时需要 ≥4GB 内存,内存不足会导致 Node.js OOM -- 镜像仅包含 FastGPT 应用本身,MongoDB、Redis、PGVector、MinIO 需通过 docker-compose 单独部署 -- 首次启动时需确保所有外部服务已就绪,否则应用会因数据库连接失败而退出 -- 原始 Dockerfile 使用 Alpine 基础镜像,本适配改用 OpenCloudOS 9 (RPM) 基础镜像,部分原生模块(如 `@node-rs/jieba`)可能需要额外编译 diff --git a/frameworks/fastgpt/4.14.9/build.conf b/frameworks/fastgpt/4.14.9/build.conf deleted file mode 100644 index f2397f9aaeb721aa5c4d0bbce4dcf1a15f9de149..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.9/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# fastgpt 4.14.9 on OpenCloudOS 9 -IMAGE_NAME=oc9-fastgpt -IMAGE_TAG=4.14.9 -GPU_TEST=false diff --git a/frameworks/fastgpt/4.14.9/test.sh b/frameworks/fastgpt/4.14.9/test.sh deleted file mode 100755 index 4f1319fc744a713b6c5595fab63b44bf870f3cd0..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/4.14.9/test.sh +++ /dev/null @@ -1,59 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" - -echo "=== FastGPT 4.14.9 功能测试 ===" - -# 1. 验证 Node.js 版本 >= 20 -echo -n "检查 Node.js 版本... " -docker run --rm --entrypoint node "$IMAGE" -e " -const v = process.versions.node.split('.').map(Number); -if (v[0] < 20) { console.error('Node.js >= 20 required, got ' + process.versions.node); process.exit(1); } -console.log('Node.js ' + process.versions.node); -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证应用目录结构 -echo -n "检查应用目录结构... " -docker run --rm --entrypoint node "$IMAGE" -e " -const fs = require('fs'); -const checks = [ - './projects/app/server.js', - './projects/app/public', - './projects/app/.next/static', - './projects/app/worker', - './data/config.json' -]; -checks.forEach(p => { - if (!fs.existsSync(p)) { console.error('Missing: ' + p); process.exit(1); } -}); -console.log('目录结构完整'); -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 3. 验证关键 node_modules 存在 -echo -n "检查关键依赖... " -docker run --rm --entrypoint node "$IMAGE" -e " -const fs = require('fs'); -const mods = ['tiktoken']; -mods.forEach(m => { - if (!fs.existsSync('./node_modules/' + m)) { console.error('Missing module: ' + m); process.exit(1); } -}); -console.log('关键依赖完整'); -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 4. 验证 server.js 存在且为有效 JS(不启动服务器,避免触发 instrumentation 原生绑定加载) -echo -n "检查 server.js 有效性... " -docker run --rm --entrypoint node "$IMAGE" -e " -const fs = require('fs'); -const path = './projects/app/server.js'; -if (!fs.existsSync(path)) { console.error('Missing: ' + path); process.exit(1); } -const src = fs.readFileSync(path, 'utf8'); -// Verify it looks like a valid Node.js entry (contains expected keywords) -const keywords = ['require', 'next']; -keywords.forEach(kw => { - if (!src.includes(kw)) { console.error('server.js missing expected keyword: ' + kw); process.exit(1); } -}); -console.log('server.js 结构正常'); -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" \ No newline at end of file diff --git a/frameworks/fastgpt/build-and-test.sh b/frameworks/fastgpt/build-and-test.sh deleted file mode 100755 index 04b02edebf7ab2252ee3ec2517529b48967f2eb7..0000000000000000000000000000000000000000 --- a/frameworks/fastgpt/build-and-test.sh +++ /dev/null @@ -1,165 +0,0 @@ -#!/bin/bash -# FastGPT 多版本批量构建与测试脚本 -# 用法: -# bash build-and-test.sh # 构建并测试全部版本 -# bash build-and-test.sh 4.14.10.2 4.14.10.3 # 仅指定版本 -# PLATFORM=linux/amd64 bash build-and-test.sh # 指定平台 -# GIT_PROXY="" bash build-and-test.sh # 关闭 git 代理(海外环境) -# SKIP_BUILD=1 bash build-and-test.sh # 跳过构建只跑测试 -set -u - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -cd "$SCRIPT_DIR" - -# ===== 可配置参数 ===== -# 默认按宿主机架构构建:x86_64→linux/amd64,arm64/aarch64→linux/arm64 -HOST_ARCH="$(uname -m)" -case "$HOST_ARCH" in - x86_64|amd64) DEFAULT_PLATFORM="linux/amd64" ;; - arm64|aarch64) DEFAULT_PLATFORM="linux/arm64" ;; - *) DEFAULT_PLATFORM="linux/amd64" ;; -esac -PLATFORM="${PLATFORM:-$DEFAULT_PLATFORM}" -GIT_PROXY="${GIT_PROXY:-https://gh-proxy.com/}" -IMAGE_PREFIX="${IMAGE_PREFIX:-oc9-fastgpt}" -SKIP_BUILD="${SKIP_BUILD:-0}" -SKIP_TEST="${SKIP_TEST:-0}" -# CLEANUP_AFTER=1:每个版本测试通过后立即 docker rmi + buildx prune,避免磁盘累积 -CLEANUP_AFTER="${CLEANUP_AFTER:-0}" -# DISK_THRESHOLD_GB:开始构建前若 /var/lib/docker 所在分区可用空间低于此值则中止,单位 GB(0 关闭) -DISK_THRESHOLD_GB="${DISK_THRESHOLD_GB:-15}" - -# ===== 全部已知版本(按时间顺序) ===== -ALL_VERSIONS=(4.14.9.3 4.14.9.4 4.14.9.5 4.14.10 4.14.10.1 4.14.10.2 4.14.10.3) - -# ===== 入参:未传则跑全部 ===== -if [ "$#" -gt 0 ]; then - VERSIONS=("$@") -else - VERSIONS=("${ALL_VERSIONS[@]}") -fi - -# ===== 颜色 ===== -RED='\033[0;31m' -GREEN='\033[0;32m' -YELLOW='\033[0;33m' -BLUE='\033[0;34m' -NC='\033[0m' - -log() { printf "${BLUE}[%s]${NC} %s\n" "$(date +%H:%M:%S)" "$*"; } -ok() { printf "${GREEN}✓${NC} %s\n" "$*"; } -fail() { printf "${RED}✗${NC} %s\n" "$*"; } -warn() { printf "${YELLOW}⚠${NC} %s\n" "$*"; } - -# ===== 校验环境 ===== -log "检查 docker buildx..." -if ! docker buildx version &>/dev/null; then - fail "docker buildx 未安装" - exit 1 -fi -ok "docker buildx 可用" - -log "本次任务:" -echo " Platform : $PLATFORM" -echo " GIT_PROXY : ${GIT_PROXY:-(关闭)}" -echo " IMAGE : ${IMAGE_PREFIX}:" -echo " Versions : ${VERSIONS[*]}" -echo " SKIP_BUILD : $SKIP_BUILD" -echo " SKIP_TEST : $SKIP_TEST" -echo "" - -# ===== 结果记录 ===== -declare -a RESULT_VER RESULT_BUILD RESULT_TEST RESULT_DURATION - -START_TS=$(date +%s) - -for V in "${VERSIONS[@]}"; do - VER_DIR="$SCRIPT_DIR/$V" - IMAGE="${IMAGE_PREFIX}:${V}" - - if [ ! -d "$VER_DIR" ]; then - warn "版本目录不存在:$VER_DIR,跳过" - RESULT_VER+=("$V"); RESULT_BUILD+=("SKIP"); RESULT_TEST+=("SKIP"); RESULT_DURATION+=("0s") - continue - fi - - log "==========================================" - log "处理版本 v$V" - log "==========================================" - VSTART=$(date +%s) - - # ---- 构建 ---- - BUILD_RESULT="SKIP" - if [ "$SKIP_BUILD" != "1" ]; then - log "[build] $IMAGE platform=$PLATFORM" - BUILD_ARGS=(--platform "$PLATFORM" -t "$IMAGE" --load) - if [ -n "$GIT_PROXY" ]; then - BUILD_ARGS+=(--build-arg "GIT_PROXY=$GIT_PROXY") - else - BUILD_ARGS+=(--build-arg "GIT_PROXY=") - fi - - if (cd "$VER_DIR" && docker buildx build "${BUILD_ARGS[@]}" .); then - ok "[build] v$V 成功" - BUILD_RESULT="OK" - else - fail "[build] v$V 失败" - BUILD_RESULT="FAIL" - fi - fi - - # ---- 测试 ---- - TEST_RESULT="SKIP" - if [ "$SKIP_TEST" != "1" ] && [ "$BUILD_RESULT" != "FAIL" ]; then - log "[test] bash $VER_DIR/test.sh $IMAGE" - if bash "$VER_DIR/test.sh" "$IMAGE"; then - ok "[test] v$V 通过" - TEST_RESULT="OK" - else - fail "[test] v$V 失败" - TEST_RESULT="FAIL" - fi - fi - - VEND=$(date +%s) - VDUR=$((VEND - VSTART)) - - RESULT_VER+=("$V") - RESULT_BUILD+=("$BUILD_RESULT") - RESULT_TEST+=("$TEST_RESULT") - RESULT_DURATION+=("${VDUR}s") - echo "" -done - -END_TS=$(date +%s) -TOTAL=$((END_TS - START_TS)) - -# ===== 汇总 ===== -echo "" -log "==========================================" -log "全部完成(总耗时 ${TOTAL}s)" -log "==========================================" -printf "%-12s | %-8s | %-8s | %-8s\n" "VERSION" "BUILD" "TEST" "DURATION" -printf "%-12s-+-%-8s-+-%-8s-+-%-8s\n" "------------" "--------" "--------" "--------" - -EXIT_CODE=0 -for i in "${!RESULT_VER[@]}"; do - V="${RESULT_VER[$i]}" - B="${RESULT_BUILD[$i]}" - T="${RESULT_TEST[$i]}" - D="${RESULT_DURATION[$i]}" - case "$B$T" in - *FAIL*) [ "$EXIT_CODE" = 0 ] && EXIT_CODE=1 ;; - esac - printf "%-12s | %-8s | %-8s | %-8s\n" "$V" "$B" "$T" "$D" -done - -if [ $EXIT_CODE -eq 0 ]; then - echo "" - ok "全部版本构建并测试通过" -else - echo "" - fail "存在失败的版本,详见上表" -fi - -exit $EXIT_CODE diff --git "a/frameworks/langgraph/1.1.3/1.1.3\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276.png" "b/frameworks/langgraph/1.1.3/1.1.3\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276.png" deleted file mode 100644 index 7720fb631ecbadd412e7fcac8410221eaa528975..0000000000000000000000000000000000000000 Binary files "a/frameworks/langgraph/1.1.3/1.1.3\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276.png" and /dev/null differ diff --git a/frameworks/langgraph/1.1.3/Dockerfile b/frameworks/langgraph/1.1.3/Dockerfile deleted file mode 100644 index 58f7bceafa29034eaccb0cbebf72187a88390839..0000000000000000000000000000000000000000 --- a/frameworks/langgraph/1.1.3/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# 基础镜像:OpenCloudOS 9 极简版,适用于纯 Python / CPU 框架 -FROM opencloudos/opencloudos9-minimal:latest - -# 镜像元信息 -LABEL maintainer="pangxb666" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="LangGraph 1.1.3 on OpenCloudOS 9" - -# 安装 Python 3.11 及 pip,安装完成后清理缓存以减小镜像体积 -RUN dnf install -y \ - python3.11 \ - python3.11-pip \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 使用清华镜像源安装 LangGraph,加速国内网络下的依赖下载 -RUN pip3.11 install --no-cache-dir langgraph==1.1.3 \ - -i https://pypi.tuna.tsinghua.edu.cn/simple \ - --trusted-host pypi.tuna.tsinghua.edu.cn - -# 记录镜像构建时间,便于追溯 -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -# 默认进入 Python 3.11 交互环境 -CMD ["python3.11"] diff --git a/frameworks/langgraph/1.1.3/README.md b/frameworks/langgraph/1.1.3/README.md deleted file mode 100644 index d0d3b0b55ffaf60869f989a42254c1bdffb17da8..0000000000000000000000000000000000000000 --- a/frameworks/langgraph/1.1.3/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# LangGraph 1.1.3 on OpenCloudOS 9 - -## 基本信息 - -- **框架版本**:1.1.3 -- **基础镜像**:opencloudos/opencloudos9-minimal:latest -- **Python 版本**:3.11 -- **CUDA 版本**:N/A -- **开源地址**:https://github.com/langchain-ai/langgraph - -## 简介 - -LangGraph 是基于 LangChain 构建的有状态、多参与者应用程序框架,用于创建具有循环图结构的 AI Agent 工作流。 - -## 构建 - -```bash -docker build -t oc9-langgraph:1.1.3 . -``` - -## 使用示例 - -```bash -# 验证版本 -docker run --rm oc9-langgraph:1.1.3 python3.11 -c "import importlib.metadata; print(importlib.metadata.version('langgraph'))" - -# 运行基础测试 -docker run --rm oc9-langgraph:1.1.3 bash /test.sh -``` - -## 功能验证 - -```bash -docker run --rm oc9-langgraph:1.1.3 python3.11 -c " -from langgraph.graph import StateGraph, END -from typing import TypedDict - -class State(TypedDict): - value: str - -def node(state): - return {'value': 'ok'} - -g = StateGraph(State) -g.add_node('node', node) -g.set_entry_point('node') -g.add_edge('node', END) -app = g.compile() -print(app.invoke({'value': 'test'})) -" -``` - -## 已知问题 - -无 diff --git a/frameworks/langgraph/1.1.3/build.conf b/frameworks/langgraph/1.1.3/build.conf deleted file mode 100644 index 384d12487eb0fadc6929ef4ab28bb1cdc3eb4f7c..0000000000000000000000000000000000000000 --- a/frameworks/langgraph/1.1.3/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# langgraph 1.1.3 on OpenCloudOS 9 -IMAGE_NAME=oc9-langgraph -IMAGE_TAG=1.1.3 -GPU_TEST=false diff --git a/frameworks/langgraph/1.1.3/test.sh b/frameworks/langgraph/1.1.3/test.sh deleted file mode 100644 index 118928344ed67c940a7f5048c4395d52c373cd27..0000000000000000000000000000000000000000 --- a/frameworks/langgraph/1.1.3/test.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" - -echo "=== LangGraph 1.1.3 基础功能测试 ===" - -# 1. 验证 langgraph 可正常导入并检查版本 -echo -n "检查 import langgraph... " -sudo docker run --rm "$IMAGE" python3.11 -c " -import importlib.metadata -print(importlib.metadata.version('langgraph')) -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证 StateGraph 核心功能 -echo -n "检查 StateGraph 构建与执行... " -sudo docker run --rm "$IMAGE" python3.11 -c " -from langgraph.graph import StateGraph, END -from typing import TypedDict - -class State(TypedDict): - value: str - -def process(state): - return {'value': 'hello from langgraph'} - -graph = StateGraph(State) -graph.add_node('process', process) -graph.set_entry_point('process') -graph.add_edge('process', END) -app = graph.compile() - -result = app.invoke({'value': 'test'}) -assert result['value'] == 'hello from langgraph', f'期望 hello from langgraph,实际 {result[\"value\"]}' -print('StateGraph 执行正常') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 3. 验证条件边功能 -echo -n "检查条件边(conditional edges)... " -sudo docker run --rm "$IMAGE" python3.11 -c " -from langgraph.graph import StateGraph, END -from typing import TypedDict - -class State(TypedDict): - count: int - -def increment(state): - return {'count': state['count'] + 1} - -def should_stop(state): - if state['count'] >= 3: - return END - return 'increment' - -graph = StateGraph(State) -graph.add_node('increment', increment) -graph.set_entry_point('increment') -graph.add_conditional_edges('increment', should_stop) -app = graph.compile() - -result = app.invoke({'count': 0}) -assert result['count'] == 3, f'期望 count=3,实际 {result[\"count\"]}' -print('条件边执行正常') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" diff --git "a/frameworks/langgraph/1.1.4/1.1.4\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276.png" "b/frameworks/langgraph/1.1.4/1.1.4\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276.png" deleted file mode 100644 index 7d65366fad1069882564e7cca177e4ffbfe91bca..0000000000000000000000000000000000000000 Binary files "a/frameworks/langgraph/1.1.4/1.1.4\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276.png" and /dev/null differ diff --git a/frameworks/langgraph/1.1.4/Dockerfile b/frameworks/langgraph/1.1.4/Dockerfile deleted file mode 100644 index 104c70ea214e30fac2404fce968c873f4dbfd898..0000000000000000000000000000000000000000 --- a/frameworks/langgraph/1.1.4/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# 基础镜像:OpenCloudOS 9 极简版,适用于纯 Python / CPU 框架 -FROM opencloudos/opencloudos9-minimal:latest - -# 镜像元信息 -LABEL maintainer="pangxb666" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="LangGraph 1.1.4 on OpenCloudOS 9" - -# 安装 Python 3.11 及 pip,安装完成后清理缓存以减小镜像体积 -RUN dnf install -y \ - python3.11 \ - python3.11-pip \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 使用清华镜像源安装 LangGraph,加速国内网络下的依赖下载 -RUN pip3.11 install --no-cache-dir langgraph==1.1.4 \ - -i https://pypi.tuna.tsinghua.edu.cn/simple \ - --trusted-host pypi.tuna.tsinghua.edu.cn - -# 记录镜像构建时间,便于追溯 -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -# 默认进入 Python 3.11 交互环境 -CMD ["python3.11"] diff --git a/frameworks/langgraph/1.1.4/README.md b/frameworks/langgraph/1.1.4/README.md deleted file mode 100644 index 28285b8c253899c831eabc3212eb9a253fb95ebc..0000000000000000000000000000000000000000 --- a/frameworks/langgraph/1.1.4/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# LangGraph 1.1.4 on OpenCloudOS 9 - -## 基本信息 - -- **框架版本**:1.1.4 -- **基础镜像**:opencloudos/opencloudos9-minimal:latest -- **Python 版本**:3.11 -- **CUDA 版本**:N/A -- **开源地址**:https://github.com/langchain-ai/langgraph - -## 简介 - -LangGraph 是基于 LangChain 构建的有状态、多参与者应用程序框架,用于创建具有循环图结构的 AI Agent 工作流。 - -## 构建 - -```bash -docker build -t oc9-langgraph:1.1.4 . -``` - -## 使用示例 - -```bash -# 验证版本 -docker run --rm oc9-langgraph:1.1.4 python3.11 -c "import importlib.metadata; print(importlib.metadata.version('langgraph'))" - -# 运行基础测试 -docker run --rm oc9-langgraph:1.1.4 bash /test.sh -``` - -## 功能验证 - -```bash -docker run --rm oc9-langgraph:1.1.4 python3.11 -c " -from langgraph.graph import StateGraph, END -from typing import TypedDict - -class State(TypedDict): - value: str - -def node(state): - return {'value': 'ok'} - -g = StateGraph(State) -g.add_node('node', node) -g.set_entry_point('node') -g.add_edge('node', END) -app = g.compile() -print(app.invoke({'value': 'test'})) -" -``` - -## 已知问题 - -无 diff --git a/frameworks/langgraph/1.1.4/build.conf b/frameworks/langgraph/1.1.4/build.conf deleted file mode 100644 index 4e582c481b1b3764be9c665f0676a591d7166135..0000000000000000000000000000000000000000 --- a/frameworks/langgraph/1.1.4/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# langgraph 1.1.4 on OpenCloudOS 9 -IMAGE_NAME=oc9-langgraph -IMAGE_TAG=1.1.4 -GPU_TEST=false diff --git a/frameworks/langgraph/1.1.4/test.sh b/frameworks/langgraph/1.1.4/test.sh deleted file mode 100644 index b6ff98926e6ab42758518be6b229d7e910b86618..0000000000000000000000000000000000000000 --- a/frameworks/langgraph/1.1.4/test.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" - -echo "=== LangGraph 1.1.4 基础功能测试 ===" - -# 1. 验证 langgraph 可正常导入并检查版本 -echo -n "检查 import langgraph... " -sudo docker run --rm "$IMAGE" python3.11 -c " -import importlib.metadata -print(importlib.metadata.version('langgraph')) -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证 StateGraph 核心功能 -echo -n "检查 StateGraph 构建与执行... " -sudo docker run --rm "$IMAGE" python3.11 -c " -from langgraph.graph import StateGraph, END -from typing import TypedDict - -class State(TypedDict): - value: str - -def process(state): - return {'value': 'hello from langgraph'} - -graph = StateGraph(State) -graph.add_node('process', process) -graph.set_entry_point('process') -graph.add_edge('process', END) -app = graph.compile() - -result = app.invoke({'value': 'test'}) -assert result['value'] == 'hello from langgraph', f'期望 hello from langgraph,实际 {result[\"value\"]}' -print('StateGraph 执行正常') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 3. 验证条件边功能 -echo -n "检查条件边(conditional edges)... " -sudo docker run --rm "$IMAGE" python3.11 -c " -from langgraph.graph import StateGraph, END -from typing import TypedDict - -class State(TypedDict): - count: int - -def increment(state): - return {'count': state['count'] + 1} - -def should_stop(state): - if state['count'] >= 3: - return END - return 'increment' - -graph = StateGraph(State) -graph.add_node('increment', increment) -graph.set_entry_point('increment') -graph.add_conditional_edges('increment', should_stop) -app = graph.compile() - -result = app.invoke({'count': 0}) -assert result['count'] == 3, f'期望 count=3,实际 {result[\"count\"]}' -print('条件边执行正常') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" diff --git "a/frameworks/langgraph/1.1.5/1.1.5\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276.png" "b/frameworks/langgraph/1.1.5/1.1.5\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276.png" deleted file mode 100644 index 6eb54f11552aa0b16838a98486532f7eeab8720e..0000000000000000000000000000000000000000 Binary files "a/frameworks/langgraph/1.1.5/1.1.5\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276.png" and /dev/null differ diff --git a/frameworks/langgraph/1.1.5/Dockerfile b/frameworks/langgraph/1.1.5/Dockerfile deleted file mode 100644 index 0df569d093b882009bfb2d2c213f125b9df227e8..0000000000000000000000000000000000000000 --- a/frameworks/langgraph/1.1.5/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# 基础镜像:OpenCloudOS 9 极简版,适用于纯 Python / CPU 框架 -FROM opencloudos/opencloudos9-minimal:latest - -# 镜像元信息 -LABEL maintainer="pangxb666" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="LangGraph 1.1.5 on OpenCloudOS 9" - -# 安装 Python 3.11 及 pip,安装完成后清理缓存以减小镜像体积 -RUN dnf install -y \ - python3.11 \ - python3.11-pip \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 使用清华镜像源安装 LangGraph,加速国内网络下的依赖下载 -RUN pip3.11 install --no-cache-dir langgraph==1.1.5 \ - -i https://pypi.tuna.tsinghua.edu.cn/simple \ - --trusted-host pypi.tuna.tsinghua.edu.cn - -# 记录镜像构建时间,便于追溯 -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -# 默认进入 Python 3.11 交互环境 -CMD ["python3.11"] diff --git a/frameworks/langgraph/1.1.5/README.md b/frameworks/langgraph/1.1.5/README.md deleted file mode 100644 index 739392199e4bc9ba1594a1c4867806903b4a9d4e..0000000000000000000000000000000000000000 --- a/frameworks/langgraph/1.1.5/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# LangGraph 1.1.5 on OpenCloudOS 9 - -## 基本信息 - -- **框架版本**:1.1.5 -- **基础镜像**:opencloudos/opencloudos9-minimal:latest -- **Python 版本**:3.11 -- **CUDA 版本**:N/A -- **开源地址**:https://github.com/langchain-ai/langgraph - -## 简介 - -LangGraph 是基于 LangChain 构建的有状态、多参与者应用程序框架,用于创建具有循环图结构的 AI Agent 工作流。 - -## 构建 - -```bash -docker build -t oc9-langgraph:1.1.5 . -``` - -## 使用示例 - -```bash -# 验证版本 -docker run --rm oc9-langgraph:1.1.5 python3.11 -c "import importlib.metadata; print(importlib.metadata.version('langgraph'))" - -# 运行基础测试 -docker run --rm oc9-langgraph:1.1.5 bash /test.sh -``` - -## 功能验证 - -```bash -docker run --rm oc9-langgraph:1.1.5 python3.11 -c " -from langgraph.graph import StateGraph, END -from typing import TypedDict - -class State(TypedDict): - value: str - -def node(state): - return {'value': 'ok'} - -g = StateGraph(State) -g.add_node('node', node) -g.set_entry_point('node') -g.add_edge('node', END) -app = g.compile() -print(app.invoke({'value': 'test'})) -" -``` - -## 已知问题 - -无 diff --git a/frameworks/langgraph/1.1.5/build.conf b/frameworks/langgraph/1.1.5/build.conf deleted file mode 100644 index 760201ffa7f5a46e7944d6059f8d310243ba2f7c..0000000000000000000000000000000000000000 --- a/frameworks/langgraph/1.1.5/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# langgraph 1.1.5 on OpenCloudOS 9 -IMAGE_NAME=oc9-langgraph -IMAGE_TAG=1.1.5 -GPU_TEST=false diff --git a/frameworks/langgraph/1.1.5/test.sh b/frameworks/langgraph/1.1.5/test.sh deleted file mode 100644 index fbeba7f5be56946122b8fbf5364afeb6b3a40fe3..0000000000000000000000000000000000000000 --- a/frameworks/langgraph/1.1.5/test.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" - -echo "=== LangGraph 1.1.5 基础功能测试 ===" - -# 1. 验证 langgraph 可正常导入并检查版本 -echo -n "检查 import langgraph... " -sudo docker run --rm "$IMAGE" python3.11 -c " -import importlib.metadata -print(importlib.metadata.version('langgraph')) -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证 StateGraph 核心功能 -echo -n "检查 StateGraph 构建与执行... " -sudo docker run --rm "$IMAGE" python3.11 -c " -from langgraph.graph import StateGraph, END -from typing import TypedDict - -class State(TypedDict): - value: str - -def process(state): - return {'value': 'hello from langgraph'} - -graph = StateGraph(State) -graph.add_node('process', process) -graph.set_entry_point('process') -graph.add_edge('process', END) -app = graph.compile() - -result = app.invoke({'value': 'test'}) -assert result['value'] == 'hello from langgraph', f'期望 hello from langgraph,实际 {result[\"value\"]}' -print('StateGraph 执行正常') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 3. 验证条件边功能 -echo -n "检查条件边(conditional edges)... " -sudo docker run --rm "$IMAGE" python3.11 -c " -from langgraph.graph import StateGraph, END -from typing import TypedDict - -class State(TypedDict): - count: int - -def increment(state): - return {'count': state['count'] + 1} - -def should_stop(state): - if state['count'] >= 3: - return END - return 'increment' - -graph = StateGraph(State) -graph.add_node('increment', increment) -graph.set_entry_point('increment') -graph.add_conditional_edges('increment', should_stop) -app = graph.compile() - -result = app.invoke({'count': 0}) -assert result['count'] == 3, f'期望 count=3,实际 {result[\"count\"]}' -print('条件边执行正常') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" diff --git "a/frameworks/langgraph/1.1.6/1.1.6\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276.png" "b/frameworks/langgraph/1.1.6/1.1.6\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276.png" deleted file mode 100644 index 94d43d732d684d2d936d7ff321f034546eb0aa06..0000000000000000000000000000000000000000 Binary files "a/frameworks/langgraph/1.1.6/1.1.6\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276.png" and /dev/null differ diff --git a/frameworks/langgraph/1.1.6/Dockerfile b/frameworks/langgraph/1.1.6/Dockerfile deleted file mode 100644 index bebd69e6ea96c245cacf280160d132c03f49fc32..0000000000000000000000000000000000000000 --- a/frameworks/langgraph/1.1.6/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# 基础镜像:OpenCloudOS 9 极简版,适用于纯 Python / CPU 框架 -FROM opencloudos/opencloudos9-minimal:latest - -# 镜像元信息 -LABEL maintainer="pangxb666" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="LangGraph 1.1.6 on OpenCloudOS 9" - -# 安装 Python 3.11 及 pip,安装完成后清理缓存以减小镜像体积 -RUN dnf install -y \ - python3.11 \ - python3.11-pip \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 使用清华镜像源安装 LangGraph,加速国内网络下的依赖下载 -RUN pip3.11 install --no-cache-dir langgraph==1.1.6 \ - -i https://pypi.tuna.tsinghua.edu.cn/simple \ - --trusted-host pypi.tuna.tsinghua.edu.cn - -# 记录镜像构建时间,便于追溯 -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -# 默认进入 Python 3.11 交互环境 -CMD ["python3.11"] diff --git a/frameworks/langgraph/1.1.6/README.md b/frameworks/langgraph/1.1.6/README.md deleted file mode 100644 index 50e925f6f391b71a5fc4618a31f329ad15901322..0000000000000000000000000000000000000000 --- a/frameworks/langgraph/1.1.6/README.md +++ /dev/null @@ -1,55 +0,0 @@ -# LangGraph 1.1.6 on OpenCloudOS 9 - -## 基本信息 - -- **框架版本**:1.1.6 -- **基础镜像**:opencloudos/opencloudos9-minimal:latest -- **Python 版本**:3.11 -- **CUDA 版本**:N/A -- **开源地址**:https://github.com/langchain-ai/langgraph - -## 简介 - -LangGraph 是基于 LangChain 构建的有状态、多参与者应用程序框架,用于创建具有循环图结构的 AI Agent 工作流。 - -## 构建 - -```bash -docker build -t oc9-langgraph:1.1.6 . -``` - -## 使用示例 - -```bash -# 验证版本 -docker run --rm oc9-langgraph:1.1.6 python3.11 -c "import importlib.metadata; print(importlib.metadata.version('langgraph'))" - -# 运行基础测试 -docker run --rm oc9-langgraph:1.1.6 bash /test.sh -``` - -## 功能验证 - -```bash -docker run --rm oc9-langgraph:1.1.6 python3.11 -c " -from langgraph.graph import StateGraph, END -from typing import TypedDict - -class State(TypedDict): - value: str - -def node(state): - return {'value': 'ok'} - -g = StateGraph(State) -g.add_node('node', node) -g.set_entry_point('node') -g.add_edge('node', END) -app = g.compile() -print(app.invoke({'value': 'test'})) -" -``` - -## 已知问题 - -无 diff --git a/frameworks/langgraph/1.1.6/build.conf b/frameworks/langgraph/1.1.6/build.conf deleted file mode 100644 index a0042f6aa73be8f225798d71762d291fcb89866c..0000000000000000000000000000000000000000 --- a/frameworks/langgraph/1.1.6/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# langgraph 1.1.6 on OpenCloudOS 9 -IMAGE_NAME=oc9-langgraph -IMAGE_TAG=1.1.6 -GPU_TEST=false diff --git a/frameworks/langgraph/1.1.6/test.sh b/frameworks/langgraph/1.1.6/test.sh deleted file mode 100644 index b71d0ec098abfa78e5bab3bd53e47c893ab00b01..0000000000000000000000000000000000000000 --- a/frameworks/langgraph/1.1.6/test.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" - -echo "=== LangGraph 1.1.6 基础功能测试 ===" - -# 1. 验证 langgraph 可正常导入并检查版本 -echo -n "检查 import langgraph... " -sudo docker run --rm "$IMAGE" python3.11 -c " -import importlib.metadata -print(importlib.metadata.version('langgraph')) -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证 StateGraph 核心功能 -echo -n "检查 StateGraph 构建与执行... " -sudo docker run --rm "$IMAGE" python3.11 -c " -from langgraph.graph import StateGraph, END -from typing import TypedDict - -class State(TypedDict): - value: str - -def process(state): - return {'value': 'hello from langgraph'} - -graph = StateGraph(State) -graph.add_node('process', process) -graph.set_entry_point('process') -graph.add_edge('process', END) -app = graph.compile() - -result = app.invoke({'value': 'test'}) -assert result['value'] == 'hello from langgraph', f'期望 hello from langgraph,实际 {result[\"value\"]}' -print('StateGraph 执行正常') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 3. 验证条件边功能 -echo -n "检查条件边(conditional edges)... " -sudo docker run --rm "$IMAGE" python3.11 -c " -from langgraph.graph import StateGraph, END -from typing import TypedDict - -class State(TypedDict): - count: int - -def increment(state): - return {'count': state['count'] + 1} - -def should_stop(state): - if state['count'] >= 3: - return END - return 'increment' - -graph = StateGraph(State) -graph.add_node('increment', increment) -graph.set_entry_point('increment') -graph.add_conditional_edges('increment', should_stop) -app = graph.compile() - -result = app.invoke({'count': 0}) -assert result['count'] == 3, f'期望 count=3,实际 {result[\"count\"]}' -print('条件边执行正常') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" diff --git a/frameworks/llama.cpp/b8981/Dockerfile b/frameworks/llama.cpp/b8981/Dockerfile deleted file mode 100644 index 0f46be7e4e1b47f0d2db90257b5880962fe94476..0000000000000000000000000000000000000000 --- a/frameworks/llama.cpp/b8981/Dockerfile +++ /dev/null @@ -1,56 +0,0 @@ -# llama.cpp (GPU) on OpenCloudOS 9 -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="OpenCloudOS Community" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="llama.cpp b8981 (GPU/CUDA) on OpenCloudOS 9" - -# 安装编译工具和 Python 3.11 -RUN dnf install -y \ - cmake \ - gcc \ - gcc-c++ \ - git \ - python3.11 \ - python3.11-pip \ - make \ - && dnf clean all \ - && rm -rf /var/cache/yum/* \ - && ln -sf /usr/bin/python3.11 /usr/bin/python3 - -# 将 CUDA 工具链加入 PATH,确保 cmake 能找到 nvcc -ENV PATH="/usr/local/cuda/bin:${PATH}" - -# 显式指定 CUDA 目标架构(docker build 无 GPU,无法自动检测 native) -# 80=Ampere(A100), 86=Ampere(RTX30xx/A40), 89=Ada(RTX40xx/L4/L40), 90=Hopper(H100) -# GGML_CUDA_NO_VMM=ON: Docker 构建环境没有 libcuda.so.1(CUDA 驱动库), -# 禁用 VMM(虚拟内存管理)以避免链接错误,运行时由宿主机提供驱动库 -ENV CMAKE_CUDA_ARCHITECTURES="80;86;89;90" - -RUN git clone https://github.com/ggml-org/llama.cpp.git /opt/llama.cpp \ - && cd /opt/llama.cpp \ - && git checkout b8981 \ - && cmake -B build \ - -DGGML_CUDA=ON \ - -DGGML_CUDA_NO_VMM=ON \ - -DCMAKE_CUDA_ARCHITECTURES="80;86;89;90" \ - -DCMAKE_BUILD_TYPE=Release \ - && cmake --build build --config Release -j$(nproc) \ - && cmake --install build \ - && install -m 755 build/bin/llama-cli build/bin/llama-server /usr/local/bin/ \ - && ls -la /usr/local/bin/llama-* \ - && ldconfig \ - && rm -rf /opt/llama.cpp/build - -# 安装 Python binding(启用 CUDA,同样需要 NO_VMM) -# --timeout 120 增大超时,--retries 5 增加重试次数,避免网络波动导致构建失败 -RUN CMAKE_ARGS="-DGGML_CUDA=ON -DGGML_CUDA_NO_VMM=ON -DCMAKE_CUDA_ARCHITECTURES=80\;86\;89\;90" \ - python3.11 -m pip install --no-cache-dir --timeout 120 --retries 5 llama-cpp-python - -# 设置 GPU 环境变量 -ENV NVIDIA_VISIBLE_DEVICES=all -ENV PATH="/opt/llama.cpp:${PATH}" - -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -CMD ["python3.11"] \ No newline at end of file diff --git a/frameworks/llama.cpp/b8981/README.md b/frameworks/llama.cpp/b8981/README.md deleted file mode 100644 index defd43c9645425d0f0d1abc909faa42f6567b298..0000000000000000000000000000000000000000 --- a/frameworks/llama.cpp/b8981/README.md +++ /dev/null @@ -1,86 +0,0 @@ -# llama.cpp on OpenCloudOS 9 - -## 基本信息 -- **框架版本**:b8981 -- **开源地址**:[ggml-org/llama.cpp](https://github.com/ggml-org/llama.cpp) -- **基础镜像**:opencloudos/opencloudos9-cuda-devel:12.8 -- **Python 版本**:3.11 -- **CUDA 版本**:12.8 -- **编译选项**:GGML_CUDA=ON, CMAKE_CUDA_ARCHITECTURES=80;86;89;90 -- **支持 GPU 架构**:Ampere (sm_80/sm_86)、Ada Lovelace (sm_89)、Hopper (sm_90) - -## 构建 - -```bash -docker build -t oc9-llama-cpp:b8981 . -``` - -> 构建过程从源码编译 llama.cpp,需要较好的网络环境以拉取依赖,构建时间约 5-15 分钟。 - -## 使用示例 - -### 命令行推理(llama-cli) - -```bash -# 下载模型(示例:Qwen2.5-0.5B) -wget https://huggingface.co/Qwen/Qwen2.5-0.5B-Instruct-GGUF/resolve/main/qwen2.5-0.5b-instruct-q4_k_m.gguf -O /tmp/model.gguf - -# 运行推理 -docker run --rm --gpus all \ - -v /tmp/model.gguf:/models/model.gguf \ - oc9-llama-cpp:b8981 \ - llama-cli -m /models/model.gguf -p "你好,请介绍一下你自己" -n 256 -``` - -### API 服务(llama-server) - -```bash -# 启动推理服务 -docker run --rm --gpus all \ - -p 8080:8080 \ - -v /tmp/model.gguf:/models/model.gguf \ - oc9-llama-cpp:b8981 \ - llama-server -m /models/model.gguf --host 0.0.0.0 --port 8080 - -# 访问服务 -curl http://localhost:8080/v1/chat/completions \ - -H 'Content-Type: application/json' \ - -d '{ - "model": "model", - "messages": [{"role": "user", "content": "你好"}], - "max_tokens": 128 - }' -``` - -### Python 推理(llama-cpp-python) - -```bash -docker run --rm --gpus all \ - -v /tmp/model.gguf:/models/model.gguf \ - oc9-llama-cpp:b8981 \ - python3 -c " -from llama_cpp import Llama -llm = Llama(model_path='/models/model.gguf', n_gpu_layers=-1) -print(llm.create_chat_completion( - messages=[{'role': 'user', 'content': '你好'}], - max_tokens=128 -)) -" -``` - -## 测试验证 - -```bash -# 执行测试脚本(需要 GPU 环境) -bash test.sh oc9-llama-cpp:b8981 -``` - -测试脚本会验证以下内容: -- CUDA 环境是否可用 -- llama-cli 命令行工具是否可执行 -- llama-server 服务程序是否可执行 -- llama-cpp-python 绑定是否可正常导入 - -## 已知问题 -- 首次运行时需要提供 GGUF 格式的模型文件,建议提前下载并挂载到容器中。 -- 源码编译耗时较长,建议利用 Docker 层缓存加速重复构建。 diff --git a/frameworks/llama.cpp/b8981/build.conf b/frameworks/llama.cpp/b8981/build.conf deleted file mode 100644 index f64caa69ae897da74e5e08efae08d08bb25813a7..0000000000000000000000000000000000000000 --- a/frameworks/llama.cpp/b8981/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# llama.cpp b8981 on OpenCloudOS 9 (GPU/CUDA) -IMAGE_NAME=oc9-llama-cpp -IMAGE_TAG=b8981 -GPU_TEST=false diff --git a/frameworks/llama.cpp/b8981/test.sh b/frameworks/llama.cpp/b8981/test.sh deleted file mode 100755 index 232f8673d14bbc2de86a8a0d2716f829715888a9..0000000000000000000000000000000000000000 --- a/frameworks/llama.cpp/b8981/test.sh +++ /dev/null @@ -1,64 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" - -echo "=== llama.cpp GPU 镜像功能测试 ===" - -# 1. 验证 CUDA 环境 -echo -n "检查 CUDA... " -docker run --rm --gpus all "$IMAGE" python3 -c " -import subprocess -result = subprocess.run(['nvidia-smi'], capture_output=True, text=True) -assert result.returncode == 0, 'nvidia-smi failed' -print('CUDA driver OK') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证 llama-cli 可执行 -echo -n "检查 llama-cli... " -if ! docker run --rm --gpus all "$IMAGE" bash -c ' - if ! command -v llama-cli >/dev/null 2>&1; then - echo "llama-cli not found in PATH" - echo "PATH=$PATH" - ls -la /usr/local/bin/llama-* 2>/dev/null || true - exit 1 - fi - file "$(command -v llama-cli)" | grep -q "ELF" || { - echo "llama-cli is not a valid executable" - file "$(command -v llama-cli)" - exit 1 - } -'; then - echo "✗ 失败" - exit 1 -fi -echo "✓ 通过" - -# 3. 验证 llama-server 可执行 -echo -n "检查 llama-server... " -if ! docker run --rm --gpus all "$IMAGE" bash -c ' - if ! command -v llama-server >/dev/null 2>&1; then - echo "llama-server not found in PATH" - echo "PATH=$PATH" - ls -la /usr/local/bin/llama-* 2>/dev/null || true - exit 1 - fi - file "$(command -v llama-server)" | grep -q "ELF" || { - echo "llama-server is not a valid executable" - file "$(command -v llama-server)" - exit 1 - } -'; then - echo "✗ 失败" - exit 1 -fi -echo "✓ 通过" - -# 4. 验证 Python binding 导入 -echo -n "检查 llama-cpp-python import... " -docker run --rm --gpus all "$IMAGE" python3 -c " -from llama_cpp import Llama -print('llama-cpp-python 导入成功') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" diff --git "a/frameworks/llama_index/0.14.15/0.14.15\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276" "b/frameworks/llama_index/0.14.15/0.14.15\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276" deleted file mode 100644 index 12a3c0b943e5e604e012ee8e7729de703174ce99..0000000000000000000000000000000000000000 Binary files "a/frameworks/llama_index/0.14.15/0.14.15\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276" and /dev/null differ diff --git a/frameworks/llama_index/0.14.15/Dockerfile b/frameworks/llama_index/0.14.15/Dockerfile deleted file mode 100644 index 23b8e8434081f280f36072b877135edfe6038fda..0000000000000000000000000000000000000000 --- a/frameworks/llama_index/0.14.15/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ -FROM opencloudos/opencloudos9-minimal:latest - -LABEL maintainer="pangxb666" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="LlamaIndex 0.14.15 on OpenCloudOS 9" - -RUN dnf install -y \ - python3.11 \ - python3.11-pip \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -RUN pip3.11 install --no-cache-dir llama-index==0.14.15 llama-index-core==0.14.15 \ - -i https://pypi.tuna.tsinghua.edu.cn/simple \ - --trusted-host pypi.tuna.tsinghua.edu.cn - -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -CMD ["python3.11"] diff --git a/frameworks/llama_index/0.14.15/README.md b/frameworks/llama_index/0.14.15/README.md deleted file mode 100644 index 2d99e2d39e34f6865ddc182165293aee97da6e8b..0000000000000000000000000000000000000000 --- a/frameworks/llama_index/0.14.15/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# LlamaIndex 0.14.15 on OpenCloudOS 9 - -## 基本信息 - -- **框架版本**:0.14.15 -- **基础镜像**:opencloudos/opencloudos9-minimal:latest -- **Python 版本**:3.11 -- **CUDA 版本**:N/A -- **开源地址**:https://github.com/run-llama/llama_index - -## 简介 - -LlamaIndex 是一个面向 LLM 应用的数据框架,提供数据摄取、索引和查询等核心能力,帮助开发者快速构建基于私有数据的 RAG(检索增强生成)应用。 - -## 构建 - -```bash -docker build -t oc9-llama_index:0.14.15 . -``` - -## 使用示例 - -```bash -# 验证版本 -docker run --rm oc9-llama_index:0.14.15 python3.11 -c "import importlib.metadata; print(importlib.metadata.version('llama-index-core'))" - -# 运行基础测试 -docker run --rm oc9-llama_index:0.14.15 bash /test.sh -``` - -## 已知问题 - -无 diff --git a/frameworks/llama_index/0.14.15/build.conf b/frameworks/llama_index/0.14.15/build.conf deleted file mode 100644 index 760a744bec6101137face13d81fe7843568bc6e4..0000000000000000000000000000000000000000 --- a/frameworks/llama_index/0.14.15/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# llama_index 0.14.15 on OpenCloudOS 9 -IMAGE_NAME=oc9-llama-index -IMAGE_TAG=0.14.15 -GPU_TEST=false diff --git a/frameworks/llama_index/0.14.15/test.sh b/frameworks/llama_index/0.14.15/test.sh deleted file mode 100644 index cc0bb45bf4ae1db21f713aad9aaa0c56abaf46f7..0000000000000000000000000000000000000000 --- a/frameworks/llama_index/0.14.15/test.sh +++ /dev/null @@ -1,45 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" - -echo "=== LlamaIndex 0.14.15 基础功能测试 ===" - -# 1. 验证版本 -echo -n "检查 llama-index-core 版本... " -sudo docker run --rm "$IMAGE" python3.11 -c " -import importlib.metadata -version = importlib.metadata.version('llama-index-core') -print(version) -assert version == '0.14.15', f'期望 0.14.15,实际 {version}' -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证核心模块导入 -echo -n "检查 llama_index.core 导入... " -sudo docker run --rm "$IMAGE" python3.11 -c " -from llama_index.core import VectorStoreIndex, Document, Settings -print('核心模块导入正常') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 3. 验证 Document 创建 -echo -n "检查 Document 创建... " -sudo docker run --rm "$IMAGE" python3.11 -c " -from llama_index.core import Document -doc = Document(text='OpenCloudOS 9 LlamaIndex 测试文档') -assert doc.text == 'OpenCloudOS 9 LlamaIndex 测试文档' -print('Document 创建成功') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 4. 验证 Node 解析器 -echo -n "检查 SentenceSplitter... " -sudo docker run --rm "$IMAGE" python3.11 -c " -from llama_index.core.node_parser import SentenceSplitter -from llama_index.core import Document -splitter = SentenceSplitter(chunk_size=512, chunk_overlap=20) -doc = Document(text='LlamaIndex 是一个面向 LLM 应用的数据框架,提供数据摄取、索引和查询等核心能力。') -nodes = splitter.get_nodes_from_documents([doc]) -assert len(nodes) > 0 -print(f'节点数量: {len(nodes)}') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" diff --git "a/frameworks/llama_index/0.14.16/0.14.16\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276" "b/frameworks/llama_index/0.14.16/0.14.16\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276" deleted file mode 100644 index 640c46ddd9e16afd6a2b2f0fef2709ba90848bf6..0000000000000000000000000000000000000000 Binary files "a/frameworks/llama_index/0.14.16/0.14.16\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276" and /dev/null differ diff --git a/frameworks/llama_index/0.14.16/Dockerfile b/frameworks/llama_index/0.14.16/Dockerfile deleted file mode 100644 index 3b0b5c3f2cf849ec26cef0885643bc159e9d93e0..0000000000000000000000000000000000000000 --- a/frameworks/llama_index/0.14.16/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# 基础镜像:OpenCloudOS 9 极简版,适用于纯 Python / CPU 框架 -FROM opencloudos/opencloudos9-minimal:latest - -# 镜像元信息 -LABEL maintainer="pangxb666" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="LlamaIndex 0.14.16 on OpenCloudOS 9" - -# 安装 Python 3.11 及 pip,安装完成后清理缓存以减小镜像体积 -RUN dnf install -y \ - python3.11 \ - python3.11-pip \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 使用清华镜像源安装 LlamaIndex,加速国内网络下的依赖下载 -RUN pip3.11 install --no-cache-dir llama-index==0.14.16 llama-index-core==0.14.16 \ - -i https://pypi.tuna.tsinghua.edu.cn/simple \ - --trusted-host pypi.tuna.tsinghua.edu.cn - -# 记录镜像构建时间,便于追溯 -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -# 默认进入 Python 3.11 交互环境 -CMD ["python3.11"] diff --git a/frameworks/llama_index/0.14.16/README.md b/frameworks/llama_index/0.14.16/README.md deleted file mode 100644 index 2730db9dd80c5dc779c064fd4b6bd7821c3bb0c2..0000000000000000000000000000000000000000 --- a/frameworks/llama_index/0.14.16/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# LlamaIndex 0.14.16 on OpenCloudOS 9 - -## 基本信息 - -- **框架版本**:0.14.16 -- **基础镜像**:opencloudos/opencloudos9-minimal:latest -- **Python 版本**:3.11 -- **CUDA 版本**:N/A -- **开源地址**:https://github.com/run-llama/llama_index - -## 简介 - -LlamaIndex 是一个用于构建 LLM 驱动应用的数据框架,提供数据摄取、索引、查询等核心能力,支持 RAG(检索增强生成)等场景。 - -## 构建 - -```bash -docker build -t oc9-llama_index:0.14.16 . -``` - -## 使用示例 - -```bash -# 验证版本 -docker run --rm oc9-llama_index:0.14.16 python3.11 -c "import importlib.metadata; print(importlib.metadata.version('llama-index'))" - -# 运行基础测试 -docker run --rm oc9-llama_index:0.14.16 bash /test.sh -``` - -## 已知问题 - -无 diff --git a/frameworks/llama_index/0.14.16/build.conf b/frameworks/llama_index/0.14.16/build.conf deleted file mode 100644 index 4cd74afdc9d7c6ccd3198e9389e7fc8c9b398111..0000000000000000000000000000000000000000 --- a/frameworks/llama_index/0.14.16/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# llama_index 0.14.16 on OpenCloudOS 9 -IMAGE_NAME=oc9-llama-index -IMAGE_TAG=0.14.16 -GPU_TEST=false diff --git a/frameworks/llama_index/0.14.16/test.sh b/frameworks/llama_index/0.14.16/test.sh deleted file mode 100644 index adabffcfc549674d3f50ded34f6693e7a0ad09a1..0000000000000000000000000000000000000000 --- a/frameworks/llama_index/0.14.16/test.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" - -echo "=== LlamaIndex 0.14.16 基础功能测试 ===" - -# 1. 验证 llama-index 可正常导入并检查版本 -echo -n "检查 import llama_index... " -sudo docker run --rm "$IMAGE" python3.11 -c " -import importlib.metadata -print(importlib.metadata.version('llama-index-core')) -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证 Document 核心对象创建 -echo -n "检查 Document 对象创建... " -sudo docker run --rm "$IMAGE" python3.11 -c " -from llama_index.core import Document - -doc = Document(text='LlamaIndex 是一个用于 LLM 应用的数据框架') -assert doc.text == 'LlamaIndex 是一个用于 LLM 应用的数据框架' -assert doc.doc_id is not None -print(f'Document 创建成功,id={doc.doc_id[:8]}...') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 3. 验证 SentenceSplitter 文本分割 -echo -n "检查 SentenceSplitter 文本分割... " -sudo docker run --rm "$IMAGE" python3.11 -c " -from llama_index.core.node_parser import SentenceSplitter -from llama_index.core import Document - -splitter = SentenceSplitter(chunk_size=100, chunk_overlap=10) -doc = Document(text='This is a test sentence. ' * 20) -nodes = splitter.get_nodes_from_documents([doc]) -assert len(nodes) > 0, '文本分割应产生至少一个节点' -print(f'分割产生 {len(nodes)} 个节点') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" diff --git "a/frameworks/llama_index/0.14.18/0.14.18\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276" "b/frameworks/llama_index/0.14.18/0.14.18\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276" deleted file mode 100644 index 67425a5e30e64d37ccf4d0298861ac57ec5c1c19..0000000000000000000000000000000000000000 Binary files "a/frameworks/llama_index/0.14.18/0.14.18\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276" and /dev/null differ diff --git a/frameworks/llama_index/0.14.18/Dockerfile b/frameworks/llama_index/0.14.18/Dockerfile deleted file mode 100644 index 1f068cc16885d8384ad57388914c70b29349fac5..0000000000000000000000000000000000000000 --- a/frameworks/llama_index/0.14.18/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# 基础镜像:OpenCloudOS 9 极简版,适用于纯 Python / CPU 框架 -FROM opencloudos/opencloudos9-minimal:latest - -# 镜像元信息 -LABEL maintainer="pangxb666" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="LlamaIndex 0.14.18 on OpenCloudOS 9" - -# 安装 Python 3.11 及 pip,安装完成后清理缓存以减小镜像体积 -RUN dnf install -y \ - python3.11 \ - python3.11-pip \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 使用清华镜像源安装 LlamaIndex,加速国内网络下的依赖下载 -RUN pip3.11 install --no-cache-dir llama-index==0.14.18 llama-index-core==0.14.18 \ - -i https://pypi.tuna.tsinghua.edu.cn/simple \ - --trusted-host pypi.tuna.tsinghua.edu.cn - -# 记录镜像构建时间,便于追溯 -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -# 默认进入 Python 3.11 交互环境 -CMD ["python3.11"] diff --git a/frameworks/llama_index/0.14.18/README.md b/frameworks/llama_index/0.14.18/README.md deleted file mode 100644 index 1d65d051db5cf8434168d87a350332ec6f7b11e0..0000000000000000000000000000000000000000 --- a/frameworks/llama_index/0.14.18/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# LlamaIndex 0.14.18 on OpenCloudOS 9 - -## 基本信息 - -- **框架版本**:0.14.18 -- **基础镜像**:opencloudos/opencloudos9-minimal:latest -- **Python 版本**:3.11 -- **CUDA 版本**:N/A -- **开源地址**:https://github.com/run-llama/llama_index - -## 简介 - -LlamaIndex 是一个用于构建 LLM 驱动应用的数据框架,提供数据摄取、索引、查询等核心能力,支持 RAG(检索增强生成)等场景。 - -## 构建 - -```bash -docker build -t oc9-llama_index:0.14.18 . -``` - -## 使用示例 - -```bash -# 验证版本 -docker run --rm oc9-llama_index:0.14.18 python3.11 -c "import importlib.metadata; print(importlib.metadata.version('llama-index'))" - -# 运行基础测试 -docker run --rm oc9-llama_index:0.14.18 bash /test.sh -``` - -## 已知问题 - -无 diff --git a/frameworks/llama_index/0.14.18/build.conf b/frameworks/llama_index/0.14.18/build.conf deleted file mode 100644 index 6110ae35adac97801ecaf7885c2f389a0bba8794..0000000000000000000000000000000000000000 --- a/frameworks/llama_index/0.14.18/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# llama_index 0.14.18 on OpenCloudOS 9 -IMAGE_NAME=oc9-llama-index -IMAGE_TAG=0.14.18 -GPU_TEST=false diff --git a/frameworks/llama_index/0.14.18/test.sh b/frameworks/llama_index/0.14.18/test.sh deleted file mode 100644 index 1270c95c3bf2ecc0f1792af269e001b44602d21a..0000000000000000000000000000000000000000 --- a/frameworks/llama_index/0.14.18/test.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" - -echo "=== LlamaIndex 0.14.18 基础功能测试 ===" - -# 1. 验证 llama-index 可正常导入并检查版本 -echo -n "检查 import llama_index... " -sudo docker run --rm "$IMAGE" python3.11 -c " -import importlib.metadata -print(importlib.metadata.version('llama-index-core')) -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证 Document 核心对象创建 -echo -n "检查 Document 对象创建... " -sudo docker run --rm "$IMAGE" python3.11 -c " -from llama_index.core import Document - -doc = Document(text='LlamaIndex 是一个用于 LLM 应用的数据框架') -assert doc.text == 'LlamaIndex 是一个用于 LLM 应用的数据框架' -assert doc.doc_id is not None -print(f'Document 创建成功,id={doc.doc_id[:8]}...') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 3. 验证 SentenceSplitter 文本分割 -echo -n "检查 SentenceSplitter 文本分割... " -sudo docker run --rm "$IMAGE" python3.11 -c " -from llama_index.core.node_parser import SentenceSplitter -from llama_index.core import Document - -splitter = SentenceSplitter(chunk_size=100, chunk_overlap=10) -doc = Document(text='This is a test sentence. ' * 20) -nodes = splitter.get_nodes_from_documents([doc]) -assert len(nodes) > 0, '文本分割应产生至少一个节点' -print(f'分割产生 {len(nodes)} 个节点') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" diff --git "a/frameworks/llama_index/0.14.19/0.14.19\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276" "b/frameworks/llama_index/0.14.19/0.14.19\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276" deleted file mode 100644 index dbb774a7ae3776f50b665ba49950246ed8e1b2b2..0000000000000000000000000000000000000000 Binary files "a/frameworks/llama_index/0.14.19/0.14.19\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276" and /dev/null differ diff --git a/frameworks/llama_index/0.14.19/Dockerfile b/frameworks/llama_index/0.14.19/Dockerfile deleted file mode 100644 index 0ca2c99267589a5d3cfa276a3936c9f2ffcb10c4..0000000000000000000000000000000000000000 --- a/frameworks/llama_index/0.14.19/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# 基础镜像:OpenCloudOS 9 极简版,适用于纯 Python / CPU 框架 -FROM opencloudos/opencloudos9-minimal:latest - -# 镜像元信息 -LABEL maintainer="pangxb666" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="LlamaIndex 0.14.19 on OpenCloudOS 9" - -# 安装 Python 3.11 及 pip,安装完成后清理缓存以减小镜像体积 -RUN dnf install -y \ - python3.11 \ - python3.11-pip \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 使用清华镜像源安装 LlamaIndex,加速国内网络下的依赖下载 -RUN pip3.11 install --no-cache-dir llama-index==0.14.19 llama-index-core==0.14.19 \ - -i https://pypi.tuna.tsinghua.edu.cn/simple \ - --trusted-host pypi.tuna.tsinghua.edu.cn - -# 记录镜像构建时间,便于追溯 -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -# 默认进入 Python 3.11 交互环境 -CMD ["python3.11"] diff --git a/frameworks/llama_index/0.14.19/README.md b/frameworks/llama_index/0.14.19/README.md deleted file mode 100644 index 7ff1615aa1beafb139d364c48d833cc831095819..0000000000000000000000000000000000000000 --- a/frameworks/llama_index/0.14.19/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# LlamaIndex 0.14.19 on OpenCloudOS 9 - -## 基本信息 - -- **框架版本**:0.14.19 -- **基础镜像**:opencloudos/opencloudos9-minimal:latest -- **Python 版本**:3.11 -- **CUDA 版本**:N/A -- **开源地址**:https://github.com/run-llama/llama_index - -## 简介 - -LlamaIndex 是一个用于构建 LLM 驱动应用的数据框架,提供数据摄取、索引、查询等核心能力,支持 RAG(检索增强生成)等场景。 - -## 构建 - -```bash -docker build -t oc9-llama_index:0.14.19 . -``` - -## 使用示例 - -```bash -# 验证版本 -docker run --rm oc9-llama_index:0.14.19 python3.11 -c "import importlib.metadata; print(importlib.metadata.version('llama-index'))" - -# 运行基础测试 -docker run --rm oc9-llama_index:0.14.19 bash /test.sh -``` - -## 已知问题 - -无 diff --git a/frameworks/llama_index/0.14.19/build.conf b/frameworks/llama_index/0.14.19/build.conf deleted file mode 100644 index 6968592d9969657f2137b7662d947e4e8711b907..0000000000000000000000000000000000000000 --- a/frameworks/llama_index/0.14.19/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# llama_index 0.14.19 on OpenCloudOS 9 -IMAGE_NAME=oc9-llama-index -IMAGE_TAG=0.14.19 -GPU_TEST=false diff --git a/frameworks/llama_index/0.14.19/test.sh b/frameworks/llama_index/0.14.19/test.sh deleted file mode 100644 index 56b8bc241cba560667b696861dce0efab2ad28cb..0000000000000000000000000000000000000000 --- a/frameworks/llama_index/0.14.19/test.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" - -echo "=== LlamaIndex 0.14.19 基础功能测试 ===" - -# 1. 验证 llama-index 可正常导入并检查版本 -echo -n "检查 import llama_index... " -sudo docker run --rm "$IMAGE" python3.11 -c " -import importlib.metadata -print(importlib.metadata.version('llama-index-core')) -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证 Document 核心对象创建 -echo -n "检查 Document 对象创建... " -sudo docker run --rm "$IMAGE" python3.11 -c " -from llama_index.core import Document - -doc = Document(text='LlamaIndex 是一个用于 LLM 应用的数据框架') -assert doc.text == 'LlamaIndex 是一个用于 LLM 应用的数据框架' -assert doc.doc_id is not None -print(f'Document 创建成功,id={doc.doc_id[:8]}...') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 3. 验证 SentenceSplitter 文本分割 -echo -n "检查 SentenceSplitter 文本分割... " -sudo docker run --rm "$IMAGE" python3.11 -c " -from llama_index.core.node_parser import SentenceSplitter -from llama_index.core import Document - -splitter = SentenceSplitter(chunk_size=100, chunk_overlap=10) -doc = Document(text='This is a test sentence. ' * 20) -nodes = splitter.get_nodes_from_documents([doc]) -assert len(nodes) > 0, '文本分割应产生至少一个节点' -print(f'分割产生 {len(nodes)} 个节点') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" diff --git "a/frameworks/llama_index/0.14.20/0.14.20\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276" "b/frameworks/llama_index/0.14.20/0.14.20\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276" deleted file mode 100644 index 9a3d3496b4f7b6cd34a5386f8f4a1c0ac4d7e23a..0000000000000000000000000000000000000000 Binary files "a/frameworks/llama_index/0.14.20/0.14.20\346\265\213\350\257\225\347\273\223\346\236\234\346\210\252\345\233\276" and /dev/null differ diff --git a/frameworks/llama_index/0.14.20/Dockerfile b/frameworks/llama_index/0.14.20/Dockerfile deleted file mode 100644 index 629348d6e3ab5f68a8c9df42b114ad0878053799..0000000000000000000000000000000000000000 --- a/frameworks/llama_index/0.14.20/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# 基础镜像:OpenCloudOS 9 极简版,适用于纯 Python / CPU 框架 -FROM opencloudos/opencloudos9-minimal:latest - -# 镜像元信息 -LABEL maintainer="pangxb666" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="LlamaIndex 0.14.20 on OpenCloudOS 9" - -# 安装 Python 3.11 及 pip,安装完成后清理缓存以减小镜像体积 -RUN dnf install -y \ - python3.11 \ - python3.11-pip \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 使用清华镜像源安装 LlamaIndex,加速国内网络下的依赖下载 -RUN pip3.11 install --no-cache-dir llama-index==0.14.20 llama-index-core==0.14.20 \ - -i https://pypi.tuna.tsinghua.edu.cn/simple \ - --trusted-host pypi.tuna.tsinghua.edu.cn - -# 记录镜像构建时间,便于追溯 -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -# 默认进入 Python 3.11 交互环境 -CMD ["python3.11"] diff --git a/frameworks/llama_index/0.14.20/README.md b/frameworks/llama_index/0.14.20/README.md deleted file mode 100644 index e1b3e17a91cb97c1a43c0270431b834f10c99d94..0000000000000000000000000000000000000000 --- a/frameworks/llama_index/0.14.20/README.md +++ /dev/null @@ -1,33 +0,0 @@ -# LlamaIndex 0.14.20 on OpenCloudOS 9 - -## 基本信息 - -- **框架版本**:0.14.20 -- **基础镜像**:opencloudos/opencloudos9-minimal:latest -- **Python 版本**:3.11 -- **CUDA 版本**:N/A -- **开源地址**:https://github.com/run-llama/llama_index - -## 简介 - -LlamaIndex 是一个用于构建 LLM 驱动应用的数据框架,提供数据摄取、索引、查询等核心能力,支持 RAG(检索增强生成)等场景。 - -## 构建 - -```bash -docker build -t oc9-llama_index:0.14.20 . -``` - -## 使用示例 - -```bash -# 验证版本 -docker run --rm oc9-llama_index:0.14.20 python3.11 -c "import importlib.metadata; print(importlib.metadata.version('llama-index'))" - -# 运行基础测试 -docker run --rm oc9-llama_index:0.14.20 bash /test.sh -``` - -## 已知问题 - -无 diff --git a/frameworks/llama_index/0.14.20/build.conf b/frameworks/llama_index/0.14.20/build.conf deleted file mode 100644 index a4ed93cfae99a60dfabb5ad2e4707dd528a7ba40..0000000000000000000000000000000000000000 --- a/frameworks/llama_index/0.14.20/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# llama_index 0.14.20 on OpenCloudOS 9 -IMAGE_NAME=oc9-llama-index -IMAGE_TAG=0.14.20 -GPU_TEST=false diff --git a/frameworks/llama_index/0.14.20/test.sh b/frameworks/llama_index/0.14.20/test.sh deleted file mode 100644 index ac8feeda39b5735e425868eee35f379695d6dd08..0000000000000000000000000000000000000000 --- a/frameworks/llama_index/0.14.20/test.sh +++ /dev/null @@ -1,39 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" - -echo "=== LlamaIndex 0.14.20 基础功能测试 ===" - -# 1. 验证 llama-index 可正常导入并检查版本 -echo -n "检查 import llama_index... " -sudo docker run --rm "$IMAGE" python3.11 -c " -import importlib.metadata -print(importlib.metadata.version('llama-index-core')) -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证 Document 核心对象创建 -echo -n "检查 Document 对象创建... " -sudo docker run --rm "$IMAGE" python3.11 -c " -from llama_index.core import Document - -doc = Document(text='LlamaIndex 是一个用于 LLM 应用的数据框架') -assert doc.text == 'LlamaIndex 是一个用于 LLM 应用的数据框架' -assert doc.doc_id is not None -print(f'Document 创建成功,id={doc.doc_id[:8]}...') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 3. 验证 SentenceSplitter 文本分割 -echo -n "检查 SentenceSplitter 文本分割... " -sudo docker run --rm "$IMAGE" python3.11 -c " -from llama_index.core.node_parser import SentenceSplitter -from llama_index.core import Document - -splitter = SentenceSplitter(chunk_size=100, chunk_overlap=10) -doc = Document(text='This is a test sentence. ' * 20) -nodes = splitter.get_nodes_from_documents([doc]) -assert len(nodes) > 0, '文本分割应产生至少一个节点' -print(f'分割产生 {len(nodes)} 个节点') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" diff --git a/frameworks/llamafactory/0.9.2/Dockerfile b/frameworks/llamafactory/0.9.2/Dockerfile deleted file mode 100644 index d133396378ca1068d21f8da481c981f6646cd441..0000000000000000000000000000000000000000 --- a/frameworks/llamafactory/0.9.2/Dockerfile +++ /dev/null @@ -1,82 +0,0 @@ -# syntax=docker/dockerfile:1.6 -# -# Dockerfile for LLaMA-Factory 0.9.2 -# -------------------------------------------------------------------- -# Base image: OpenCloudOS 9 (RHEL 9 compatible) + CUDA 12.8 devel -# Python : 3.11 (pre-installed in the base image) -# PyTorch : 2.6.0 + cu128 (matches LLaMA-Factory 0.9.2 requirements) -# -------------------------------------------------------------------- - -ARG CUDA_IMAGE=opencloudos/opencloudos9-cuda-devel:12.8 -FROM ${CUDA_IMAGE} AS base - -LABEL maintainer="harrywu0913" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="LLaMA-Factory (GPU) on OpenCloudOS 9" - -# ---- Build-time arguments (override with --build-arg) -------------- -ARG LLAMA_FACTORY_VERSION=0.9.2 -ARG TORCH_VERSION=2.11.0 -ARG TORCH_CUDA=cu128 -ARG PYTHON_VERSION=3.11 -ARG APP_USER=llama -ARG APP_UID=1000 -ARG APP_GID=1000 - -# ---- Runtime environment ------------------------------------------ -ENV LANG=C.UTF-8 \ - LC_ALL=C.UTF-8 \ - PYTHONDONTWRITEBYTECODE=1 \ - PYTHONUNBUFFERED=1 \ - PIP_NO_CACHE_DIR=1 \ - PIP_DISABLE_PIP_VERSION_CHECK=1 \ - HF_HOME=/workspace/.cache/huggingface \ - TRANSFORMERS_CACHE=/workspace/.cache/huggingface/transformers \ - TORCH_HOME=/workspace/.cache/torch \ - NVIDIA_VISIBLE_DEVICES=all \ - NVIDIA_DRIVER_CAPABILITIES=compute,utility - -# ---- System packages ---------------------------------------------- -# The base image (OpenCloudOS 9) already ships Python 3.11 and pip3, -# so we only install the build toolchain, VCS, and init helper via dnf. -# `tini` lives in EPEL on EL9, so we enable epel-release first. -RUN dnf install -y --setopt=install_weak_deps=False \ - git \ - curl \ - ca-certificates \ - tini \ - && ln -sf /usr/bin/python${PYTHON_VERSION} /usr/bin/python \ - && dnf clean all \ - && rm -rf /var/cache/dnf - -# ---- Non-root user ------------------------------------------------- -RUN groupadd --gid ${APP_GID} ${APP_USER} \ - && useradd --uid ${APP_UID} --gid ${APP_GID} --create-home --shell /bin/bash ${APP_USER} \ - && mkdir -p /workspace /workspace/.cache \ - && chown -R ${APP_USER}:${APP_USER} /workspace - -WORKDIR /workspace - -RUN python -m pip install --no-cache-dir\ - --index-url https://download.pytorch.org/whl/${TORCH_CUDA} \ - torch==${TORCH_VERSION} - -# Install LLaMA-Factory with the common extras: -# torch - torch-related metrics -# metrics - rouge/bleu/etc. -RUN python -m pip install --no-cache-dir\ - pydantic==2.10.6 \ - llamafactory[torch,metrics]==${LLAMA_FACTORY_VERSION} - -# ---- Final wiring -------------------------------------------------- -USER ${APP_USER} -ENV PATH="/home/${APP_USER}/.local/bin:${PATH}" - -# Healthcheck: import the library; fails fast if the install broke. -HEALTHCHECK --interval=30s --timeout=10s --start-period=20s --retries=3 \ - CMD python -c "import llamafactory; print(llamafactory.__version__)" || exit 1 - -# tini as PID 1 to reap zombies and forward signals cleanly. -ENTRYPOINT ["/usr/bin/tini", "--"] -CMD ["llamafactory-cli", "help"] - diff --git a/frameworks/llamafactory/0.9.2/README.md b/frameworks/llamafactory/0.9.2/README.md deleted file mode 100644 index 23a11a07161129f247efc2ae3444f9acd6c0be2a..0000000000000000000000000000000000000000 --- a/frameworks/llamafactory/0.9.2/README.md +++ /dev/null @@ -1,43 +0,0 @@ -# LLaMA-Factory on OpenCloudOS 9 - -## 基本信息 -- **框架版本**:v0.9.2 -- **基础镜像**:opencloudos/opencloudos9-cuda-devel:12.8 -- **Python 版本**:3.11 -- **CUDA 版本**:12.8 - -## 构建 - -```bash -docker build -t oc9-llamafactory:0.9.2 . -``` - -## 使用示例 - -```bash -docker run --rm oc9-llamafactory:0.9.2 \ - python -c "import llamafactory; print(llamafactory.__version__)" -``` - -启动 WebUI(需要 GPU): - -```bash -docker run --rm --gpus all -p 7860:7860 \ - -v "$PWD/data:/workspace/data" \ - -v "$PWD/output:/workspace/output" \ - -e GRADIO_SERVER_NAME=0.0.0.0 \ - -e HF_TOKEN="${HF_TOKEN}" \ - oc9-llamafactory:0.9.2 \ - llamafactory-cli webui -``` - -构建后验证: - -```bash -chmod +x test.sh -./test.sh "oc9-llamafactory:0.9.2" -``` - -成功运行截图见 `screenshots/test-success.png`。 - - diff --git a/frameworks/llamafactory/0.9.2/build.conf b/frameworks/llamafactory/0.9.2/build.conf deleted file mode 100644 index 0ed8a0da45d6581570d7e1efeded6153bac9ae95..0000000000000000000000000000000000000000 --- a/frameworks/llamafactory/0.9.2/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# Llama-Factory 0.9.2 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-llamafactory -IMAGE_TAG=0.9.2 -GPU_TEST=true \ No newline at end of file diff --git a/frameworks/llamafactory/0.9.2/test-success.png b/frameworks/llamafactory/0.9.2/test-success.png deleted file mode 100644 index 461b8f057cb245ac14885912ed9714d2468df645..0000000000000000000000000000000000000000 Binary files a/frameworks/llamafactory/0.9.2/test-success.png and /dev/null differ diff --git a/frameworks/llamafactory/0.9.2/test.sh b/frameworks/llamafactory/0.9.2/test.sh deleted file mode 100755 index dd7dee1829e0a1ad6b90cff1da24c8cf6989f2ac..0000000000000000000000000000000000000000 --- a/frameworks/llamafactory/0.9.2/test.sh +++ /dev/null @@ -1,90 +0,0 @@ -#!/bin/bash -# --------------------------------------------------------------- -# test.sh - Post-build verification for oc9-llamafactory:0.9.2 -# -# Usage: -# ./test.sh [IMAGE_TAG] -# -# Exit code: 0 on success, non-zero on any failed check. -# --------------------------------------------------------------- -set -euo pipefail - -IMAGE="${1:-oc9-llamafactory:0.9.2}" -EXPECTED_LF_VERSION="0.9.2" -EXPECTED_TORCH_MAJOR="2" - -pass() { printf " \033[32m[✓ PASS]\033[0m %s\n" "$1"; } -fail() { printf " \033[31m[✗ FAIL]\033[0m %s\n" "$1"; exit 1; } -info() { printf "\033[34m==>\033[0m %s\n" "$1"; } - -# --- 0. Prerequisites ------------------------------------------ -info "Checking prerequisites" -command -v docker >/dev/null 2>&1 || fail "docker is not installed" -pass "docker binary found: $(docker --version)" - -# --- 1. Image exists ------------------------------------------- -info "Checking image '${IMAGE}' exists" -if ! docker image inspect "${IMAGE}" >/dev/null 2>&1; then - fail "image '${IMAGE}' not found. Build it first: docker build -t ${IMAGE} ." -fi -pass "image is present locally" - -# Detect whether the host exposes a GPU to Docker. -GPU_FLAG="" -if docker run --rm --gpus all "${IMAGE}" true >/dev/null 2>&1; then - GPU_FLAG="--gpus all" - info "GPU detected - running full test matrix" -else - info "No GPU available - running CPU-only subset" -fi - -# --- 2. Python & framework versions ---------------------------- -info "Verifying Python / PyTorch / LLaMA-Factory versions" -VERS_OUTPUT="$(docker run --rm -i ${GPU_FLAG} "${IMAGE}" python - <<'PY' -import sys, torch, llamafactory -print(f"python={sys.version.split()[0]}") -print(f"torch={torch.__version__}") -print(f"llamafactory={llamafactory.__version__}") -print(f"cuda_available={torch.cuda.is_available()}") -PY -)" -echo "${VERS_OUTPUT}" | sed 's/^/ /' - -echo "${VERS_OUTPUT}" | grep -q "^python=3\.11" \ - && pass "python 3.11 OK" \ - || fail "unexpected python version" - -echo "${VERS_OUTPUT}" | grep -q "^torch=${EXPECTED_TORCH_MAJOR}\." \ - && pass "torch ${EXPECTED_TORCH_MAJOR}.x OK" \ - || fail "unexpected torch version" - -echo "${VERS_OUTPUT}" | grep -q "^llamafactory=${EXPECTED_LF_VERSION}" \ - && pass "llamafactory ${EXPECTED_LF_VERSION} OK" \ - || fail "unexpected llamafactory version" - -# --- 3. CUDA visibility (GPU hosts only) ----------------------- -if [[ -n "${GPU_FLAG}" ]]; then - info "Verifying CUDA is visible to PyTorch" - echo "${VERS_OUTPUT}" | grep -q "^cuda_available=True" \ - && pass "torch.cuda.is_available() == True" \ - || fail "CUDA not visible inside container" -fi - -# --- 4. CLI smoke test ----------------------------------------- -info "Running 'llamafactory-cli help'" -if docker run --rm ${GPU_FLAG} "${IMAGE}" llamafactory-cli help >/dev/null 2>&1; then - pass "llamafactory-cli help exited 0" -else - fail "llamafactory-cli help failed" -fi - -# --- 5. Non-root user ------------------------------------------ -info "Verifying the container runs as non-root" -WHOAMI="$(docker run --rm ${GPU_FLAG} "${IMAGE}" whoami)" -[[ "${WHOAMI}" == "llama" ]] \ - && pass "runtime user is '${WHOAMI}'" \ - || fail "expected 'llama', got '${WHOAMI}'" - - -printf "\n\033[32mAll checks passed for %s\033[0m\n" "${IMAGE}" - diff --git a/frameworks/maxkb/2.5.0/Dockerfile b/frameworks/maxkb/2.5.0/Dockerfile deleted file mode 100644 index 38d7211b19c377ff4893844c5996060edc3aaeea..0000000000000000000000000000000000000000 --- a/frameworks/maxkb/2.5.0/Dockerfile +++ /dev/null @@ -1,106 +0,0 @@ -# MaxKB v2.5.0 on OpenCloudOS 9 -# 基于 https://github.com/1Panel-dev/MaxKB/tree/v2.5.0/installer/Dockerfile -# 适配修改:基础镜像更换为 opencloudos9-minimal,PostgreSQL/Redis 改为外部服务 - -# ========== Stage 1: Source Clone ========== -FROM opencloudos/opencloudos9-minimal:latest AS src - -RUN dnf install -y git \ - && dnf clean all && rm -rf /var/cache/yum/* - -RUN git clone --depth 1 --branch v2.5.0 \ - https://github.com/1Panel-dev/MaxKB.git /src - -# ========== Stage 2: Frontend Build ========== -FROM node:24-alpine AS web-build -COPY --from=src /src/ui ui -RUN cd ui && ls -la && if [ -d "dist" ]; then exit 0; fi && \ - npm install --prefer-offline --no-audit && \ - npm install -D concurrently && \ - NODE_OPTIONS="--max-old-space-size=4096" npx concurrently "npm run build" "npm run build-chat" && \ - find . -maxdepth 1 ! -name '.' ! -name 'dist' ! -name 'public' -exec rm -rf {} + - -# ========== Stage 3: Application Build ========== -FROM opencloudos/opencloudos9-minimal:latest AS stage-build - -COPY --from=src /src /opt/maxkb-app - -RUN dnf install -y \ - gcc gcc-c++ gettext libffi-devel python3.11 python3.11-pip \ - && dnf clean all && rm -rf /var/cache/yum/* \ - && ln -sf /usr/bin/python3.11 /usr/bin/python3 \ - && python3.11 -m venv /opt/py3 - -ENV PATH=/opt/py3/bin:$PATH - -WORKDIR /opt/maxkb-app -# 构建阶段设置 MAXKB_CONFIG_TYPE=ENV,使 Django 加载配置走环境变量而非 YAML 文件 -# (/opt/maxkb/conf/config.yml 在构建时不存在,走 YAML 路径会 ImportError) -ENV MAXKB_CONFIG_TYPE=ENV -RUN mkdir -p /opt/maxkb-app/sandbox/lib && \ - gcc -shared -fPIC -o /opt/maxkb-app/sandbox/lib/sandbox.so /opt/maxkb-app/installer/sandbox.c -ldl && \ - rm -rf /opt/maxkb-app/ui && \ - pip install uv && \ - python -m uv pip install -r pyproject.toml && \ - find /opt/maxkb-app -depth \( -name ".git*" -o -name ".docker*" -o -name ".idea*" \ - -o -name ".editorconfig*" -o -name ".prettierrc*" -o -name "README.md" \ - -o -name "poetry.lock" -o -name "pyproject.toml" \) -exec rm -rf {} + && \ - python /opt/maxkb-app/apps/manage.py compilemessages && \ - PIP_TARGET=/opt/maxkb-app/sandbox/python-packages && \ - python -m uv pip install --target=$PIP_TARGET requests pymysql psycopg2-binary && \ - rm -rf /opt/maxkb-app/installer - -COPY --from=web-build --chown=root:root ui /opt/maxkb-app/ui - -# ========== Stage 4: Runtime ========== -FROM opencloudos/opencloudos9-minimal:latest - -LABEL maintainer="OpenCloudOS Community" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="MaxKB v2.5.0 on OpenCloudOS 9" - -ARG DOCKER_IMAGE_TAG=2.5.0 - -RUN dnf install -y \ - curl ca-certificates python3.11 \ - && dnf clean all && rm -rf /var/cache/yum/* \ - && update-ca-trust \ - && ln -sf /usr/bin/python3.11 /usr/bin/python3 - -ENV PATH=/opt/py3/bin:$PATH \ - LANG=en_US.UTF-8 \ - PYTHONUNBUFFERED=1 \ - TZ=Asia/Shanghai \ - MAXKB_VERSION="${DOCKER_IMAGE_TAG}" \ - MAXKB_DB_NAME=maxkb \ - MAXKB_DB_HOST=127.0.0.1 \ - MAXKB_DB_PORT=5432 \ - MAXKB_DB_USER=root \ - MAXKB_DB_PASSWORD=Password123@postgres \ - MAXKB_DB_MAX_OVERFLOW=80 \ - MAXKB_REDIS_HOST=127.0.0.1 \ - MAXKB_REDIS_PORT=6379 \ - MAXKB_REDIS_DB=0 \ - MAXKB_REDIS_PASSWORD=Password123@redis \ - MAXKB_EMBEDDING_MODEL_PATH=/opt/maxkb-app/model/embedding \ - MAXKB_EMBEDDING_MODEL_NAME=/opt/maxkb-app/model/embedding/shibing624_text2vec-base-chinese \ - MAXKB_LOCAL_MODEL_HOST=127.0.0.1 \ - MAXKB_LOCAL_MODEL_PORT=11636 \ - MAXKB_LOCAL_MODEL_PROTOCOL=http \ - PIP_TARGET=/opt/maxkb/python-packages \ - MAXKB_CONFIG_TYPE=ENV \ - MAXKB_LOG_LEVEL=INFO \ - MAXKB_SANDBOX=1 \ - MAXKB_SANDBOX_HOME=/opt/maxkb-app/sandbox \ - MAXKB_SANDBOX_PYTHON_PACKAGE_PATHS="/opt/py3/lib/python3.11/site-packages,/opt/maxkb-app/sandbox/python-packages,/opt/maxkb/python-packages" \ - MAXKB_ADMIN_PATH=/admin - -WORKDIR /opt/maxkb-app -COPY --from=stage-build /opt/maxkb-app /opt/maxkb-app -COPY --from=stage-build /opt/py3 /opt/py3 - -EXPOSE 8080 -VOLUME /opt/maxkb - -ENTRYPOINT ["python", "/opt/maxkb-app/main.py"] -CMD ["start"] \ No newline at end of file diff --git a/frameworks/maxkb/2.5.0/README.md b/frameworks/maxkb/2.5.0/README.md deleted file mode 100644 index 057e7801dbe1314a3a35eb3e6286f501551ef270..0000000000000000000000000000000000000000 --- a/frameworks/maxkb/2.5.0/README.md +++ /dev/null @@ -1,120 +0,0 @@ -# MaxKB on OpenCloudOS 9 - -## 基本信息 -- **框架版本**:v2.5.0 -- **基础镜像**:opencloudos9-minimal:latest -- **Python 版本**:3.11 -- **Node.js 版本**:24.x(仅构建时使用) -- **框架类型**:知识库问答平台(Django + Vue.js) -- **CUDA 版本**:N/A(CPU 框架) - -## 简介 - -[MaxKB](https://github.com/1Panel-dev/MaxKB) 是 1Panel 团队开发的开源知识库问答平台,基于大语言模型(LLM)和 RAG 技术,提供强大的知识库管理与智能问答能力。支持多种 LLM 接入(OpenAI、Anthropic、Ollama、DeepSeek 等),内置文档解析、向量检索、工作流编排等功能。 - -## 构建 - -```bash -docker build -t oc9-maxkb:2.5.0 frameworks/maxkb/2.5.0/ -``` - -> 构建需要 ≥8GB 内存(PyTorch + LangChain 依赖较多)。 - -## 使用示例 - -MaxKB 需要配合以下外部服务一起部署: - -| 服务 | 说明 | -|------|------| -| **PostgreSQL** | 主数据库(≥17,需安装 pgvector 扩展) | -| **Redis** | 缓存(≥7.0) | - -### docker-compose 部署示例 - -```yaml -services: - maxkb: - image: oc9-maxkb:2.5.0 - container_name: maxkb - restart: always - ports: - - "8080:8080" - volumes: - - ./maxkb-data:/opt/maxkb - environment: - - MAXKB_DB_HOST=pgsql - - MAXKB_DB_PORT=5432 - - MAXKB_DB_USER=root - - MAXKB_DB_PASSWORD=Password123@postgres - - MAXKB_DB_NAME=maxkb - - MAXKB_REDIS_HOST=redis - - MAXKB_REDIS_PORT=6379 - - MAXKB_REDIS_PASSWORD=Password123@redis - - MAXKB_EMBEDDING_MODEL_PATH=/opt/maxkb/model/embedding - - MAXKB_SANDBOX=1 - depends_on: - - pgsql - - redis - - pgsql: - image: pgvector/pgvector:0.8.0-pg17 - container_name: pgsql - restart: always - volumes: - - ./pgsql-data:/var/lib/postgresql/data - environment: - - POSTGRES_USER=root - - POSTGRES_PASSWORD=Password123@postgres - - POSTGRES_DB=maxkb - - redis: - image: redis:7.2-alpine - container_name: redis - restart: always - volumes: - - ./redis-data:/data - command: redis-server --requirepass Password123@redis --appendonly yes -``` - -启动后访问 `http://localhost:8080`。 - -## 主要环境变量 - -| 变量 | 说明 | 默认值 | -|------|------|--------| -| `MAXKB_DB_HOST` | PostgreSQL 主机地址 | `127.0.0.1` | -| `MAXKB_DB_PORT` | PostgreSQL 端口 | `5432` | -| `MAXKB_DB_USER` | PostgreSQL 用户名 | `root` | -| `MAXKB_DB_PASSWORD` | PostgreSQL 密码 | `Password123@postgres` | -| `MAXKB_DB_NAME` | 数据库名 | `maxkb` | -| `MAXKB_REDIS_HOST` | Redis 主机地址 | `127.0.0.1` | -| `MAXKB_REDIS_PORT` | Redis 端口 | `6379` | -| `MAXKB_REDIS_PASSWORD` | Redis 密码 | `Password123@redis` | -| `MAXKB_EMBEDDING_MODEL_PATH` | Embedding 模型路径 | `/opt/maxkb-app/model/embedding` | -| `MAXKB_SANDBOX` | 是否启用沙箱 | `1` | -| `MAXKB_ADMIN_PATH` | 管理后台路径 | `/admin` | -| `MAXKB_LOG_LEVEL` | 日志级别 | `INFO` | - -## 测试验证 - -```bash -bash test.sh oc9-maxkb:2.5.0 -``` - -测试脚本会验证以下内容: -- Python 版本 ≥ 3.11 -- Django 框架可用 -- MaxKB 核心模块可导入 -- LangChain 核心库可用 -- PyTorch CPU 可用 -- 前端构建产物存在 -- sandbox 共享库存在 -- 入口文件完整性 - -## 已知问题 - -- 构建时需要 ≥8GB 内存,内存不足会导致 pip install 或 npm build OOM -- 镜像仅包含 MaxKB 应用本身,PostgreSQL(带 pgvector)和 Redis 需通过 docker-compose 单独部署 -- 首次启动时需确保数据库已初始化并创建了 pgvector 扩展(需执行 `CREATE EXTENSION vector`) -- 原始官方镜像将 PostgreSQL 和 Redis 打包在同一容器中,本适配将它们分离为独立服务 -- Embedding 模型需要额外下载到 `/opt/maxkb/model/embedding/` 目录 diff --git a/frameworks/maxkb/2.5.0/build.conf b/frameworks/maxkb/2.5.0/build.conf deleted file mode 100644 index 644bd1e1d1ba69da6cccfc8247199c73d6bf058b..0000000000000000000000000000000000000000 --- a/frameworks/maxkb/2.5.0/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# maxkb 2.5.0 on OpenCloudOS 9 -IMAGE_NAME=oc9-maxkb -IMAGE_TAG=2.5.0 -GPU_TEST=false diff --git a/frameworks/maxkb/2.5.0/test.sh b/frameworks/maxkb/2.5.0/test.sh deleted file mode 100755 index 56a13cf1dfe2443170a0005f1e76bc1407f60fc5..0000000000000000000000000000000000000000 --- a/frameworks/maxkb/2.5.0/test.sh +++ /dev/null @@ -1,66 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" - -echo "=== MaxKB v2.5.0 基础功能测试 ===" - -# 1. 验证 Python 版本 >= 3.11 -echo -n "检查 Python 版本... " -docker run --rm --entrypoint python3.11 "$IMAGE" -c " -import sys -assert sys.version_info >= (3, 11), f'Python version too low: {sys.version}' -print(f'Python {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 2. 验证 Django 框架可用 -echo -n "检查 Django 框架... " -docker run --rm --entrypoint python3.11 "$IMAGE" -c " -import django -print(f'Django {django.__version__}') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 3. 验证 MaxKB 核心模块可导入 -echo -n "检查 MaxKB 核心模块... " -docker run --rm --entrypoint python3.11 "$IMAGE" -c " -import sys, os -sys.path.insert(0, '/opt/maxkb-app/apps') -os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'maxkb.settings') -from maxkb import settings -print(f'MaxKB settings module loaded') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 4. 验证 LangChain 核心库可用 -echo -n "检查 LangChain 核心库... " -docker run --rm --entrypoint python3.11 "$IMAGE" -c " -from langchain_core.messages import HumanMessage -print('langchain_core 可用') -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 5. 验证 PyTorch CPU 可用 -echo -n "检查 PyTorch CPU... " -docker run --rm --entrypoint python3.11 "$IMAGE" -c " -import torch -print(f'PyTorch {torch.__version__} (CPU)') -assert not torch.cuda.is_available(), 'GPU should not be available in CPU image' -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 6. 验证前端构建产物存在 -echo -n "检查前端构建产物... " -docker run --rm --entrypoint bash "$IMAGE" -c " -test -d /opt/maxkb-app/ui/dist && echo '前端构建产物存在' || { echo '前端构建产物不存在'; exit 1; } -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 7. 验证 sandbox 共享库存在 -echo -n "检查 sandbox 共享库... " -docker run --rm --entrypoint bash "$IMAGE" -c " -test -f /opt/maxkb-app/sandbox/lib/sandbox.so && echo 'sandbox.so 存在' || { echo 'sandbox.so 不存在'; exit 1; } -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -# 8. 验证入口文件存在 -echo -n "检查入口文件... " -docker run --rm --entrypoint bash "$IMAGE" -c " -test -f /opt/maxkb-app/main.py && echo 'main.py 存在' || { echo 'main.py 不存在'; exit 1; } -" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } - -echo "=== 所有测试通过 ===" \ No newline at end of file diff --git a/frameworks/ollama/0.18.1/Dockerfile b/frameworks/ollama/0.18.1/Dockerfile deleted file mode 100644 index 07d782b650bfe2873c574cfbd0f72b5e8a979cb5..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.18.1/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="OpenCloudOS Community" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="Ollama v0.18.1 (GPU) on OpenCloudOS 9" - -RUN dnf install -y \ - curl \ - zstd \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -ARG OLLAMA_VERSION=0.18.1 -RUN curl -fsSL "https://github.com/ollama/ollama/releases/download/v${OLLAMA_VERSION}/ollama-linux-amd64.tar.zst" \ - | zstd -d | tar x -C /usr - -ENV NVIDIA_VISIBLE_DEVICES=all -ENV OLLAMA_HOST=0.0.0.0:11434 -EXPOSE 11434 - -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -CMD ["ollama", "serve"] diff --git a/frameworks/ollama/0.18.1/README.md b/frameworks/ollama/0.18.1/README.md deleted file mode 100644 index 82c79b0439c054139c3d842ff74e2b1b6f0f4b35..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.18.1/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# Ollama v0.18.1 on OpenCloudOS 9 - -## 基本信息 - -- **框架版本**:v0.18.1 -- **开源地址**:[https://github.com/ollama/ollama](https://github.com/ollama/ollama) -- **基础镜像**:opencloudos9-cuda-devel:12.8 -- **Python 版本**:N/A(Go 编译二进制,无需 Python) -- **CUDA 版本**:12.8(基础镜像),Ollama 内部自带 CUDA 运行时库 -- **默认端口**:11434 - -## 构建命令 - -```bash -docker build -t oc9-ollama:0.18.1 frameworks/ollama/0.18.1/ -``` - -## 使用示例 - -### 启动 Ollama 服务 - -```bash -docker run -d --gpus all --name ollama \ - -p 11434:11434 \ - -v ollama-models:/root/.ollama \ - oc9-ollama:0.18.1 -``` - -### CPU 模式(不挂载 GPU) - -```bash -docker run -d --name ollama \ - -p 11434:11434 \ - -v ollama-models:/root/.ollama \ - oc9-ollama:0.18.1 -``` - -### 运行模型 - -```bash -# 进入容器拉取并运行模型 -docker exec -it ollama ollama run qwen3:0.6b -``` - -### 调用 API - -```bash -# 查看已安装模型 -curl http://localhost:11434/api/tags - -# 聊天对话 -curl http://localhost:11434/api/chat -d '{ - "model": "qwen3:0.6b", - "messages": [{"role": "user", "content": "你好"}] -}' -``` - -## 技术说明 - -- Ollama 为 Go 编译的独立二进制,内部已打包 CUDA 运行时库,无需额外安装 CUDA -- 使用 `opencloudos9-cuda-devel` 基础镜像以兼容 NVIDIA GPU 驱动 -- 模型数据默认存储在 `/root/.ollama`,建议通过 Volume 持久化 -- 支持 NVIDIA GPU(CUDA)和 CPU 模式自动切换 - -## 已知问题 - -- 首次拉取大模型时需要较长下载时间,建议提前拉取或使用镜像源 -- ARM64 架构需替换 Dockerfile 中的 `amd64` 为 `arm64` diff --git a/frameworks/ollama/0.18.1/build.conf b/frameworks/ollama/0.18.1/build.conf deleted file mode 100644 index fbb3bdbe3ebc51692a97b007f5cd6ca9c683e14f..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.18.1/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ollama 0.18.1 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-ollama -IMAGE_TAG=0.18.1 -GPU_TEST=false diff --git a/frameworks/ollama/0.18.1/test.sh b/frameworks/ollama/0.18.1/test.sh deleted file mode 100755 index 5ba461e4dc6c070a22085b11e5df7315a21f40ee..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.18.1/test.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env bash -set -e - -IMAGE="${1:-}" -if [ -z "${IMAGE}" ]; then - echo "用法: bash test.sh <镜像名:标签>" >&2 - exit 1 -fi - -command -v docker >/dev/null 2>&1 || { echo "✗ 未找到 docker" >&2; exit 1; } - -echo "=== Ollama 容器基础功能测试 ===" -echo "待测镜像: ${IMAGE}" - -docker run --rm --gpus all \ - -e OLLAMA_BIN="${OLLAMA_BIN:-/usr/bin/ollama}" \ - -e OLLAMA_HOST="${OLLAMA_HOST:-0.0.0.0:11434}" \ - -e START_TIMEOUT="${START_TIMEOUT:-30}" \ - --entrypoint /bin/bash \ - "${IMAGE}" -lc ' -set -Eeuo pipefail - -export CUDA_HOME="${CUDA_HOME:-/usr/local/cuda}" -export PATH="${CUDA_HOME}/bin:${PATH}" -export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH:-}" - -OLLAMA_URL="http://${OLLAMA_HOST}/api" -SERVER_PID="" - -pass() { echo "✓ $1"; } -fail() { echo "✗ $1" >&2; exit 1; } - -cleanup() { - [ -n "${SERVER_PID}" ] && kill "${SERVER_PID}" >/dev/null 2>&1 && wait "${SERVER_PID}" 2>/dev/null || true -} -trap cleanup EXIT - -http_get() { - local url="$1" - if command -v curl >/dev/null 2>&1; then - curl -fsS "${url}" - elif command -v wget >/dev/null 2>&1; then - wget -qO- "${url}" - elif command -v python3 >/dev/null 2>&1; then - python3 - "${url}" <<"PY" -import sys -from urllib.request import urlopen - -url = sys.argv[1] -with urlopen(url, timeout=5) as resp: - sys.stdout.write(resp.read().decode("utf-8", errors="replace")) -PY - else - fail "未找到 curl、wget 或 python3,无法检查 HTTP API" - fi -} - -echo "[1/5] 检查 ollama 二进制..." -[ -x "${OLLAMA_BIN}" ] || fail "ollama 未安装或不可执行: ${OLLAMA_BIN}" -pass "ollama 二进制存在" - -echo "[2/5] 检查 ollama 是否可正常运行..." -VERSION_OUT="$(${OLLAMA_BIN} --version 2>&1)" || fail "ollama --version 执行失败" -echo " ${VERSION_OUT}" -pass "ollama 可正常运行" - -echo "[3/5] 检查运行环境信息..." -if command -v nvidia-smi >/dev/null 2>&1; then - nvidia-smi | head -n 3 || true - pass "检测到 nvidia-smi" -else - echo " 未检测到 nvidia-smi,跳过 GPU 检查" - pass "GPU 检查已跳过" -fi - -if command -v nvcc >/dev/null 2>&1; then - nvcc --version | tail -n 2 || true -fi - -echo "[4/5] 启动 ollama API 服务并检查 /api/version..." -"${OLLAMA_BIN}" serve >/tmp/ollama-test.log 2>&1 & -SERVER_PID=$! - -READY=0 -for _ in $(seq 1 "${START_TIMEOUT}"); do - if http_get "${OLLAMA_URL}/version" >/dev/null 2>&1; then - READY=1 - break - fi - sleep 1 -done - -if [ "${READY}" != "1" ]; then - echo "---- ollama 服务日志 ----" - cat /tmp/ollama-test.log || true - echo "------------------------" - fail "ollama serve 启动失败或 ${START_TIMEOUT}s 内未就绪" -fi - -API_VERSION="$(http_get "${OLLAMA_URL}/version")" || fail "访问 /api/version 失败" -echo " ${API_VERSION}" -pass "ollama API 服务正常" - -echo "[5/5] 检查核心 CLI 功能..." -LIST_OUT="$(${OLLAMA_BIN} list 2>&1)" || fail "ollama list 执行失败" -echo "${LIST_OUT}" -pass "ollama list 可正常执行" -' - -echo "✓ 镜像 ${IMAGE} 基础功能测试通过" diff --git a/frameworks/ollama/0.18.1/test_result.png b/frameworks/ollama/0.18.1/test_result.png deleted file mode 100644 index 3c4c832751a890cd3c226944f79af99c7ef45a6a..0000000000000000000000000000000000000000 Binary files a/frameworks/ollama/0.18.1/test_result.png and /dev/null differ diff --git a/frameworks/ollama/0.18.2/Dockerfile b/frameworks/ollama/0.18.2/Dockerfile deleted file mode 100644 index 8fe3bda3cc9967fdd96b5b854253a5f7bc47307b..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.18.2/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="OpenCloudOS Community" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="Ollama v0.18.2 (GPU) on OpenCloudOS 9" - -RUN dnf install -y \ - curl \ - zstd \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -ARG OLLAMA_VERSION=0.18.2 -RUN curl -fsSL "https://github.com/ollama/ollama/releases/download/v${OLLAMA_VERSION}/ollama-linux-amd64.tar.zst" \ - | zstd -d | tar x -C /usr - -ENV NVIDIA_VISIBLE_DEVICES=all -ENV OLLAMA_HOST=0.0.0.0:11434 -EXPOSE 11434 - -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -CMD ["ollama", "serve"] diff --git a/frameworks/ollama/0.18.2/README.md b/frameworks/ollama/0.18.2/README.md deleted file mode 100644 index e0824b905ca5e2c644b652382e8100ce6b01cb74..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.18.2/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# Ollama v0.18.2 on OpenCloudOS 9 - -## 基本信息 - -- **框架版本**:v0.18.2 -- **开源地址**:[https://github.com/ollama/ollama](https://github.com/ollama/ollama) -- **基础镜像**:opencloudos9-cuda-devel:12.8 -- **Python 版本**:N/A(Go 编译二进制,无需 Python) -- **CUDA 版本**:12.8(基础镜像),Ollama 内部自带 CUDA 运行时库 -- **默认端口**:11434 - -## 构建命令 - -```bash -docker build -t oc9-ollama:0.18.2 frameworks/ollama/0.18.2/ -``` - -## 使用示例 - -### 启动 Ollama 服务 - -```bash -docker run -d --gpus all --name ollama \ - -p 11434:11434 \ - -v ollama-models:/root/.ollama \ - oc9-ollama:0.18.2 -``` - -### CPU 模式(不挂载 GPU) - -```bash -docker run -d --name ollama \ - -p 11434:11434 \ - -v ollama-models:/root/.ollama \ - oc9-ollama:0.18.2 -``` - -### 运行模型 - -```bash -# 进入容器拉取并运行模型 -docker exec -it ollama ollama run qwen3:0.6b -``` - -### 调用 API - -```bash -# 查看已安装模型 -curl http://localhost:11434/api/tags - -# 聊天对话 -curl http://localhost:11434/api/chat -d '{ - "model": "qwen3:0.6b", - "messages": [{"role": "user", "content": "你好"}] -}' -``` - -## 技术说明 - -- Ollama 为 Go 编译的独立二进制,内部已打包 CUDA 运行时库,无需额外安装 CUDA -- 使用 `opencloudos9-cuda-devel` 基础镜像以兼容 NVIDIA GPU 驱动 -- 模型数据默认存储在 `/root/.ollama`,建议通过 Volume 持久化 -- 支持 NVIDIA GPU(CUDA)和 CPU 模式自动切换 - -## 已知问题 - -- 首次拉取大模型时需要较长下载时间,建议提前拉取或使用镜像源 -- ARM64 架构需替换 Dockerfile 中的 `amd64` 为 `arm64` diff --git a/frameworks/ollama/0.18.2/build.conf b/frameworks/ollama/0.18.2/build.conf deleted file mode 100644 index 43d9b2cea650f04ade191aa1e7851472141f04b4..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.18.2/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ollama 0.18.2 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-ollama -IMAGE_TAG=0.18.2 -GPU_TEST=false diff --git a/frameworks/ollama/0.18.2/test.sh b/frameworks/ollama/0.18.2/test.sh deleted file mode 100755 index 5ba461e4dc6c070a22085b11e5df7315a21f40ee..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.18.2/test.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env bash -set -e - -IMAGE="${1:-}" -if [ -z "${IMAGE}" ]; then - echo "用法: bash test.sh <镜像名:标签>" >&2 - exit 1 -fi - -command -v docker >/dev/null 2>&1 || { echo "✗ 未找到 docker" >&2; exit 1; } - -echo "=== Ollama 容器基础功能测试 ===" -echo "待测镜像: ${IMAGE}" - -docker run --rm --gpus all \ - -e OLLAMA_BIN="${OLLAMA_BIN:-/usr/bin/ollama}" \ - -e OLLAMA_HOST="${OLLAMA_HOST:-0.0.0.0:11434}" \ - -e START_TIMEOUT="${START_TIMEOUT:-30}" \ - --entrypoint /bin/bash \ - "${IMAGE}" -lc ' -set -Eeuo pipefail - -export CUDA_HOME="${CUDA_HOME:-/usr/local/cuda}" -export PATH="${CUDA_HOME}/bin:${PATH}" -export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH:-}" - -OLLAMA_URL="http://${OLLAMA_HOST}/api" -SERVER_PID="" - -pass() { echo "✓ $1"; } -fail() { echo "✗ $1" >&2; exit 1; } - -cleanup() { - [ -n "${SERVER_PID}" ] && kill "${SERVER_PID}" >/dev/null 2>&1 && wait "${SERVER_PID}" 2>/dev/null || true -} -trap cleanup EXIT - -http_get() { - local url="$1" - if command -v curl >/dev/null 2>&1; then - curl -fsS "${url}" - elif command -v wget >/dev/null 2>&1; then - wget -qO- "${url}" - elif command -v python3 >/dev/null 2>&1; then - python3 - "${url}" <<"PY" -import sys -from urllib.request import urlopen - -url = sys.argv[1] -with urlopen(url, timeout=5) as resp: - sys.stdout.write(resp.read().decode("utf-8", errors="replace")) -PY - else - fail "未找到 curl、wget 或 python3,无法检查 HTTP API" - fi -} - -echo "[1/5] 检查 ollama 二进制..." -[ -x "${OLLAMA_BIN}" ] || fail "ollama 未安装或不可执行: ${OLLAMA_BIN}" -pass "ollama 二进制存在" - -echo "[2/5] 检查 ollama 是否可正常运行..." -VERSION_OUT="$(${OLLAMA_BIN} --version 2>&1)" || fail "ollama --version 执行失败" -echo " ${VERSION_OUT}" -pass "ollama 可正常运行" - -echo "[3/5] 检查运行环境信息..." -if command -v nvidia-smi >/dev/null 2>&1; then - nvidia-smi | head -n 3 || true - pass "检测到 nvidia-smi" -else - echo " 未检测到 nvidia-smi,跳过 GPU 检查" - pass "GPU 检查已跳过" -fi - -if command -v nvcc >/dev/null 2>&1; then - nvcc --version | tail -n 2 || true -fi - -echo "[4/5] 启动 ollama API 服务并检查 /api/version..." -"${OLLAMA_BIN}" serve >/tmp/ollama-test.log 2>&1 & -SERVER_PID=$! - -READY=0 -for _ in $(seq 1 "${START_TIMEOUT}"); do - if http_get "${OLLAMA_URL}/version" >/dev/null 2>&1; then - READY=1 - break - fi - sleep 1 -done - -if [ "${READY}" != "1" ]; then - echo "---- ollama 服务日志 ----" - cat /tmp/ollama-test.log || true - echo "------------------------" - fail "ollama serve 启动失败或 ${START_TIMEOUT}s 内未就绪" -fi - -API_VERSION="$(http_get "${OLLAMA_URL}/version")" || fail "访问 /api/version 失败" -echo " ${API_VERSION}" -pass "ollama API 服务正常" - -echo "[5/5] 检查核心 CLI 功能..." -LIST_OUT="$(${OLLAMA_BIN} list 2>&1)" || fail "ollama list 执行失败" -echo "${LIST_OUT}" -pass "ollama list 可正常执行" -' - -echo "✓ 镜像 ${IMAGE} 基础功能测试通过" diff --git a/frameworks/ollama/0.18.2/test_result.png b/frameworks/ollama/0.18.2/test_result.png deleted file mode 100644 index 2afd74340de84b0c1d3dc55629d46961d310281e..0000000000000000000000000000000000000000 Binary files a/frameworks/ollama/0.18.2/test_result.png and /dev/null differ diff --git a/frameworks/ollama/0.18.3/Dockerfile b/frameworks/ollama/0.18.3/Dockerfile deleted file mode 100644 index fa9e0165b310ae1be3fcc0ca73106e3eb359e0cb..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.18.3/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="OpenCloudOS Community" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="Ollama v0.18.3 (GPU) on OpenCloudOS 9" - -RUN dnf install -y \ - curl \ - zstd \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -ARG OLLAMA_VERSION=0.18.3 -RUN curl -fsSL "https://github.com/ollama/ollama/releases/download/v${OLLAMA_VERSION}/ollama-linux-amd64.tar.zst" \ - | zstd -d | tar x -C /usr - -ENV NVIDIA_VISIBLE_DEVICES=all -ENV OLLAMA_HOST=0.0.0.0:11434 -EXPOSE 11434 - -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -CMD ["ollama", "serve"] diff --git a/frameworks/ollama/0.18.3/README.md b/frameworks/ollama/0.18.3/README.md deleted file mode 100644 index f66d90e240bab863767be597c29002a1480f3386..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.18.3/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# Ollama v0.18.3 on OpenCloudOS 9 - -## 基本信息 - -- **框架版本**:v0.18.3 -- **开源地址**:[https://github.com/ollama/ollama](https://github.com/ollama/ollama) -- **基础镜像**:opencloudos9-cuda-devel:12.8 -- **Python 版本**:N/A(Go 编译二进制,无需 Python) -- **CUDA 版本**:12.8(基础镜像),Ollama 内部自带 CUDA 运行时库 -- **默认端口**:11434 - -## 构建命令 - -```bash -docker build -t oc9-ollama:0.18.3 frameworks/ollama/0.18.3/ -``` - -## 使用示例 - -### 启动 Ollama 服务 - -```bash -docker run -d --gpus all --name ollama \ - -p 11434:11434 \ - -v ollama-models:/root/.ollama \ - oc9-ollama:0.18.3 -``` - -### CPU 模式(不挂载 GPU) - -```bash -docker run -d --name ollama \ - -p 11434:11434 \ - -v ollama-models:/root/.ollama \ - oc9-ollama:0.18.3 -``` - -### 运行模型 - -```bash -# 进入容器拉取并运行模型 -docker exec -it ollama ollama run qwen3:0.6b -``` - -### 调用 API - -```bash -# 查看已安装模型 -curl http://localhost:11434/api/tags - -# 聊天对话 -curl http://localhost:11434/api/chat -d '{ - "model": "qwen3:0.6b", - "messages": [{"role": "user", "content": "你好"}] -}' -``` - -## 技术说明 - -- Ollama 为 Go 编译的独立二进制,内部已打包 CUDA 运行时库,无需额外安装 CUDA -- 使用 `opencloudos9-cuda-devel` 基础镜像以兼容 NVIDIA GPU 驱动 -- 模型数据默认存储在 `/root/.ollama`,建议通过 Volume 持久化 -- 支持 NVIDIA GPU(CUDA)和 CPU 模式自动切换 - -## 已知问题 - -- 首次拉取大模型时需要较长下载时间,建议提前拉取或使用镜像源 -- ARM64 架构需替换 Dockerfile 中的 `amd64` 为 `arm64` diff --git a/frameworks/ollama/0.18.3/build.conf b/frameworks/ollama/0.18.3/build.conf deleted file mode 100644 index 6018ad744fc1576538a8126eec47ab885f51efa5..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.18.3/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ollama 0.18.3 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-ollama -IMAGE_TAG=0.18.3 -GPU_TEST=false diff --git a/frameworks/ollama/0.18.3/test.sh b/frameworks/ollama/0.18.3/test.sh deleted file mode 100755 index 5ba461e4dc6c070a22085b11e5df7315a21f40ee..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.18.3/test.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env bash -set -e - -IMAGE="${1:-}" -if [ -z "${IMAGE}" ]; then - echo "用法: bash test.sh <镜像名:标签>" >&2 - exit 1 -fi - -command -v docker >/dev/null 2>&1 || { echo "✗ 未找到 docker" >&2; exit 1; } - -echo "=== Ollama 容器基础功能测试 ===" -echo "待测镜像: ${IMAGE}" - -docker run --rm --gpus all \ - -e OLLAMA_BIN="${OLLAMA_BIN:-/usr/bin/ollama}" \ - -e OLLAMA_HOST="${OLLAMA_HOST:-0.0.0.0:11434}" \ - -e START_TIMEOUT="${START_TIMEOUT:-30}" \ - --entrypoint /bin/bash \ - "${IMAGE}" -lc ' -set -Eeuo pipefail - -export CUDA_HOME="${CUDA_HOME:-/usr/local/cuda}" -export PATH="${CUDA_HOME}/bin:${PATH}" -export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH:-}" - -OLLAMA_URL="http://${OLLAMA_HOST}/api" -SERVER_PID="" - -pass() { echo "✓ $1"; } -fail() { echo "✗ $1" >&2; exit 1; } - -cleanup() { - [ -n "${SERVER_PID}" ] && kill "${SERVER_PID}" >/dev/null 2>&1 && wait "${SERVER_PID}" 2>/dev/null || true -} -trap cleanup EXIT - -http_get() { - local url="$1" - if command -v curl >/dev/null 2>&1; then - curl -fsS "${url}" - elif command -v wget >/dev/null 2>&1; then - wget -qO- "${url}" - elif command -v python3 >/dev/null 2>&1; then - python3 - "${url}" <<"PY" -import sys -from urllib.request import urlopen - -url = sys.argv[1] -with urlopen(url, timeout=5) as resp: - sys.stdout.write(resp.read().decode("utf-8", errors="replace")) -PY - else - fail "未找到 curl、wget 或 python3,无法检查 HTTP API" - fi -} - -echo "[1/5] 检查 ollama 二进制..." -[ -x "${OLLAMA_BIN}" ] || fail "ollama 未安装或不可执行: ${OLLAMA_BIN}" -pass "ollama 二进制存在" - -echo "[2/5] 检查 ollama 是否可正常运行..." -VERSION_OUT="$(${OLLAMA_BIN} --version 2>&1)" || fail "ollama --version 执行失败" -echo " ${VERSION_OUT}" -pass "ollama 可正常运行" - -echo "[3/5] 检查运行环境信息..." -if command -v nvidia-smi >/dev/null 2>&1; then - nvidia-smi | head -n 3 || true - pass "检测到 nvidia-smi" -else - echo " 未检测到 nvidia-smi,跳过 GPU 检查" - pass "GPU 检查已跳过" -fi - -if command -v nvcc >/dev/null 2>&1; then - nvcc --version | tail -n 2 || true -fi - -echo "[4/5] 启动 ollama API 服务并检查 /api/version..." -"${OLLAMA_BIN}" serve >/tmp/ollama-test.log 2>&1 & -SERVER_PID=$! - -READY=0 -for _ in $(seq 1 "${START_TIMEOUT}"); do - if http_get "${OLLAMA_URL}/version" >/dev/null 2>&1; then - READY=1 - break - fi - sleep 1 -done - -if [ "${READY}" != "1" ]; then - echo "---- ollama 服务日志 ----" - cat /tmp/ollama-test.log || true - echo "------------------------" - fail "ollama serve 启动失败或 ${START_TIMEOUT}s 内未就绪" -fi - -API_VERSION="$(http_get "${OLLAMA_URL}/version")" || fail "访问 /api/version 失败" -echo " ${API_VERSION}" -pass "ollama API 服务正常" - -echo "[5/5] 检查核心 CLI 功能..." -LIST_OUT="$(${OLLAMA_BIN} list 2>&1)" || fail "ollama list 执行失败" -echo "${LIST_OUT}" -pass "ollama list 可正常执行" -' - -echo "✓ 镜像 ${IMAGE} 基础功能测试通过" diff --git a/frameworks/ollama/0.18.3/test_result.png b/frameworks/ollama/0.18.3/test_result.png deleted file mode 100644 index df3182169a653849a9203beebff246f9f14c03ae..0000000000000000000000000000000000000000 Binary files a/frameworks/ollama/0.18.3/test_result.png and /dev/null differ diff --git a/frameworks/ollama/0.18.4/Dockerfile b/frameworks/ollama/0.18.4/Dockerfile deleted file mode 100644 index 79c80315f49fb624fda03c8b74412b6bafa927c7..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.18.4/Dockerfile +++ /dev/null @@ -1,23 +0,0 @@ -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="OpenCloudOS Community" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="Ollama v0.18.4 (GPU) on OpenCloudOS 9" - -RUN dnf install -y \ - curl \ - zstd \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -ARG OLLAMA_VERSION=0.18.4-rc0 -RUN curl -fsSL "https://github.com/ollama/ollama/releases/download/v${OLLAMA_VERSION}/ollama-linux-amd64.tar.zst" \ - | zstd -d | tar x -C /usr - -ENV NVIDIA_VISIBLE_DEVICES=all -ENV OLLAMA_HOST=0.0.0.0:11434 -EXPOSE 11434 - -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -CMD ["ollama", "serve"] diff --git a/frameworks/ollama/0.18.4/README.md b/frameworks/ollama/0.18.4/README.md deleted file mode 100644 index b68e108e91a9b245087eeb6ee7201d0d3e0bd3fc..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.18.4/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# Ollama v0.18.4 on OpenCloudOS 9 - -## 基本信息 - -- **框架版本**:v0.18.4 -- **开源地址**:[https://github.com/ollama/ollama](https://github.com/ollama/ollama) -- **基础镜像**:opencloudos9-cuda-devel:12.8 -- **Python 版本**:N/A(Go 编译二进制,无需 Python) -- **CUDA 版本**:12.8(基础镜像),Ollama 内部自带 CUDA 运行时库 -- **默认端口**:11434 - -## 构建命令 - -```bash -docker build -t oc9-ollama:0.18.4 frameworks/ollama/0.18.4/ -``` - -## 使用示例 - -### 启动 Ollama 服务 - -```bash -docker run -d --gpus all --name ollama \ - -p 11434:11434 \ - -v ollama-models:/root/.ollama \ - oc9-ollama:0.18.4 -``` - -### CPU 模式(不挂载 GPU) - -```bash -docker run -d --name ollama \ - -p 11434:11434 \ - -v ollama-models:/root/.ollama \ - oc9-ollama:0.18.4 -``` - -### 运行模型 - -```bash -# 进入容器拉取并运行模型 -docker exec -it ollama ollama run qwen3:0.6b -``` - -### 调用 API - -```bash -# 查看已安装模型 -curl http://localhost:11434/api/tags - -# 聊天对话 -curl http://localhost:11434/api/chat -d '{ - "model": "qwen3:0.6b", - "messages": [{"role": "user", "content": "你好"}] -}' -``` - -## 技术说明 - -- Ollama 为 Go 编译的独立二进制,内部已打包 CUDA 运行时库,无需额外安装 CUDA -- 使用 `opencloudos9-cuda-devel` 基础镜像以兼容 NVIDIA GPU 驱动 -- 模型数据默认存储在 `/root/.ollama`,建议通过 Volume 持久化 -- 支持 NVIDIA GPU(CUDA)和 CPU 模式自动切换 - -## 已知问题 - -- 首次拉取大模型时需要较长下载时间,建议提前拉取或使用镜像源 -- ARM64 架构需替换 Dockerfile 中的 `amd64` 为 `arm64` diff --git a/frameworks/ollama/0.18.4/build.conf b/frameworks/ollama/0.18.4/build.conf deleted file mode 100644 index 848d84b62a28b132ae69dbb8fdd4ab728b9edf4a..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.18.4/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ollama 0.18.4 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-ollama -IMAGE_TAG=0.18.4 -GPU_TEST=false diff --git a/frameworks/ollama/0.18.4/test.sh b/frameworks/ollama/0.18.4/test.sh deleted file mode 100755 index 5ba461e4dc6c070a22085b11e5df7315a21f40ee..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.18.4/test.sh +++ /dev/null @@ -1,110 +0,0 @@ -#!/usr/bin/env bash -set -e - -IMAGE="${1:-}" -if [ -z "${IMAGE}" ]; then - echo "用法: bash test.sh <镜像名:标签>" >&2 - exit 1 -fi - -command -v docker >/dev/null 2>&1 || { echo "✗ 未找到 docker" >&2; exit 1; } - -echo "=== Ollama 容器基础功能测试 ===" -echo "待测镜像: ${IMAGE}" - -docker run --rm --gpus all \ - -e OLLAMA_BIN="${OLLAMA_BIN:-/usr/bin/ollama}" \ - -e OLLAMA_HOST="${OLLAMA_HOST:-0.0.0.0:11434}" \ - -e START_TIMEOUT="${START_TIMEOUT:-30}" \ - --entrypoint /bin/bash \ - "${IMAGE}" -lc ' -set -Eeuo pipefail - -export CUDA_HOME="${CUDA_HOME:-/usr/local/cuda}" -export PATH="${CUDA_HOME}/bin:${PATH}" -export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH:-}" - -OLLAMA_URL="http://${OLLAMA_HOST}/api" -SERVER_PID="" - -pass() { echo "✓ $1"; } -fail() { echo "✗ $1" >&2; exit 1; } - -cleanup() { - [ -n "${SERVER_PID}" ] && kill "${SERVER_PID}" >/dev/null 2>&1 && wait "${SERVER_PID}" 2>/dev/null || true -} -trap cleanup EXIT - -http_get() { - local url="$1" - if command -v curl >/dev/null 2>&1; then - curl -fsS "${url}" - elif command -v wget >/dev/null 2>&1; then - wget -qO- "${url}" - elif command -v python3 >/dev/null 2>&1; then - python3 - "${url}" <<"PY" -import sys -from urllib.request import urlopen - -url = sys.argv[1] -with urlopen(url, timeout=5) as resp: - sys.stdout.write(resp.read().decode("utf-8", errors="replace")) -PY - else - fail "未找到 curl、wget 或 python3,无法检查 HTTP API" - fi -} - -echo "[1/5] 检查 ollama 二进制..." -[ -x "${OLLAMA_BIN}" ] || fail "ollama 未安装或不可执行: ${OLLAMA_BIN}" -pass "ollama 二进制存在" - -echo "[2/5] 检查 ollama 是否可正常运行..." -VERSION_OUT="$(${OLLAMA_BIN} --version 2>&1)" || fail "ollama --version 执行失败" -echo " ${VERSION_OUT}" -pass "ollama 可正常运行" - -echo "[3/5] 检查运行环境信息..." -if command -v nvidia-smi >/dev/null 2>&1; then - nvidia-smi | head -n 3 || true - pass "检测到 nvidia-smi" -else - echo " 未检测到 nvidia-smi,跳过 GPU 检查" - pass "GPU 检查已跳过" -fi - -if command -v nvcc >/dev/null 2>&1; then - nvcc --version | tail -n 2 || true -fi - -echo "[4/5] 启动 ollama API 服务并检查 /api/version..." -"${OLLAMA_BIN}" serve >/tmp/ollama-test.log 2>&1 & -SERVER_PID=$! - -READY=0 -for _ in $(seq 1 "${START_TIMEOUT}"); do - if http_get "${OLLAMA_URL}/version" >/dev/null 2>&1; then - READY=1 - break - fi - sleep 1 -done - -if [ "${READY}" != "1" ]; then - echo "---- ollama 服务日志 ----" - cat /tmp/ollama-test.log || true - echo "------------------------" - fail "ollama serve 启动失败或 ${START_TIMEOUT}s 内未就绪" -fi - -API_VERSION="$(http_get "${OLLAMA_URL}/version")" || fail "访问 /api/version 失败" -echo " ${API_VERSION}" -pass "ollama API 服务正常" - -echo "[5/5] 检查核心 CLI 功能..." -LIST_OUT="$(${OLLAMA_BIN} list 2>&1)" || fail "ollama list 执行失败" -echo "${LIST_OUT}" -pass "ollama list 可正常执行" -' - -echo "✓ 镜像 ${IMAGE} 基础功能测试通过" diff --git a/frameworks/ollama/0.18.4/test_result.png b/frameworks/ollama/0.18.4/test_result.png deleted file mode 100644 index eb7c5ebd7afbc1d3d1308d26c1cf8989fb9ff50e..0000000000000000000000000000000000000000 Binary files a/frameworks/ollama/0.18.4/test_result.png and /dev/null differ diff --git a/frameworks/ollama/0.19.0/Dockerfile b/frameworks/ollama/0.19.0/Dockerfile deleted file mode 100644 index 3ed8c13806984fd525475de66952a78a7146e99f..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.19.0/Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ - -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="stronking 363133710@qq.com" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="ollma 0.19.0 (GPU) on OpenCloudOS 9" - - -ENV NVIDIA_VISIBLE_DEVICES=all -WORKDIR /tmp/ -RUN dnf install -y git gcc gcc-c++ make \ - cmake tar gzip xz \ - zstd curl wget \ - && dnf clean all \ - && rm -rf /var/ccache/yum/* - -RUN curl -LO https://go.dev/dl/go1.24.1.linux-amd64.tar.gz -RUN rm -rf /usr/local/go -RUN tar -C /usr/local -xzf go1.24.1.linux-amd64.tar.gz -ENV PATH=/usr/local/go/bin:$PATH -RUN wget https://github.com/ollama/ollama/archive/refs/tags/v0.19.0.zip && unzip v0.19.0.zip -WORKDIR /tmp/ollama-0.19.0/ -RUN cmake -B build -RUN cmake --build build -j"$(nproc)" -RUN cmake --install build --prefix /usr/local -RUN go build -trimpath -ldflags="-w -s -X=github.com/ollama/ollama/version.Version=0.19.0 -X=github.com/ollama/ollama/server.mode=release" -o ollama . -RUN install -m 755 ./ollama /usr/local/bin/ollama -RUN rm -rf /tmp/* -WORKDIR /home/ -RUN rm -rf /root/.cache && rm -rf /root/go -EXPOSE 11434 -CMD ["ollama","serve"] \ No newline at end of file diff --git a/frameworks/ollama/0.19.0/README.md b/frameworks/ollama/0.19.0/README.md deleted file mode 100644 index f642541d5276f2dee3f5f013b47079c0433f237f..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.19.0/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# ollama 0.19.0 on OpenCloudOS 9 - -## 基本信息 -- **框架版本**:v0.19.0 -- **基础镜像**:opencloudos9-cuda-devel:12.8 -- **Python 版本**:3.11 -- **CUDA 版本**: 12.x 或 更高 - -## 构建 - -docker build -t oc9-ollama:0.19.0 . - - -## 源码构建ollama应用,依赖go版本对应关系说明 - -| Ollama 版本 | Go 版本 | 说明 | -|---|---|----------------------| -| v0.1.0 | 1.20 | 早期版本 | -| v0.2.0 | 1.22.0 | 0.2.x 开始升级到 Go 1.22 | -| v0.2.1 | 1.22.0 | 与 v0.2.0 一致 | -| v0.3.14 | 1.22.5 | 0.3.x 使用 Go 1.22.5 | -| v0.4.7 | 1.22.8 | 0.4.x 使用 Go 1.22.8 | -| v0.5.13 | 1.24.0 | 0.5.x 已升级到 Go 1.24.0 | -| v0.11.4 | 1.24.0 | 0.11.x 仍为 Go 1.24.0 | -| v0.20.4 | 1.24.1 | 打包版本 | -| main(当前主线) | 1.24.1 | 当前官方主线 `go.mod` | - - -## 使用示例 - -### ollama 环境变量配置说明 - -下面这些是日常最常用、最值得优先掌握的环境变量。 - -| 变量名 | 作用 | 常见值示例 | 说明 | -|---|---|---|---| -| `OLLAMA_HOST` | 设置 Ollama 服务监听地址 | `0.0.0.0:11434` | 默认监听 `127.0.0.1:11434`。如果要让容器外、局域网、反向代理访问,通常设为 `0.0.0.0:11434`。 | -| `OLLAMA_MODELS` | 设置模型存储目录 | `/models` | 用于把模型文件放到挂载卷、大磁盘或 NAS。 | -| `OLLAMA_KEEP_ALIVE` | 模型在内存中保留时长 | `30m` | 默认约为 `5m`。负值通常表示无限保留,`0` 表示不保活。 | -| `OLLAMA_CONTEXT_LENGTH` | 设置默认上下文长度 | `8192` | FAQ 中示例为 `8192`。不同版本对默认值说明略有差异,建议显式设置。 | -| `OLLAMA_ORIGINS` | 设置允许跨域访问的来源 | `http://localhost:3000,https://chat.example.com` | 当前端页面、浏览器扩展要直接访问 Ollama API 时很常用。 | -| `OLLAMA_NO_CLOUD` | 禁用 Ollama cloud 功能 | `1` | 适合纯本地、内网、离线化部署。 | -| `OLLAMA_DEBUG` | 打开调试日志 | `1` | 用于排查服务启动、模型加载、推理等问题。 | -| `HTTPS_PROXY` | 设置模型下载代理 | `https://proxy.example.com:8443` | 官方 FAQ 明确建议优先使用 `HTTPS_PROXY`。 | -| `NO_PROXY` | 设置代理例外地址 | `127.0.0.1,localhost` | 避免本地 API 请求被代理。 | -| `CUDA_VISIBLE_DEVICES` | 指定可见的 NVIDIA GPU | `0` 或 `0,1` | 多卡机器常用,只让 Ollama 使用指定 GPU。 | - - -### 镜像启动命令 - -docker run -d --name oc9-ollama --gpus all oc9-ollama:0.19.0 - -### 镜像测试命令 - -docker run --rm --gpus all oc9-ollama:0.19.0 bash test.sh - -## 已知问题 -- (如有) \ No newline at end of file diff --git a/frameworks/ollama/0.19.0/build.conf b/frameworks/ollama/0.19.0/build.conf deleted file mode 100644 index 3eed6e3e76c321a27ce5e57c57aa1e9b61265aa2..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.19.0/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ollama 0.19.0 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-ollama -IMAGE_TAG=0.19.0 -GPU_TEST=false \ No newline at end of file diff --git a/frameworks/ollama/0.19.0/test.sh b/frameworks/ollama/0.19.0/test.sh deleted file mode 100644 index d6b02c705a78daf69725a8c500a48b92869384e5..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.19.0/test.sh +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin bash - -set -e - -IMAGE="${1:-}" - -pass() { - echo "✓ $1" -} - -fail() { - echo "✗ $1" >&2 - exit 1 -} - -if [ -z "${IMAGE}" ]; then - echo "用法: bash test.sh <镜像名:标签>" >&2 - exit 1 -fi - -command -v docker >/dev/null 2>&1 || fail "未找到 docker,无法运行容器功能测试" - -echo "=== Ollama 容器基础功能测试 ===" -echo "待测镜像: ${IMAGE}" - -OLLAMA_BIN="${OLLAMA_BIN:-/usr/local/bin/ollama}" -OLLAMA_HOST="${OLLAMA_HOST:-127.0.0.1:11434}" -START_TIMEOUT="${START_TIMEOUT:-30}" - -docker run --rm \ - --gpus all \ - -e OLLAMA_BIN="${OLLAMA_BIN}" \ - -e OLLAMA_HOST="${OLLAMA_HOST}" \ - -e START_TIMEOUT="${START_TIMEOUT}" \ - --entrypoint /bin/bash \ - "${IMAGE}" \ - -lc ' -set -Eeuo pipefail - -export CUDA_HOME="${CUDA_HOME:-/usr/local/cuda}" -export PATH="${CUDA_HOME}/bin:${PATH}" -export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH:-}" - -OLLAMA_BIN="${OLLAMA_BIN:-/usr/local/bin/ollama}" -OLLAMA_HOST="${OLLAMA_HOST:-127.0.0.1:11434}" -OLLAMA_URL="http://${OLLAMA_HOST}" -START_TIMEOUT="${START_TIMEOUT:-30}" -SERVER_PID="" - -pass() { - echo "✓ $1" -} - -fail() { - echo "✗ $1" >&2 - exit 1 -} - -cleanup() { - if [ -n "${SERVER_PID}" ]; then - kill "${SERVER_PID}" >/dev/null 2>&1 || true - wait "${SERVER_PID}" 2>/dev/null || true - fi -} -trap cleanup EXIT - -http_get() { - local url="$1" - if command -v curl >/dev/null 2>&1; then - curl -fsS "${url}" - elif command -v wget >/dev/null 2>&1; then - wget -qO- "${url}" - elif command -v python3 >/dev/null 2>&1; then - python3 - "${url}" <<"PY" -import sys -from urllib.request import urlopen - -url = sys.argv[1] -with urlopen(url, timeout=5) as resp: - sys.stdout.write(resp.read().decode("utf-8", errors="replace")) -PY - else - fail "未找到 curl、wget 或 python3,无法检查 HTTP API" - fi -} - -echo "[1/5] 检查 ollama 二进制..." -[ -x "${OLLAMA_BIN}" ] || fail "ollama 未安装或不可执行: ${OLLAMA_BIN}" -pass "ollama 二进制存在" - -echo "[2/5] 检查 ollama 是否可正常运行..." -VERSION_OUT="$(${OLLAMA_BIN} --version 2>&1)" || fail "ollama --version 执行失败" -echo " ${VERSION_OUT}" -pass "ollama 可正常运行" - -echo "[3/5] 检查运行环境信息..." -if command -v nvidia-smi >/dev/null 2>&1; then - nvidia-smi | head -n 3 || true - pass "检测到 nvidia-smi(基础测试不强制要求 GPU)" -else - echo " 未检测到 nvidia-smi,跳过 GPU 检查;CUDA 可用性由 CI 的 GPU_TEST=true 额外验证" - pass "GPU 检查已跳过" -fi - -if command -v nvcc >/dev/null 2>&1; then - nvcc --version | tail -n 2 || true -fi - -echo "[4/5] 启动 ollama API 服务并检查 /api/version..." -"${OLLAMA_BIN}" serve >/tmp/ollama-test.log 2>&1 & -SERVER_PID=$! - -READY=0 -for _ in $(seq 1 "${START_TIMEOUT}"); do - if http_get "${OLLAMA_URL}/api/version" >/dev/null 2>&1; then - READY=1 - break - fi - sleep 1 -done - -if [ "${READY}" != "1" ]; then - echo "---- ollama 服务日志 ----" - cat /tmp/ollama-test.log || true - echo "------------------------" - fail "ollama serve 启动失败或 ${START_TIMEOUT}s 内未就绪" -fi -pass "ollama API 服务启动成功" - -API_VERSION="$(http_get "${OLLAMA_URL}/api/version")" || fail "访问 /api/version 失败" -echo " ${API_VERSION}" -pass "API /api/version 可正常访问" - -echo "[5/5] 检查核心 CLI 功能..." -LIST_OUT="$(${OLLAMA_BIN} list 2>&1)" || fail "ollama list 执行失败" -echo "${LIST_OUT}" -pass "ollama list 可正常执行" - -echo "=== 容器内基础功能测试通过 ===" -' - -pass "镜像 ${IMAGE} 基础功能测试通过" \ No newline at end of file diff --git a/frameworks/ollama/0.19.0/test_result.png b/frameworks/ollama/0.19.0/test_result.png deleted file mode 100644 index e8c48d49dc25bc3b00e08b6b019cfd12af1cee99..0000000000000000000000000000000000000000 Binary files a/frameworks/ollama/0.19.0/test_result.png and /dev/null differ diff --git a/frameworks/ollama/0.20.0/Dockerfile b/frameworks/ollama/0.20.0/Dockerfile deleted file mode 100644 index 3f54c5619f585463b5988084b521352d56efc547..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.20.0/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ - -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="stronking 363133710@qq.com" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="ollma 0.20.0 (GPU) on OpenCloudOS 9" - - -ENV NVIDIA_VISIBLE_DEVICES=all -WORKDIR /tmp/ -RUN dnf install -y git gcc gcc-c++ make \ - cmake tar gzip xz \ - zstd curl wget \ - && dnf clean all \ - && rm -rf /var/ccache/yum/* - -RUN curl -LO https://go.dev/dl/go1.24.1.linux-amd64.tar.gz -RUN rm -rf /usr/local/go -RUN tar -C /usr/local -xzf go1.24.1.linux-amd64.tar.gz -ENV PATH=/usr/local/go/bin:$PATH -RUN wget https://github.com/ollama/ollama/archive/refs/tags/v0.20.0.zip && unzip v0.20.0.zip -WORKDIR /tmp/ollama-0.20.0/ -RUN cmake -B build -RUN cmake --build build -j"$(nproc)" -RUN cmake --install build --prefix /usr/local -RUN go build -trimpath -ldflags="-w -s -X=github.com/ollama/ollama/version.Version=0.20.0 -X=github.com/ollama/ollama/server.mode=release" -o ollama . -RUN install -m 755 ./ollama /usr/local/bin/ollama -RUN rm -rf /tmp/* -WORKDIR /home/ -RUN rm -rf /root/.cache && rm -rf /root/go -EXPOSE 11434 - -CMD ["ollama","serve"] \ No newline at end of file diff --git a/frameworks/ollama/0.20.0/README.md b/frameworks/ollama/0.20.0/README.md deleted file mode 100644 index 2655f62fe36ec352b4cee3bb8f0e547dc3d6f3ec..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.20.0/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# ollama 0.20.0 on OpenCloudOS 9 - -## 基本信息 -- **框架版本**:v0.20.0 -- **基础镜像**:opencloudos9-cuda-devel:12.8 -- **Python 版本**:3.11 -- **CUDA 版本**: 12.x 或 更高 - -## 构建 - -docker build -t oc9-ollama:0.20.0 . - - -## 源码构建ollama应用,依赖go版本对应关系说明 - -| Ollama 版本 | Go 版本 | 说明 | -|---|---|----------------------| -| v0.1.0 | 1.20 | 早期版本 | -| v0.2.0 | 1.22.0 | 0.2.x 开始升级到 Go 1.22 | -| v0.2.1 | 1.22.0 | 与 v0.2.0 一致 | -| v0.3.14 | 1.22.5 | 0.3.x 使用 Go 1.22.5 | -| v0.4.7 | 1.22.8 | 0.4.x 使用 Go 1.22.8 | -| v0.5.13 | 1.24.0 | 0.5.x 已升级到 Go 1.24.0 | -| v0.11.4 | 1.24.0 | 0.11.x 仍为 Go 1.24.0 | -| v0.20.4 | 1.24.1 | 打包版本 | -| main(当前主线) | 1.24.1 | 当前官方主线 `go.mod` | - - -## 使用示例 - -### ollama 环境变量配置说明 - -下面这些是日常最常用、最值得优先掌握的环境变量。 - -| 变量名 | 作用 | 常见值示例 | 说明 | -|---|---|---|---| -| `OLLAMA_HOST` | 设置 Ollama 服务监听地址 | `0.0.0.0:11434` | 默认监听 `127.0.0.1:11434`。如果要让容器外、局域网、反向代理访问,通常设为 `0.0.0.0:11434`。 | -| `OLLAMA_MODELS` | 设置模型存储目录 | `/models` | 用于把模型文件放到挂载卷、大磁盘或 NAS。 | -| `OLLAMA_KEEP_ALIVE` | 模型在内存中保留时长 | `30m` | 默认约为 `5m`。负值通常表示无限保留,`0` 表示不保活。 | -| `OLLAMA_CONTEXT_LENGTH` | 设置默认上下文长度 | `8192` | FAQ 中示例为 `8192`。不同版本对默认值说明略有差异,建议显式设置。 | -| `OLLAMA_ORIGINS` | 设置允许跨域访问的来源 | `http://localhost:3000,https://chat.example.com` | 当前端页面、浏览器扩展要直接访问 Ollama API 时很常用。 | -| `OLLAMA_NO_CLOUD` | 禁用 Ollama cloud 功能 | `1` | 适合纯本地、内网、离线化部署。 | -| `OLLAMA_DEBUG` | 打开调试日志 | `1` | 用于排查服务启动、模型加载、推理等问题。 | -| `HTTPS_PROXY` | 设置模型下载代理 | `https://proxy.example.com:8443` | 官方 FAQ 明确建议优先使用 `HTTPS_PROXY`。 | -| `NO_PROXY` | 设置代理例外地址 | `127.0.0.1,localhost` | 避免本地 API 请求被代理。 | -| `CUDA_VISIBLE_DEVICES` | 指定可见的 NVIDIA GPU | `0` 或 `0,1` | 多卡机器常用,只让 Ollama 使用指定 GPU。 | - - -### 镜像启动命令 - -docker run -d --name oc9-ollama --gpus all oc9-ollama:0.20.0 - -### 镜像测试命令 - -docker run --rm --gpus all oc9-ollama:0.20.0 bash test.sh - -## 已知问题 -- (如有) \ No newline at end of file diff --git a/frameworks/ollama/0.20.0/build.conf b/frameworks/ollama/0.20.0/build.conf deleted file mode 100644 index 70d3c487595c39d57e1b75ec9072e1e9a99d4722..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.20.0/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ollama 0.20.00 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-ollama -IMAGE_TAG=0.20.0 -GPU_TEST=false \ No newline at end of file diff --git a/frameworks/ollama/0.20.0/test.sh b/frameworks/ollama/0.20.0/test.sh deleted file mode 100644 index d6b02c705a78daf69725a8c500a48b92869384e5..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.20.0/test.sh +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin bash - -set -e - -IMAGE="${1:-}" - -pass() { - echo "✓ $1" -} - -fail() { - echo "✗ $1" >&2 - exit 1 -} - -if [ -z "${IMAGE}" ]; then - echo "用法: bash test.sh <镜像名:标签>" >&2 - exit 1 -fi - -command -v docker >/dev/null 2>&1 || fail "未找到 docker,无法运行容器功能测试" - -echo "=== Ollama 容器基础功能测试 ===" -echo "待测镜像: ${IMAGE}" - -OLLAMA_BIN="${OLLAMA_BIN:-/usr/local/bin/ollama}" -OLLAMA_HOST="${OLLAMA_HOST:-127.0.0.1:11434}" -START_TIMEOUT="${START_TIMEOUT:-30}" - -docker run --rm \ - --gpus all \ - -e OLLAMA_BIN="${OLLAMA_BIN}" \ - -e OLLAMA_HOST="${OLLAMA_HOST}" \ - -e START_TIMEOUT="${START_TIMEOUT}" \ - --entrypoint /bin/bash \ - "${IMAGE}" \ - -lc ' -set -Eeuo pipefail - -export CUDA_HOME="${CUDA_HOME:-/usr/local/cuda}" -export PATH="${CUDA_HOME}/bin:${PATH}" -export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH:-}" - -OLLAMA_BIN="${OLLAMA_BIN:-/usr/local/bin/ollama}" -OLLAMA_HOST="${OLLAMA_HOST:-127.0.0.1:11434}" -OLLAMA_URL="http://${OLLAMA_HOST}" -START_TIMEOUT="${START_TIMEOUT:-30}" -SERVER_PID="" - -pass() { - echo "✓ $1" -} - -fail() { - echo "✗ $1" >&2 - exit 1 -} - -cleanup() { - if [ -n "${SERVER_PID}" ]; then - kill "${SERVER_PID}" >/dev/null 2>&1 || true - wait "${SERVER_PID}" 2>/dev/null || true - fi -} -trap cleanup EXIT - -http_get() { - local url="$1" - if command -v curl >/dev/null 2>&1; then - curl -fsS "${url}" - elif command -v wget >/dev/null 2>&1; then - wget -qO- "${url}" - elif command -v python3 >/dev/null 2>&1; then - python3 - "${url}" <<"PY" -import sys -from urllib.request import urlopen - -url = sys.argv[1] -with urlopen(url, timeout=5) as resp: - sys.stdout.write(resp.read().decode("utf-8", errors="replace")) -PY - else - fail "未找到 curl、wget 或 python3,无法检查 HTTP API" - fi -} - -echo "[1/5] 检查 ollama 二进制..." -[ -x "${OLLAMA_BIN}" ] || fail "ollama 未安装或不可执行: ${OLLAMA_BIN}" -pass "ollama 二进制存在" - -echo "[2/5] 检查 ollama 是否可正常运行..." -VERSION_OUT="$(${OLLAMA_BIN} --version 2>&1)" || fail "ollama --version 执行失败" -echo " ${VERSION_OUT}" -pass "ollama 可正常运行" - -echo "[3/5] 检查运行环境信息..." -if command -v nvidia-smi >/dev/null 2>&1; then - nvidia-smi | head -n 3 || true - pass "检测到 nvidia-smi(基础测试不强制要求 GPU)" -else - echo " 未检测到 nvidia-smi,跳过 GPU 检查;CUDA 可用性由 CI 的 GPU_TEST=true 额外验证" - pass "GPU 检查已跳过" -fi - -if command -v nvcc >/dev/null 2>&1; then - nvcc --version | tail -n 2 || true -fi - -echo "[4/5] 启动 ollama API 服务并检查 /api/version..." -"${OLLAMA_BIN}" serve >/tmp/ollama-test.log 2>&1 & -SERVER_PID=$! - -READY=0 -for _ in $(seq 1 "${START_TIMEOUT}"); do - if http_get "${OLLAMA_URL}/api/version" >/dev/null 2>&1; then - READY=1 - break - fi - sleep 1 -done - -if [ "${READY}" != "1" ]; then - echo "---- ollama 服务日志 ----" - cat /tmp/ollama-test.log || true - echo "------------------------" - fail "ollama serve 启动失败或 ${START_TIMEOUT}s 内未就绪" -fi -pass "ollama API 服务启动成功" - -API_VERSION="$(http_get "${OLLAMA_URL}/api/version")" || fail "访问 /api/version 失败" -echo " ${API_VERSION}" -pass "API /api/version 可正常访问" - -echo "[5/5] 检查核心 CLI 功能..." -LIST_OUT="$(${OLLAMA_BIN} list 2>&1)" || fail "ollama list 执行失败" -echo "${LIST_OUT}" -pass "ollama list 可正常执行" - -echo "=== 容器内基础功能测试通过 ===" -' - -pass "镜像 ${IMAGE} 基础功能测试通过" \ No newline at end of file diff --git a/frameworks/ollama/0.20.0/test_result.png b/frameworks/ollama/0.20.0/test_result.png deleted file mode 100644 index f37739c07aaec79bac38534cac42e84866a38348..0000000000000000000000000000000000000000 Binary files a/frameworks/ollama/0.20.0/test_result.png and /dev/null differ diff --git a/frameworks/ollama/0.20.2/Dockerfile b/frameworks/ollama/0.20.2/Dockerfile deleted file mode 100644 index 2c436de1c1b4c030db901a7f60c2c8ac6868b8c2..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.20.2/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ - -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="stronking 363133710@qq.com" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="ollma 0.20.2 (GPU) on OpenCloudOS 9" - - -ENV NVIDIA_VISIBLE_DEVICES=all -WORKDIR /tmp/ -RUN dnf install -y git gcc gcc-c++ make \ - cmake tar gzip xz \ - zstd curl wget \ - && dnf clean all \ - && rm -rf /var/ccache/yum/* - -RUN curl -LO https://go.dev/dl/go1.24.1.linux-amd64.tar.gz -RUN rm -rf /usr/local/go -RUN tar -C /usr/local -xzf go1.24.1.linux-amd64.tar.gz -ENV PATH=/usr/local/go/bin:$PATH -RUN wget https://github.com/ollama/ollama/archive/refs/tags/v0.20.2.zip && unzip v0.20.2.zip -WORKDIR /tmp/ollama-0.20.2/ -RUN cmake -B build -RUN cmake --build build -j"$(nproc)" -RUN cmake --install build --prefix /usr/local -RUN go build -trimpath -ldflags="-w -s -X=github.com/ollama/ollama/version.Version=0.20.2 -X=github.com/ollama/ollama/server.mode=release" -o ollama . -RUN install -m 755 ./ollama /usr/local/bin/ollama -RUN rm -rf /tmp/* -WORKDIR /home/ -RUN rm -rf /root/.cache && rm -rf /root/go -EXPOSE 11434 - -CMD ["ollama","serve"] \ No newline at end of file diff --git a/frameworks/ollama/0.20.2/README.md b/frameworks/ollama/0.20.2/README.md deleted file mode 100644 index 30a79c7ebd94c2e4c4132ab8746acec661d73758..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.20.2/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# ollama 0.20.2 on OpenCloudOS 9 - -## 基本信息 -- **框架版本**:v0.20.2 -- **基础镜像**:opencloudos9-cuda-devel:12.8 -- **Python 版本**:3.11 -- **CUDA 版本**: 12.x 或 更高 - -## 构建 - -docker build -t oc9-ollama:0.20.3 . - - -## 源码构建ollama应用,依赖go版本对应关系说明 - -| Ollama 版本 | Go 版本 | 说明 | -|---|---|----------------------| -| v0.1.0 | 1.20 | 早期版本 | -| v0.2.0 | 1.22.0 | 0.2.x 开始升级到 Go 1.22 | -| v0.2.1 | 1.22.0 | 与 v0.2.0 一致 | -| v0.3.14 | 1.22.5 | 0.3.x 使用 Go 1.22.5 | -| v0.4.7 | 1.22.8 | 0.4.x 使用 Go 1.22.8 | -| v0.5.13 | 1.24.0 | 0.5.x 已升级到 Go 1.24.0 | -| v0.11.4 | 1.24.0 | 0.11.x 仍为 Go 1.24.0 | -| v0.20.4 | 1.24.1 | 打包版本 | -| main(当前主线) | 1.24.1 | 当前官方主线 `go.mod` | - - -## 使用示例 - -### ollama 环境变量配置说明 - -下面这些是日常最常用、最值得优先掌握的环境变量。 - -| 变量名 | 作用 | 常见值示例 | 说明 | -|---|---|---|---| -| `OLLAMA_HOST` | 设置 Ollama 服务监听地址 | `0.0.0.0:11434` | 默认监听 `127.0.0.1:11434`。如果要让容器外、局域网、反向代理访问,通常设为 `0.0.0.0:11434`。 | -| `OLLAMA_MODELS` | 设置模型存储目录 | `/models` | 用于把模型文件放到挂载卷、大磁盘或 NAS。 | -| `OLLAMA_KEEP_ALIVE` | 模型在内存中保留时长 | `30m` | 默认约为 `5m`。负值通常表示无限保留,`0` 表示不保活。 | -| `OLLAMA_CONTEXT_LENGTH` | 设置默认上下文长度 | `8192` | FAQ 中示例为 `8192`。不同版本对默认值说明略有差异,建议显式设置。 | -| `OLLAMA_ORIGINS` | 设置允许跨域访问的来源 | `http://localhost:3000,https://chat.example.com` | 当前端页面、浏览器扩展要直接访问 Ollama API 时很常用。 | -| `OLLAMA_NO_CLOUD` | 禁用 Ollama cloud 功能 | `1` | 适合纯本地、内网、离线化部署。 | -| `OLLAMA_DEBUG` | 打开调试日志 | `1` | 用于排查服务启动、模型加载、推理等问题。 | -| `HTTPS_PROXY` | 设置模型下载代理 | `https://proxy.example.com:8443` | 官方 FAQ 明确建议优先使用 `HTTPS_PROXY`。 | -| `NO_PROXY` | 设置代理例外地址 | `127.0.0.1,localhost` | 避免本地 API 请求被代理。 | -| `CUDA_VISIBLE_DEVICES` | 指定可见的 NVIDIA GPU | `0` 或 `0,1` | 多卡机器常用,只让 Ollama 使用指定 GPU。 | - - -### 镜像启动命令 - -docker run -d --name oc9-ollama --gpus all oc9-ollama:0.20.2 - -### 镜像测试命令 - -docker run --rm --gpus all oc9-ollama:0.20.2 bash test.sh - -## 已知问题 -- (如有) \ No newline at end of file diff --git a/frameworks/ollama/0.20.2/build.conf b/frameworks/ollama/0.20.2/build.conf deleted file mode 100644 index f20b48c490661309d744cc88a6bc38c5caf04627..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.20.2/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ollama 0.20.2 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-ollama -IMAGE_TAG=0.20.2 -GPU_TEST=false \ No newline at end of file diff --git a/frameworks/ollama/0.20.2/test.sh b/frameworks/ollama/0.20.2/test.sh deleted file mode 100644 index d6b02c705a78daf69725a8c500a48b92869384e5..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.20.2/test.sh +++ /dev/null @@ -1,142 +0,0 @@ -#!/usr/bin bash - -set -e - -IMAGE="${1:-}" - -pass() { - echo "✓ $1" -} - -fail() { - echo "✗ $1" >&2 - exit 1 -} - -if [ -z "${IMAGE}" ]; then - echo "用法: bash test.sh <镜像名:标签>" >&2 - exit 1 -fi - -command -v docker >/dev/null 2>&1 || fail "未找到 docker,无法运行容器功能测试" - -echo "=== Ollama 容器基础功能测试 ===" -echo "待测镜像: ${IMAGE}" - -OLLAMA_BIN="${OLLAMA_BIN:-/usr/local/bin/ollama}" -OLLAMA_HOST="${OLLAMA_HOST:-127.0.0.1:11434}" -START_TIMEOUT="${START_TIMEOUT:-30}" - -docker run --rm \ - --gpus all \ - -e OLLAMA_BIN="${OLLAMA_BIN}" \ - -e OLLAMA_HOST="${OLLAMA_HOST}" \ - -e START_TIMEOUT="${START_TIMEOUT}" \ - --entrypoint /bin/bash \ - "${IMAGE}" \ - -lc ' -set -Eeuo pipefail - -export CUDA_HOME="${CUDA_HOME:-/usr/local/cuda}" -export PATH="${CUDA_HOME}/bin:${PATH}" -export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH:-}" - -OLLAMA_BIN="${OLLAMA_BIN:-/usr/local/bin/ollama}" -OLLAMA_HOST="${OLLAMA_HOST:-127.0.0.1:11434}" -OLLAMA_URL="http://${OLLAMA_HOST}" -START_TIMEOUT="${START_TIMEOUT:-30}" -SERVER_PID="" - -pass() { - echo "✓ $1" -} - -fail() { - echo "✗ $1" >&2 - exit 1 -} - -cleanup() { - if [ -n "${SERVER_PID}" ]; then - kill "${SERVER_PID}" >/dev/null 2>&1 || true - wait "${SERVER_PID}" 2>/dev/null || true - fi -} -trap cleanup EXIT - -http_get() { - local url="$1" - if command -v curl >/dev/null 2>&1; then - curl -fsS "${url}" - elif command -v wget >/dev/null 2>&1; then - wget -qO- "${url}" - elif command -v python3 >/dev/null 2>&1; then - python3 - "${url}" <<"PY" -import sys -from urllib.request import urlopen - -url = sys.argv[1] -with urlopen(url, timeout=5) as resp: - sys.stdout.write(resp.read().decode("utf-8", errors="replace")) -PY - else - fail "未找到 curl、wget 或 python3,无法检查 HTTP API" - fi -} - -echo "[1/5] 检查 ollama 二进制..." -[ -x "${OLLAMA_BIN}" ] || fail "ollama 未安装或不可执行: ${OLLAMA_BIN}" -pass "ollama 二进制存在" - -echo "[2/5] 检查 ollama 是否可正常运行..." -VERSION_OUT="$(${OLLAMA_BIN} --version 2>&1)" || fail "ollama --version 执行失败" -echo " ${VERSION_OUT}" -pass "ollama 可正常运行" - -echo "[3/5] 检查运行环境信息..." -if command -v nvidia-smi >/dev/null 2>&1; then - nvidia-smi | head -n 3 || true - pass "检测到 nvidia-smi(基础测试不强制要求 GPU)" -else - echo " 未检测到 nvidia-smi,跳过 GPU 检查;CUDA 可用性由 CI 的 GPU_TEST=true 额外验证" - pass "GPU 检查已跳过" -fi - -if command -v nvcc >/dev/null 2>&1; then - nvcc --version | tail -n 2 || true -fi - -echo "[4/5] 启动 ollama API 服务并检查 /api/version..." -"${OLLAMA_BIN}" serve >/tmp/ollama-test.log 2>&1 & -SERVER_PID=$! - -READY=0 -for _ in $(seq 1 "${START_TIMEOUT}"); do - if http_get "${OLLAMA_URL}/api/version" >/dev/null 2>&1; then - READY=1 - break - fi - sleep 1 -done - -if [ "${READY}" != "1" ]; then - echo "---- ollama 服务日志 ----" - cat /tmp/ollama-test.log || true - echo "------------------------" - fail "ollama serve 启动失败或 ${START_TIMEOUT}s 内未就绪" -fi -pass "ollama API 服务启动成功" - -API_VERSION="$(http_get "${OLLAMA_URL}/api/version")" || fail "访问 /api/version 失败" -echo " ${API_VERSION}" -pass "API /api/version 可正常访问" - -echo "[5/5] 检查核心 CLI 功能..." -LIST_OUT="$(${OLLAMA_BIN} list 2>&1)" || fail "ollama list 执行失败" -echo "${LIST_OUT}" -pass "ollama list 可正常执行" - -echo "=== 容器内基础功能测试通过 ===" -' - -pass "镜像 ${IMAGE} 基础功能测试通过" \ No newline at end of file diff --git a/frameworks/ollama/0.20.2/test_result.png b/frameworks/ollama/0.20.2/test_result.png deleted file mode 100644 index 82e779b884d5b2929cd11e649a932154d38cdcc8..0000000000000000000000000000000000000000 Binary files a/frameworks/ollama/0.20.2/test_result.png and /dev/null differ diff --git a/frameworks/ollama/0.20.3/Dockerfile b/frameworks/ollama/0.20.3/Dockerfile deleted file mode 100644 index 1ded53a54dca7e3001aa6d59d5da91c53f412b4e..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.20.3/Dockerfile +++ /dev/null @@ -1,33 +0,0 @@ - -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="stronking 363133710@qq.com" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="ollma 0.20.3 (GPU) on OpenCloudOS 9" - - -ENV NVIDIA_VISIBLE_DEVICES=all -WORKDIR /tmp/ -RUN dnf install -y git gcc gcc-c++ make \ - cmake tar gzip xz \ - zstd curl wget \ - && dnf clean all \ - && rm -rf /var/ccache/yum/* - -RUN curl -LO https://go.dev/dl/go1.24.1.linux-amd64.tar.gz -RUN rm -rf /usr/local/go -RUN tar -C /usr/local -xzf go1.24.1.linux-amd64.tar.gz -ENV PATH=/usr/local/go/bin:$PATH -RUN wget https://github.com/ollama/ollama/archive/refs/tags/v0.20.3.zip && unzip v0.20.3.zip -WORKDIR /tmp/ollama-0.20.3/ -RUN cmake -B build -RUN cmake --build build -j"$(nproc)" -RUN cmake --install build --prefix /usr/local -RUN go build -trimpath -ldflags="-w -s -X=github.com/ollama/ollama/version.Version=0.20.3 -X=github.com/ollama/ollama/server.mode=release" -o ollama . -RUN install -m 755 ./ollama /usr/local/bin/ollama -RUN rm -rf /tmp/* -WORKDIR /home/ -RUN rm -rf /root/.cache && rm -rf /root/go -EXPOSE 11434 - -CMD ["ollama","serve"] \ No newline at end of file diff --git a/frameworks/ollama/0.20.3/README.md b/frameworks/ollama/0.20.3/README.md deleted file mode 100644 index 26d55415ff92a18b4e6ef6efb5303256e0a530fb..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.20.3/README.md +++ /dev/null @@ -1,58 +0,0 @@ -# ollama 0.20.3 on OpenCloudOS 9 - -## 基本信息 -- **框架版本**:v0.20.3 -- **基础镜像**:opencloudos9-cuda-devel:12.8 -- **Python 版本**:3.11 -- **CUDA 版本**: 12.x 或 更高 - -## 构建 - -docker build -t oc9-ollama:0.20.3 . - - -## 源码构建ollama应用,依赖go版本对应关系说明 - -| Ollama 版本 | Go 版本 | 说明 | -|---|---|----------------------| -| v0.1.0 | 1.20 | 早期版本 | -| v0.2.0 | 1.22.0 | 0.2.x 开始升级到 Go 1.22 | -| v0.2.1 | 1.22.0 | 与 v0.2.0 一致 | -| v0.3.14 | 1.22.5 | 0.3.x 使用 Go 1.22.5 | -| v0.4.7 | 1.22.8 | 0.4.x 使用 Go 1.22.8 | -| v0.5.13 | 1.24.0 | 0.5.x 已升级到 Go 1.24.0 | -| v0.11.4 | 1.24.0 | 0.11.x 仍为 Go 1.24.0 | -| v0.20.4 | 1.24.1 | 打包版本 | -| main(当前主线) | 1.24.1 | 当前官方主线 `go.mod` | - - -## 使用示例 - -### ollama 环境变量配置说明 - -下面这些是日常最常用、最值得优先掌握的环境变量。 - -| 变量名 | 作用 | 常见值示例 | 说明 | -|---|---|---|---| -| `OLLAMA_HOST` | 设置 Ollama 服务监听地址 | `0.0.0.0:11434` | 默认监听 `127.0.0.1:11434`。如果要让容器外、局域网、反向代理访问,通常设为 `0.0.0.0:11434`。 | -| `OLLAMA_MODELS` | 设置模型存储目录 | `/models` | 用于把模型文件放到挂载卷、大磁盘或 NAS。 | -| `OLLAMA_KEEP_ALIVE` | 模型在内存中保留时长 | `30m` | 默认约为 `5m`。负值通常表示无限保留,`0` 表示不保活。 | -| `OLLAMA_CONTEXT_LENGTH` | 设置默认上下文长度 | `8192` | FAQ 中示例为 `8192`。不同版本对默认值说明略有差异,建议显式设置。 | -| `OLLAMA_ORIGINS` | 设置允许跨域访问的来源 | `http://localhost:3000,https://chat.example.com` | 当前端页面、浏览器扩展要直接访问 Ollama API 时很常用。 | -| `OLLAMA_NO_CLOUD` | 禁用 Ollama cloud 功能 | `1` | 适合纯本地、内网、离线化部署。 | -| `OLLAMA_DEBUG` | 打开调试日志 | `1` | 用于排查服务启动、模型加载、推理等问题。 | -| `HTTPS_PROXY` | 设置模型下载代理 | `https://proxy.example.com:8443` | 官方 FAQ 明确建议优先使用 `HTTPS_PROXY`。 | -| `NO_PROXY` | 设置代理例外地址 | `127.0.0.1,localhost` | 避免本地 API 请求被代理。 | -| `CUDA_VISIBLE_DEVICES` | 指定可见的 NVIDIA GPU | `0` 或 `0,1` | 多卡机器常用,只让 Ollama 使用指定 GPU。 | - - -### 镜像启动命令 - -docker run -d --name oc9-ollama --gpus all oc9-ollama:0.20.3 - -### 镜像测试命令 - -docker run --rm --gpus all oc9-ollama:0.20.3 bash test.sh - -## 已知问题 -- (如有) \ No newline at end of file diff --git a/frameworks/ollama/0.20.3/build.conf b/frameworks/ollama/0.20.3/build.conf deleted file mode 100644 index 4c1cb8c293892b9d464eac1a84c6a1d1d1e224e7..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.20.3/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ollama 0.20.3 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-ollama -IMAGE_TAG=0.20.3 -GPU_TEST=false \ No newline at end of file diff --git a/frameworks/ollama/0.20.3/test.sh b/frameworks/ollama/0.20.3/test.sh deleted file mode 100644 index baf8ad4576e8eb8b914296a356bdc6b712fca602..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.20.3/test.sh +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin bash -set -e - -IMAGE="${1:-}" - -pass() { - echo "✓ $1" -} - -fail() { - echo "✗ $1" >&2 - exit 1 -} - -if [ -z "${IMAGE}" ]; then - echo "用法: bash test.sh <镜像名:标签>" >&2 - exit 1 -fi - -command -v docker >/dev/null 2>&1 || fail "未找到 docker,无法运行容器功能测试" - -echo "=== Ollama 容器基础功能测试 ===" -echo "待测镜像: ${IMAGE}" - -OLLAMA_BIN="${OLLAMA_BIN:-/usr/local/bin/ollama}" -OLLAMA_HOST="${OLLAMA_HOST:-127.0.0.1:11434}" -START_TIMEOUT="${START_TIMEOUT:-30}" - -docker run --rm \ - --gpus all \ - -e OLLAMA_BIN="${OLLAMA_BIN}" \ - -e OLLAMA_HOST="${OLLAMA_HOST}" \ - -e START_TIMEOUT="${START_TIMEOUT}" \ - --entrypoint /bin/bash \ - "${IMAGE}" \ - -lc ' -set -Eeuo pipefail - -export CUDA_HOME="${CUDA_HOME:-/usr/local/cuda}" -export PATH="${CUDA_HOME}/bin:${PATH}" -export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH:-}" - -OLLAMA_BIN="${OLLAMA_BIN:-/usr/local/bin/ollama}" -OLLAMA_HOST="${OLLAMA_HOST:-127.0.0.1:11434}" -OLLAMA_URL="http://${OLLAMA_HOST}" -START_TIMEOUT="${START_TIMEOUT:-30}" -SERVER_PID="" - -pass() { - echo "✓ $1" -} - -fail() { - echo "✗ $1" >&2 - exit 1 -} - -cleanup() { - if [ -n "${SERVER_PID}" ]; then - kill "${SERVER_PID}" >/dev/null 2>&1 || true - wait "${SERVER_PID}" 2>/dev/null || true - fi -} -trap cleanup EXIT - -http_get() { - local url="$1" - if command -v curl >/dev/null 2>&1; then - curl -fsS "${url}" - elif command -v wget >/dev/null 2>&1; then - wget -qO- "${url}" - elif command -v python3 >/dev/null 2>&1; then - python3 - "${url}" <<"PY" -import sys -from urllib.request import urlopen - -url = sys.argv[1] -with urlopen(url, timeout=5) as resp: - sys.stdout.write(resp.read().decode("utf-8", errors="replace")) -PY - else - fail "未找到 curl、wget 或 python3,无法检查 HTTP API" - fi -} - -echo "[1/5] 检查 ollama 二进制..." -[ -x "${OLLAMA_BIN}" ] || fail "ollama 未安装或不可执行: ${OLLAMA_BIN}" -pass "ollama 二进制存在" - -echo "[2/5] 检查 ollama 是否可正常运行..." -VERSION_OUT="$(${OLLAMA_BIN} --version 2>&1)" || fail "ollama --version 执行失败" -echo " ${VERSION_OUT}" -pass "ollama 可正常运行" - -echo "[3/5] 检查运行环境信息..." -if command -v nvidia-smi >/dev/null 2>&1; then - nvidia-smi | head -n 3 || true - pass "检测到 nvidia-smi(基础测试不强制要求 GPU)" -else - echo " 未检测到 nvidia-smi,跳过 GPU 检查;CUDA 可用性由 CI 的 GPU_TEST=true 额外验证" - pass "GPU 检查已跳过" -fi - -if command -v nvcc >/dev/null 2>&1; then - nvcc --version | tail -n 2 || true -fi - -echo "[4/5] 启动 ollama API 服务并检查 /api/version..." -"${OLLAMA_BIN}" serve >/tmp/ollama-test.log 2>&1 & -SERVER_PID=$! - -READY=0 -for _ in $(seq 1 "${START_TIMEOUT}"); do - if http_get "${OLLAMA_URL}/api/version" >/dev/null 2>&1; then - READY=1 - break - fi - sleep 1 -done - -if [ "${READY}" != "1" ]; then - echo "---- ollama 服务日志 ----" - cat /tmp/ollama-test.log || true - echo "------------------------" - fail "ollama serve 启动失败或 ${START_TIMEOUT}s 内未就绪" -fi -pass "ollama API 服务启动成功" - -API_VERSION="$(http_get "${OLLAMA_URL}/api/version")" || fail "访问 /api/version 失败" -echo " ${API_VERSION}" -pass "API /api/version 可正常访问" - -echo "[5/5] 检查核心 CLI 功能..." -LIST_OUT="$(${OLLAMA_BIN} list 2>&1)" || fail "ollama list 执行失败" -echo "${LIST_OUT}" -pass "ollama list 可正常执行" - -echo "=== 容器内基础功能测试通过 ===" -' - -pass "镜像 ${IMAGE} 基础功能测试通过" \ No newline at end of file diff --git a/frameworks/ollama/0.20.3/test_result.png b/frameworks/ollama/0.20.3/test_result.png deleted file mode 100644 index 3e3c8d171292caa656a451acc4f5d54840ca6ad2..0000000000000000000000000000000000000000 Binary files a/frameworks/ollama/0.20.3/test_result.png and /dev/null differ diff --git a/frameworks/ollama/0.20.4/Dockerfile b/frameworks/ollama/0.20.4/Dockerfile deleted file mode 100644 index b10bd50c80f7d76453e3f955cc4ff8ea2075f171..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.20.4/Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ - -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="stronking 363133710@qq.com" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="ollma 0.20.4 (GPU) on OpenCloudOS 9" - - -ENV NVIDIA_VISIBLE_DEVICES=all -WORKDIR /tmp/ -RUN dnf install -y git gcc gcc-c++ make \ - cmake tar gzip xz \ - zstd curl wget \ - && dnf clean all \ - && rm -rf /var/ccache/yum/* - -RUN curl -LO https://go.dev/dl/go1.24.1.linux-amd64.tar.gz -RUN rm -rf /usr/local/go -RUN tar -C /usr/local -xzf go1.24.1.linux-amd64.tar.gz -ENV PATH=/usr/local/go/bin:$PATH -RUN wget https://github.com/ollama/ollama/archive/refs/tags/v0.20.4.zip && unzip v0.20.4.zip -WORKDIR /tmp/ollama-0.20.4/ -RUN cmake -B build -RUN cmake --build build -j"$(nproc)" -RUN cmake --install build --prefix /usr/local -RUN go build -trimpath -ldflags="-w -s -X=github.com/ollama/ollama/version.Version=0.20.4 -X=github.com/ollama/ollama/server.mode=release" -o ollama . -RUN install -m 755 ./ollama /usr/local/bin/ollama -RUN rm -rf /tmp/* -WORKDIR /home/ -RUN rm -rf /root/.cache && rm -rf /root/go -EXPOSE 11434 -CMD ["ollama","serve"] \ No newline at end of file diff --git a/frameworks/ollama/0.20.4/README.md b/frameworks/ollama/0.20.4/README.md deleted file mode 100644 index df9752c8c7b99f18107af6c25fd57462015bd597..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.20.4/README.md +++ /dev/null @@ -1,42 +0,0 @@ -# ollama 0.20.4 on OpenCloudOS 9 - -## 基本信息 -- **框架版本**:v0.20.4 -- **基础镜像**:opencloudos9-cuda-devel:12.8 -- **Python 版本**:3.11 -- **CUDA 版本**: 12.x 或 更高 - -## 构建 - -docker build -t oc9-ollama:0.20.4 . - -## 使用示例 - -### ollama 环境变量配置说明 - -下面这些是日常最常用、最值得优先掌握的环境变量。 - -| 变量名 | 作用 | 常见值示例 | 说明 | -|---|---|---|---| -| `OLLAMA_HOST` | 设置 Ollama 服务监听地址 | `0.0.0.0:11434` | 默认监听 `127.0.0.1:11434`。如果要让容器外、局域网、反向代理访问,通常设为 `0.0.0.0:11434`。 | -| `OLLAMA_MODELS` | 设置模型存储目录 | `/models` | 用于把模型文件放到挂载卷、大磁盘或 NAS。 | -| `OLLAMA_KEEP_ALIVE` | 模型在内存中保留时长 | `30m` | 默认约为 `5m`。负值通常表示无限保留,`0` 表示不保活。 | -| `OLLAMA_CONTEXT_LENGTH` | 设置默认上下文长度 | `8192` | FAQ 中示例为 `8192`。不同版本对默认值说明略有差异,建议显式设置。 | -| `OLLAMA_ORIGINS` | 设置允许跨域访问的来源 | `http://localhost:3000,https://chat.example.com` | 当前端页面、浏览器扩展要直接访问 Ollama API 时很常用。 | -| `OLLAMA_NO_CLOUD` | 禁用 Ollama cloud 功能 | `1` | 适合纯本地、内网、离线化部署。 | -| `OLLAMA_DEBUG` | 打开调试日志 | `1` | 用于排查服务启动、模型加载、推理等问题。 | -| `HTTPS_PROXY` | 设置模型下载代理 | `https://proxy.example.com:8443` | 官方 FAQ 明确建议优先使用 `HTTPS_PROXY`。 | -| `NO_PROXY` | 设置代理例外地址 | `127.0.0.1,localhost` | 避免本地 API 请求被代理。 | -| `CUDA_VISIBLE_DEVICES` | 指定可见的 NVIDIA GPU | `0` 或 `0,1` | 多卡机器常用,只让 Ollama 使用指定 GPU。 | - - -### 镜像启动命令 - -docker run -d --name oc9-ollama oc9-ollama:0.20.4 - -### 镜像测试命令 - -docker run --rm --gpus all oc9-ollama:0.20.4 bash test.sh - -## 已知问题 -- (如有) \ No newline at end of file diff --git a/frameworks/ollama/0.20.4/build.conf b/frameworks/ollama/0.20.4/build.conf deleted file mode 100644 index d669220c4b10647dda55859bcf474fe2afc3b1e3..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.20.4/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ollama 0.20.4 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-ollama -IMAGE_TAG=0.20.4 -GPU_TEST=false \ No newline at end of file diff --git a/frameworks/ollama/0.20.4/test.sh b/frameworks/ollama/0.20.4/test.sh deleted file mode 100644 index baf8ad4576e8eb8b914296a356bdc6b712fca602..0000000000000000000000000000000000000000 --- a/frameworks/ollama/0.20.4/test.sh +++ /dev/null @@ -1,141 +0,0 @@ -#!/usr/bin bash -set -e - -IMAGE="${1:-}" - -pass() { - echo "✓ $1" -} - -fail() { - echo "✗ $1" >&2 - exit 1 -} - -if [ -z "${IMAGE}" ]; then - echo "用法: bash test.sh <镜像名:标签>" >&2 - exit 1 -fi - -command -v docker >/dev/null 2>&1 || fail "未找到 docker,无法运行容器功能测试" - -echo "=== Ollama 容器基础功能测试 ===" -echo "待测镜像: ${IMAGE}" - -OLLAMA_BIN="${OLLAMA_BIN:-/usr/local/bin/ollama}" -OLLAMA_HOST="${OLLAMA_HOST:-127.0.0.1:11434}" -START_TIMEOUT="${START_TIMEOUT:-30}" - -docker run --rm \ - --gpus all \ - -e OLLAMA_BIN="${OLLAMA_BIN}" \ - -e OLLAMA_HOST="${OLLAMA_HOST}" \ - -e START_TIMEOUT="${START_TIMEOUT}" \ - --entrypoint /bin/bash \ - "${IMAGE}" \ - -lc ' -set -Eeuo pipefail - -export CUDA_HOME="${CUDA_HOME:-/usr/local/cuda}" -export PATH="${CUDA_HOME}/bin:${PATH}" -export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH:-}" - -OLLAMA_BIN="${OLLAMA_BIN:-/usr/local/bin/ollama}" -OLLAMA_HOST="${OLLAMA_HOST:-127.0.0.1:11434}" -OLLAMA_URL="http://${OLLAMA_HOST}" -START_TIMEOUT="${START_TIMEOUT:-30}" -SERVER_PID="" - -pass() { - echo "✓ $1" -} - -fail() { - echo "✗ $1" >&2 - exit 1 -} - -cleanup() { - if [ -n "${SERVER_PID}" ]; then - kill "${SERVER_PID}" >/dev/null 2>&1 || true - wait "${SERVER_PID}" 2>/dev/null || true - fi -} -trap cleanup EXIT - -http_get() { - local url="$1" - if command -v curl >/dev/null 2>&1; then - curl -fsS "${url}" - elif command -v wget >/dev/null 2>&1; then - wget -qO- "${url}" - elif command -v python3 >/dev/null 2>&1; then - python3 - "${url}" <<"PY" -import sys -from urllib.request import urlopen - -url = sys.argv[1] -with urlopen(url, timeout=5) as resp: - sys.stdout.write(resp.read().decode("utf-8", errors="replace")) -PY - else - fail "未找到 curl、wget 或 python3,无法检查 HTTP API" - fi -} - -echo "[1/5] 检查 ollama 二进制..." -[ -x "${OLLAMA_BIN}" ] || fail "ollama 未安装或不可执行: ${OLLAMA_BIN}" -pass "ollama 二进制存在" - -echo "[2/5] 检查 ollama 是否可正常运行..." -VERSION_OUT="$(${OLLAMA_BIN} --version 2>&1)" || fail "ollama --version 执行失败" -echo " ${VERSION_OUT}" -pass "ollama 可正常运行" - -echo "[3/5] 检查运行环境信息..." -if command -v nvidia-smi >/dev/null 2>&1; then - nvidia-smi | head -n 3 || true - pass "检测到 nvidia-smi(基础测试不强制要求 GPU)" -else - echo " 未检测到 nvidia-smi,跳过 GPU 检查;CUDA 可用性由 CI 的 GPU_TEST=true 额外验证" - pass "GPU 检查已跳过" -fi - -if command -v nvcc >/dev/null 2>&1; then - nvcc --version | tail -n 2 || true -fi - -echo "[4/5] 启动 ollama API 服务并检查 /api/version..." -"${OLLAMA_BIN}" serve >/tmp/ollama-test.log 2>&1 & -SERVER_PID=$! - -READY=0 -for _ in $(seq 1 "${START_TIMEOUT}"); do - if http_get "${OLLAMA_URL}/api/version" >/dev/null 2>&1; then - READY=1 - break - fi - sleep 1 -done - -if [ "${READY}" != "1" ]; then - echo "---- ollama 服务日志 ----" - cat /tmp/ollama-test.log || true - echo "------------------------" - fail "ollama serve 启动失败或 ${START_TIMEOUT}s 内未就绪" -fi -pass "ollama API 服务启动成功" - -API_VERSION="$(http_get "${OLLAMA_URL}/api/version")" || fail "访问 /api/version 失败" -echo " ${API_VERSION}" -pass "API /api/version 可正常访问" - -echo "[5/5] 检查核心 CLI 功能..." -LIST_OUT="$(${OLLAMA_BIN} list 2>&1)" || fail "ollama list 执行失败" -echo "${LIST_OUT}" -pass "ollama list 可正常执行" - -echo "=== 容器内基础功能测试通过 ===" -' - -pass "镜像 ${IMAGE} 基础功能测试通过" \ No newline at end of file diff --git a/frameworks/ollama/0.20.4/test_result.png b/frameworks/ollama/0.20.4/test_result.png deleted file mode 100644 index 1615340f988aff2da22331f69c22a5f6f337a131..0000000000000000000000000000000000000000 Binary files a/frameworks/ollama/0.20.4/test_result.png and /dev/null differ diff --git a/frameworks/onnxruntime/1.24.1-cpu/Dockerfile b/frameworks/onnxruntime/1.24.1-cpu/Dockerfile deleted file mode 100644 index 26ba70c225e19d82722967fdab901b2921325dc9..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.1-cpu/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -FROM opencloudos/opencloudos9-minimal:latest - -LABEL maintainer="Anstarc " -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="ONNX Runtime 1.24.1 CPU on OpenCloudOS 9" - -# 安装系统依赖 -RUN dnf install -y \ - python3.11 \ - python3.11-pip \ - git \ - wget \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 设置工作目录 -WORKDIR /app - -# 安装 ONNX Runtime CPU 版本及依赖 -# 注意:onnx 需要 1.20 以兼容 onnxruntime 1.24.1 (opset 25) -RUN pip3.11 install --no-cache-dir \ - onnxruntime==1.24.1 \ - onnx==1.20.1 \ - numpy \ - protobuf - -# 默认命令 -CMD ["python3.11", "-c", "import onnxruntime; print(f'ONNX Runtime {onnxruntime.__version__} ready')"] diff --git a/frameworks/onnxruntime/1.24.1-cpu/README.md b/frameworks/onnxruntime/1.24.1-cpu/README.md deleted file mode 100644 index d877a1dc5c204dcf16dfad5eb433c47f5bf9e9c6..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.1-cpu/README.md +++ /dev/null @@ -1,82 +0,0 @@ -# ONNX Runtime 1.24.1 CPU on OpenCloudOS 9 - -ONNX Runtime 是微软开源的跨平台机器学习推理加速器,支持多种深度学习框架(PyTorch、TensorFlow 等)训练的模型。 - -## 基本信息 - -- **基础镜像**: opencloudos/opencloudos9-minimal:latest -- **Python 版本**: 3.11 -- **ONNX Runtime 版本**: 1.24.1 (CPU) -- **ONNX 版本**: 1.20.1 (兼容 opset 25) - -## 构建 - -```bash -docker build -t oc9-onnxruntime-cpu:1.24.1 . -``` - -## 测试 - -```bash -./test.sh oc9-onnxruntime-cpu:1.24.1 -``` - -测试项包括: -- Python 环境 -- ONNX Runtime 版本验证 -- CPU 推理功能 -- ONNX ML 域支持 (ai.onnx.ml) -- ONNX IR 版本兼容性 (v3-v10) - -## 使用示例 - -### 基本使用 - -```bash -# 查看版本信息 -docker run --rm oc9-onnxruntime-cpu:1.24.1 python3.11 -c "import onnxruntime; print(onnxruntime.__version__)" - -# 查看可用的 Execution Providers -docker run --rm oc9-onnxruntime-cpu:1.24.1 python3.11 -c "import onnxruntime as ort; print(ort.get_available_providers())" -``` - -### CPU 推理 - -```python -import onnxruntime as ort -import numpy as np - -# 加载模型(使用 CPU Provider) -session = ort.InferenceSession( - "model.onnx", - providers=['CPUExecutionProvider'] -) - -# 准备输入数据 -input_name = session.get_inputs()[0].name -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) - -# 运行推理 -outputs = session.run(None, {input_name: input_data}) -``` - -### 交互式使用 - -```bash -docker run --rm -it oc9-onnxruntime-cpu:1.24.1 bash -``` - -## 支持的 Opset 和 IR 版本 - -- **ai.onnx**: opset 1-25 (标准推理算子) -- **ai.onnx.ml**: opset 1-5 (传统机器学习算子) -- **ONNX IR**: v3-v10 (2017-2024,完全向后兼容) - -## 系统要求 - -- **Docker**: 19.03+ - -## 参考资源 - -- [ONNX Runtime 官方文档](https://onnxruntime.ai/docs/) -- [CPU Execution Provider](https://onnxruntime.ai/docs/execution-providers/CPU-ExecutionProvider.html) diff --git a/frameworks/onnxruntime/1.24.1-cpu/build.conf b/frameworks/onnxruntime/1.24.1-cpu/build.conf deleted file mode 100644 index b6b502815e345237c8c2c0cdddd2d9ff55ef352c..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.1-cpu/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ONNX Runtime 1.24.1 CPU on OpenCloudOS 9 -IMAGE_NAME=oc9-onnxruntime-cpu -IMAGE_TAG=1.24.1 -GPU_TEST=false diff --git a/frameworks/onnxruntime/1.24.1-cpu/test.sh b/frameworks/onnxruntime/1.24.1-cpu/test.sh deleted file mode 100755 index 16a261c3a67ad50d4e55887d70e0ca6ba71411d5..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.1-cpu/test.sh +++ /dev/null @@ -1,217 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:-oc9-onnxruntime-cpu:1.24.1}" - -echo "==========================================" -echo "测试 ONNX Runtime 1.24.1 CPU 镜像" -echo "镜像: $IMAGE" -echo "==========================================" - -# 测试 1: Python 环境 -echo -n "测试 1: Python 环境... " -docker run --rm "$IMAGE" python3.11 --version > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 --version - exit 1 -fi - -# 测试 2: ONNX Runtime 版本 -echo -n "测试 2: ONNX Runtime 版本... " -VERSION=$(docker run --rm "$IMAGE" python3.11 -c "import onnxruntime; print(onnxruntime.__version__)") -if [ "$VERSION" = "1.24.1" ]; then - echo "✓ (版本: $VERSION)" -else - echo "✗ (期望: 1.24.1, 实际: $VERSION)" - exit 1 -fi - -# 测试 3: 核心依赖 -echo -n "测试 3: 核心依赖 (numpy, protobuf)... " -docker run --rm "$IMAGE" python3.11 -c "import numpy; import google.protobuf" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c "import numpy; import google.protobuf" - exit 1 -fi - -# 测试 4: 可用的 Execution Providers -echo -n "测试 4: 可用的 Execution Providers... " -PROVIDERS=$(docker run --rm "$IMAGE" python3.11 -c "import onnxruntime as ort; print(','.join(ort.get_available_providers()))") -echo "✓" -echo " 可用 Providers: $PROVIDERS" - -# 测试 5: CPU 推理测试 -echo -n "测试 5: CPU 推理测试... " -docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -# 创建简单的 ONNX 模型 -X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3, 224, 224]) -Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3, 224, 224]) -node = helper.make_node('Identity', ['X'], ['Y']) -graph = helper.make_graph([node], 'test', [X], [Y]) -model = helper.make_model(graph) -onnx.save(model, '/tmp/test.onnx') - -# 使用 CPU Provider 进行推理 -sess = ort.InferenceSession('/tmp/test.onnx', providers=['CPUExecutionProvider']) -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) -output = sess.run(None, {'X': input_data}) -print('推理成功') -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3, 224, 224]) -Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3, 224, 224]) -node = helper.make_node('Identity', ['X'], ['Y']) -graph = helper.make_graph([node], 'test', [X], [Y]) -model = helper.make_model(graph) -onnx.save(model, '/tmp/test.onnx') - -sess = ort.InferenceSession('/tmp/test.onnx', providers=['CPUExecutionProvider']) -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) -output = sess.run(None, {'X': input_data}) -print('推理成功') -" - exit 1 -fi - -# 测试 6: ONNX ML 域支持 -echo -n "测试 6: ONNX ML 域 (ai.onnx.ml)... " -docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -# 测试 LabelEncoder -X = helper.make_tensor_value_info('X', TensorProto.STRING, [None]) -Y = helper.make_tensor_value_info('Y', TensorProto.INT64, [None]) -node = helper.make_node( - 'LabelEncoder', ['X'], ['Y'], - domain='ai.onnx.ml', - keys_strings=['cat', 'dog'], - values_int64s=[0, 1], - default_int64=999 -) -graph = helper.make_graph([node], 'test_ml', [X], [Y]) -model = helper.make_model(graph, opset_imports=[ - helper.make_opsetid('', 21), - helper.make_opsetid('ai.onnx.ml', 3) -]) -onnx.save(model, '/tmp/test_ml.onnx') - -sess = ort.InferenceSession('/tmp/test_ml.onnx', providers=['CPUExecutionProvider']) -input_data = np.array(['cat', 'dog'], dtype=object) -output = sess.run(None, {'X': input_data}) -assert list(output[0]) == [0, 1], 'ML domain test failed' -print('ML domain OK') -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -X = helper.make_tensor_value_info('X', TensorProto.STRING, [None]) -Y = helper.make_tensor_value_info('Y', TensorProto.INT64, [None]) -node = helper.make_node( - 'LabelEncoder', ['X'], ['Y'], - domain='ai.onnx.ml', - keys_strings=['cat', 'dog'], - values_int64s=[0, 1], - default_int64=999 -) -graph = helper.make_graph([node], 'test_ml', [X], [Y]) -model = helper.make_model(graph, opset_imports=[ - helper.make_opsetid('', 21), - helper.make_opsetid('ai.onnx.ml', 3) -]) -onnx.save(model, '/tmp/test_ml.onnx') - -sess = ort.InferenceSession('/tmp/test_ml.onnx', providers=['CPUExecutionProvider']) -input_data = np.array(['cat', 'dog'], dtype=object) -output = sess.run(None, {'X': input_data}) -print('Output:', output[0]) -" - exit 1 -fi - -# 测试 7: ONNX IR 版本兼容性 -echo -n "测试 7: ONNX IR 版本兼容性... " -docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -# 测试多个 IR 版本 -test_cases = [(3, 7), (5, 11), (7, 15), (9, 19)] -for ir_ver, opset_ver in test_cases: - X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3]) - Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3]) - node = helper.make_node('Relu', ['X'], ['Y']) - graph = helper.make_graph([node], f'test_ir{ir_ver}', [X], [Y]) - model = helper.make_model(graph, opset_imports=[helper.make_opsetid('', opset_ver)]) - model.ir_version = ir_ver - onnx.save(model, f'/tmp/test_ir{ir_ver}.onnx') - - sess = ort.InferenceSession(f'/tmp/test_ir{ir_ver}.onnx', providers=['CPUExecutionProvider']) - input_data = np.random.randn(1, 3).astype(np.float32) - output = sess.run(None, {'X': input_data}) - -print('IR versions OK') -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓ (测试 IR v3, v5, v7, v9)" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -test_cases = [(3, 7), (5, 11), (7, 15), (9, 19)] -for ir_ver, opset_ver in test_cases: - X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3]) - Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3]) - node = helper.make_node('Relu', ['X'], ['Y']) - graph = helper.make_graph([node], f'test_ir{ir_ver}', [X], [Y]) - model = helper.make_model(graph, opset_imports=[helper.make_opsetid('', opset_ver)]) - model.ir_version = ir_ver - onnx.save(model, f'/tmp/test_ir{ir_ver}.onnx') - - sess = ort.InferenceSession(f'/tmp/test_ir{ir_ver}.onnx', providers=['CPUExecutionProvider']) - input_data = np.random.randn(1, 3).astype(np.float32) - output = sess.run(None, {'X': input_data}) - print(f'IR v{ir_ver} OK') -" - exit 1 -fi - -echo "" -echo "==========================================" -echo "所有测试通过!" -echo "==========================================" diff --git a/frameworks/onnxruntime/1.24.1-gpu/Dockerfile b/frameworks/onnxruntime/1.24.1-gpu/Dockerfile deleted file mode 100644 index 34f02faaef9ea618f053e0721b0856b3ef331f3f..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.1-gpu/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="Anstarc " -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="ONNX Runtime 1.24.1 GPU on OpenCloudOS 9" - -# 安装系统依赖 -RUN dnf install -y \ - python3.11 \ - python3.11-pip \ - git \ - wget \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 设置工作目录 -WORKDIR /app - -# 安装 ONNX Runtime GPU 版本及依赖 -# 注意:onnx 需要 1.20 以兼容 onnxruntime 1.24.1 (opset 25) -RUN pip3.11 install --no-cache-dir \ - onnxruntime-gpu==1.24.1 \ - onnx==1.20.1 \ - numpy \ - protobuf - -RUN pip3.11 install --no-cache-dir \ - torch torchvision --index-url https://download.pytorch.org/whl/cu128 - -# 设置 GPU 环境变量 -ENV NVIDIA_VISIBLE_DEVICES=all -ENV CUDA_MODULE_LOADING=LAZY - -# 默认命令 -CMD ["python3.11", "-c", "import onnxruntime; print(f'ONNX Runtime {onnxruntime.__version__} ready')"] diff --git a/frameworks/onnxruntime/1.24.1-gpu/README.md b/frameworks/onnxruntime/1.24.1-gpu/README.md deleted file mode 100644 index 40b3aad01ab252717dda2a51b109f3de307108b7..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.1-gpu/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# ONNX Runtime 1.24.1 GPU on OpenCloudOS 9 - -ONNX Runtime 是微软开源的跨平台机器学习推理加速器,支持多种深度学习框架(PyTorch、TensorFlow 等)训练的模型。 - -## 基本信息 - -- **基础镜像**: opencloudos/opencloudos9-cuda-devel:12.8 -- **Python 版本**: 3.11 -- **CUDA 版本**: 12.8 -- **ONNX Runtime 版本**: 1.24.1 (GPU) -- **ONNX 版本**: 1.20.1 (兼容 opset 25) - -## 构建 - -```bash -docker build -t oc9-onnxruntime-gpu:1.24.1 . -``` - -## 测试 - -```bash -./test.sh oc9-onnxruntime-gpu:1.24.1 -``` - -测试项包括: -- Python 和 CUDA 环境 -- ONNX Runtime 版本验证 -- GPU 推理功能 -- ONNX ML 域支持 (ai.onnx.ml) -- ONNX IR 版本兼容性 (v3-v10) - -## 使用示例 - -### 基本使用 - -```bash -# 查看版本信息 -docker run --rm oc9-onnxruntime-gpu:1.24.1 python3.11 -c "import onnxruntime; print(onnxruntime.__version__)" - -# 查看可用的 Execution Providers -docker run --rm --gpus all oc9-onnxruntime-gpu:1.24.1 python3.11 -c "import onnxruntime as ort; print(ort.get_available_providers())" -``` - -### GPU 推理 - -```python -import onnxruntime as ort -import numpy as np - -# 加载模型(使用 CUDA Provider) -session = ort.InferenceSession( - "model.onnx", - providers=['CUDAExecutionProvider', 'CPUExecutionProvider'] -) - -# 准备输入数据 -input_name = session.get_inputs()[0].name -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) - -# 运行推理 -outputs = session.run(None, {input_name: input_data}) -``` - -### 交互式使用 - -```bash -docker run --rm -it --gpus all oc9-onnxruntime-gpu:1.24.1 bash -``` - -## 支持的 Opset 和 IR 版本 - -- **ai.onnx**: opset 1-25 (标准推理算子,支持 GPU) -- **ai.onnx.ml**: opset 1-5 (传统机器学习算子,CPU only) -- **ONNX IR**: v3-v10 (2017-2024,完全向后兼容) - -## 系统要求 - -- **GPU**: NVIDIA GPU with CUDA 12.x support -- **显存**: 建议 4GB+ -- **Docker**: 19.03+ with nvidia-docker2 - -## 参考资源 - -- [ONNX Runtime 官方文档](https://onnxruntime.ai/docs/) -- [CUDA Execution Provider](https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html) diff --git a/frameworks/onnxruntime/1.24.1-gpu/build.conf b/frameworks/onnxruntime/1.24.1-gpu/build.conf deleted file mode 100644 index 0a257d69a82879ac25044457b93a6777712ea40e..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.1-gpu/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ONNX Runtime 1.24.1 GPU on OpenCloudOS 9 -IMAGE_NAME=oc9-onnxruntime-gpu -IMAGE_TAG=1.24.1 -GPU_TEST=true diff --git a/frameworks/onnxruntime/1.24.1-gpu/test.sh b/frameworks/onnxruntime/1.24.1-gpu/test.sh deleted file mode 100755 index e49ac5e65b5084ac99048fe5d1ab022a48dbcc6c..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.1-gpu/test.sh +++ /dev/null @@ -1,243 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:-oc9-onnxruntime-gpu:1.24.1}" - -echo "==========================================" -echo "测试 ONNX Runtime 1.24.1 GPU 镜像" -echo "镜像: $IMAGE" -echo "==========================================" - -# 测试 1: Python 和 CUDA 环境 -echo -n "测试 1: Python 和 CUDA 环境... " -docker run --rm "$IMAGE" bash -c "python3.11 --version && /usr/local/cuda/bin/nvcc --version" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" bash -c "python3.11 --version && /usr/local/cuda/bin/nvcc --version" - exit 1 -fi - -# 测试 2: ONNX Runtime 版本 -echo -n "测试 2: ONNX Runtime 版本... " -VERSION=$(docker run --rm "$IMAGE" python3.11 -c "import onnxruntime; print(onnxruntime.__version__)") -if [ "$VERSION" = "1.24.1" ]; then - echo "✓ (版本: $VERSION)" -else - echo "✗ (期望: 1.24.1, 实际: $VERSION)" - exit 1 -fi - -# 测试 3: 核心依赖 -echo -n "测试 3: 核心依赖 (numpy, protobuf)... " -docker run --rm "$IMAGE" python3.11 -c "import numpy; import google.protobuf" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c "import numpy; import google.protobuf" - exit 1 -fi - -# 测试 4: 可用的 Execution Providers -echo -n "测试 4: 可用的 Execution Providers... " -PROVIDERS=$(docker run --rm "$IMAGE" python3.11 -c "import onnxruntime as ort; print(','.join(ort.get_available_providers()))") -echo "✓" -echo " 可用 Providers: $PROVIDERS" - -# 测试 5: GPU 环境检查 -echo -n "测试 5: GPU 环境检查... " -if command -v nvidia-smi &> /dev/null; then - GPU_COUNT=$(nvidia-smi --query-gpu=name --format=csv,noheader | wc -l) - echo "✓ (检测到 $GPU_COUNT 个 GPU)" - - # 测试 6: CUDA Execution Provider - echo -n "测试 6: CUDA Execution Provider... " - HAS_CUDA=$(docker run --rm --gpus all "$IMAGE" python3.11 -c "import onnxruntime as ort; print('CUDAExecutionProvider' in ort.get_available_providers())") - if [ "$HAS_CUDA" = "True" ]; then - echo "✓" - else - echo "✗ (CUDA Provider 不可用)" - exit 1 - fi - - # 测试 7: 简单推理测试(使用 CUDA) - echo -n "测试 7: 简单推理测试 (CUDA)... " - docker run --rm --gpus all "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np - -# 创建简单的 ONNX 模型(identity 操作) -from onnxruntime import InferenceSession -import onnx -from onnx import helper, TensorProto - -# 创建一个简单的 identity 模型 -X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3, 224, 224]) -Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3, 224, 224]) -node = helper.make_node('Identity', ['X'], ['Y']) -graph = helper.make_graph([node], 'test', [X], [Y]) -model = helper.make_model(graph) - -# 保存模型 -onnx.save(model, '/tmp/test.onnx') - -# 使用 CUDA Provider 进行推理 -sess = ort.InferenceSession('/tmp/test.onnx', providers=['CUDAExecutionProvider', 'CPUExecutionProvider']) -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) -output = sess.run(None, {'X': input_data}) - -print('推理成功') -" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "✓" - else - echo "✗" - docker run --rm --gpus all "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3, 224, 224]) -Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3, 224, 224]) -node = helper.make_node('Identity', ['X'], ['Y']) -graph = helper.make_graph([node], 'test', [X], [Y]) -model = helper.make_model(graph) -onnx.save(model, '/tmp/test.onnx') - -sess = ort.InferenceSession('/tmp/test.onnx', providers=['CUDAExecutionProvider', 'CPUExecutionProvider']) -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) -output = sess.run(None, {'X': input_data}) -print('推理成功') -" - exit 1 - fi -else - echo "⊘ (未检测到 GPU,跳过 GPU 测试)" - echo "测试 6-7: 跳过 (需要 GPU 环境)" -fi - -# 测试 8: ONNX ML 域支持 -echo -n "测试 8: ONNX ML 域 (ai.onnx.ml)... " -docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -# 测试 LabelEncoder -X = helper.make_tensor_value_info('X', TensorProto.STRING, [None]) -Y = helper.make_tensor_value_info('Y', TensorProto.INT64, [None]) -node = helper.make_node( - 'LabelEncoder', ['X'], ['Y'], - domain='ai.onnx.ml', - keys_strings=['cat', 'dog'], - values_int64s=[0, 1], - default_int64=999 -) -graph = helper.make_graph([node], 'test_ml', [X], [Y]) -model = helper.make_model(graph, opset_imports=[ - helper.make_opsetid('', 21), - helper.make_opsetid('ai.onnx.ml', 3) -]) -onnx.save(model, '/tmp/test_ml.onnx') - -sess = ort.InferenceSession('/tmp/test_ml.onnx', providers=['CPUExecutionProvider']) -input_data = np.array(['cat', 'dog'], dtype=object) -output = sess.run(None, {'X': input_data}) -assert list(output[0]) == [0, 1], 'ML domain test failed' -print('ML domain OK') -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -X = helper.make_tensor_value_info('X', TensorProto.STRING, [None]) -Y = helper.make_tensor_value_info('Y', TensorProto.INT64, [None]) -node = helper.make_node( - 'LabelEncoder', ['X'], ['Y'], - domain='ai.onnx.ml', - keys_strings=['cat', 'dog'], - values_int64s=[0, 1], - default_int64=999 -) -graph = helper.make_graph([node], 'test_ml', [X], [Y]) -model = helper.make_model(graph, opset_imports=[ - helper.make_opsetid('', 21), - helper.make_opsetid('ai.onnx.ml', 3) -]) -onnx.save(model, '/tmp/test_ml.onnx') - -sess = ort.InferenceSession('/tmp/test_ml.onnx', providers=['CPUExecutionProvider']) -input_data = np.array(['cat', 'dog'], dtype=object) -output = sess.run(None, {'X': input_data}) -print('Output:', output[0]) -" - exit 1 -fi - -# 测试 9: ONNX IR 版本兼容性 -echo -n "测试 9: ONNX IR 版本兼容性... " -docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -# 测试多个 IR 版本 -test_cases = [(3, 7), (5, 11), (7, 15), (9, 19)] -for ir_ver, opset_ver in test_cases: - X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3]) - Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3]) - node = helper.make_node('Relu', ['X'], ['Y']) - graph = helper.make_graph([node], f'test_ir{ir_ver}', [X], [Y]) - model = helper.make_model(graph, opset_imports=[helper.make_opsetid('', opset_ver)]) - model.ir_version = ir_ver - onnx.save(model, f'/tmp/test_ir{ir_ver}.onnx') - - sess = ort.InferenceSession(f'/tmp/test_ir{ir_ver}.onnx', providers=['CPUExecutionProvider']) - input_data = np.random.randn(1, 3).astype(np.float32) - output = sess.run(None, {'X': input_data}) - -print('IR versions OK') -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓ (测试 IR v3, v5, v7, v9)" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -test_cases = [(3, 7), (5, 11), (7, 15), (9, 19)] -for ir_ver, opset_ver in test_cases: - X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3]) - Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3]) - node = helper.make_node('Relu', ['X'], ['Y']) - graph = helper.make_graph([node], f'test_ir{ir_ver}', [X], [Y]) - model = helper.make_model(graph, opset_imports=[helper.make_opsetid('', opset_ver)]) - model.ir_version = ir_ver - onnx.save(model, f'/tmp/test_ir{ir_ver}.onnx') - - sess = ort.InferenceSession(f'/tmp/test_ir{ir_ver}.onnx', providers=['CPUExecutionProvider']) - input_data = np.random.randn(1, 3).astype(np.float32) - output = sess.run(None, {'X': input_data}) - print(f'IR v{ir_ver} OK') -" - exit 1 -fi - -echo "" -echo "==========================================" -echo "所有测试通过!" -echo "==========================================" diff --git a/frameworks/onnxruntime/1.24.2-cpu/Dockerfile b/frameworks/onnxruntime/1.24.2-cpu/Dockerfile deleted file mode 100644 index 9dbf76bfc287ce6258adeb74cbbda250e35168ec..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.2-cpu/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -FROM opencloudos/opencloudos9-minimal:latest - -LABEL maintainer="Anstarc " -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="ONNX Runtime 1.24.2 CPU on OpenCloudOS 9" - -# 安装系统依赖 -RUN dnf install -y \ - python3.11 \ - python3.11-pip \ - git \ - wget \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 设置工作目录 -WORKDIR /app - -# 安装 ONNX Runtime CPU 版本及依赖 -# 注意:onnx 需要 1.20 以兼容 onnxruntime 1.24.2 (opset 25) -RUN pip3.11 install --no-cache-dir \ - onnxruntime==1.24.2 \ - onnx==1.20.1 \ - numpy \ - protobuf - -# 默认命令 -CMD ["python3.11", "-c", "import onnxruntime; print(f'ONNX Runtime {onnxruntime.__version__} ready')"] diff --git a/frameworks/onnxruntime/1.24.2-cpu/README.md b/frameworks/onnxruntime/1.24.2-cpu/README.md deleted file mode 100644 index 4c486c0ea5f3195b25230d8739d791a6959d207a..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.2-cpu/README.md +++ /dev/null @@ -1,82 +0,0 @@ -# ONNX Runtime 1.24.2 CPU on OpenCloudOS 9 - -ONNX Runtime 是微软开源的跨平台机器学习推理加速器,支持多种深度学习框架(PyTorch、TensorFlow 等)训练的模型。 - -## 基本信息 - -- **基础镜像**: opencloudos/opencloudos9-minimal:latest -- **Python 版本**: 3.11 -- **ONNX Runtime 版本**: 1.24.2 (CPU) -- **ONNX 版本**: 1.20.1 (兼容 opset 25) - -## 构建 - -```bash -docker build -t oc9-onnxruntime-cpu:1.24.2 . -``` - -## 测试 - -```bash -./test.sh oc9-onnxruntime-cpu:1.24.2 -``` - -测试项包括: -- Python 环境 -- ONNX Runtime 版本验证 -- CPU 推理功能 -- ONNX ML 域支持 (ai.onnx.ml) -- ONNX IR 版本兼容性 (v3-v10) - -## 使用示例 - -### 基本使用 - -```bash -# 查看版本信息 -docker run --rm oc9-onnxruntime-cpu:1.24.2 python3.11 -c "import onnxruntime; print(onnxruntime.__version__)" - -# 查看可用的 Execution Providers -docker run --rm oc9-onnxruntime-cpu:1.24.2 python3.11 -c "import onnxruntime as ort; print(ort.get_available_providers())" -``` - -### CPU 推理 - -```python -import onnxruntime as ort -import numpy as np - -# 加载模型(使用 CPU Provider) -session = ort.InferenceSession( - "model.onnx", - providers=['CPUExecutionProvider'] -) - -# 准备输入数据 -input_name = session.get_inputs()[0].name -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) - -# 运行推理 -outputs = session.run(None, {input_name: input_data}) -``` - -### 交互式使用 - -```bash -docker run --rm -it oc9-onnxruntime-cpu:1.24.2 bash -``` - -## 支持的 Opset 和 IR 版本 - -- **ai.onnx**: opset 1-25 (标准推理算子) -- **ai.onnx.ml**: opset 1-5 (传统机器学习算子) -- **ONNX IR**: v3-v10 (2017-2024,完全向后兼容) - -## 系统要求 - -- **Docker**: 19.03+ - -## 参考资源 - -- [ONNX Runtime 官方文档](https://onnxruntime.ai/docs/) -- [CPU Execution Provider](https://onnxruntime.ai/docs/execution-providers/CPU-ExecutionProvider.html) diff --git a/frameworks/onnxruntime/1.24.2-cpu/build.conf b/frameworks/onnxruntime/1.24.2-cpu/build.conf deleted file mode 100644 index c03bb1c9a27f23a7a5f7ca430c9d61b62734abf0..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.2-cpu/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ONNX Runtime 1.24.2 CPU on OpenCloudOS 9 -IMAGE_NAME=oc9-onnxruntime-cpu -IMAGE_TAG=1.24.2 -GPU_TEST=false diff --git a/frameworks/onnxruntime/1.24.2-cpu/test.sh b/frameworks/onnxruntime/1.24.2-cpu/test.sh deleted file mode 100755 index 747920b7056e17a03fcadaaa246f2f6cf43436e6..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.2-cpu/test.sh +++ /dev/null @@ -1,217 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:-oc9-onnxruntime-cpu:1.24.2}" - -echo "==========================================" -echo "测试 ONNX Runtime 1.24.2 CPU 镜像" -echo "镜像: $IMAGE" -echo "==========================================" - -# 测试 1: Python 环境 -echo -n "测试 1: Python 环境... " -docker run --rm "$IMAGE" python3.11 --version > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 --version - exit 1 -fi - -# 测试 2: ONNX Runtime 版本 -echo -n "测试 2: ONNX Runtime 版本... " -VERSION=$(docker run --rm "$IMAGE" python3.11 -c "import onnxruntime; print(onnxruntime.__version__)") -if [ "$VERSION" = "1.24.2" ]; then - echo "✓ (版本: $VERSION)" -else - echo "✗ (期望: 1.24.2, 实际: $VERSION)" - exit 1 -fi - -# 测试 3: 核心依赖 -echo -n "测试 3: 核心依赖 (numpy, protobuf)... " -docker run --rm "$IMAGE" python3.11 -c "import numpy; import google.protobuf" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c "import numpy; import google.protobuf" - exit 1 -fi - -# 测试 4: 可用的 Execution Providers -echo -n "测试 4: 可用的 Execution Providers... " -PROVIDERS=$(docker run --rm "$IMAGE" python3.11 -c "import onnxruntime as ort; print(','.join(ort.get_available_providers()))") -echo "✓" -echo " 可用 Providers: $PROVIDERS" - -# 测试 5: CPU 推理测试 -echo -n "测试 5: CPU 推理测试... " -docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -# 创建简单的 ONNX 模型 -X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3, 224, 224]) -Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3, 224, 224]) -node = helper.make_node('Identity', ['X'], ['Y']) -graph = helper.make_graph([node], 'test', [X], [Y]) -model = helper.make_model(graph) -onnx.save(model, '/tmp/test.onnx') - -# 使用 CPU Provider 进行推理 -sess = ort.InferenceSession('/tmp/test.onnx', providers=['CPUExecutionProvider']) -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) -output = sess.run(None, {'X': input_data}) -print('推理成功') -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3, 224, 224]) -Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3, 224, 224]) -node = helper.make_node('Identity', ['X'], ['Y']) -graph = helper.make_graph([node], 'test', [X], [Y]) -model = helper.make_model(graph) -onnx.save(model, '/tmp/test.onnx') - -sess = ort.InferenceSession('/tmp/test.onnx', providers=['CPUExecutionProvider']) -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) -output = sess.run(None, {'X': input_data}) -print('推理成功') -" - exit 1 -fi - -# 测试 6: ONNX ML 域支持 -echo -n "测试 6: ONNX ML 域 (ai.onnx.ml)... " -docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -# 测试 LabelEncoder -X = helper.make_tensor_value_info('X', TensorProto.STRING, [None]) -Y = helper.make_tensor_value_info('Y', TensorProto.INT64, [None]) -node = helper.make_node( - 'LabelEncoder', ['X'], ['Y'], - domain='ai.onnx.ml', - keys_strings=['cat', 'dog'], - values_int64s=[0, 1], - default_int64=999 -) -graph = helper.make_graph([node], 'test_ml', [X], [Y]) -model = helper.make_model(graph, opset_imports=[ - helper.make_opsetid('', 21), - helper.make_opsetid('ai.onnx.ml', 3) -]) -onnx.save(model, '/tmp/test_ml.onnx') - -sess = ort.InferenceSession('/tmp/test_ml.onnx', providers=['CPUExecutionProvider']) -input_data = np.array(['cat', 'dog'], dtype=object) -output = sess.run(None, {'X': input_data}) -assert list(output[0]) == [0, 1], 'ML domain test failed' -print('ML domain OK') -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -X = helper.make_tensor_value_info('X', TensorProto.STRING, [None]) -Y = helper.make_tensor_value_info('Y', TensorProto.INT64, [None]) -node = helper.make_node( - 'LabelEncoder', ['X'], ['Y'], - domain='ai.onnx.ml', - keys_strings=['cat', 'dog'], - values_int64s=[0, 1], - default_int64=999 -) -graph = helper.make_graph([node], 'test_ml', [X], [Y]) -model = helper.make_model(graph, opset_imports=[ - helper.make_opsetid('', 21), - helper.make_opsetid('ai.onnx.ml', 3) -]) -onnx.save(model, '/tmp/test_ml.onnx') - -sess = ort.InferenceSession('/tmp/test_ml.onnx', providers=['CPUExecutionProvider']) -input_data = np.array(['cat', 'dog'], dtype=object) -output = sess.run(None, {'X': input_data}) -print('Output:', output[0]) -" - exit 1 -fi - -# 测试 7: ONNX IR 版本兼容性 -echo -n "测试 7: ONNX IR 版本兼容性... " -docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -# 测试多个 IR 版本 -test_cases = [(3, 7), (5, 11), (7, 15), (9, 19)] -for ir_ver, opset_ver in test_cases: - X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3]) - Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3]) - node = helper.make_node('Relu', ['X'], ['Y']) - graph = helper.make_graph([node], f'test_ir{ir_ver}', [X], [Y]) - model = helper.make_model(graph, opset_imports=[helper.make_opsetid('', opset_ver)]) - model.ir_version = ir_ver - onnx.save(model, f'/tmp/test_ir{ir_ver}.onnx') - - sess = ort.InferenceSession(f'/tmp/test_ir{ir_ver}.onnx', providers=['CPUExecutionProvider']) - input_data = np.random.randn(1, 3).astype(np.float32) - output = sess.run(None, {'X': input_data}) - -print('IR versions OK') -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓ (测试 IR v3, v5, v7, v9)" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -test_cases = [(3, 7), (5, 11), (7, 15), (9, 19)] -for ir_ver, opset_ver in test_cases: - X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3]) - Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3]) - node = helper.make_node('Relu', ['X'], ['Y']) - graph = helper.make_graph([node], f'test_ir{ir_ver}', [X], [Y]) - model = helper.make_model(graph, opset_imports=[helper.make_opsetid('', opset_ver)]) - model.ir_version = ir_ver - onnx.save(model, f'/tmp/test_ir{ir_ver}.onnx') - - sess = ort.InferenceSession(f'/tmp/test_ir{ir_ver}.onnx', providers=['CPUExecutionProvider']) - input_data = np.random.randn(1, 3).astype(np.float32) - output = sess.run(None, {'X': input_data}) - print(f'IR v{ir_ver} OK') -" - exit 1 -fi - -echo "" -echo "==========================================" -echo "所有测试通过!" -echo "==========================================" diff --git a/frameworks/onnxruntime/1.24.2-gpu/Dockerfile b/frameworks/onnxruntime/1.24.2-gpu/Dockerfile deleted file mode 100644 index a3e220bffbba237540258963781137c5175ada1b..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.2-gpu/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="Anstarc " -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="ONNX Runtime 1.24.2 GPU on OpenCloudOS 9" - -# 安装系统依赖 -RUN dnf install -y \ - python3.11 \ - python3.11-pip \ - git \ - wget \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 设置工作目录 -WORKDIR /app - -# 安装 ONNX Runtime GPU 版本及依赖 -# 注意:onnx 需要 1.20 以兼容 onnxruntime 1.24.2 (opset 25) -RUN pip3.11 install --no-cache-dir \ - onnxruntime-gpu==1.24.2 \ - onnx==1.20.1 \ - numpy \ - protobuf - -RUN pip3.11 install --no-cache-dir \ - torch torchvision --index-url https://download.pytorch.org/whl/cu128 - -# 设置 GPU 环境变量 -ENV NVIDIA_VISIBLE_DEVICES=all -ENV CUDA_MODULE_LOADING=LAZY - -# 默认命令 -CMD ["python3.11", "-c", "import onnxruntime; print(f'ONNX Runtime {onnxruntime.__version__} ready')"] diff --git a/frameworks/onnxruntime/1.24.2-gpu/README.md b/frameworks/onnxruntime/1.24.2-gpu/README.md deleted file mode 100644 index 1abbddd51a997d628f0166ce01559ad4a68e4279..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.2-gpu/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# ONNX Runtime 1.24.2 GPU on OpenCloudOS 9 - -ONNX Runtime 是微软开源的跨平台机器学习推理加速器,支持多种深度学习框架(PyTorch、TensorFlow 等)训练的模型。 - -## 基本信息 - -- **基础镜像**: opencloudos/opencloudos9-cuda-devel:12.8 -- **Python 版本**: 3.11 -- **CUDA 版本**: 12.8 -- **ONNX Runtime 版本**: 1.24.2 (GPU) -- **ONNX 版本**: 1.20.1 (兼容 opset 25) - -## 构建 - -```bash -docker build -t oc9-onnxruntime-gpu:1.24.2 . -``` - -## 测试 - -```bash -./test.sh oc9-onnxruntime-gpu:1.24.2 -``` - -测试项包括: -- Python 和 CUDA 环境 -- ONNX Runtime 版本验证 -- GPU 推理功能 -- ONNX ML 域支持 (ai.onnx.ml) -- ONNX IR 版本兼容性 (v3-v10) - -## 使用示例 - -### 基本使用 - -```bash -# 查看版本信息 -docker run --rm oc9-onnxruntime-gpu:1.24.2 python3.11 -c "import onnxruntime; print(onnxruntime.__version__)" - -# 查看可用的 Execution Providers -docker run --rm --gpus all oc9-onnxruntime-gpu:1.24.2 python3.11 -c "import onnxruntime as ort; print(ort.get_available_providers())" -``` - -### GPU 推理 - -```python -import onnxruntime as ort -import numpy as np - -# 加载模型(使用 CUDA Provider) -session = ort.InferenceSession( - "model.onnx", - providers=['CUDAExecutionProvider', 'CPUExecutionProvider'] -) - -# 准备输入数据 -input_name = session.get_inputs()[0].name -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) - -# 运行推理 -outputs = session.run(None, {input_name: input_data}) -``` - -### 交互式使用 - -```bash -docker run --rm -it --gpus all oc9-onnxruntime-gpu:1.24.2 bash -``` - -## 支持的 Opset 和 IR 版本 - -- **ai.onnx**: opset 1-25 (标准推理算子,支持 GPU) -- **ai.onnx.ml**: opset 1-5 (传统机器学习算子,CPU only) -- **ONNX IR**: v3-v10 (2017-2024,完全向后兼容) - -## 系统要求 - -- **GPU**: NVIDIA GPU with CUDA 12.x support -- **显存**: 建议 4GB+ -- **Docker**: 19.03+ with nvidia-docker2 - -## 参考资源 - -- [ONNX Runtime 官方文档](https://onnxruntime.ai/docs/) -- [CUDA Execution Provider](https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html) diff --git a/frameworks/onnxruntime/1.24.2-gpu/build.conf b/frameworks/onnxruntime/1.24.2-gpu/build.conf deleted file mode 100644 index 44e96cb5e364d4b640131cce869724821d5e8984..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.2-gpu/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ONNX Runtime 1.24.2 GPU on OpenCloudOS 9 -IMAGE_NAME=oc9-onnxruntime-gpu -IMAGE_TAG=1.24.2 -GPU_TEST=true diff --git a/frameworks/onnxruntime/1.24.2-gpu/test.sh b/frameworks/onnxruntime/1.24.2-gpu/test.sh deleted file mode 100755 index 5bb7e83004b2e3d1cfef957386a51f80231e4ede..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.2-gpu/test.sh +++ /dev/null @@ -1,243 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:-oc9-onnxruntime-gpu:1.24.2}" - -echo "==========================================" -echo "测试 ONNX Runtime 1.24.2 GPU 镜像" -echo "镜像: $IMAGE" -echo "==========================================" - -# 测试 1: Python 和 CUDA 环境 -echo -n "测试 1: Python 和 CUDA 环境... " -docker run --rm "$IMAGE" bash -c "python3.11 --version && /usr/local/cuda/bin/nvcc --version" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" bash -c "python3.11 --version && /usr/local/cuda/bin/nvcc --version" - exit 1 -fi - -# 测试 2: ONNX Runtime 版本 -echo -n "测试 2: ONNX Runtime 版本... " -VERSION=$(docker run --rm "$IMAGE" python3.11 -c "import onnxruntime; print(onnxruntime.__version__)") -if [ "$VERSION" = "1.24.2" ]; then - echo "✓ (版本: $VERSION)" -else - echo "✗ (期望: 1.24.2, 实际: $VERSION)" - exit 1 -fi - -# 测试 3: 核心依赖 -echo -n "测试 3: 核心依赖 (numpy, protobuf)... " -docker run --rm "$IMAGE" python3.11 -c "import numpy; import google.protobuf" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c "import numpy; import google.protobuf" - exit 1 -fi - -# 测试 4: 可用的 Execution Providers -echo -n "测试 4: 可用的 Execution Providers... " -PROVIDERS=$(docker run --rm "$IMAGE" python3.11 -c "import onnxruntime as ort; print(','.join(ort.get_available_providers()))") -echo "✓" -echo " 可用 Providers: $PROVIDERS" - -# 测试 5: GPU 环境检查 -echo -n "测试 5: GPU 环境检查... " -if command -v nvidia-smi &> /dev/null; then - GPU_COUNT=$(nvidia-smi --query-gpu=name --format=csv,noheader | wc -l) - echo "✓ (检测到 $GPU_COUNT 个 GPU)" - - # 测试 6: CUDA Execution Provider - echo -n "测试 6: CUDA Execution Provider... " - HAS_CUDA=$(docker run --rm --gpus all "$IMAGE" python3.11 -c "import onnxruntime as ort; print('CUDAExecutionProvider' in ort.get_available_providers())") - if [ "$HAS_CUDA" = "True" ]; then - echo "✓" - else - echo "✗ (CUDA Provider 不可用)" - exit 1 - fi - - # 测试 7: 简单推理测试(使用 CUDA) - echo -n "测试 7: 简单推理测试 (CUDA)... " - docker run --rm --gpus all "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np - -# 创建简单的 ONNX 模型(identity 操作) -from onnxruntime import InferenceSession -import onnx -from onnx import helper, TensorProto - -# 创建一个简单的 identity 模型 -X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3, 224, 224]) -Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3, 224, 224]) -node = helper.make_node('Identity', ['X'], ['Y']) -graph = helper.make_graph([node], 'test', [X], [Y]) -model = helper.make_model(graph) - -# 保存模型 -onnx.save(model, '/tmp/test.onnx') - -# 使用 CUDA Provider 进行推理 -sess = ort.InferenceSession('/tmp/test.onnx', providers=['CUDAExecutionProvider', 'CPUExecutionProvider']) -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) -output = sess.run(None, {'X': input_data}) - -print('推理成功') -" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "✓" - else - echo "✗" - docker run --rm --gpus all "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3, 224, 224]) -Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3, 224, 224]) -node = helper.make_node('Identity', ['X'], ['Y']) -graph = helper.make_graph([node], 'test', [X], [Y]) -model = helper.make_model(graph) -onnx.save(model, '/tmp/test.onnx') - -sess = ort.InferenceSession('/tmp/test.onnx', providers=['CUDAExecutionProvider', 'CPUExecutionProvider']) -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) -output = sess.run(None, {'X': input_data}) -print('推理成功') -" - exit 1 - fi -else - echo "⊘ (未检测到 GPU,跳过 GPU 测试)" - echo "测试 6-7: 跳过 (需要 GPU 环境)" -fi - -# 测试 8: ONNX ML 域支持 -echo -n "测试 8: ONNX ML 域 (ai.onnx.ml)... " -docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -# 测试 LabelEncoder -X = helper.make_tensor_value_info('X', TensorProto.STRING, [None]) -Y = helper.make_tensor_value_info('Y', TensorProto.INT64, [None]) -node = helper.make_node( - 'LabelEncoder', ['X'], ['Y'], - domain='ai.onnx.ml', - keys_strings=['cat', 'dog'], - values_int64s=[0, 1], - default_int64=999 -) -graph = helper.make_graph([node], 'test_ml', [X], [Y]) -model = helper.make_model(graph, opset_imports=[ - helper.make_opsetid('', 21), - helper.make_opsetid('ai.onnx.ml', 3) -]) -onnx.save(model, '/tmp/test_ml.onnx') - -sess = ort.InferenceSession('/tmp/test_ml.onnx', providers=['CPUExecutionProvider']) -input_data = np.array(['cat', 'dog'], dtype=object) -output = sess.run(None, {'X': input_data}) -assert list(output[0]) == [0, 1], 'ML domain test failed' -print('ML domain OK') -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -X = helper.make_tensor_value_info('X', TensorProto.STRING, [None]) -Y = helper.make_tensor_value_info('Y', TensorProto.INT64, [None]) -node = helper.make_node( - 'LabelEncoder', ['X'], ['Y'], - domain='ai.onnx.ml', - keys_strings=['cat', 'dog'], - values_int64s=[0, 1], - default_int64=999 -) -graph = helper.make_graph([node], 'test_ml', [X], [Y]) -model = helper.make_model(graph, opset_imports=[ - helper.make_opsetid('', 21), - helper.make_opsetid('ai.onnx.ml', 3) -]) -onnx.save(model, '/tmp/test_ml.onnx') - -sess = ort.InferenceSession('/tmp/test_ml.onnx', providers=['CPUExecutionProvider']) -input_data = np.array(['cat', 'dog'], dtype=object) -output = sess.run(None, {'X': input_data}) -print('Output:', output[0]) -" - exit 1 -fi - -# 测试 9: ONNX IR 版本兼容性 -echo -n "测试 9: ONNX IR 版本兼容性... " -docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -# 测试多个 IR 版本 -test_cases = [(3, 7), (5, 11), (7, 15), (9, 19)] -for ir_ver, opset_ver in test_cases: - X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3]) - Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3]) - node = helper.make_node('Relu', ['X'], ['Y']) - graph = helper.make_graph([node], f'test_ir{ir_ver}', [X], [Y]) - model = helper.make_model(graph, opset_imports=[helper.make_opsetid('', opset_ver)]) - model.ir_version = ir_ver - onnx.save(model, f'/tmp/test_ir{ir_ver}.onnx') - - sess = ort.InferenceSession(f'/tmp/test_ir{ir_ver}.onnx', providers=['CPUExecutionProvider']) - input_data = np.random.randn(1, 3).astype(np.float32) - output = sess.run(None, {'X': input_data}) - -print('IR versions OK') -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓ (测试 IR v3, v5, v7, v9)" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -test_cases = [(3, 7), (5, 11), (7, 15), (9, 19)] -for ir_ver, opset_ver in test_cases: - X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3]) - Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3]) - node = helper.make_node('Relu', ['X'], ['Y']) - graph = helper.make_graph([node], f'test_ir{ir_ver}', [X], [Y]) - model = helper.make_model(graph, opset_imports=[helper.make_opsetid('', opset_ver)]) - model.ir_version = ir_ver - onnx.save(model, f'/tmp/test_ir{ir_ver}.onnx') - - sess = ort.InferenceSession(f'/tmp/test_ir{ir_ver}.onnx', providers=['CPUExecutionProvider']) - input_data = np.random.randn(1, 3).astype(np.float32) - output = sess.run(None, {'X': input_data}) - print(f'IR v{ir_ver} OK') -" - exit 1 -fi - -echo "" -echo "==========================================" -echo "所有测试通过!" -echo "==========================================" diff --git a/frameworks/onnxruntime/1.24.3-cpu/Dockerfile b/frameworks/onnxruntime/1.24.3-cpu/Dockerfile deleted file mode 100644 index 4a0c7db76e95820a4d775eb4cc0fc0489144686d..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.3-cpu/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -FROM opencloudos/opencloudos9-minimal:latest - -LABEL maintainer="Anstarc " -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="ONNX Runtime 1.24.3 CPU on OpenCloudOS 9" - -# 安装系统依赖 -RUN dnf install -y \ - python3.11 \ - python3.11-pip \ - git \ - wget \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 设置工作目录 -WORKDIR /app - -# 安装 ONNX Runtime CPU 版本及依赖 -# 注意:onnx 需要 1.20 以兼容 onnxruntime 1.24.3 (opset 25) -RUN pip3.11 install --no-cache-dir \ - onnxruntime==1.24.3 \ - onnx==1.20.1 \ - numpy \ - protobuf - -# 默认命令 -CMD ["python3.11", "-c", "import onnxruntime; print(f'ONNX Runtime {onnxruntime.__version__} ready')"] diff --git a/frameworks/onnxruntime/1.24.3-cpu/README.md b/frameworks/onnxruntime/1.24.3-cpu/README.md deleted file mode 100644 index e3846a2f3b19074ceadb4512351de9a520636f9e..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.3-cpu/README.md +++ /dev/null @@ -1,82 +0,0 @@ -# ONNX Runtime 1.24.3 CPU on OpenCloudOS 9 - -ONNX Runtime 是微软开源的跨平台机器学习推理加速器,支持多种深度学习框架(PyTorch、TensorFlow 等)训练的模型。 - -## 基本信息 - -- **基础镜像**: opencloudos/opencloudos9-minimal:latest -- **Python 版本**: 3.11 -- **ONNX Runtime 版本**: 1.24.3 (CPU) -- **ONNX 版本**: 1.20.1 (兼容 opset 25) - -## 构建 - -```bash -docker build -t oc9-onnxruntime-cpu:1.24.3 . -``` - -## 测试 - -```bash -./test.sh oc9-onnxruntime-cpu:1.24.3 -``` - -测试项包括: -- Python 环境 -- ONNX Runtime 版本验证 -- CPU 推理功能 -- ONNX ML 域支持 (ai.onnx.ml) -- ONNX IR 版本兼容性 (v3-v10) - -## 使用示例 - -### 基本使用 - -```bash -# 查看版本信息 -docker run --rm oc9-onnxruntime-cpu:1.24.3 python3.11 -c "import onnxruntime; print(onnxruntime.__version__)" - -# 查看可用的 Execution Providers -docker run --rm oc9-onnxruntime-cpu:1.24.3 python3.11 -c "import onnxruntime as ort; print(ort.get_available_providers())" -``` - -### CPU 推理 - -```python -import onnxruntime as ort -import numpy as np - -# 加载模型(使用 CPU Provider) -session = ort.InferenceSession( - "model.onnx", - providers=['CPUExecutionProvider'] -) - -# 准备输入数据 -input_name = session.get_inputs()[0].name -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) - -# 运行推理 -outputs = session.run(None, {input_name: input_data}) -``` - -### 交互式使用 - -```bash -docker run --rm -it oc9-onnxruntime-cpu:1.24.3 bash -``` - -## 支持的 Opset 和 IR 版本 - -- **ai.onnx**: opset 1-25 (标准推理算子) -- **ai.onnx.ml**: opset 1-5 (传统机器学习算子) -- **ONNX IR**: v3-v10 (2017-2024,完全向后兼容) - -## 系统要求 - -- **Docker**: 19.03+ - -## 参考资源 - -- [ONNX Runtime 官方文档](https://onnxruntime.ai/docs/) -- [CPU Execution Provider](https://onnxruntime.ai/docs/execution-providers/CPU-ExecutionProvider.html) diff --git a/frameworks/onnxruntime/1.24.3-cpu/build.conf b/frameworks/onnxruntime/1.24.3-cpu/build.conf deleted file mode 100644 index 511886bd00296c63a3986c3e26873704b6fec133..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.3-cpu/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ONNX Runtime 1.24.3 CPU on OpenCloudOS 9 -IMAGE_NAME=oc9-onnxruntime-cpu -IMAGE_TAG=1.24.3 -GPU_TEST=false diff --git a/frameworks/onnxruntime/1.24.3-cpu/test.sh b/frameworks/onnxruntime/1.24.3-cpu/test.sh deleted file mode 100755 index f3a072b871576a57022ae99c63a49475594f0b5a..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.3-cpu/test.sh +++ /dev/null @@ -1,217 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:-oc9-onnxruntime-cpu:1.24.3}" - -echo "==========================================" -echo "测试 ONNX Runtime 1.24.3 CPU 镜像" -echo "镜像: $IMAGE" -echo "==========================================" - -# 测试 1: Python 环境 -echo -n "测试 1: Python 环境... " -docker run --rm "$IMAGE" python3.11 --version > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 --version - exit 1 -fi - -# 测试 2: ONNX Runtime 版本 -echo -n "测试 2: ONNX Runtime 版本... " -VERSION=$(docker run --rm "$IMAGE" python3.11 -c "import onnxruntime; print(onnxruntime.__version__)") -if [ "$VERSION" = "1.24.3" ]; then - echo "✓ (版本: $VERSION)" -else - echo "✗ (期望: 1.24.3, 实际: $VERSION)" - exit 1 -fi - -# 测试 3: 核心依赖 -echo -n "测试 3: 核心依赖 (numpy, protobuf)... " -docker run --rm "$IMAGE" python3.11 -c "import numpy; import google.protobuf" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c "import numpy; import google.protobuf" - exit 1 -fi - -# 测试 4: 可用的 Execution Providers -echo -n "测试 4: 可用的 Execution Providers... " -PROVIDERS=$(docker run --rm "$IMAGE" python3.11 -c "import onnxruntime as ort; print(','.join(ort.get_available_providers()))") -echo "✓" -echo " 可用 Providers: $PROVIDERS" - -# 测试 5: CPU 推理测试 -echo -n "测试 5: CPU 推理测试... " -docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -# 创建简单的 ONNX 模型 -X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3, 224, 224]) -Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3, 224, 224]) -node = helper.make_node('Identity', ['X'], ['Y']) -graph = helper.make_graph([node], 'test', [X], [Y]) -model = helper.make_model(graph) -onnx.save(model, '/tmp/test.onnx') - -# 使用 CPU Provider 进行推理 -sess = ort.InferenceSession('/tmp/test.onnx', providers=['CPUExecutionProvider']) -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) -output = sess.run(None, {'X': input_data}) -print('推理成功') -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3, 224, 224]) -Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3, 224, 224]) -node = helper.make_node('Identity', ['X'], ['Y']) -graph = helper.make_graph([node], 'test', [X], [Y]) -model = helper.make_model(graph) -onnx.save(model, '/tmp/test.onnx') - -sess = ort.InferenceSession('/tmp/test.onnx', providers=['CPUExecutionProvider']) -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) -output = sess.run(None, {'X': input_data}) -print('推理成功') -" - exit 1 -fi - -# 测试 6: ONNX ML 域支持 -echo -n "测试 6: ONNX ML 域 (ai.onnx.ml)... " -docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -# 测试 LabelEncoder -X = helper.make_tensor_value_info('X', TensorProto.STRING, [None]) -Y = helper.make_tensor_value_info('Y', TensorProto.INT64, [None]) -node = helper.make_node( - 'LabelEncoder', ['X'], ['Y'], - domain='ai.onnx.ml', - keys_strings=['cat', 'dog'], - values_int64s=[0, 1], - default_int64=999 -) -graph = helper.make_graph([node], 'test_ml', [X], [Y]) -model = helper.make_model(graph, opset_imports=[ - helper.make_opsetid('', 21), - helper.make_opsetid('ai.onnx.ml', 3) -]) -onnx.save(model, '/tmp/test_ml.onnx') - -sess = ort.InferenceSession('/tmp/test_ml.onnx', providers=['CPUExecutionProvider']) -input_data = np.array(['cat', 'dog'], dtype=object) -output = sess.run(None, {'X': input_data}) -assert list(output[0]) == [0, 1], 'ML domain test failed' -print('ML domain OK') -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -X = helper.make_tensor_value_info('X', TensorProto.STRING, [None]) -Y = helper.make_tensor_value_info('Y', TensorProto.INT64, [None]) -node = helper.make_node( - 'LabelEncoder', ['X'], ['Y'], - domain='ai.onnx.ml', - keys_strings=['cat', 'dog'], - values_int64s=[0, 1], - default_int64=999 -) -graph = helper.make_graph([node], 'test_ml', [X], [Y]) -model = helper.make_model(graph, opset_imports=[ - helper.make_opsetid('', 21), - helper.make_opsetid('ai.onnx.ml', 3) -]) -onnx.save(model, '/tmp/test_ml.onnx') - -sess = ort.InferenceSession('/tmp/test_ml.onnx', providers=['CPUExecutionProvider']) -input_data = np.array(['cat', 'dog'], dtype=object) -output = sess.run(None, {'X': input_data}) -print('Output:', output[0]) -" - exit 1 -fi - -# 测试 7: ONNX IR 版本兼容性 -echo -n "测试 7: ONNX IR 版本兼容性... " -docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -# 测试多个 IR 版本 -test_cases = [(3, 7), (5, 11), (7, 15), (9, 19)] -for ir_ver, opset_ver in test_cases: - X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3]) - Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3]) - node = helper.make_node('Relu', ['X'], ['Y']) - graph = helper.make_graph([node], f'test_ir{ir_ver}', [X], [Y]) - model = helper.make_model(graph, opset_imports=[helper.make_opsetid('', opset_ver)]) - model.ir_version = ir_ver - onnx.save(model, f'/tmp/test_ir{ir_ver}.onnx') - - sess = ort.InferenceSession(f'/tmp/test_ir{ir_ver}.onnx', providers=['CPUExecutionProvider']) - input_data = np.random.randn(1, 3).astype(np.float32) - output = sess.run(None, {'X': input_data}) - -print('IR versions OK') -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓ (测试 IR v3, v5, v7, v9)" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -test_cases = [(3, 7), (5, 11), (7, 15), (9, 19)] -for ir_ver, opset_ver in test_cases: - X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3]) - Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3]) - node = helper.make_node('Relu', ['X'], ['Y']) - graph = helper.make_graph([node], f'test_ir{ir_ver}', [X], [Y]) - model = helper.make_model(graph, opset_imports=[helper.make_opsetid('', opset_ver)]) - model.ir_version = ir_ver - onnx.save(model, f'/tmp/test_ir{ir_ver}.onnx') - - sess = ort.InferenceSession(f'/tmp/test_ir{ir_ver}.onnx', providers=['CPUExecutionProvider']) - input_data = np.random.randn(1, 3).astype(np.float32) - output = sess.run(None, {'X': input_data}) - print(f'IR v{ir_ver} OK') -" - exit 1 -fi - -echo "" -echo "==========================================" -echo "所有测试通过!" -echo "==========================================" diff --git a/frameworks/onnxruntime/1.24.3-gpu/Dockerfile b/frameworks/onnxruntime/1.24.3-gpu/Dockerfile deleted file mode 100644 index 2da1827044eea029531626e9e611427a2450509b..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.3-gpu/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="Anstarc " -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="ONNX Runtime 1.24.3 GPU on OpenCloudOS 9" - -# 安装系统依赖 -RUN dnf install -y \ - python3.11 \ - python3.11-pip \ - git \ - wget \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 设置工作目录 -WORKDIR /app - -# 安装 ONNX Runtime GPU 版本及依赖 -# 注意:onnx 需要 1.20 以兼容 onnxruntime 1.24.3 (opset 25) -RUN pip3.11 install --no-cache-dir \ - onnxruntime-gpu==1.24.3 \ - onnx==1.20.1 \ - numpy \ - protobuf - -RUN pip3.11 install --no-cache-dir \ - torch torchvision --index-url https://download.pytorch.org/whl/cu128 - -# 设置 GPU 环境变量 -ENV NVIDIA_VISIBLE_DEVICES=all -ENV CUDA_MODULE_LOADING=LAZY - -# 默认命令 -CMD ["python3.11", "-c", "import onnxruntime; print(f'ONNX Runtime {onnxruntime.__version__} ready')"] diff --git a/frameworks/onnxruntime/1.24.3-gpu/README.md b/frameworks/onnxruntime/1.24.3-gpu/README.md deleted file mode 100644 index 13a058a418c295ac7ef8a9067545eb18395fa68d..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.3-gpu/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# ONNX Runtime 1.24.3 GPU on OpenCloudOS 9 - -ONNX Runtime 是微软开源的跨平台机器学习推理加速器,支持多种深度学习框架(PyTorch、TensorFlow 等)训练的模型。 - -## 基本信息 - -- **基础镜像**: opencloudos/opencloudos9-cuda-devel:12.8 -- **Python 版本**: 3.11 -- **CUDA 版本**: 12.8 -- **ONNX Runtime 版本**: 1.24.3 (GPU) -- **ONNX 版本**: 1.20.1 (兼容 opset 25) - -## 构建 - -```bash -docker build -t oc9-onnxruntime-gpu:1.24.3 . -``` - -## 测试 - -```bash -./test.sh oc9-onnxruntime-gpu:1.24.3 -``` - -测试项包括: -- Python 和 CUDA 环境 -- ONNX Runtime 版本验证 -- GPU 推理功能 -- ONNX ML 域支持 (ai.onnx.ml) -- ONNX IR 版本兼容性 (v3-v10) - -## 使用示例 - -### 基本使用 - -```bash -# 查看版本信息 -docker run --rm oc9-onnxruntime-gpu:1.24.3 python3.11 -c "import onnxruntime; print(onnxruntime.__version__)" - -# 查看可用的 Execution Providers -docker run --rm --gpus all oc9-onnxruntime-gpu:1.24.3 python3.11 -c "import onnxruntime as ort; print(ort.get_available_providers())" -``` - -### GPU 推理 - -```python -import onnxruntime as ort -import numpy as np - -# 加载模型(使用 CUDA Provider) -session = ort.InferenceSession( - "model.onnx", - providers=['CUDAExecutionProvider', 'CPUExecutionProvider'] -) - -# 准备输入数据 -input_name = session.get_inputs()[0].name -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) - -# 运行推理 -outputs = session.run(None, {input_name: input_data}) -``` - -### 交互式使用 - -```bash -docker run --rm -it --gpus all oc9-onnxruntime-gpu:1.24.3 bash -``` - -## 支持的 Opset 和 IR 版本 - -- **ai.onnx**: opset 1-25 (标准推理算子,支持 GPU) -- **ai.onnx.ml**: opset 1-5 (传统机器学习算子,CPU only) -- **ONNX IR**: v3-v10 (2017-2024,完全向后兼容) - -## 系统要求 - -- **GPU**: NVIDIA GPU with CUDA 12.x support -- **显存**: 建议 4GB+ -- **Docker**: 19.03+ with nvidia-docker2 - -## 参考资源 - -- [ONNX Runtime 官方文档](https://onnxruntime.ai/docs/) -- [CUDA Execution Provider](https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html) diff --git a/frameworks/onnxruntime/1.24.3-gpu/build.conf b/frameworks/onnxruntime/1.24.3-gpu/build.conf deleted file mode 100644 index dd6b2d99ba57321d0271153d780ca566e3567ef2..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.3-gpu/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ONNX Runtime 1.24.3 GPU on OpenCloudOS 9 -IMAGE_NAME=oc9-onnxruntime-gpu -IMAGE_TAG=1.24.3 -GPU_TEST=true diff --git a/frameworks/onnxruntime/1.24.3-gpu/test.sh b/frameworks/onnxruntime/1.24.3-gpu/test.sh deleted file mode 100755 index 6d266487ed29a703b3aefadc1ada826c97b50a76..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.3-gpu/test.sh +++ /dev/null @@ -1,243 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:-oc9-onnxruntime-gpu:1.24.3}" - -echo "==========================================" -echo "测试 ONNX Runtime 1.24.3 GPU 镜像" -echo "镜像: $IMAGE" -echo "==========================================" - -# 测试 1: Python 和 CUDA 环境 -echo -n "测试 1: Python 和 CUDA 环境... " -docker run --rm "$IMAGE" bash -c "python3.11 --version && /usr/local/cuda/bin/nvcc --version" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" bash -c "python3.11 --version && /usr/local/cuda/bin/nvcc --version" - exit 1 -fi - -# 测试 2: ONNX Runtime 版本 -echo -n "测试 2: ONNX Runtime 版本... " -VERSION=$(docker run --rm "$IMAGE" python3.11 -c "import onnxruntime; print(onnxruntime.__version__)") -if [ "$VERSION" = "1.24.3" ]; then - echo "✓ (版本: $VERSION)" -else - echo "✗ (期望: 1.24.3, 实际: $VERSION)" - exit 1 -fi - -# 测试 3: 核心依赖 -echo -n "测试 3: 核心依赖 (numpy, protobuf)... " -docker run --rm "$IMAGE" python3.11 -c "import numpy; import google.protobuf" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c "import numpy; import google.protobuf" - exit 1 -fi - -# 测试 4: 可用的 Execution Providers -echo -n "测试 4: 可用的 Execution Providers... " -PROVIDERS=$(docker run --rm "$IMAGE" python3.11 -c "import onnxruntime as ort; print(','.join(ort.get_available_providers()))") -echo "✓" -echo " 可用 Providers: $PROVIDERS" - -# 测试 5: GPU 环境检查 -echo -n "测试 5: GPU 环境检查... " -if command -v nvidia-smi &> /dev/null; then - GPU_COUNT=$(nvidia-smi --query-gpu=name --format=csv,noheader | wc -l) - echo "✓ (检测到 $GPU_COUNT 个 GPU)" - - # 测试 6: CUDA Execution Provider - echo -n "测试 6: CUDA Execution Provider... " - HAS_CUDA=$(docker run --rm --gpus all "$IMAGE" python3.11 -c "import onnxruntime as ort; print('CUDAExecutionProvider' in ort.get_available_providers())") - if [ "$HAS_CUDA" = "True" ]; then - echo "✓" - else - echo "✗ (CUDA Provider 不可用)" - exit 1 - fi - - # 测试 7: 简单推理测试(使用 CUDA) - echo -n "测试 7: 简单推理测试 (CUDA)... " - docker run --rm --gpus all "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np - -# 创建简单的 ONNX 模型(identity 操作) -from onnxruntime import InferenceSession -import onnx -from onnx import helper, TensorProto - -# 创建一个简单的 identity 模型 -X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3, 224, 224]) -Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3, 224, 224]) -node = helper.make_node('Identity', ['X'], ['Y']) -graph = helper.make_graph([node], 'test', [X], [Y]) -model = helper.make_model(graph) - -# 保存模型 -onnx.save(model, '/tmp/test.onnx') - -# 使用 CUDA Provider 进行推理 -sess = ort.InferenceSession('/tmp/test.onnx', providers=['CUDAExecutionProvider', 'CPUExecutionProvider']) -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) -output = sess.run(None, {'X': input_data}) - -print('推理成功') -" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "✓" - else - echo "✗" - docker run --rm --gpus all "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3, 224, 224]) -Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3, 224, 224]) -node = helper.make_node('Identity', ['X'], ['Y']) -graph = helper.make_graph([node], 'test', [X], [Y]) -model = helper.make_model(graph) -onnx.save(model, '/tmp/test.onnx') - -sess = ort.InferenceSession('/tmp/test.onnx', providers=['CUDAExecutionProvider', 'CPUExecutionProvider']) -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) -output = sess.run(None, {'X': input_data}) -print('推理成功') -" - exit 1 - fi -else - echo "⊘ (未检测到 GPU,跳过 GPU 测试)" - echo "测试 6-7: 跳过 (需要 GPU 环境)" -fi - -# 测试 8: ONNX ML 域支持 -echo -n "测试 8: ONNX ML 域 (ai.onnx.ml)... " -docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -# 测试 LabelEncoder -X = helper.make_tensor_value_info('X', TensorProto.STRING, [None]) -Y = helper.make_tensor_value_info('Y', TensorProto.INT64, [None]) -node = helper.make_node( - 'LabelEncoder', ['X'], ['Y'], - domain='ai.onnx.ml', - keys_strings=['cat', 'dog'], - values_int64s=[0, 1], - default_int64=999 -) -graph = helper.make_graph([node], 'test_ml', [X], [Y]) -model = helper.make_model(graph, opset_imports=[ - helper.make_opsetid('', 21), - helper.make_opsetid('ai.onnx.ml', 3) -]) -onnx.save(model, '/tmp/test_ml.onnx') - -sess = ort.InferenceSession('/tmp/test_ml.onnx', providers=['CPUExecutionProvider']) -input_data = np.array(['cat', 'dog'], dtype=object) -output = sess.run(None, {'X': input_data}) -assert list(output[0]) == [0, 1], 'ML domain test failed' -print('ML domain OK') -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -X = helper.make_tensor_value_info('X', TensorProto.STRING, [None]) -Y = helper.make_tensor_value_info('Y', TensorProto.INT64, [None]) -node = helper.make_node( - 'LabelEncoder', ['X'], ['Y'], - domain='ai.onnx.ml', - keys_strings=['cat', 'dog'], - values_int64s=[0, 1], - default_int64=999 -) -graph = helper.make_graph([node], 'test_ml', [X], [Y]) -model = helper.make_model(graph, opset_imports=[ - helper.make_opsetid('', 21), - helper.make_opsetid('ai.onnx.ml', 3) -]) -onnx.save(model, '/tmp/test_ml.onnx') - -sess = ort.InferenceSession('/tmp/test_ml.onnx', providers=['CPUExecutionProvider']) -input_data = np.array(['cat', 'dog'], dtype=object) -output = sess.run(None, {'X': input_data}) -print('Output:', output[0]) -" - exit 1 -fi - -# 测试 9: ONNX IR 版本兼容性 -echo -n "测试 9: ONNX IR 版本兼容性... " -docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -# 测试多个 IR 版本 -test_cases = [(3, 7), (5, 11), (7, 15), (9, 19)] -for ir_ver, opset_ver in test_cases: - X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3]) - Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3]) - node = helper.make_node('Relu', ['X'], ['Y']) - graph = helper.make_graph([node], f'test_ir{ir_ver}', [X], [Y]) - model = helper.make_model(graph, opset_imports=[helper.make_opsetid('', opset_ver)]) - model.ir_version = ir_ver - onnx.save(model, f'/tmp/test_ir{ir_ver}.onnx') - - sess = ort.InferenceSession(f'/tmp/test_ir{ir_ver}.onnx', providers=['CPUExecutionProvider']) - input_data = np.random.randn(1, 3).astype(np.float32) - output = sess.run(None, {'X': input_data}) - -print('IR versions OK') -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓ (测试 IR v3, v5, v7, v9)" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -test_cases = [(3, 7), (5, 11), (7, 15), (9, 19)] -for ir_ver, opset_ver in test_cases: - X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3]) - Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3]) - node = helper.make_node('Relu', ['X'], ['Y']) - graph = helper.make_graph([node], f'test_ir{ir_ver}', [X], [Y]) - model = helper.make_model(graph, opset_imports=[helper.make_opsetid('', opset_ver)]) - model.ir_version = ir_ver - onnx.save(model, f'/tmp/test_ir{ir_ver}.onnx') - - sess = ort.InferenceSession(f'/tmp/test_ir{ir_ver}.onnx', providers=['CPUExecutionProvider']) - input_data = np.random.randn(1, 3).astype(np.float32) - output = sess.run(None, {'X': input_data}) - print(f'IR v{ir_ver} OK') -" - exit 1 -fi - -echo "" -echo "==========================================" -echo "所有测试通过!" -echo "==========================================" diff --git a/frameworks/onnxruntime/1.24.4-cpu/Dockerfile b/frameworks/onnxruntime/1.24.4-cpu/Dockerfile deleted file mode 100644 index 5b8b9851bc1654ae364af32c3c2fc2059cd015c8..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.4-cpu/Dockerfile +++ /dev/null @@ -1,28 +0,0 @@ -FROM opencloudos/opencloudos9-minimal:latest - -LABEL maintainer="Anstarc " -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="ONNX Runtime 1.24.4 CPU on OpenCloudOS 9" - -# 安装系统依赖 -RUN dnf install -y \ - python3.11 \ - python3.11-pip \ - git \ - wget \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 设置工作目录 -WORKDIR /app - -# 安装 ONNX Runtime CPU 版本及依赖 -# 注意:onnx 需要 1.20 以兼容 onnxruntime 1.24.4 (opset 25) -RUN pip3.11 install --no-cache-dir \ - onnxruntime==1.24.4 \ - onnx==1.20.1 \ - numpy \ - protobuf - -# 默认命令 -CMD ["python3.11", "-c", "import onnxruntime; print(f'ONNX Runtime {onnxruntime.__version__} ready')"] diff --git a/frameworks/onnxruntime/1.24.4-cpu/README.md b/frameworks/onnxruntime/1.24.4-cpu/README.md deleted file mode 100644 index b1495f1fa537490b86a7841b6799840d0ea55d89..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.4-cpu/README.md +++ /dev/null @@ -1,82 +0,0 @@ -# ONNX Runtime 1.24.4 CPU on OpenCloudOS 9 - -ONNX Runtime 是微软开源的跨平台机器学习推理加速器,支持多种深度学习框架(PyTorch、TensorFlow 等)训练的模型。 - -## 基本信息 - -- **基础镜像**: opencloudos/opencloudos9-minimal:latest -- **Python 版本**: 3.11 -- **ONNX Runtime 版本**: 1.24.4 (CPU) -- **ONNX 版本**: 1.20.1 (兼容 opset 25) - -## 构建 - -```bash -docker build -t oc9-onnxruntime-cpu:1.24.4 . -``` - -## 测试 - -```bash -./test.sh oc9-onnxruntime-cpu:1.24.4 -``` - -测试项包括: -- Python 环境 -- ONNX Runtime 版本验证 -- CPU 推理功能 -- ONNX ML 域支持 (ai.onnx.ml) -- ONNX IR 版本兼容性 (v3-v10) - -## 使用示例 - -### 基本使用 - -```bash -# 查看版本信息 -docker run --rm oc9-onnxruntime-cpu:1.24.4 python3.11 -c "import onnxruntime; print(onnxruntime.__version__)" - -# 查看可用的 Execution Providers -docker run --rm oc9-onnxruntime-cpu:1.24.4 python3.11 -c "import onnxruntime as ort; print(ort.get_available_providers())" -``` - -### CPU 推理 - -```python -import onnxruntime as ort -import numpy as np - -# 加载模型(使用 CPU Provider) -session = ort.InferenceSession( - "model.onnx", - providers=['CPUExecutionProvider'] -) - -# 准备输入数据 -input_name = session.get_inputs()[0].name -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) - -# 运行推理 -outputs = session.run(None, {input_name: input_data}) -``` - -### 交互式使用 - -```bash -docker run --rm -it oc9-onnxruntime-cpu:1.24.4 bash -``` - -## 支持的 Opset 和 IR 版本 - -- **ai.onnx**: opset 1-25 (标准推理算子) -- **ai.onnx.ml**: opset 1-5 (传统机器学习算子) -- **ONNX IR**: v3-v10 (2017-2024,完全向后兼容) - -## 系统要求 - -- **Docker**: 19.03+ - -## 参考资源 - -- [ONNX Runtime 官方文档](https://onnxruntime.ai/docs/) -- [CPU Execution Provider](https://onnxruntime.ai/docs/execution-providers/CPU-ExecutionProvider.html) diff --git a/frameworks/onnxruntime/1.24.4-cpu/build.conf b/frameworks/onnxruntime/1.24.4-cpu/build.conf deleted file mode 100644 index f86e19148783ec8d03e9d9754281567e4768488a..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.4-cpu/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ONNX Runtime 1.24.4 CPU on OpenCloudOS 9 -IMAGE_NAME=oc9-onnxruntime-cpu -IMAGE_TAG=1.24.4 -GPU_TEST=false diff --git a/frameworks/onnxruntime/1.24.4-cpu/test.sh b/frameworks/onnxruntime/1.24.4-cpu/test.sh deleted file mode 100755 index aa82543eb0aafbb32af6c5c9814167110258962f..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.4-cpu/test.sh +++ /dev/null @@ -1,217 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:-oc9-onnxruntime-cpu:1.24.4}" - -echo "==========================================" -echo "测试 ONNX Runtime 1.24.4 CPU 镜像" -echo "镜像: $IMAGE" -echo "==========================================" - -# 测试 1: Python 环境 -echo -n "测试 1: Python 环境... " -docker run --rm "$IMAGE" python3.11 --version > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 --version - exit 1 -fi - -# 测试 2: ONNX Runtime 版本 -echo -n "测试 2: ONNX Runtime 版本... " -VERSION=$(docker run --rm "$IMAGE" python3.11 -c "import onnxruntime; print(onnxruntime.__version__)") -if [ "$VERSION" = "1.24.4" ]; then - echo "✓ (版本: $VERSION)" -else - echo "✗ (期望: 1.24.4, 实际: $VERSION)" - exit 1 -fi - -# 测试 3: 核心依赖 -echo -n "测试 3: 核心依赖 (numpy, protobuf)... " -docker run --rm "$IMAGE" python3.11 -c "import numpy; import google.protobuf" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c "import numpy; import google.protobuf" - exit 1 -fi - -# 测试 4: 可用的 Execution Providers -echo -n "测试 4: 可用的 Execution Providers... " -PROVIDERS=$(docker run --rm "$IMAGE" python3.11 -c "import onnxruntime as ort; print(','.join(ort.get_available_providers()))") -echo "✓" -echo " 可用 Providers: $PROVIDERS" - -# 测试 5: CPU 推理测试 -echo -n "测试 5: CPU 推理测试... " -docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -# 创建简单的 ONNX 模型 -X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3, 224, 224]) -Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3, 224, 224]) -node = helper.make_node('Identity', ['X'], ['Y']) -graph = helper.make_graph([node], 'test', [X], [Y]) -model = helper.make_model(graph) -onnx.save(model, '/tmp/test.onnx') - -# 使用 CPU Provider 进行推理 -sess = ort.InferenceSession('/tmp/test.onnx', providers=['CPUExecutionProvider']) -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) -output = sess.run(None, {'X': input_data}) -print('推理成功') -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3, 224, 224]) -Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3, 224, 224]) -node = helper.make_node('Identity', ['X'], ['Y']) -graph = helper.make_graph([node], 'test', [X], [Y]) -model = helper.make_model(graph) -onnx.save(model, '/tmp/test.onnx') - -sess = ort.InferenceSession('/tmp/test.onnx', providers=['CPUExecutionProvider']) -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) -output = sess.run(None, {'X': input_data}) -print('推理成功') -" - exit 1 -fi - -# 测试 6: ONNX ML 域支持 -echo -n "测试 6: ONNX ML 域 (ai.onnx.ml)... " -docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -# 测试 LabelEncoder -X = helper.make_tensor_value_info('X', TensorProto.STRING, [None]) -Y = helper.make_tensor_value_info('Y', TensorProto.INT64, [None]) -node = helper.make_node( - 'LabelEncoder', ['X'], ['Y'], - domain='ai.onnx.ml', - keys_strings=['cat', 'dog'], - values_int64s=[0, 1], - default_int64=999 -) -graph = helper.make_graph([node], 'test_ml', [X], [Y]) -model = helper.make_model(graph, opset_imports=[ - helper.make_opsetid('', 21), - helper.make_opsetid('ai.onnx.ml', 3) -]) -onnx.save(model, '/tmp/test_ml.onnx') - -sess = ort.InferenceSession('/tmp/test_ml.onnx', providers=['CPUExecutionProvider']) -input_data = np.array(['cat', 'dog'], dtype=object) -output = sess.run(None, {'X': input_data}) -assert list(output[0]) == [0, 1], 'ML domain test failed' -print('ML domain OK') -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -X = helper.make_tensor_value_info('X', TensorProto.STRING, [None]) -Y = helper.make_tensor_value_info('Y', TensorProto.INT64, [None]) -node = helper.make_node( - 'LabelEncoder', ['X'], ['Y'], - domain='ai.onnx.ml', - keys_strings=['cat', 'dog'], - values_int64s=[0, 1], - default_int64=999 -) -graph = helper.make_graph([node], 'test_ml', [X], [Y]) -model = helper.make_model(graph, opset_imports=[ - helper.make_opsetid('', 21), - helper.make_opsetid('ai.onnx.ml', 3) -]) -onnx.save(model, '/tmp/test_ml.onnx') - -sess = ort.InferenceSession('/tmp/test_ml.onnx', providers=['CPUExecutionProvider']) -input_data = np.array(['cat', 'dog'], dtype=object) -output = sess.run(None, {'X': input_data}) -print('Output:', output[0]) -" - exit 1 -fi - -# 测试 7: ONNX IR 版本兼容性 -echo -n "测试 7: ONNX IR 版本兼容性... " -docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -# 测试多个 IR 版本 -test_cases = [(3, 7), (5, 11), (7, 15), (9, 19)] -for ir_ver, opset_ver in test_cases: - X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3]) - Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3]) - node = helper.make_node('Relu', ['X'], ['Y']) - graph = helper.make_graph([node], f'test_ir{ir_ver}', [X], [Y]) - model = helper.make_model(graph, opset_imports=[helper.make_opsetid('', opset_ver)]) - model.ir_version = ir_ver - onnx.save(model, f'/tmp/test_ir{ir_ver}.onnx') - - sess = ort.InferenceSession(f'/tmp/test_ir{ir_ver}.onnx', providers=['CPUExecutionProvider']) - input_data = np.random.randn(1, 3).astype(np.float32) - output = sess.run(None, {'X': input_data}) - -print('IR versions OK') -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓ (测试 IR v3, v5, v7, v9)" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -test_cases = [(3, 7), (5, 11), (7, 15), (9, 19)] -for ir_ver, opset_ver in test_cases: - X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3]) - Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3]) - node = helper.make_node('Relu', ['X'], ['Y']) - graph = helper.make_graph([node], f'test_ir{ir_ver}', [X], [Y]) - model = helper.make_model(graph, opset_imports=[helper.make_opsetid('', opset_ver)]) - model.ir_version = ir_ver - onnx.save(model, f'/tmp/test_ir{ir_ver}.onnx') - - sess = ort.InferenceSession(f'/tmp/test_ir{ir_ver}.onnx', providers=['CPUExecutionProvider']) - input_data = np.random.randn(1, 3).astype(np.float32) - output = sess.run(None, {'X': input_data}) - print(f'IR v{ir_ver} OK') -" - exit 1 -fi - -echo "" -echo "==========================================" -echo "所有测试通过!" -echo "==========================================" diff --git a/frameworks/onnxruntime/1.24.4-gpu/Dockerfile b/frameworks/onnxruntime/1.24.4-gpu/Dockerfile deleted file mode 100644 index 8cfcece29a0336dd9252622a9d9788ab1e0c5349..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.4-gpu/Dockerfile +++ /dev/null @@ -1,35 +0,0 @@ -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="Anstarc " -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="ONNX Runtime 1.24.4 GPU on OpenCloudOS 9" - -# 安装系统依赖 -RUN dnf install -y \ - python3.11 \ - python3.11-pip \ - git \ - wget \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 设置工作目录 -WORKDIR /app - -# 安装 ONNX Runtime GPU 版本及依赖 -# 注意:onnx 需要 1.20 以兼容 onnxruntime 1.24.4 (opset 25) -RUN pip3.11 install --no-cache-dir \ - onnxruntime-gpu==1.24.4 \ - onnx==1.20.1 \ - numpy \ - protobuf - -RUN pip3.11 install --no-cache-dir \ - torch torchvision --index-url https://download.pytorch.org/whl/cu128 - -# 设置 GPU 环境变量 -ENV NVIDIA_VISIBLE_DEVICES=all -ENV CUDA_MODULE_LOADING=LAZY - -# 默认命令 -CMD ["python3.11", "-c", "import onnxruntime; print(f'ONNX Runtime {onnxruntime.__version__} ready')"] diff --git a/frameworks/onnxruntime/1.24.4-gpu/README.md b/frameworks/onnxruntime/1.24.4-gpu/README.md deleted file mode 100644 index fa03bedc5667b117c4392735e31a623d235866c3..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.4-gpu/README.md +++ /dev/null @@ -1,85 +0,0 @@ -# ONNX Runtime 1.24.4 GPU on OpenCloudOS 9 - -ONNX Runtime 是微软开源的跨平台机器学习推理加速器,支持多种深度学习框架(PyTorch、TensorFlow 等)训练的模型。 - -## 基本信息 - -- **基础镜像**: opencloudos/opencloudos9-cuda-devel:12.8 -- **Python 版本**: 3.11 -- **CUDA 版本**: 12.8 -- **ONNX Runtime 版本**: 1.24.4 (GPU) -- **ONNX 版本**: 1.20.1 (兼容 opset 25) - -## 构建 - -```bash -docker build -t oc9-onnxruntime-gpu:1.24.4 . -``` - -## 测试 - -```bash -./test.sh oc9-onnxruntime-gpu:1.24.4 -``` - -测试项包括: -- Python 和 CUDA 环境 -- ONNX Runtime 版本验证 -- GPU 推理功能 -- ONNX ML 域支持 (ai.onnx.ml) -- ONNX IR 版本兼容性 (v3-v10) - -## 使用示例 - -### 基本使用 - -```bash -# 查看版本信息 -docker run --rm oc9-onnxruntime-gpu:1.24.4 python3.11 -c "import onnxruntime; print(onnxruntime.__version__)" - -# 查看可用的 Execution Providers -docker run --rm --gpus all oc9-onnxruntime-gpu:1.24.4 python3.11 -c "import onnxruntime as ort; print(ort.get_available_providers())" -``` - -### GPU 推理 - -```python -import onnxruntime as ort -import numpy as np - -# 加载模型(使用 CUDA Provider) -session = ort.InferenceSession( - "model.onnx", - providers=['CUDAExecutionProvider', 'CPUExecutionProvider'] -) - -# 准备输入数据 -input_name = session.get_inputs()[0].name -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) - -# 运行推理 -outputs = session.run(None, {input_name: input_data}) -``` - -### 交互式使用 - -```bash -docker run --rm -it --gpus all oc9-onnxruntime-gpu:1.24.4 bash -``` - -## 支持的 Opset 和 IR 版本 - -- **ai.onnx**: opset 1-25 (标准推理算子,支持 GPU) -- **ai.onnx.ml**: opset 1-5 (传统机器学习算子,CPU only) -- **ONNX IR**: v3-v10 (2017-2024,完全向后兼容) - -## 系统要求 - -- **GPU**: NVIDIA GPU with CUDA 12.x support -- **显存**: 建议 4GB+ -- **Docker**: 19.03+ with nvidia-docker2 - -## 参考资源 - -- [ONNX Runtime 官方文档](https://onnxruntime.ai/docs/) -- [CUDA Execution Provider](https://onnxruntime.ai/docs/execution-providers/CUDA-ExecutionProvider.html) diff --git a/frameworks/onnxruntime/1.24.4-gpu/build.conf b/frameworks/onnxruntime/1.24.4-gpu/build.conf deleted file mode 100644 index 13e9c2fccb531411912721bfccdd0b2f1a1dcde5..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.4-gpu/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# ONNX Runtime 1.24.4 GPU on OpenCloudOS 9 -IMAGE_NAME=oc9-onnxruntime-gpu -IMAGE_TAG=1.24.4 -GPU_TEST=true diff --git a/frameworks/onnxruntime/1.24.4-gpu/test.sh b/frameworks/onnxruntime/1.24.4-gpu/test.sh deleted file mode 100755 index de01cd1927e77dd023442f7ece638712f28b631f..0000000000000000000000000000000000000000 --- a/frameworks/onnxruntime/1.24.4-gpu/test.sh +++ /dev/null @@ -1,243 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:-oc9-onnxruntime-gpu:1.24.4}" - -echo "==========================================" -echo "测试 ONNX Runtime 1.24.4 GPU 镜像" -echo "镜像: $IMAGE" -echo "==========================================" - -# 测试 1: Python 和 CUDA 环境 -echo -n "测试 1: Python 和 CUDA 环境... " -docker run --rm "$IMAGE" bash -c "python3.11 --version && /usr/local/cuda/bin/nvcc --version" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" bash -c "python3.11 --version && /usr/local/cuda/bin/nvcc --version" - exit 1 -fi - -# 测试 2: ONNX Runtime 版本 -echo -n "测试 2: ONNX Runtime 版本... " -VERSION=$(docker run --rm "$IMAGE" python3.11 -c "import onnxruntime; print(onnxruntime.__version__)") -if [ "$VERSION" = "1.24.4" ]; then - echo "✓ (版本: $VERSION)" -else - echo "✗ (期望: 1.24.4, 实际: $VERSION)" - exit 1 -fi - -# 测试 3: 核心依赖 -echo -n "测试 3: 核心依赖 (numpy, protobuf)... " -docker run --rm "$IMAGE" python3.11 -c "import numpy; import google.protobuf" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c "import numpy; import google.protobuf" - exit 1 -fi - -# 测试 4: 可用的 Execution Providers -echo -n "测试 4: 可用的 Execution Providers... " -PROVIDERS=$(docker run --rm "$IMAGE" python3.11 -c "import onnxruntime as ort; print(','.join(ort.get_available_providers()))") -echo "✓" -echo " 可用 Providers: $PROVIDERS" - -# 测试 5: GPU 环境检查 -echo -n "测试 5: GPU 环境检查... " -if command -v nvidia-smi &> /dev/null; then - GPU_COUNT=$(nvidia-smi --query-gpu=name --format=csv,noheader | wc -l) - echo "✓ (检测到 $GPU_COUNT 个 GPU)" - - # 测试 6: CUDA Execution Provider - echo -n "测试 6: CUDA Execution Provider... " - HAS_CUDA=$(docker run --rm --gpus all "$IMAGE" python3.11 -c "import onnxruntime as ort; print('CUDAExecutionProvider' in ort.get_available_providers())") - if [ "$HAS_CUDA" = "True" ]; then - echo "✓" - else - echo "✗ (CUDA Provider 不可用)" - exit 1 - fi - - # 测试 7: 简单推理测试(使用 CUDA) - echo -n "测试 7: 简单推理测试 (CUDA)... " - docker run --rm --gpus all "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np - -# 创建简单的 ONNX 模型(identity 操作) -from onnxruntime import InferenceSession -import onnx -from onnx import helper, TensorProto - -# 创建一个简单的 identity 模型 -X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3, 224, 224]) -Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3, 224, 224]) -node = helper.make_node('Identity', ['X'], ['Y']) -graph = helper.make_graph([node], 'test', [X], [Y]) -model = helper.make_model(graph) - -# 保存模型 -onnx.save(model, '/tmp/test.onnx') - -# 使用 CUDA Provider 进行推理 -sess = ort.InferenceSession('/tmp/test.onnx', providers=['CUDAExecutionProvider', 'CPUExecutionProvider']) -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) -output = sess.run(None, {'X': input_data}) - -print('推理成功') -" > /dev/null 2>&1 - if [ $? -eq 0 ]; then - echo "✓" - else - echo "✗" - docker run --rm --gpus all "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3, 224, 224]) -Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3, 224, 224]) -node = helper.make_node('Identity', ['X'], ['Y']) -graph = helper.make_graph([node], 'test', [X], [Y]) -model = helper.make_model(graph) -onnx.save(model, '/tmp/test.onnx') - -sess = ort.InferenceSession('/tmp/test.onnx', providers=['CUDAExecutionProvider', 'CPUExecutionProvider']) -input_data = np.random.randn(1, 3, 224, 224).astype(np.float32) -output = sess.run(None, {'X': input_data}) -print('推理成功') -" - exit 1 - fi -else - echo "⊘ (未检测到 GPU,跳过 GPU 测试)" - echo "测试 6-7: 跳过 (需要 GPU 环境)" -fi - -# 测试 8: ONNX ML 域支持 -echo -n "测试 8: ONNX ML 域 (ai.onnx.ml)... " -docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -# 测试 LabelEncoder -X = helper.make_tensor_value_info('X', TensorProto.STRING, [None]) -Y = helper.make_tensor_value_info('Y', TensorProto.INT64, [None]) -node = helper.make_node( - 'LabelEncoder', ['X'], ['Y'], - domain='ai.onnx.ml', - keys_strings=['cat', 'dog'], - values_int64s=[0, 1], - default_int64=999 -) -graph = helper.make_graph([node], 'test_ml', [X], [Y]) -model = helper.make_model(graph, opset_imports=[ - helper.make_opsetid('', 21), - helper.make_opsetid('ai.onnx.ml', 3) -]) -onnx.save(model, '/tmp/test_ml.onnx') - -sess = ort.InferenceSession('/tmp/test_ml.onnx', providers=['CPUExecutionProvider']) -input_data = np.array(['cat', 'dog'], dtype=object) -output = sess.run(None, {'X': input_data}) -assert list(output[0]) == [0, 1], 'ML domain test failed' -print('ML domain OK') -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -X = helper.make_tensor_value_info('X', TensorProto.STRING, [None]) -Y = helper.make_tensor_value_info('Y', TensorProto.INT64, [None]) -node = helper.make_node( - 'LabelEncoder', ['X'], ['Y'], - domain='ai.onnx.ml', - keys_strings=['cat', 'dog'], - values_int64s=[0, 1], - default_int64=999 -) -graph = helper.make_graph([node], 'test_ml', [X], [Y]) -model = helper.make_model(graph, opset_imports=[ - helper.make_opsetid('', 21), - helper.make_opsetid('ai.onnx.ml', 3) -]) -onnx.save(model, '/tmp/test_ml.onnx') - -sess = ort.InferenceSession('/tmp/test_ml.onnx', providers=['CPUExecutionProvider']) -input_data = np.array(['cat', 'dog'], dtype=object) -output = sess.run(None, {'X': input_data}) -print('Output:', output[0]) -" - exit 1 -fi - -# 测试 9: ONNX IR 版本兼容性 -echo -n "测试 9: ONNX IR 版本兼容性... " -docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -# 测试多个 IR 版本 -test_cases = [(3, 7), (5, 11), (7, 15), (9, 19)] -for ir_ver, opset_ver in test_cases: - X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3]) - Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3]) - node = helper.make_node('Relu', ['X'], ['Y']) - graph = helper.make_graph([node], f'test_ir{ir_ver}', [X], [Y]) - model = helper.make_model(graph, opset_imports=[helper.make_opsetid('', opset_ver)]) - model.ir_version = ir_ver - onnx.save(model, f'/tmp/test_ir{ir_ver}.onnx') - - sess = ort.InferenceSession(f'/tmp/test_ir{ir_ver}.onnx', providers=['CPUExecutionProvider']) - input_data = np.random.randn(1, 3).astype(np.float32) - output = sess.run(None, {'X': input_data}) - -print('IR versions OK') -" > /dev/null 2>&1 -if [ $? -eq 0 ]; then - echo "✓ (测试 IR v3, v5, v7, v9)" -else - echo "✗" - docker run --rm "$IMAGE" python3.11 -c " -import onnxruntime as ort -import numpy as np -from onnx import helper, TensorProto -import onnx - -test_cases = [(3, 7), (5, 11), (7, 15), (9, 19)] -for ir_ver, opset_ver in test_cases: - X = helper.make_tensor_value_info('X', TensorProto.FLOAT, [1, 3]) - Y = helper.make_tensor_value_info('Y', TensorProto.FLOAT, [1, 3]) - node = helper.make_node('Relu', ['X'], ['Y']) - graph = helper.make_graph([node], f'test_ir{ir_ver}', [X], [Y]) - model = helper.make_model(graph, opset_imports=[helper.make_opsetid('', opset_ver)]) - model.ir_version = ir_ver - onnx.save(model, f'/tmp/test_ir{ir_ver}.onnx') - - sess = ort.InferenceSession(f'/tmp/test_ir{ir_ver}.onnx', providers=['CPUExecutionProvider']) - input_data = np.random.randn(1, 3).astype(np.float32) - output = sess.run(None, {'X': input_data}) - print(f'IR v{ir_ver} OK') -" - exit 1 -fi - -echo "" -echo "==========================================" -echo "所有测试通过!" -echo "==========================================" diff --git a/frameworks/paddle/3.2.2/Dockerfile b/frameworks/paddle/3.2.2/Dockerfile deleted file mode 100644 index 4a26a94be63099693af1f02088781f557e894dad..0000000000000000000000000000000000000000 --- a/frameworks/paddle/3.2.2/Dockerfile +++ /dev/null @@ -1,29 +0,0 @@ -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="OpenCloudOS Community" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="PaddlePaddle 3.2.2 (GPU) on OpenCloudOS 9" - -# Install Python 3.11 and build tools -RUN dnf install -y \ - python3.11 \ - python3.11-pip \ - ccache \ - && dnf clean all \ - && rm -rf /var/cache/yum/* \ - && ln -sf /usr/bin/python3.11 /usr/bin/python3 - -# Install PaddlePaddle GPU (CUDA 12.6) from official index -# PaddlePaddle ships its own CUDA runtime, compatible with CUDA 12.8 base image -RUN pip3.11 install --no-cache-dir uv \ - && uv pip install --no-cache-dir \ - paddlepaddle-gpu==3.2.2 \ - -i https://www.paddlepaddle.org.cn/packages/stable/cu126/ \ - --system - -# Set GPU environment -ENV NVIDIA_VISIBLE_DEVICES=all - -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -CMD ["python3.11"] \ No newline at end of file diff --git a/frameworks/paddle/3.2.2/README.md b/frameworks/paddle/3.2.2/README.md deleted file mode 100644 index 9bed14ecb082ef157ff9393e8361f39158983a71..0000000000000000000000000000000000000000 --- a/frameworks/paddle/3.2.2/README.md +++ /dev/null @@ -1,52 +0,0 @@ -# PaddlePaddle on OpenCloudOS 9 - -## 基本信息 -- **框架版本**:v3.2.2 -- **基础镜像**:opencloudos/opencloudos9-cuda-devel:12.8 -- **Python 版本**:3.11 -- **CUDA 版本**:12.6(PaddlePaddle 内置 CUDA 运行时) -- **GPU 驱动要求**:>= 550.54.14 - -## 构建 - -```bash -docker build -t oc9-paddle:3.2.2 . -``` - -## 使用示例 - -```bash -# 验证 PaddlePaddle 版本 -docker run --rm --gpus all oc9-paddle:3.2.2 python3 -c "import paddle; print(paddle.__version__)" - -# 验证 GPU 可用性 -docker run --rm --gpus all oc9-paddle:3.2.2 python3 -c " -import paddle -print(f'GPU available: {paddle.device.is_compiled_with_cuda()}') -print(f'GPU count: {paddle.device.cuda.device_count()}') -" - -# GPU 矩阵运算示例 -docker run --rm --gpus all oc9-paddle:3.2.2 python3 -c " -import paddle -x = paddle.to_tensor([[1.0, 2.0], [3.0, 4.0]], place=paddle.CUDAPlace(0)) -y = paddle.matmul(x, x) -print(f'Result: {y}') -" -``` - -## 测试验证 - -```bash -# 执行测试脚本(需要 GPU 环境) -bash test.sh oc9-paddle:3.2.2 -``` - -测试脚本会验证以下内容: -- PaddlePaddle 是否正常导入 -- GPU 是否可用 -- GPU 上的张量计算是否正确 - -## 已知问题 -- PaddlePaddle GPU 版本自带 CUDA 12.6 运行时,与基础镜像的 CUDA 12.8 不冲突。 -- 首次运行时 PaddlePaddle 可能需要下载额外的库文件,建议保证网络连通。 diff --git a/frameworks/paddle/3.2.2/build.conf b/frameworks/paddle/3.2.2/build.conf deleted file mode 100644 index 44eec3407edaed19989909d9bd7608be8aa70dd6..0000000000000000000000000000000000000000 --- a/frameworks/paddle/3.2.2/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# paddlepaddle 3.2.2 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-paddle -IMAGE_TAG=3.2.2 -GPU_TEST=false diff --git a/frameworks/paddle/3.2.2/test.sh b/frameworks/paddle/3.2.2/test.sh deleted file mode 100755 index b2e799d747313265b0acc2d7aec59beb975a5980..0000000000000000000000000000000000000000 --- a/frameworks/paddle/3.2.2/test.sh +++ /dev/null @@ -1,43 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:?ERROR: Missing image argument. Usage: bash test.sh }" - -echo "=== PaddlePaddle GPU Image Test ===" - -# 1. Verify PaddlePaddle import -echo -n "Check paddle import... " -docker run --rm --gpus all "$IMAGE" python3 -c " -import paddle -print(f'PaddlePaddle version: {paddle.__version__}') -" && echo "PASS" || { echo "FAIL"; exit 1; } - -# 2. Verify GPU availability -echo -n "Check GPU availability... " -docker run --rm --gpus all "$IMAGE" python3 -c " -import paddle -assert paddle.device.is_compiled_with_cuda(), 'PaddlePaddle not compiled with CUDA' -gpu_count = paddle.device.cuda.device_count() -assert gpu_count > 0, 'No GPU detected' -print(f'GPU count: {gpu_count}') -print(f'GPU place: {paddle.CUDAPlace(0)}') -" && echo "PASS" || { echo "FAIL"; exit 1; } - -# 3. Verify core functionality (simple tensor computation on GPU) -echo -n "Check core functionality... " -docker run --rm --gpus all "$IMAGE" python3 -c " -import paddle - -# Create tensor on GPU -x = paddle.to_tensor([[1.0, 2.0], [3.0, 4.0]], place=paddle.CUDAPlace(0)) -y = paddle.to_tensor([[5.0, 6.0], [7.0, 8.0]], place=paddle.CUDAPlace(0)) - -# Matrix multiplication -z = paddle.matmul(x, y) -expected = paddle.to_tensor([[19.0, 22.0], [43.0, 50.0]], place=paddle.CUDAPlace(0)) -assert paddle.allclose(z, expected), f'Matrix multiplication result mismatch: {z}' - -print('Core functionality OK') -" && echo "PASS" || { echo "FAIL"; exit 1; } - -echo "=== All tests passed ===" diff --git a/frameworks/pytorch/2.10.0/Dockerfile b/frameworks/pytorch/2.10.0/Dockerfile deleted file mode 100644 index 3185627ca7fb32151c3a865a8e525a2efc30537e..0000000000000000000000000000000000000000 --- a/frameworks/pytorch/2.10.0/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ - -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="stronking 363133710@qq.com" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="Torch 2.10.0 (GPU) on OpenCloudOS 9" - -ENV NVIDIA_VISIBLE_DEVICES=all \ - PYTHONUNBUFFERED=1 \ - PIP_DISABLE_PIP_VERSION_CHECK=1 \ - PIP_DEFAULT_TIMEOUT=120 - - -WORKDIR /home - -RUN --mount=type=cache,id=pip-cache-opencloudos9-cu128,target=/root/.cache/pip \ - pip install \ - torch==2.10.0 \ - torchvision==0.25.0 \ - torchaudio==2.10.0 \ - --index-url https://download.pytorch.org/whl/cu128 - -COPY test.sh . - -CMD ["python3"] \ No newline at end of file diff --git a/frameworks/pytorch/2.10.0/README.md b/frameworks/pytorch/2.10.0/README.md deleted file mode 100644 index 81fcbf520c8a1537921251d1ab85c41b870487ae..0000000000000000000000000000000000000000 --- a/frameworks/pytorch/2.10.0/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# Torch 2.10.0 on OpenCloudOS 9 - -## 基本信息 -- **框架版本**:v2.10.0 -- **基础镜像**:opencloudos9-cuda-devel:12.8 -- **Python 版本**:3.11 -- **CUDA 版本**: 12.x 或 更高 - -## 构建 - -docker build -t oc9-pytorch:2.10.0 . - -## 镜像启动命令 - -docker run -d --gpus all --name oc9-pytorch oc9-pytorch:2.10.0 - -## 镜像测试命令 - -docker run --rm --gpus all oc9-pytorch:2.10.0 bash test.sh - diff --git a/frameworks/pytorch/2.10.0/build.conf b/frameworks/pytorch/2.10.0/build.conf deleted file mode 100644 index fff269862299e4313eb586f485b6f862e3e3b939..0000000000000000000000000000000000000000 --- a/frameworks/pytorch/2.10.0/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# pytorch 2.10.0 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-pytorch -IMAGE_TAG=2.10.0 -GPU_TEST=true \ No newline at end of file diff --git a/frameworks/pytorch/2.10.0/test.sh b/frameworks/pytorch/2.10.0/test.sh deleted file mode 100644 index 71e9e0a7683912d1386e6daad10342577d3377e5..0000000000000000000000000000000000000000 --- a/frameworks/pytorch/2.10.0/test.sh +++ /dev/null @@ -1,204 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:-}" - -if [ -z "${IMAGE}" ]; then - echo "用法: bash test.sh <镜像名:标签>" - exit 1 -fi - -if ! command -v docker >/dev/null 2>&1; then - echo "✗ 未找到 docker" - exit 1 -fi - -echo "=== PyTorch 容器基础功能测试 ===" -echo "测试镜像: ${IMAGE}" - -docker run --rm --gpus all "${IMAGE}" /bin/bash -lc ' -set -e - -export CUDA_HOME=/usr/local/cuda -export PATH=/usr/local/cuda/bin:$PATH -export LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH:-} - -echo "=== PyTorch 基础功能测试 ===" - -# 说明: -# CI 的 GPU_TEST=true 会额外执行 torch.cuda.is_available() 验证 CUDA。 -# 因此这里默认不强制要求 CUDA,避免基础测试因为未挂载 GPU 失败。 -# 如需强制测试 CUDA,可在运行 test.sh 时设置 REQUIRE_CUDA=1。 -REQUIRE_CUDA="${REQUIRE_CUDA:-0}" - -echo "REQUIRE_CUDA=${REQUIRE_CUDA}" - -pass() { - echo "✓ $1" -} - -fail() { - echo "✗ $1" - exit 1 -} - -check() { - local name="$1" - shift - - echo "检查 ${name}..." - if "$@"; then - pass "${name}" - else - fail "${name}" - fi -} - -echo -echo "=== 1. Python / PyTorch Import 检查 ===" - -check "python3 存在" command -v python3 - -check "import torch / torchvision / torchaudio" python3 - <<'"'"'PY'"'"' -import torch -import torchvision -import torchaudio - -print("torch:", torch.__version__) -print("torchvision:", torchvision.__version__) -print("torchaudio:", torchaudio.__version__) -print("torch path:", torch.__file__) -PY - - -echo -echo "=== 2. CPU 基础功能检查 ===" - -check "CPU Tensor 计算" python3 - <<'"'"'PY'"'"' -import torch - -x = torch.randn(512, 512) -y = torch.randn(512, 512) -z = x @ y - -assert z.shape == (512, 512) -assert torch.isfinite(z).all() - -print("CPU matmul OK") -PY - - -check "Autograd 自动求导" python3 - <<'"'"'PY'"'"' -import torch - -x = torch.tensor([1.0, 2.0, 3.0], requires_grad=True) -y = (x * x).sum() -y.backward() - -expected = torch.tensor([2.0, 4.0, 6.0]) -assert torch.allclose(x.grad, expected) - -print("Autograd OK") -PY - - -echo -echo "=== 3. CUDA 环境信息检查 ===" - -if command -v nvidia-smi >/dev/null 2>&1; then - echo "检测到 nvidia-smi:" - nvidia-smi || true -else - echo "未检测到 nvidia-smi,跳过 nvidia-smi 检查" -fi - -if command -v nvcc >/dev/null 2>&1; then - check "nvcc --version" nvcc --version -else - if [ "${REQUIRE_CUDA}" = "1" ]; then - fail "REQUIRE_CUDA=1,但未找到 nvcc" - else - echo "未找到 nvcc,跳过 nvcc 检查" - fi -fi - - -echo -echo "=== 4. PyTorch CUDA 功能检查 ===" - -check "torch CUDA 状态查询" python3 - < 0, "No CUDA device found" -else: - if not torch.cuda.is_available(): - print("CUDA not available, skip GPU assertion") -PY - - -if [ "${REQUIRE_CUDA}" = "1" ]; then - check "GPU Tensor 计算" python3 - <<'"'"'PY'"'"' -import torch - -assert torch.cuda.is_available(), "CUDA is not available" - -device = torch.device("cuda:0") - -print("GPU name:", torch.cuda.get_device_name(0)) - -x = torch.randn(1024, 1024, device=device) -y = torch.randn(1024, 1024, device=device) -z = x @ y - -torch.cuda.synchronize() - -assert z.is_cuda -assert z.shape == (1024, 1024) -assert torch.isfinite(z).all() - -print("GPU matmul OK") -PY -else - echo "REQUIRE_CUDA=0,跳过 GPU Tensor 计算" -fi - - -echo -echo "=== 5. torchvision / torchaudio 基础功能检查 ===" - -check "torchvision transforms" python3 - <<'"'"'PY'"'"' -import torchvision.transforms as T - -transform = T.Compose([ - T.Resize((224, 224)), - T.ToTensor(), -]) - -assert transform is not None -print("torchvision transforms OK") -PY - - -check "torchaudio import" python3 - <<'"'"'PY'"'"' -import torchaudio - -print("torchaudio version:", torchaudio.__version__) -print("torchaudio OK") -PY - - -echo -echo "=== 所有 PyTorch 容器基础测试通过 ===" -' - -echo "✓ 镜像 ${IMAGE} 功能测试通过" -exit 0 \ No newline at end of file diff --git a/frameworks/pytorch/2.10.0/test_result.png b/frameworks/pytorch/2.10.0/test_result.png deleted file mode 100644 index b1b3dc48a71cbcdc352b7e572c0fa887a4e7bbdd..0000000000000000000000000000000000000000 Binary files a/frameworks/pytorch/2.10.0/test_result.png and /dev/null differ diff --git a/frameworks/pytorch/2.11.0/Dockerfile b/frameworks/pytorch/2.11.0/Dockerfile deleted file mode 100644 index 6c18270339dc08c8ed6b3c7f859388db0a3ee926..0000000000000000000000000000000000000000 --- a/frameworks/pytorch/2.11.0/Dockerfile +++ /dev/null @@ -1,24 +0,0 @@ - -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="stronking 363133710@qq.com" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="Torch 2.11.0 (GPU) on OpenCloudOS 9" - -ENV NVIDIA_VISIBLE_DEVICES=all \ - PYTHONUNBUFFERED=1 \ - PIP_DISABLE_PIP_VERSION_CHECK=1 \ - PIP_DEFAULT_TIMEOUT=120 - - -WORKDIR /home - -RUN --mount=type=cache,id=pip-cache-opencloudos9-cu128,target=/root/.cache/pip \ - pip install \ - torch==2.11.0 \ - torchvision==0.26.0 \ - torchaudio==2.11.0 \ - --index-url https://download.pytorch.org/whl/cu128 -COPY test.sh . - -CMD ["python3"] \ No newline at end of file diff --git a/frameworks/pytorch/2.11.0/README.md b/frameworks/pytorch/2.11.0/README.md deleted file mode 100644 index 299d2414cd6686525589a57edfa3e897a234dc1c..0000000000000000000000000000000000000000 --- a/frameworks/pytorch/2.11.0/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# Torch 2.11.0 on OpenCloudOS 9 - -## 基本信息 -- **框架版本**:v2.11.0 -- **基础镜像**:opencloudos9-cuda-devel:12.8 -- **Python 版本**:3.11 -- **CUDA 版本**: 12.x 或 更高 - -## 构建 - -docker build -t oc9-pytorch:2.11.0 . - -## 镜像启动命令 - -docker run -d --gpus all --name oc9-pytorch oc9-pytorch:2.11.0 - -## 镜像测试命令 - -docker run --rm --gpus all oc9-pytorch:2.11.0 bash test.sh - diff --git a/frameworks/pytorch/2.11.0/build.conf b/frameworks/pytorch/2.11.0/build.conf deleted file mode 100644 index f101d2580ae45e2f652dd06e4e22d5c54ce1fcac..0000000000000000000000000000000000000000 --- a/frameworks/pytorch/2.11.0/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# pytorch 2.11.0 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-pytorch -IMAGE_TAG=2.11.0 -GPU_TEST=true \ No newline at end of file diff --git a/frameworks/pytorch/2.11.0/test.sh b/frameworks/pytorch/2.11.0/test.sh deleted file mode 100644 index 71e9e0a7683912d1386e6daad10342577d3377e5..0000000000000000000000000000000000000000 --- a/frameworks/pytorch/2.11.0/test.sh +++ /dev/null @@ -1,204 +0,0 @@ -#!/bin/bash -set -e - -IMAGE="${1:-}" - -if [ -z "${IMAGE}" ]; then - echo "用法: bash test.sh <镜像名:标签>" - exit 1 -fi - -if ! command -v docker >/dev/null 2>&1; then - echo "✗ 未找到 docker" - exit 1 -fi - -echo "=== PyTorch 容器基础功能测试 ===" -echo "测试镜像: ${IMAGE}" - -docker run --rm --gpus all "${IMAGE}" /bin/bash -lc ' -set -e - -export CUDA_HOME=/usr/local/cuda -export PATH=/usr/local/cuda/bin:$PATH -export LD_LIBRARY_PATH=/usr/local/cuda/lib64:${LD_LIBRARY_PATH:-} - -echo "=== PyTorch 基础功能测试 ===" - -# 说明: -# CI 的 GPU_TEST=true 会额外执行 torch.cuda.is_available() 验证 CUDA。 -# 因此这里默认不强制要求 CUDA,避免基础测试因为未挂载 GPU 失败。 -# 如需强制测试 CUDA,可在运行 test.sh 时设置 REQUIRE_CUDA=1。 -REQUIRE_CUDA="${REQUIRE_CUDA:-0}" - -echo "REQUIRE_CUDA=${REQUIRE_CUDA}" - -pass() { - echo "✓ $1" -} - -fail() { - echo "✗ $1" - exit 1 -} - -check() { - local name="$1" - shift - - echo "检查 ${name}..." - if "$@"; then - pass "${name}" - else - fail "${name}" - fi -} - -echo -echo "=== 1. Python / PyTorch Import 检查 ===" - -check "python3 存在" command -v python3 - -check "import torch / torchvision / torchaudio" python3 - <<'"'"'PY'"'"' -import torch -import torchvision -import torchaudio - -print("torch:", torch.__version__) -print("torchvision:", torchvision.__version__) -print("torchaudio:", torchaudio.__version__) -print("torch path:", torch.__file__) -PY - - -echo -echo "=== 2. CPU 基础功能检查 ===" - -check "CPU Tensor 计算" python3 - <<'"'"'PY'"'"' -import torch - -x = torch.randn(512, 512) -y = torch.randn(512, 512) -z = x @ y - -assert z.shape == (512, 512) -assert torch.isfinite(z).all() - -print("CPU matmul OK") -PY - - -check "Autograd 自动求导" python3 - <<'"'"'PY'"'"' -import torch - -x = torch.tensor([1.0, 2.0, 3.0], requires_grad=True) -y = (x * x).sum() -y.backward() - -expected = torch.tensor([2.0, 4.0, 6.0]) -assert torch.allclose(x.grad, expected) - -print("Autograd OK") -PY - - -echo -echo "=== 3. CUDA 环境信息检查 ===" - -if command -v nvidia-smi >/dev/null 2>&1; then - echo "检测到 nvidia-smi:" - nvidia-smi || true -else - echo "未检测到 nvidia-smi,跳过 nvidia-smi 检查" -fi - -if command -v nvcc >/dev/null 2>&1; then - check "nvcc --version" nvcc --version -else - if [ "${REQUIRE_CUDA}" = "1" ]; then - fail "REQUIRE_CUDA=1,但未找到 nvcc" - else - echo "未找到 nvcc,跳过 nvcc 检查" - fi -fi - - -echo -echo "=== 4. PyTorch CUDA 功能检查 ===" - -check "torch CUDA 状态查询" python3 - < 0, "No CUDA device found" -else: - if not torch.cuda.is_available(): - print("CUDA not available, skip GPU assertion") -PY - - -if [ "${REQUIRE_CUDA}" = "1" ]; then - check "GPU Tensor 计算" python3 - <<'"'"'PY'"'"' -import torch - -assert torch.cuda.is_available(), "CUDA is not available" - -device = torch.device("cuda:0") - -print("GPU name:", torch.cuda.get_device_name(0)) - -x = torch.randn(1024, 1024, device=device) -y = torch.randn(1024, 1024, device=device) -z = x @ y - -torch.cuda.synchronize() - -assert z.is_cuda -assert z.shape == (1024, 1024) -assert torch.isfinite(z).all() - -print("GPU matmul OK") -PY -else - echo "REQUIRE_CUDA=0,跳过 GPU Tensor 计算" -fi - - -echo -echo "=== 5. torchvision / torchaudio 基础功能检查 ===" - -check "torchvision transforms" python3 - <<'"'"'PY'"'"' -import torchvision.transforms as T - -transform = T.Compose([ - T.Resize((224, 224)), - T.ToTensor(), -]) - -assert transform is not None -print("torchvision transforms OK") -PY - - -check "torchaudio import" python3 - <<'"'"'PY'"'"' -import torchaudio - -print("torchaudio version:", torchaudio.__version__) -print("torchaudio OK") -PY - - -echo -echo "=== 所有 PyTorch 容器基础测试通过 ===" -' - -echo "✓ 镜像 ${IMAGE} 功能测试通过" -exit 0 \ No newline at end of file diff --git a/frameworks/pytorch/2.11.0/test_result.png b/frameworks/pytorch/2.11.0/test_result.png deleted file mode 100644 index 53eb6b3807245bf88ce9dc07eabfe3d9b457bdc5..0000000000000000000000000000000000000000 Binary files a/frameworks/pytorch/2.11.0/test_result.png and /dev/null differ diff --git a/frameworks/ragflow/0.24.0/.env b/frameworks/ragflow/0.24.0/.env deleted file mode 100644 index 1c8183b60025cf32627251a3d92e755770392688..0000000000000000000000000000000000000000 --- a/frameworks/ragflow/0.24.0/.env +++ /dev/null @@ -1,32 +0,0 @@ -DOC_ENGINE=elasticsearch -DEVICE=cpu -COMPOSE_PROFILES=${DOC_ENGINE},${DEVICE} -STACK_VERSION=8.11.3 -ES_HOST=es01 -ES_PORT=1200 -ELASTIC_PASSWORD=infini_rag_flow -MEM_LIMIT=2147483648 -MYSQL_PASSWORD=infini_rag_flow -MYSQL_HOST=mysql -MYSQL_DBNAME=rag_flow -MYSQL_PORT=3306 -EXPOSE_MYSQL_PORT=5455 -MYSQL_MAX_PACKET=1073741824 -MINIO_HOST=minio -MINIO_CONSOLE_PORT=9001 -MINIO_PORT=9000 -MINIO_USER=rag_flow -MINIO_PASSWORD=infini_rag_flow -REDIS_HOST=redis -REDIS_PORT=6379 -REDIS_PASSWORD=infini_rag_flow -SVR_WEB_HTTP_PORT=80 -SVR_WEB_HTTPS_PORT=443 -SVR_HTTP_PORT=9380 -ADMIN_SVR_HTTP_PORT=9381 -SVR_MCP_PORT=9382 -RAGFLOW_IMAGE=oc9-ragflow:0.24.0 -TZ=Asia/Shanghai -HF_ENDPOINT=https://hf-mirror.com -DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 -REGISTER_ENABLED=1 diff --git a/frameworks/ragflow/0.24.0/Dockerfile b/frameworks/ragflow/0.24.0/Dockerfile deleted file mode 100644 index 4ed817b003a7b56463ac1d9f20b7e7812a8f1d5f..0000000000000000000000000000000000000000 --- a/frameworks/ragflow/0.24.0/Dockerfile +++ /dev/null @@ -1,212 +0,0 @@ -# RAGFlow 0.24.0 on OpenCloudOS 9 (CPU) -# Based on: https://github.com/infiniflow/ragflow/blob/v0.24.0/Dockerfile -# Adapted for opencloudos/opencloudos9-minimal - -# base stage -FROM opencloudos/opencloudos9-minimal:latest AS base - -LABEL maintainer="OpenCloudOS Community" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="RAGFlow 0.24.0 (CPU) on OpenCloudOS 9" - -USER root -SHELL ["/bin/bash", "-c"] - -WORKDIR /ragflow - -# Install system dependencies -# opencv-python: glib2 mesa-libGL -# python-pptx: java-17-openjdk -# Building C extensions: python3-devel nss openssl-devel -RUN dnf install -y --setopt=install_weak_deps=False --skip-broken \ - ca-certificates \ - glib2 \ - mesa-libGL \ - pkgconfig \ - libicu-devel \ - java-17-openjdk \ - atk-devel \ - python3-devel \ - gtk4-devel \ - nss \ - xdg-utils \ - mesa-libgbm-devel \ - gnupg2 \ - unzip \ - curl \ - wget \ - git \ - vim-minimal \ - less \ - fontconfig \ - google-noto-sans-cjk-ttc-fonts \ - postgresql \ - libpq-devel \ - gcc-c++ \ - make \ - openssl-devel \ - libffi-devel \ - bzip2 \ - xz \ - sqlite-devel \ - readline-devel \ - tk-devel \ - gdbm-devel \ - jemalloc-devel && \ - dnf clean all && \ - rm -rf /var/cache/yum/* - -# Install document processing tools separately (optional, may fail on transient mirror issues) -RUN dnf install -y --setopt=install_weak_deps=False --skip-broken \ - ghostscript pandoc texlive || true && \ - dnf clean all && \ - rm -rf /var/cache/yum/* - -# Install nginx and hostname (needed by entrypoint.sh) -RUN dnf install -y --setopt=install_weak_deps=False nginx hostname && \ - dnf clean all && \ - rm -rf /var/cache/yum/* - -# Install uv -RUN arch="$(uname -m)" && \ - if [ "$arch" = "x86_64" ]; then uv_arch="x86_64"; else uv_arch="aarch64"; fi && \ - curl -fsSL "https://github.com/astral-sh/uv/releases/download/0.6.0/uv-${uv_arch}-unknown-linux-gnu.tar.gz" -o /tmp/uv.tar.gz && \ - tar xzf /tmp/uv.tar.gz -C /usr/local/bin/ --strip-components=1 && \ - rm /tmp/uv.tar.gz && \ - uv python install 3.12 - -ENV PYTHONDONTWRITEBYTECODE=1 -ENV DOTNET_SYSTEM_GLOBALIZATION_INVARIANT=1 -ENV PATH=/root/.local/bin:/usr/local/bin:$PATH - -# Install Node.js 20 directly -RUN arch="$(uname -m)" && \ - if [ "$arch" = "x86_64" ]; then node_arch="x64"; else node_arch="arm64"; fi && \ - curl -fsSL "https://nodejs.org/dist/v20.19.0/node-v20.19.0-linux-${node_arch}.tar.xz" -o /tmp/node.tar.xz && \ - tar -xJf /tmp/node.tar.xz -C /usr/local --strip-components=1 && \ - rm /tmp/node.tar.xz && \ - node -v && npm -v - -# builder stage -FROM base AS builder - -WORKDIR /ragflow - -# Clone RAGFlow v0.24.0 source -RUN git clone --depth 1 --branch v0.24.0 https://github.com/infiniflow/ragflow.git /tmp/ragflow-src - -# Copy source directories -RUN cp -r /tmp/ragflow-src/web /ragflow/web && \ - cp -r /tmp/ragflow-src/api /ragflow/api && \ - cp -r /tmp/ragflow-src/docs /ragflow/docs && \ - cp -r /tmp/ragflow-src/conf /ragflow/conf && \ - cp -r /tmp/ragflow-src/deepdoc /ragflow/deepdoc && \ - cp -r /tmp/ragflow-src/rag /ragflow/rag && \ - cp -r /tmp/ragflow-src/agent /ragflow/agent && \ - cp -r /tmp/ragflow-src/mcp /ragflow/mcp && \ - cp -r /tmp/ragflow-src/admin /ragflow/admin && \ - cp -r /tmp/ragflow-src/common /ragflow/common && \ - cp -r /tmp/ragflow-src/memory /ragflow/memory && \ - cp -r /tmp/ragflow-src/sdk /ragflow/sdk && \ - cp -r /tmp/ragflow-src/tools /ragflow/tools && \ - cp /tmp/ragflow-src/pyproject.toml /ragflow/pyproject.toml && \ - cp /tmp/ragflow-src/uv.lock /ragflow/uv.lock && \ - cp /tmp/ragflow-src/LICENSE /ragflow/LICENSE && \ - cp /tmp/ragflow-src/README.md /ragflow/README.md && \ - cp /tmp/ragflow-src/docker/entrypoint.sh /ragflow/entrypoint.sh && \ - cp /tmp/ragflow-src/docker/service_conf.yaml.template /ragflow/conf/service_conf.yaml.template && \ - mkdir -p /ragflow/docker/nginx && \ - cp /tmp/ragflow-src/docker/nginx/nginx.conf /ragflow/docker/nginx/nginx.conf && \ - cp /tmp/ragflow-src/docker/nginx/ragflow.conf /ragflow/docker/nginx/ragflow.conf && \ - cp /tmp/ragflow-src/docker/nginx/proxy.conf /ragflow/docker/nginx/proxy.conf && \ - rm -rf /tmp/ragflow-src - -# Fix nginx include path: official uses relative 'proxy.conf', we need absolute path for /etc/nginx/conf.d/ -RUN sed -i 's|include proxy.conf;|include /etc/nginx/conf.d/proxy.conf;|g' /ragflow/docker/nginx/ragflow.conf - -# Fix library path mismatch: OC9 uses /usr/lib64, original entrypoint hardcodes /usr/lib/x86_64-linux-gnu/ -RUN ln -s /usr/lib64 /usr/lib/x86_64-linux-gnu - -# Fix pyproject.toml: remove non-existent packages -RUN sed -i "s/'graphrag',//" /ragflow/pyproject.toml && \ - sed -i "s/'intergrations.chatgpt-on-wechat.plugins',//" /ragflow/pyproject.toml - -# Install Python dependencies from uv.lock -# Override mirror index to use official PyPI -RUN sed -i 's|pypi.tuna.tsinghua.edu.cn|pypi.org|g' /ragflow/uv.lock && \ - sed -i 's|mirrors.tuna.tsinghua.edu.cn|pypi.org|g' /ragflow/uv.lock && \ - sed -i 's|tsinghua.edu.cn|pypi.org|g' /ragflow/uv.lock && \ - uv venv --python 3.12 && \ - .venv/bin/python3 -m ensurepip --upgrade && \ - .venv/bin/python3 -m pip install -i https://pypi.org/simple --upgrade pip && \ - .venv/bin/python3 -m pip install -i https://pypi.org/simple hatchling hatch-vcs cython && \ - uv sync --python 3.12 --frozen --no-build-isolation && \ - .venv/bin/python3 -m ensurepip --upgrade - -# Build frontend -RUN cd /ragflow/web && npm install && npm run build - -# Generate VERSION -RUN echo "v0.24.0" > /ragflow/VERSION - -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -# production stage -FROM base AS production - -USER root -WORKDIR /ragflow - -# Copy Python environment and packages -ENV VIRTUAL_ENV=/ragflow/.venv -COPY --from=builder ${VIRTUAL_ENV} ${VIRTUAL_ENV} -ENV PATH="${VIRTUAL_ENV}/bin:${PATH}" -ENV PYTHONPATH=/ragflow/ - -# Copy source code -COPY --from=builder /ragflow/web /ragflow/web -COPY --from=builder /ragflow/api /ragflow/api -COPY --from=builder /ragflow/docs /ragflow/docs -COPY --from=builder /ragflow/conf /ragflow/conf -COPY --from=builder /ragflow/deepdoc /ragflow/deepdoc -COPY --from=builder /ragflow/rag /ragflow/rag -COPY --from=builder /ragflow/agent /ragflow/agent -COPY --from=builder /ragflow/mcp /ragflow/mcp -COPY --from=builder /ragflow/admin /ragflow/admin -COPY --from=builder /ragflow/common /ragflow/common -COPY --from=builder /ragflow/memory /ragflow/memory -COPY --from=builder /ragflow/sdk /ragflow/sdk -COPY --from=builder /ragflow/tools /ragflow/tools -COPY --from=builder /ragflow/pyproject.toml /ragflow/pyproject.toml -COPY --from=builder /ragflow/uv.lock /ragflow/uv.lock -COPY --from=builder /ragflow/LICENSE /ragflow/LICENSE -COPY --from=builder /ragflow/README.md /ragflow/README.md -COPY --from=builder /ragflow/VERSION /ragflow/VERSION - -# Copy entrypoint and config -COPY --from=builder /ragflow/entrypoint.sh /ragflow/entrypoint.sh -COPY --from=builder /ragflow/conf/service_conf.yaml.template /ragflow/conf/service_conf.yaml.template -RUN chmod +x /ragflow/entrypoint.sh - -# Copy compiled web pages -COPY --from=builder /ragflow/web/dist /ragflow/web/dist - -# Install nginx configuration -RUN rm -f /etc/nginx/nginx.conf && \ - rm -f /etc/nginx/conf.d/default.conf -COPY --from=builder /ragflow/docker/nginx/nginx.conf /etc/nginx/nginx.conf -COPY --from=builder /ragflow/docker/nginx/ragflow.conf /etc/nginx/conf.d/ragflow.conf -COPY --from=builder /ragflow/docker/nginx/proxy.conf /etc/nginx/conf.d/proxy.conf - -# Install additional runtime dependencies -RUN python -m pip install --no-cache-dir ollama redis - -# Download NLTK data -RUN python -m nltk.downloader punkt_tab 2>/dev/null || python -m nltk.downloader punkt && \ - python -m nltk.downloader wordnet - -ENV HF_ENDPOINT=https://hf-mirror.com - -EXPOSE 80 443 9380 - -ENTRYPOINT ["./entrypoint.sh"] diff --git a/frameworks/ragflow/0.24.0/README.md b/frameworks/ragflow/0.24.0/README.md deleted file mode 100644 index c7abf33256463454fa396b6bc82ef3d6870030f6..0000000000000000000000000000000000000000 --- a/frameworks/ragflow/0.24.0/README.md +++ /dev/null @@ -1,68 +0,0 @@ -# RAGFlow on OpenCloudOS 9 - -## 基本信息 -- **框架版本**:v0.24.0 -- **基础镜像**:opencloudos/opencloudos9-minimal:latest -- **Python 版本**:3.12 -- **CUDA 版本**:N/A(CPU 版本) -- **架构**:amd64 - -## 关于 RAGFlow - -RAGFlow 是一个基于深度文档理解的开源 RAG(Retrieval-Augmented Generation)引擎。它提供了一套完整的流水线,涵盖文档解析、文本分块、向量检索和 LLM 生成等核心能力。 - -## 构建 - -```bash -docker build -t oc9-ragflow:0.24.0 frameworks/ragflow/0.24.0/ -``` - -## 使用示例 - -```bash -# 验证 Python 环境 -docker run --rm --entrypoint python oc9-ragflow:0.24.0 -c "import sys; print(sys.version)" - -# 验证 RAGFlow 模块可导入 -docker run --rm --entrypoint python oc9-ragflow:0.24.0 -c "from rag.utils import redis_conn; print('OK')" -docker run --rm --entrypoint python oc9-ragflow:0.24.0 -c "from deepdoc.parser import DocParser; print('OK')" -``` - -## 依赖服务 - -RAGFlow 运行时需要以下外部服务,请自行部署并配置: - -| 服务 | 用途 | 默认端口 | -|------|------|---------| -| MySQL | 元数据存储 | 3306 | -| Redis | 缓存和消息队列 | 6379 | -| Elasticsearch | 全文检索引擎 | 9200 | -| MinIO | 对象存储 | 9000 | - -> 可通过 `/ragflow/conf/service_conf.yaml` 配置上述服务的连接信息。 - -## 测试验证 - -```bash -# 执行完整端到端测试(自动拉起 MySQL、Redis、ES、MinIO 依赖服务) -bash frameworks/ragflow/0.24.0/test.sh oc9-ragflow:0.24.0 - -# 仅执行基础检查(不启动依赖服务) -bash frameworks/ragflow/0.24.0/test.sh oc9-ragflow:0.24.0 9380 180 true -``` - -测试脚本会验证以下内容: -- Python 3.12 环境可用 -- rag 核心模块可导入 -- deepdoc 模块可导入 -- nginx 已安装 -- 前端构建产物存在 -- **端到端测试(默认启用)**:自动以 Docker 容器方式拉起 MySQL、Redis、Elasticsearch、MinIO,启动 RAGFlow 并验证 `/v1/version` 等 API 接口 - -## 注意事项 - -- RAGFlow 是多服务全栈应用,镜像仅包含主服务(Python 后端 + Node.js 前端 + Nginx),不包含 MySQL、Redis、Elasticsearch、MinIO 等依赖服务。 -- 首次启动前需修改 `/ragflow/conf/service_conf.yaml` 中的服务连接配置。 -- 默认使用 Hugging Face 镜像站(hf-mirror.com)加速模型下载,可通过 `HF_ENDPOINT` 环境变量修改。 -- 构建 CPU 版本时不包含 GPU 加速的文档解析功能。 -- Dockerfile 参考 RAGFlow 官方 Dockerfile.scratch.oc9,适配了 Python 3.12(v0.24.0 pyproject.toml 要求 >=3.12)。 diff --git a/frameworks/ragflow/0.24.0/build.conf b/frameworks/ragflow/0.24.0/build.conf deleted file mode 100644 index 45bea5d0907e53939f9d1b3fb0b6e29262fa7e48..0000000000000000000000000000000000000000 --- a/frameworks/ragflow/0.24.0/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# RAGFlow 0.24.0 on OpenCloudOS 9 (CPU) -IMAGE_NAME=oc9-ragflow -IMAGE_TAG=0.24.0 -GPU_TEST=false diff --git a/frameworks/ragflow/0.24.0/docker-compose.test.yml b/frameworks/ragflow/0.24.0/docker-compose.test.yml deleted file mode 100644 index 4e2426ae193ded53c6140eec693cfa3e17a97ec2..0000000000000000000000000000000000000000 --- a/frameworks/ragflow/0.24.0/docker-compose.test.yml +++ /dev/null @@ -1,107 +0,0 @@ -services: - mysql: - image: mysql:8.0.39 - container_name: ragflow-test-mysql - environment: - MYSQL_ROOT_PASSWORD: infini_rag_flow - MYSQL_DATABASE: rag_flow - command: > - --max_connections=1000 - --character-set-server=utf8mb4 - --collation-server=utf8mb4_unicode_ci - --default-authentication-plugin=mysql_native_password - --init-file /data/application/init.sql - volumes: - - ./docker/init.sql:/data/application/init.sql - healthcheck: - test: ["CMD", "mysqladmin", "ping", "-uroot", "-pinfini_rag_flow"] - interval: 10s - timeout: 10s - retries: 120 - networks: - - ragflow-test-net - - redis: - image: valkey/valkey:8 - container_name: ragflow-test-redis - command: ["redis-server", "--requirepass", "infini_rag_flow", "--maxmemory", "128mb", "--maxmemory-policy", "allkeys-lru"] - healthcheck: - test: ["CMD", "redis-cli", "-a", "infini_rag_flow", "ping"] - interval: 10s - timeout: 10s - retries: 120 - networks: - - ragflow-test-net - - es: - image: elasticsearch:8.11.3 - container_name: ragflow-test-es - environment: - - discovery.type=single-node - - xpack.security.enabled=false - - xpack.security.http.ssl.enabled=false - - xpack.security.transport.ssl.enabled=false - - cluster.routing.allocation.disk.watermark.low=1gb - - cluster.routing.allocation.disk.watermark.high=500mb - - cluster.routing.allocation.disk.watermark.flood_stage=200mb - - ES_JAVA_OPTS=-Xms512m -Xmx512m - healthcheck: - test: ["CMD-SHELL", "curl http://localhost:9200"] - interval: 10s - timeout: 10s - retries: 120 - networks: - - ragflow-test-net - - minio: - image: quay.io/minio/minio:RELEASE.2025-06-13T11-33-47Z - container_name: ragflow-test-minio - command: ["server", "--console-address", ":9001", "/data"] - environment: - MINIO_ROOT_USER: rag_flow - MINIO_ROOT_PASSWORD: infini_rag_flow - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] - interval: 10s - timeout: 10s - retries: 120 - networks: - - ragflow-test-net - - ragflow: - image: "${RAGFLOW_IMAGE:?ERROR: RAGFLOW_IMAGE 环境变量未设置}" - container_name: ragflow-test-svc - depends_on: - mysql: - condition: service_healthy - redis: - condition: service_healthy - es: - condition: service_healthy - minio: - condition: service_healthy - ports: - - "${RAGFLOW_HTTP_PORT:-80}:80" - environment: - - MYSQL_HOST=ragflow-test-mysql - - MYSQL_PORT=3306 - - MYSQL_USER=root - - MYSQL_PASSWORD=infini_rag_flow - - MYSQL_DBNAME=rag_flow - - REDIS_HOST=ragflow-test-redis - - REDIS_PASSWORD=infini_rag_flow - - ES_HOST=ragflow-test-es - - ELASTIC_PASSWORD=infini_rag_flow - - MINIO_HOST=ragflow-test-minio - - MINIO_USER=rag_flow - - MINIO_PASSWORD=infini_rag_flow - - RAGFLOW_HOST=0.0.0.0 - - SVR_HTTP_PORT=9380 - - HF_ENDPOINT=https://hf-mirror.com - networks: - - ragflow-test-net - -networks: - ragflow-test-net: - name: ragflow-test-net - driver: bridge diff --git a/frameworks/ragflow/0.24.0/docker/init.sql b/frameworks/ragflow/0.24.0/docker/init.sql deleted file mode 100644 index 340c0ad0a84c4324fa65f822a34b359a9c68cac7..0000000000000000000000000000000000000000 --- a/frameworks/ragflow/0.24.0/docker/init.sql +++ /dev/null @@ -1,2 +0,0 @@ -CREATE DATABASE IF NOT EXISTS rag_flow; -USE rag_flow; diff --git a/frameworks/ragflow/0.24.0/test.sh b/frameworks/ragflow/0.24.0/test.sh deleted file mode 100755 index 8f5838b72447bff9e60fdc0c6aa2b8b91c6b1f19..0000000000000000000000000000000000000000 --- a/frameworks/ragflow/0.24.0/test.sh +++ /dev/null @@ -1,249 +0,0 @@ -#!/bin/bash -set -euo pipefail - -IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh [port] [health_timeout] [skip_e2e]}" -PORT_HTTP="${2:-80}" -HEALTH_TIMEOUT="${3:-300}" -SKIP_E2E="${4:-false}" - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" - -# 统一退出码:0=全部通过,1=有测试失败 -TEST_RESULT=0 - -# 记录已创建的资源,确保清理时能完整移除 -E2E_RESOURCES_CREATED=false - -# 自动寻找可用端口(若默认端口被占用) -find_free_port() { - local p=$1 - while true; do - if ! (netstat -tln 2>/dev/null | awk '{print $4}' | grep -q ":${p}$") && \ - ! (ss -tln 2>/dev/null | awk '{print $4}' | grep -q ":${p}$"); then - echo "$p" - return - fi - p=$((p + 1)) - done -} - -# 统一清理函数:无论成功/失败/中断,都清理所有测试资源 -cleanup() { - local saved_exit=$? - echo "" - echo "=== 清理测试资源 ===" - - # 如果端到端资源曾被创建(或可能被创建),一律清理 - if [[ "$E2E_RESOURCES_CREATED" == "true" ]]; then - if [[ -f "$SCRIPT_DIR/docker-compose.test.yml" ]]; then - RAGFLOW_IMAGE="$IMAGE" RAGFLOW_HTTP_PORT="$PORT_HTTP" \ - docker compose -f "$SCRIPT_DIR/docker-compose.test.yml" \ - down -v --remove-orphans >/dev/null 2>&1 || true - fi - fi - - echo "=== 清理完成 ===" - - if [[ $TEST_RESULT -ne 0 ]]; then - echo "" - echo "=== 测试失败 ===" - exit $TEST_RESULT - fi - - if [[ $saved_exit -ne 0 ]]; then - exit $saved_exit - fi - - exit 0 -} - -trap cleanup EXIT - -# 确保端口可用 -ORIG_PORT_HTTP=$PORT_HTTP -PORT_HTTP=$(find_free_port "$PORT_HTTP") -if [[ "$PORT_HTTP" != "$ORIG_PORT_HTTP" ]]; then - echo "HTTP 端口 ${ORIG_PORT_HTTP} 已被占用,自动切换到 ${PORT_HTTP}" -fi - -echo "=== RAGFlow 功能测试 ===" - -# --------------------------------------------------------------------------- -# 辅助函数:执行单项测试,失败时标记 TEST_RESULT=1 -# --------------------------------------------------------------------------- -run_test() { - local name="$1" - shift - echo -n "${name}... " - if "$@" >/dev/null 2>&1; then - echo "✓ 通过" - return 0 - else - echo "✗ 失败" - TEST_RESULT=1 - return 1 - fi -} - -# --------------------------------------------------------------------------- -# 1-5. 基础检查 -# --------------------------------------------------------------------------- - -# 1. 验证 Python 环境可用 -echo -n "[1/9] 检查 Python 3.12... " -if docker run --rm --entrypoint python "$IMAGE" -c " -import sys -assert sys.version_info >= (3, 12), f'Python version too low: {sys.version}' -print(f'Python {sys.version_info.major}.{sys.version_info.minor}.{sys.version_info.micro}') -" 2>/dev/null; then - echo "✓ 通过" -else - echo "✗ 失败" - TEST_RESULT=1 -fi - -# 2. 验证 RAGFlow 核心模块可导入 -echo -n "[2/9] 检查 rag 模块导入... " -if docker run --rm --entrypoint python "$IMAGE" -c " -from rag.utils import redis_conn -print('rag.utils.redis_conn 可用') -" 2>/dev/null; then - echo "✓ 通过" -else - echo "✗ 失败" - TEST_RESULT=1 -fi - -# 3. 验证 deepdoc 模块可导入 -echo -n "[3/9] 检查 deepdoc 模块导入... " -if docker run --rm --entrypoint python "$IMAGE" -c " -from deepdoc.parser import DocxParser -print('deepdoc.parser.DocxParser 可用') -" 2>/dev/null; then - echo "✓ 通过" -else - echo "✗ 失败" - TEST_RESULT=1 -fi - -# 4. 验证 nginx 已安装 -echo -n "[4/9] 检查 nginx... " -if docker run --rm --entrypoint nginx "$IMAGE" -v 2>/dev/null; then - echo "✓ 通过" -else - echo "✗ 失败" - TEST_RESULT=1 -fi - -# 5. 验证前端构建产物存在 -echo -n "[5/9] 检查前端构建产物... " -if docker run --rm --entrypoint bash "$IMAGE" -c " -test -d /ragflow/web/dist || test -d /ragflow/web/build -" 2>/dev/null; then - echo "✓ 通过" -else - echo "✗ 失败" - TEST_RESULT=1 -fi - -# 基础检查失败则直接退出(端到端测试依赖镜像功能完整) -if [[ $TEST_RESULT -ne 0 ]]; then - echo "" - echo "=== 基础检查未通过,跳过端到端测试 ===" - exit $TEST_RESULT -fi - -# --------------------------------------------------------------------------- -# 6-9. 端到端测试(依赖服务 + API 验证) -# --------------------------------------------------------------------------- -if [[ "$SKIP_E2E" == "true" ]]; then - echo "" - echo "跳过端到端测试(SKIP_E2E=true)" - echo "=== 所有基础测试通过 ===" - exit 0 -fi - -echo "" -echo "=== 端到端测试:启动依赖服务 ===" - -RAGFLOW_C="ragflow-test-svc" - -# 标记端到端资源开始创建 -E2E_RESOURCES_CREATED=true - -# 启动所有服务(依赖 + RAGFlow) -echo -n "[6/9] 启动所有服务(MySQL / Redis / ES / MinIO / RAGFlow)... " -if RAGFLOW_IMAGE="$IMAGE" RAGFLOW_HTTP_PORT="$PORT_HTTP" \ - docker compose -f "$SCRIPT_DIR/docker-compose.test.yml" up -d >/dev/null 2>&1; then - echo "✓" -else - echo "✗ docker compose 启动失败" - TEST_RESULT=1 - exit $TEST_RESULT -fi - -# 等待 RAGFlow API 就绪(以 /v1/system/ping 返回 200 为准,该端点无需认证) -echo -n " 等待 RAGFlow 就绪 (最多 ${HEALTH_TIMEOUT}s)" -SERVICE_STARTED=false -for i in $(seq 1 $HEALTH_TIMEOUT); do - sleep 1 - echo -n "." - HTTP_CODE=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:${PORT_HTTP}/v1/system/ping" 2>/dev/null || echo "000") - if [[ "$HTTP_CODE" == "200" ]]; then - echo " ✓" - SERVICE_STARTED=true - break - fi - if [[ $i -eq $HEALTH_TIMEOUT ]]; then - echo "" - fi -done - -if [[ "$SERVICE_STARTED" != "true" ]]; then - echo "✗ RAGFlow 启动超时,无法通过 /v1/system/ping 检测到服务就绪" - echo "" - echo "RAGFlow 容器日志(最后 30 行):" - docker logs "$RAGFLOW_C" 2>&1 | tail -30 || true - TEST_RESULT=1 - exit $TEST_RESULT -fi - -# 7. 版本接口(/v1/system/version 需要认证,此处检查路由存在即可) -echo -n "[7/9] 检查 API 版本接口... " -VERSION_CODE=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:${PORT_HTTP}/v1/system/version" 2>/dev/null || echo "000") -if [[ "$VERSION_CODE" == "401" ]] || [[ "$VERSION_CODE" == "200" ]]; then - echo "✓ 版本接口正常 (HTTP ${VERSION_CODE})" -else - echo "✗ 版本接口返回非预期状态码: ${VERSION_CODE}" - TEST_RESULT=1 -fi - -# 8. 额外 API 验证 -echo -n "[8/9] 检查 API 响应能力... " -HEALTH_RESP=$(curl -s "http://localhost:${PORT_HTTP}/v1/system/healthz" 2>/dev/null || echo "") -if echo "$HEALTH_RESP" | grep -qE '"retcode"|"code"|"success"|"status"'; then - echo "✓ API 返回正确 JSON 格式: $HEALTH_RESP" -else - echo "✗ API 响应格式异常: $HEALTH_RESP" - TEST_RESULT=1 -fi - -# 9. 验证 80 端口前端页面 -echo -n "[9/9] 检查 80 端口前端页面... " -HTTP_CODE_80=$(curl -s -o /dev/null -w "%{http_code}" "http://localhost:${PORT_HTTP}" 2>/dev/null || echo "000") -if [[ "$HTTP_CODE_80" == "200" ]]; then - echo "✓ 80 端口正常 (HTTP ${HTTP_CODE_80})" -else - echo "✗ 80 端口返回非预期状态码: ${HTTP_CODE_80}" - TEST_RESULT=1 -fi - -# 最终判定 -echo "" -if [[ $TEST_RESULT -eq 0 ]]; then - echo "=== 所有测试通过 ===" -else - echo "=== 测试失败 ===" -fi - -exit $TEST_RESULT diff --git a/frameworks/sglang/0.5.10/Dockerfile b/frameworks/sglang/0.5.10/Dockerfile deleted file mode 100644 index 28a69a9ca111a5e2cd60a0e13dd0acf0220dd750..0000000000000000000000000000000000000000 --- a/frameworks/sglang/0.5.10/Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -# SGLang 0.5.10 on OpenCloudOS 9 (GPU) -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="OpenCloudOS Community " -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="SGLang 0.5.10 (GPU) on OpenCloudOS 9" - -# 1. 安装系统级依赖并清理缓存 -RUN dnf install -y \ - python3-pip \ - git \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 2. 安装 Python 包管理器和 SGLang -RUN pip3 install --no-cache-dir uv \ - && uv pip install --no-cache-dir --prerelease=allow "sglang[all]==0.5.10" --system - -# 3. 注册 PyTorch/NVIDIA pip 包内的共享库到动态链接器(修复 libnvshmem_host.so.3 找不到等问题) -RUN find /usr/local/lib /usr/local/lib64 /usr/lib /usr/lib64 -type d -path '*/nvidia/*/lib' 2>/dev/null \ - > /etc/ld.so.conf.d/nvidia-pip.conf \ - && ldconfig - -# 4. 设置 GPU 环境变量 -ENV NVIDIA_VISIBLE_DEVICES=all -ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility - -WORKDIR /workspace - -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -CMD ["python3", "-c", "import sglang; print(f'SGLang {sglang.__version__} ready')"] diff --git a/frameworks/sglang/0.5.10/README.md b/frameworks/sglang/0.5.10/README.md deleted file mode 100644 index 94f162a4157c58665352ef906e027f12e824fd06..0000000000000000000000000000000000000000 --- a/frameworks/sglang/0.5.10/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# SGLang on OpenCloudOS 9 - -## 一、镜像信息 - -- **镜像名**:`oc9-sglang:0.5.10` -- **基础镜像**:`opencloudos/opencloudos9-cuda-devel:12.8` -- **Python 版本**:3.11(基础镜像默认) -- **CUDA 版本**:12.8 -- **核心组件**:SGLang 0.5.10(含 `[all]` 扩展,包含 vLLM、flashinfer 等推理依赖) -- **工作目录**:`/workspace` -- **上游项目**:[sgl-project/sglang](https://github.com/sgl-project/sglang) - -## 二、构建镜像 - -```bash -docker build -t oc9-sglang:0.5.10 . -``` - -## 三、使用示例 - -### 1. 验证 SGLang 安装 - -```bash -docker run --rm --gpus all oc9-sglang:0.5.10 \ - python3 -c "import sglang as sgl; print(sgl.__version__)" -``` - -### 2. 启动推理服务 - -下载模型权重(以 Qwen2.5-7B-Instruct 为例): - -```bash -sudo dnf install -y git-lfs -sudo git lfs install -sudo mkdir -p /models -sudo git clone https://www.modelscope.cn/Qwen/Qwen2.5-7B-Instruct.git \ - /models/Qwen2.5-7B-Instruct -``` - -启动 OpenAI 兼容服务: - -```bash -docker run -itd --name sglang_serving --rm \ - --gpus all \ - --shm-size 16g \ - -p 30000:30000 \ - -v /models/Qwen2.5-7B-Instruct:/models/Qwen2.5-7B-Instruct \ - oc9-sglang:0.5.10 \ - python3 -m sglang.launch_server \ - --model-path /models/Qwen2.5-7B-Instruct \ - --host 0.0.0.0 \ - --port 30000 -``` - -### 3. 访问服务 - -```bash -curl http://localhost:30000/v1/chat/completions \ - -H 'Content-Type: application/json' \ - -d '{ - "model": "Qwen2.5-7B-Instruct", - "messages": [{"role": "user", "content": "你好"}], - "max_tokens": 128 - }' -``` - -## 四、功能验证 - -```bash -bash ../test.sh oc9-sglang:0.5.10 -``` - -## 五、已知问题 - -- SGLang 对 GPU 计算能力有要求(推荐 SM 8.0+,如 A100/H100/L40/RTX 30 系及以上)。低计算能力的 GPU 可能在加载 flashinfer/triton 内核时报错。 -- 首次启动模型时,flashinfer 会即时编译 CUDA 内核,启动时间较长,属正常现象。 diff --git a/frameworks/sglang/0.5.10/build.conf b/frameworks/sglang/0.5.10/build.conf deleted file mode 100644 index c59fd6872add6151ccc50349cc1c75dbffe8adaa..0000000000000000000000000000000000000000 --- a/frameworks/sglang/0.5.10/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# SGLang 0.5.10 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-sglang -IMAGE_TAG=0.5.10 -GPU_TEST=true diff --git a/frameworks/sglang/0.5.8/Dockerfile b/frameworks/sglang/0.5.8/Dockerfile deleted file mode 100644 index e10d0b7f94d94606f877bef82e31f95846341cea..0000000000000000000000000000000000000000 --- a/frameworks/sglang/0.5.8/Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -# SGLang 0.5.8 on OpenCloudOS 9 (GPU) -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="OpenCloudOS Community " -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="SGLang 0.5.8 (GPU) on OpenCloudOS 9" - -# 1. 安装系统级依赖并清理缓存 -RUN dnf install -y \ - python3-pip \ - git \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 2. 安装 Python 包管理器和 SGLang -RUN pip3 install --no-cache-dir uv \ - && uv pip install --no-cache-dir "sglang[all]==0.5.8" --system - -# 3. 注册 PyTorch/NVIDIA pip 包内的共享库到动态链接器(修复 libnvshmem_host.so.3 找不到等问题) -RUN find /usr/local/lib /usr/local/lib64 /usr/lib /usr/lib64 -type d -path '*/nvidia/*/lib' 2>/dev/null \ - > /etc/ld.so.conf.d/nvidia-pip.conf \ - && ldconfig - -# 4. 设置 GPU 环境变量 -ENV NVIDIA_VISIBLE_DEVICES=all -ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility - -WORKDIR /workspace - -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -CMD ["python3", "-c", "import sglang; print(f'SGLang {sglang.__version__} installed')"] diff --git a/frameworks/sglang/0.5.8/README.md b/frameworks/sglang/0.5.8/README.md deleted file mode 100644 index 42c6304a3335ac9ef11f2852fc0426c230370aeb..0000000000000000000000000000000000000000 --- a/frameworks/sglang/0.5.8/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# SGLang on OpenCloudOS 9 - -## 一、镜像信息 - -- **镜像名**:`oc9-sglang:0.5.8` -- **基础镜像**:`opencloudos/opencloudos9-cuda-devel:12.8` -- **Python 版本**:3.11(基础镜像默认) -- **CUDA 版本**:12.8 -- **核心组件**:SGLang 0.5.8(含 `[all]` 扩展,包含 vLLM、flashinfer 等推理依赖) -- **工作目录**:`/workspace` -- **上游项目**:[sgl-project/sglang](https://github.com/sgl-project/sglang) - -## 二、构建镜像 - -```bash -docker build -t oc9-sglang:0.5.8 . -``` - -## 三、使用示例 - -### 1. 验证 SGLang 安装 - -```bash -docker run --rm --gpus all oc9-sglang:0.5.8 \ - python3 -c "import sglang as sgl; print(sgl.__version__)" -``` - -### 2. 启动推理服务 - -下载模型权重(以 Qwen2.5-7B-Instruct 为例): - -```bash -sudo dnf install -y git-lfs -sudo git lfs install -sudo mkdir -p /models -sudo git clone https://www.modelscope.cn/Qwen/Qwen2.5-7B-Instruct.git \ - /models/Qwen2.5-7B-Instruct -``` - -启动 OpenAI 兼容服务: - -```bash -docker run -itd --name sglang_serving --rm \ - --gpus all \ - --shm-size 16g \ - -p 30000:30000 \ - -v /models/Qwen2.5-7B-Instruct:/models/Qwen2.5-7B-Instruct \ - oc9-sglang:0.5.8 \ - python3 -m sglang.launch_server \ - --model-path /models/Qwen2.5-7B-Instruct \ - --host 0.0.0.0 \ - --port 30000 -``` - -### 3. 访问服务 - -```bash -curl http://localhost:30000/v1/chat/completions \ - -H 'Content-Type: application/json' \ - -d '{ - "model": "Qwen2.5-7B-Instruct", - "messages": [{"role": "user", "content": "你好"}], - "max_tokens": 128 - }' -``` - -## 四、功能验证 - -```bash -bash ../test.sh oc9-sglang:0.5.8 -``` - -## 五、已知问题 - -- SGLang 对 GPU 计算能力有要求(推荐 SM 8.0+,如 A100/H100/L40/RTX 30 系及以上)。低计算能力的 GPU 可能在加载 flashinfer/triton 内核时报错。 -- 首次启动模型时,flashinfer 会即时编译 CUDA 内核,启动时间较长,属正常现象。 diff --git a/frameworks/sglang/0.5.8/build.conf b/frameworks/sglang/0.5.8/build.conf deleted file mode 100644 index 6ae9f10baf30b0b483c6ba0c4e4dbfcee039770a..0000000000000000000000000000000000000000 --- a/frameworks/sglang/0.5.8/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# SGLang 0.5.8 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-sglang -IMAGE_TAG=0.5.8 -GPU_TEST=true diff --git a/frameworks/sglang/0.5.9/Dockerfile b/frameworks/sglang/0.5.9/Dockerfile deleted file mode 100644 index b2d44f25e6303ee8bfad088f78eb2fa157ef6c79..0000000000000000000000000000000000000000 --- a/frameworks/sglang/0.5.9/Dockerfile +++ /dev/null @@ -1,32 +0,0 @@ -# SGLang 0.5.9 on OpenCloudOS 9 (GPU) -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="OpenCloudOS Community " -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="SGLang 0.5.9 (GPU) on OpenCloudOS 9" - -# 1. 安装系统级依赖并清理缓存 -RUN dnf install -y \ - python3-pip \ - git \ - && dnf clean all \ - && rm -rf /var/cache/yum/* - -# 2. 安装 Python 包管理器和 SGLang -RUN pip3 install --no-cache-dir uv \ - && uv pip install --no-cache-dir "sglang[all]==0.5.9" --system - -# 3. 注册 PyTorch/NVIDIA pip 包内的共享库到动态链接器(修复 libnvshmem_host.so.3 找不到等问题) -RUN find /usr/local/lib /usr/local/lib64 /usr/lib /usr/lib64 -type d -path '*/nvidia/*/lib' 2>/dev/null \ - > /etc/ld.so.conf.d/nvidia-pip.conf \ - && ldconfig - -# 4. 设置 GPU 环境变量 -ENV NVIDIA_VISIBLE_DEVICES=all -ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility - -WORKDIR /workspace - -RUN echo $(date +"%Y-%m-%dT%H:%M:%S%z") > /opencloudos_build_date.txt - -CMD ["python3", "-c", "import sglang; print(f'SGLang {sglang.__version__} ready')"] diff --git a/frameworks/sglang/0.5.9/README.md b/frameworks/sglang/0.5.9/README.md deleted file mode 100644 index dbe0062d888b587c7dd40d6ccde0a8dad044a086..0000000000000000000000000000000000000000 --- a/frameworks/sglang/0.5.9/README.md +++ /dev/null @@ -1,76 +0,0 @@ -# SGLang on OpenCloudOS 9 - -## 一、镜像信息 - -- **镜像名**:`oc9-sglang:0.5.9` -- **基础镜像**:`opencloudos/opencloudos9-cuda-devel:12.8` -- **Python 版本**:3.11(基础镜像默认) -- **CUDA 版本**:12.8 -- **核心组件**:SGLang 0.5.9(含 `[all]` 扩展,包含 vLLM、flashinfer 等推理依赖) -- **工作目录**:`/workspace` -- **上游项目**:[sgl-project/sglang](https://github.com/sgl-project/sglang) - -## 二、构建镜像 - -```bash -docker build -t oc9-sglang:0.5.9 . -``` - -## 三、使用示例 - -### 1. 验证 SGLang 安装 - -```bash -docker run --rm --gpus all oc9-sglang:0.5.9 \ - python3 -c "import sglang as sgl; print(sgl.__version__)" -``` - -### 2. 启动推理服务 - -下载模型权重(以 Qwen2.5-7B-Instruct 为例): - -```bash -sudo dnf install -y git-lfs -sudo git lfs install -sudo mkdir -p /models -sudo git clone https://www.modelscope.cn/Qwen/Qwen2.5-7B-Instruct.git \ - /models/Qwen2.5-7B-Instruct -``` - -启动 OpenAI 兼容服务: - -```bash -docker run -itd --name sglang_serving --rm \ - --gpus all \ - --shm-size 16g \ - -p 30000:30000 \ - -v /models/Qwen2.5-7B-Instruct:/models/Qwen2.5-7B-Instruct \ - oc9-sglang:0.5.9 \ - python3 -m sglang.launch_server \ - --model-path /models/Qwen2.5-7B-Instruct \ - --host 0.0.0.0 \ - --port 30000 -``` - -### 3. 访问服务 - -```bash -curl http://localhost:30000/v1/chat/completions \ - -H 'Content-Type: application/json' \ - -d '{ - "model": "Qwen2.5-7B-Instruct", - "messages": [{"role": "user", "content": "你好"}], - "max_tokens": 128 - }' -``` - -## 四、功能验证 - -```bash -bash ../test.sh oc9-sglang:0.5.9 -``` - -## 五、已知问题 - -- SGLang 对 GPU 计算能力有要求(推荐 SM 8.0+,如 A100/H100/L40/RTX 30 系及以上)。低计算能力的 GPU 可能在加载 flashinfer/triton 内核时报错。 -- 首次启动模型时,flashinfer 会即时编译 CUDA 内核,启动时间较长,属正常现象。 diff --git a/frameworks/sglang/0.5.9/build.conf b/frameworks/sglang/0.5.9/build.conf deleted file mode 100644 index 67c9cf6c19909c70e3f89eeff5b64e93f89b820e..0000000000000000000000000000000000000000 --- a/frameworks/sglang/0.5.9/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# SGLang 0.5.9 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-sglang -IMAGE_TAG=0.5.9 -GPU_TEST=true diff --git a/frameworks/sglang/common.sh b/frameworks/sglang/common.sh deleted file mode 100644 index 19942ec46293f0481da79cd2ebfe255c6b9cb3dd..0000000000000000000000000000000000000000 --- a/frameworks/sglang/common.sh +++ /dev/null @@ -1,105 +0,0 @@ -#!/bin/bash -#=============================================================================== -# 框架测试公共库(被各 framework 的 test.sh 通过 `source` 引入) -# -# 提供: -# select_version [prompt_label] -# 扫描 //Dockerfile,交互式选择版本, -# 将所选版本写入 指定的全局变量。 -# -# ensure_image -# 若本地不存在镜像,则从 (应包含 Dockerfile)构建。 -# -# run_case <描述> [docker 额外参数...] -- <命令...> -# 在 $IMAGE 中执行命令,自动打印 ✓/✗,失败即退出。 -# -# run_py <描述> [docker 额外参数...] -# run_case 的便捷封装,执行 `python3 -c `。 -# -# 调用方需在 source 本文件前/后定义 $IMAGE 变量供 run_case/run_py 使用。 -#=============================================================================== - -# -------- 交互式版本选择 -------- -# 用法:select_version [prompt_label] -select_version() { - local fw_dir="$1" - local out_var="$2" - local label="${3:-版本}" - - local -a versions - mapfile -t versions < <( - find "$fw_dir" -mindepth 2 -maxdepth 2 -name Dockerfile -printf '%h\n' \ - | xargs -n1 basename | sort -V - ) - if [[ ${#versions[@]} -eq 0 ]]; then - echo "✗ 未在 $fw_dir 下发现任何 /Dockerfile" >&2 - return 1 - fi - - echo "可用${label}:" >&2 - local i - for i in "${!versions[@]}"; do - printf " %d) %s\n" "$((i+1))" "${versions[$i]}" >&2 - done - local default_idx=${#versions[@]} - local sel - read -r -p "请选择${label} [默认 ${default_idx}=${versions[$((default_idx-1))]}]: " sel - sel="${sel:-$default_idx}" - if ! [[ "$sel" =~ ^[0-9]+$ ]] || (( sel < 1 || sel > ${#versions[@]} )); then - echo "✗ 无效选择: $sel" >&2 - return 1 - fi - printf -v "$out_var" '%s' "${versions[$((sel-1))]}" -} - -# -------- 镜像存在性检查 + 自动构建 -------- -# 用法:ensure_image -# 环境变量: -# FORCE_REBUILD=1 强制重新构建镜像(删除旧镜像并使用 --no-cache 重新构建) -ensure_image() { - local image="$1" - local context="$2" - - if [[ "${FORCE_REBUILD:-0}" == "1" ]]; then - echo "FORCE_REBUILD=1:强制重建镜像 ${image}(删除旧镜像 + --no-cache)..." - sudo docker image rm -f "$image" >/dev/null 2>&1 || true - sudo docker build --no-cache --pull -t "$image" "$context" - echo "✓ 镜像强制重建完成: $image" - return 0 - fi - - if sudo docker image inspect "$image" >/dev/null 2>&1; then - echo "✓ 镜像已存在: $image(如需重建请使用 FORCE_REBUILD=1 或 --rebuild)" - return 0 - fi - - echo "镜像 ${image} 不存在,开始构建..." - sudo docker build -t "$image" "$context" - echo "✓ 镜像构建完成: $image" -} - -# -------- 测试运行器 -------- -# 用法:run_case <描述> [docker 额外参数...] -- <命令...> -# "--" 之前的参数追加给 `docker run`(如 --gpus all);之后是容器内命令。 -run_case() { - local desc="$1"; shift - local -a docker_args=() - while [[ $# -gt 0 && "$1" != "--" ]]; do - docker_args+=("$1"); shift - done - [[ "${1:-}" == "--" ]] && shift - - echo -n "${desc}... " - if sudo docker run --rm "${docker_args[@]}" "$IMAGE" "$@"; then - echo "✓ 通过" - else - echo "✗ 失败" - exit 1 - fi -} - -# 用法:run_py <描述> [docker 额外参数...] -run_py() { - local desc="$1"; local code="$2"; shift 2 - run_case "$desc" "$@" -- python3 -c "$code" -} diff --git a/frameworks/sglang/test.sh b/frameworks/sglang/test.sh deleted file mode 100755 index 3698552702b0d26a46cbaa596597f316c972d0bf..0000000000000000000000000000000000000000 --- a/frameworks/sglang/test.sh +++ /dev/null @@ -1,116 +0,0 @@ -#!/bin/bash -#=============================================================================== -# SGLang 镜像功能测试脚本 -# -# 用法:bash test.sh [--rebuild] -# -# 行为: -# - 自动扫描 .//Dockerfile,交互式选择 SGLang 版本。 -# - 镜像名固定为 oc9-sglang:;若本地不存在则自动构建。 -# - --rebuild 或 FORCE_REBUILD=1:强制重建镜像(删除旧镜像并使用 --no-cache)。 -#=============================================================================== -set -e - -SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" -DEFAULT_IMAGE_NAME="oc9-sglang" - -# 解析参数 -for arg in "$@"; do - case "$arg" in - --rebuild|-r) export FORCE_REBUILD=1 ;; - -h|--help) - grep -E '^#( |$)' "$0" | sed 's/^# \{0,1\}//'; exit 0 ;; - esac -done - -# 引入公共库(select_version / ensure_image / run_case / run_py) -# shellcheck source=./common.sh -source "$SCRIPT_DIR/common.sh" - -select_version "$SCRIPT_DIR" SGLANG_VERSION "SGLang 版本" -VERSION_DIR="$SCRIPT_DIR/$SGLANG_VERSION" -IMAGE="${DEFAULT_IMAGE_NAME}:${SGLANG_VERSION}" - -ensure_image "$IMAGE" "$VERSION_DIR" - -echo "" -echo "=== SGLang ${SGLANG_VERSION} 基础功能测试 ===" -echo "运行时间:$(date '+%Y-%m-%d %H:%M:%S')" -echo "镜像:${IMAGE}" -echo "" - -# ============================================================ -# 阶段一:CPU 安全检查(不依赖 GPU 驱动 / libcuda.so.1) -# ============================================================ -echo "--- 阶段一:安装验证 ---" - -run_py "检查 sglang 版本" " -import sglang as sgl -version = sgl.__version__ -print(version) -assert version == '${SGLANG_VERSION}', f'期望 ${SGLANG_VERSION},实际 {version}' -" - -run_py "检查 sglang 主模块导入" " -import sglang as sgl -print('ok') -" - -run_py "检查 torch CUDA 构建" " -import torch -assert torch.version.cuda is not None, 'torch 未使用 CUDA 构建' -print(f'torch={torch.__version__}, cuda={torch.version.cuda}') -" - -echo "" - -# ============================================================ -# 阶段二:GPU 运行时检查 -# 注意:sglang.srt.* 深层模块会加载 sgl_kernel,依赖 libcuda.so.1, -# 必须在挂载了 NVIDIA 运行时(--gpus all)的容器中执行。 -# ============================================================ -echo "--- 阶段二:GPU 运行时检查 ---" - -if ! command -v nvidia-smi &>/dev/null; then - echo "⚠ 未检测到 nvidia-smi,跳过 GPU 测试(请在 GPU 实例上运行)" - echo "" - echo "=== 阶段一全部通过,阶段二已跳过(无 GPU 环境) ===" - exit 0 -fi - -run_case "检查 nvidia-smi" --gpus all -- \ - nvidia-smi --query-gpu=name,driver_version,memory.total --format=csv,noheader - -run_py "检查 torch.cuda.is_available()" " -import torch -assert torch.cuda.is_available(), 'torch 无法访问 GPU' -print(f'GPU 数量: {torch.cuda.device_count()}') -for i in range(torch.cuda.device_count()): - print(f' GPU {i}: {torch.cuda.get_device_name(i)}') -" --gpus all - -run_case "检查 sglang.launch_server CLI" --gpus all -- \ - bash -c "python3 -m sglang.launch_server --help >/dev/null" - -run_py "检查 sglang ServerArgs 导入" " -from sglang.srt.server_args import ServerArgs -print('ok') -" --gpus all - -run_py "检查 sglang OpenAI 兼容入口导入" " -from sglang.srt.entrypoints.http_server import launch_server -print('ok') -" --gpus all - -run_py "检查 sglang 平台探测" " -import torch, sglang as sgl -print(f'sglang={sgl.__version__}, torch={torch.__version__}, cuda={torch.version.cuda}') -" --gpus all - -echo "" -echo "--- 阶段三:完整推理测试 ---" -echo " 请使用项目根目录的 cuda_test.sh 进行端到端推理验证:" -echo " bash cuda_test.sh --vllm-model " -echo "" - -echo "=== 所有测试通过 ===" diff --git a/frameworks/tensorflow/2.18.1/Dockerfile b/frameworks/tensorflow/2.18.1/Dockerfile deleted file mode 100644 index 2e9abf9f57f54981f56e3a2e4ba1cf12a59ad9a2..0000000000000000000000000000000000000000 --- a/frameworks/tensorflow/2.18.1/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ - -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="stronking 363133710@qq.com" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="TensorFlow 2.18.1 (GPU) on OpenCloudOS 9" - -ENV NVIDIA_VISIBLE_DEVICES=all \ - PYTHONUNBUFFERED=1 \ - PIP_DISABLE_PIP_VERSION_CHECK=1 \ - PIP_DEFAULT_TIMEOUT=120 - - -WORKDIR /home - -RUN --mount=type=cache,id=pip-cache-opencloudos9-cu128,target=/root/.cache/pip \ - pip install "tensorflow[and-cuda]==2.18.1" - -CMD ["python3"] \ No newline at end of file diff --git a/frameworks/tensorflow/2.18.1/README.md b/frameworks/tensorflow/2.18.1/README.md deleted file mode 100644 index 2c8ceffd85879e39a90fd324bda5ab5cfd5ec89b..0000000000000000000000000000000000000000 --- a/frameworks/tensorflow/2.18.1/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# tensorflow 2.18.1 on OpenCloudOS 9 - -## 基本信息 -- **框架版本**:v2.18.1 -- **基础镜像**:opencloudos9-cuda-devel:12.8 -- **Python 版本**:3.11 -- **CUDA 版本**: 12.x 或 更高 - -## 构建 - -docker build -t oc9-tensorflow:2.18.1 . - -## 镜像启动命令 - -docker run -d --gpus all --name oc9-tensorflow oc9-tensorflow:2.18.1 - -## 镜像测试命令 - -docker run --rm --gpus all oc9-tensorflow:2.18.1 bash test.sh -docker run --rm --gpus all oc9-tensorflow:2.18.1 python tensor_smoke_test.py - -## 已知问题 -``` -对于如下日志输出,属于正常现象。这些日志通常不是致命错误。 -核心原因是:TensorFlow 在 import tensorflow as tf 时,会初始化 CUDA/XLA 相关组件,并注册 cuFFT、cuDNN、cuBLAS 等 GPU 插件工厂。 -日志里的意思是:这些插件工厂已经注册过一次,现在又尝试注册,所以打印了“already been registered”。 -TensorFlow 官方 GitHub 上有多个相同现象的 issue,日志内容和图片中的告警日志基本一致, -包括 Unable to register cuFFT factory、cuDNN factory、cuBLAS factory、computation placer already registered 等 -``` -如下图所示告警日志: -![告警日志](./warring_log.png) \ No newline at end of file diff --git a/frameworks/tensorflow/2.18.1/build.conf b/frameworks/tensorflow/2.18.1/build.conf deleted file mode 100644 index b1f5736581ab05c9c6b15b8d9442e063afe25d8a..0000000000000000000000000000000000000000 --- a/frameworks/tensorflow/2.18.1/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# tensorflow 2.18.1 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-tensorflow -IMAGE_TAG=2.18.1 -GPU_TEST=false \ No newline at end of file diff --git a/frameworks/tensorflow/2.18.1/tensor_smoke_test.py b/frameworks/tensorflow/2.18.1/tensor_smoke_test.py deleted file mode 100644 index 02cec134116518270c21bcf37daf410a619ca0a1..0000000000000000000000000000000000000000 --- a/frameworks/tensorflow/2.18.1/tensor_smoke_test.py +++ /dev/null @@ -1,52 +0,0 @@ -import os -os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" - -import numpy as np -import tensorflow as tf - - -def main(): - print("TensorFlow version:", tf.__version__) - - gpus = tf.config.list_physical_devices("GPU") - print("GPUs:", gpus) - - # 基础张量计算 - a = tf.constant([[1.0, 2.0], [3.0, 4.0]]) - b = tf.constant([[5.0, 6.0], [7.0, 8.0]]) - c = tf.matmul(a, b) - - print("matmul result:") - print(c.numpy()) - - expected = tf.constant([[19.0, 22.0], [43.0, 50.0]]) - tf.debugging.assert_near(c, expected) - - # 简单 Keras 模型 - x = np.array([[0.0], [1.0], [2.0], [3.0]], dtype=np.float32) - y = np.array([[1.0], [3.0], [5.0], [7.0]], dtype=np.float32) - - model = tf.keras.Sequential([ - tf.keras.layers.Input(shape=(1,)), - tf.keras.layers.Dense(1), - ]) - - model.compile( - optimizer=tf.keras.optimizers.SGD(learning_rate=0.01), - loss="mse", - ) - - history = model.fit(x, y, epochs=3, verbose=0) - - pred = model.predict(np.array([[4.0]], dtype=np.float32), verbose=0) - - assert pred.shape == (1, 1) - assert np.isfinite(pred).all() - - print("final loss:", float(history.history["loss"][-1])) - print("prediction:", float(pred[0][0])) - print("TensorFlow smoke test passed") - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/frameworks/tensorflow/2.18.1/test.sh b/frameworks/tensorflow/2.18.1/test.sh deleted file mode 100644 index c2fed93f16a25af247974d29f8d80998f0fb4dcc..0000000000000000000000000000000000000000 --- a/frameworks/tensorflow/2.18.1/test.sh +++ /dev/null @@ -1,336 +0,0 @@ -#!/usr/bin/env bash -# 在容器外执行:验证指定 Docker 镜像中的 TensorFlow / Keras / CUDA 基础功能。 -# -# 用法: -# bash test.sh [额外 docker run 参数...] -# -# 示例: -# bash test.sh my-tensorflow:latest -# bash test.sh my-tensorflow:latest --ipc=host -# REQUIRE_CUDA=0 bash test.sh tensorflow-cpu:test -# EXPECTED_TF_VERSION_PREFIX=2.19 bash test.sh my-tensorflow:latest - -set -Eeuo pipefail - -IMAGE="${1:-}" - -if [[ -z "${IMAGE}" || "${IMAGE}" == "-h" || "${IMAGE}" == "--help" ]]; then - cat <<'USAGE' -用法: - bash test.sh [额外 docker run 参数...] - -环境变量: - REQUIRE_CUDA=1|0 是否强制要求 CUDA/GPU 可用,默认 1 - GPUS=all 传给 docker run --gpus 的值,默认 all - PYTHON_BIN=python3 容器内 Python 命令,默认 python3 - DOCKER_NETWORK=none docker 网络模式,默认 none - TIMEOUT_SECONDS=180 整体测试超时时间,默认 180 秒 - EXPECTED_TF_VERSION_PREFIX=2.19 可选,检查 TensorFlow 版本前缀 - -示例: - bash test.sh registry.example.com/ai/tensorflow:2.19-cu12 - REQUIRE_CUDA=0 bash test.sh tensorflow-cpu:test - EXPECTED_TF_VERSION_PREFIX=2.19 bash test.sh my-image:tag - bash test.sh my-image:tag --ipc=host --shm-size=2g -USAGE - exit 1 -fi - -shift || true - -REQUIRE_CUDA="${REQUIRE_CUDA:-1}" -GPUS="${GPUS:-all}" -PYTHON_BIN="${PYTHON_BIN:-python3}" -DOCKER_NETWORK="${DOCKER_NETWORK:-none}" -TIMEOUT_SECONDS="${TIMEOUT_SECONDS:-180}" -EXPECTED_TF_VERSION_PREFIX="${EXPECTED_TF_VERSION_PREFIX:-}" -EXTRA_DOCKER_ARGS=("$@") - -log() { printf '\033[1;34m%s\033[0m\n' "$*"; } -ok() { printf '\033[1;32m✓ %s\033[0m\n' "$*"; } -warn() { printf '\033[1;33m! %s\033[0m\n' "$*"; } -fail() { printf '\033[1;31m✗ %s\033[0m\n' "$*" >&2; exit 1; } - -[[ "${REQUIRE_CUDA}" =~ ^[01]$ ]] || fail "REQUIRE_CUDA 只能是 1 或 0,当前值: ${REQUIRE_CUDA}" - -command -v docker >/dev/null 2>&1 || fail "未找到 docker 命令" -docker info >/dev/null 2>&1 || fail "docker daemon 不可用,请确认 Docker 服务已启动且当前用户有权限访问" - -if ! docker image inspect "${IMAGE}" >/dev/null 2>&1; then - warn "本地未找到镜像 ${IMAGE};docker run 可能会尝试拉取镜像" -fi - -DOCKER_ARGS=(run --rm -i) - -if [[ "${REQUIRE_CUDA}" == "1" ]]; then - DOCKER_ARGS+=(--gpus "${GPUS}") -fi - -DOCKER_ARGS+=( - -e "REQUIRE_CUDA=${REQUIRE_CUDA}" - -e "PYTHON_BIN=${PYTHON_BIN}" - -e "EXPECTED_TF_VERSION_PREFIX=${EXPECTED_TF_VERSION_PREFIX}" - -e "TF_CPP_MIN_LOG_LEVEL=2" -) - -DOCKER_ARGS+=("${EXTRA_DOCKER_ARGS[@]}") -DOCKER_ARGS+=("${IMAGE}" /bin/bash -s) - -log "=== TensorFlow Docker 镜像功能测试 ===" -printf '镜像: %s\n' "${IMAGE}" -printf 'CUDA 强制检查: %s\n' "${REQUIRE_CUDA}" -printf 'Docker 网络: %s\n' "${DOCKER_NETWORK}" -printf 'Python 命令: %s\n' "${PYTHON_BIN}" - -if [[ -n "${EXPECTED_TF_VERSION_PREFIX}" ]]; then - printf '期望 TensorFlow 版本前缀: %s\n' "${EXPECTED_TF_VERSION_PREFIX}" -fi - -if ((${#EXTRA_DOCKER_ARGS[@]} > 0)); then - printf '额外 docker 参数: %s\n' "${EXTRA_DOCKER_ARGS[*]}" -fi - -RUN_CMD=(docker "${DOCKER_ARGS[@]}") -echo "##############################################" -echo "${RUN_CMD} ${DOCKER_ARGS[@]}" -echo "##############################################" - -if command -v timeout >/dev/null 2>&1; then - RUN_CMD=(timeout --preserve-status "${TIMEOUT_SECONDS}s" "${RUN_CMD[@]}") -fi - -"${RUN_CMD[@]}" <<'IN_CONTAINER' -set -Eeuo pipefail - -ok() { printf '\033[1;32m✓ %s\033[0m\n' "$*"; } -warn() { printf '\033[1;33m! %s\033[0m\n' "$*"; } -fail() { printf '\033[1;31m✗ %s\033[0m\n' "$*" >&2; exit 1; } -section() { printf '\n\033[1;34m=== %s ===\033[0m\n' "$*"; } - -PY="${PYTHON_BIN:-python3}" - -if [[ -d /usr/local/cuda ]]; then - export CUDA_HOME="${CUDA_HOME:-/usr/local/cuda}" - export PATH="${CUDA_HOME}/bin:${PATH}" - export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH:-}" -fi - -export TF_CPP_MIN_LOG_LEVEL="${TF_CPP_MIN_LOG_LEVEL:-2}" - -section "1. Python 基础检查" - -command -v "${PY}" >/dev/null 2>&1 || fail "容器内未找到 Python 命令: ${PY}" -"${PY}" --version -ok "Python 可用" - -section "2. TensorFlow 导入与版本检查" - -"${PY}" - <<'PY' -import os -import platform -import sys - -import tensorflow as tf - -print("python_executable:", sys.executable) -print("platform:", platform.platform()) -print("tensorflow_version:", tf.__version__) - -expected = os.environ.get("EXPECTED_TF_VERSION_PREFIX", "").strip() -if expected: - assert tf.__version__.startswith(expected), ( - f"期望 TensorFlow 版本前缀 {expected},实际版本 {tf.__version__}" - ) - print("expected_version_prefix:", expected) -PY - -ok "TensorFlow import 正常" - -section "3. TensorFlow 构建信息检查" - -"${PY}" - <<'PY' -import tensorflow as tf - -print("tf_version:", tf.__version__) - -try: - build_info = tf.sysconfig.get_build_info() - print("build_info:") - for k in sorted(build_info.keys()): - print(f" {k}: {build_info[k]}") -except Exception as e: - print("无法读取 tf.sysconfig.get_build_info():", repr(e)) - -try: - print("is_built_with_cuda:", tf.test.is_built_with_cuda()) -except Exception as e: - print("无法读取 tf.test.is_built_with_cuda():", repr(e)) -PY - -ok "TensorFlow 构建信息读取完成" - -section "4. CUDA / GPU 环境检查" - -if [[ "${REQUIRE_CUDA:-1}" == "1" ]]; then - command -v nvidia-smi >/dev/null 2>&1 || fail "nvidia-smi 不可用;请检查宿主机 NVIDIA 驱动、nvidia-container-toolkit、docker run --gpus 参数" - - echo "nvidia-smi 摘要:" - nvidia-smi --query-gpu=name,driver_version,memory.total --format=csv,noheader || fail "nvidia-smi 执行失败" - - "${PY}" - <<'PY' -import tensorflow as tf - -gpus = tf.config.list_physical_devices("GPU") -logical_gpus = tf.config.list_logical_devices("GPU") - -print("physical_gpus:", gpus) -print("logical_gpus:", logical_gpus) - -assert len(gpus) > 0, "TensorFlow 未检测到物理 GPU" -assert len(logical_gpus) > 0, "TensorFlow 未检测到逻辑 GPU" - -for gpu in gpus: - try: - tf.config.experimental.set_memory_growth(gpu, True) - print(f"memory_growth_enabled: {gpu}") - except Exception as e: - print(f"memory_growth_skip: {gpu}, reason={e!r}") -PY - - ok "TensorFlow GPU 识别正常" - - section "5. TensorFlow GPU 实际计算检查" - - "${PY}" - <<'PY' -import tensorflow as tf - -with tf.device("/GPU:0"): - a = tf.random.normal((1024, 1024)) - b = tf.random.normal((1024, 1024)) - c = tf.matmul(a, b) - -result = c.numpy() - -assert result.shape == (1024, 1024) -assert not tf.math.reduce_any(tf.math.is_nan(c)).numpy(), "GPU 计算结果包含 NaN" - -print("gpu_matmul_shape:", result.shape) -print("gpu_matmul_mean:", float(tf.reduce_mean(c).numpy())) -PY - - ok "TensorFlow GPU 计算正常" - - if command -v nvcc >/dev/null 2>&1; then - echo "nvcc 版本:" - nvcc --version | sed -n '1,5p' - else - warn "未检测到 nvcc:运行时镜像通常不需要 nvcc,只有编译 CUDA 扩展时才需要" - fi -else - warn "REQUIRE_CUDA=0,跳过强制 CUDA / GPU 检查" -fi - -section "6. TensorFlow CPU 基础张量计算" - -"${PY}" - <<'PY' -import tensorflow as tf - -a = tf.constant([[1.0, 2.0], [3.0, 4.0]]) -b = tf.constant([[5.0, 6.0], [7.0, 8.0]]) - -c = tf.matmul(a, b) - -expected = tf.constant([[19.0, 22.0], [43.0, 50.0]]) -tf.debugging.assert_near(c, expected) - -print("matmul_result:") -print(c.numpy()) -PY - -ok "TensorFlow 基础张量计算正常" - -section "7. Keras 模型构建、训练、推理检查" - -"${PY}" - <<'PY' -import os -import tempfile - -import numpy as np -import tensorflow as tf - -np.random.seed(123) -tf.random.set_seed(123) - -# 构造简单训练数据:y = 2x + 1 -x = np.array([[0.0], [1.0], [2.0], [3.0], [4.0], [5.0]], dtype=np.float32) -y = np.array([[1.0], [3.0], [5.0], [7.0], [9.0], [11.0]], dtype=np.float32) - -model = tf.keras.Sequential([ - tf.keras.layers.Input(shape=(1,)), - tf.keras.layers.Dense(8, activation="relu"), - tf.keras.layers.Dense(1), -]) - -model.compile( - optimizer=tf.keras.optimizers.SGD(learning_rate=0.01), - loss="mse", -) - -history = model.fit(x, y, epochs=5, batch_size=2, verbose=0) - -pred = model.predict(np.array([[6.0]], dtype=np.float32), verbose=0) - -assert pred.shape == (1, 1), f"推理结果 shape 异常:{pred.shape}" -assert np.isfinite(pred).all(), "推理结果包含 NaN 或 Inf" - -print("final_loss:", float(history.history["loss"][-1])) -print("prediction_shape:", pred.shape) -print("prediction_value:", float(pred[0][0])) - -with tempfile.TemporaryDirectory() as tmp_dir: - keras_path = os.path.join(tmp_dir, "tiny_model.keras") - model.save(keras_path) - - loaded_model = tf.keras.models.load_model(keras_path) - loaded_pred = loaded_model.predict(np.array([[6.0]], dtype=np.float32), verbose=0) - - assert loaded_pred.shape == (1, 1), f"加载模型推理 shape 异常:{loaded_pred.shape}" - assert np.isfinite(loaded_pred).all(), "加载模型推理结果包含 NaN 或 Inf" - - print("keras_save_load: ok") -PY - -ok "Keras 模型训练、推理、保存、加载正常" - -section "8. tf.data 数据管道检查" - -"${PY}" - <<'PY' -import tensorflow as tf - -dataset = tf.data.Dataset.from_tensor_slices( - ( - tf.constant([[1.0], [2.0], [3.0], [4.0]]), - tf.constant([[2.0], [4.0], [6.0], [8.0]]), - ) -) - -dataset = dataset.batch(2).prefetch(tf.data.AUTOTUNE) - -batch_count = 0 -for xb, yb in dataset: - assert xb.shape[0] <= 2 - assert yb.shape[0] <= 2 - batch_count += 1 - -assert batch_count == 2, f"batch 数量异常: {batch_count}" - -print("tf_data_batch_count:", batch_count) -PY - -ok "tf.data 数据管道正常" - -section "测试结果" -ok "所有 TensorFlow 检查通过" -IN_CONTAINER - -ok "宿主机侧 docker run 验证完成" \ No newline at end of file diff --git a/frameworks/tensorflow/2.18.1/warring_log.png b/frameworks/tensorflow/2.18.1/warring_log.png deleted file mode 100644 index 1461c0cedad8d45c8d32554de19c341ba88d37bc..0000000000000000000000000000000000000000 Binary files a/frameworks/tensorflow/2.18.1/warring_log.png and /dev/null differ diff --git a/frameworks/tensorflow/2.19.0/Dockerfile b/frameworks/tensorflow/2.19.0/Dockerfile deleted file mode 100644 index 4e44e6d6fbac6897481074fd86c5caa7291f83fd..0000000000000000000000000000000000000000 --- a/frameworks/tensorflow/2.19.0/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ - -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="stronking 363133710@qq.com" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="TensorFlow 2.19.0 (GPU) on OpenCloudOS 9" - -ENV NVIDIA_VISIBLE_DEVICES=all \ - PYTHONUNBUFFERED=1 \ - PIP_DISABLE_PIP_VERSION_CHECK=1 \ - PIP_DEFAULT_TIMEOUT=120 - - -WORKDIR /home - -RUN --mount=type=cache,id=pip-cache-opencloudos9-cu128,target=/root/.cache/pip \ - pip install "tensorflow[and-cuda]==2.19.0" - -CMD ["python3"] \ No newline at end of file diff --git a/frameworks/tensorflow/2.19.0/README.md b/frameworks/tensorflow/2.19.0/README.md deleted file mode 100644 index b2cb9370da93241d386b2c14cc4d3c4ac2798946..0000000000000000000000000000000000000000 --- a/frameworks/tensorflow/2.19.0/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# tensorflow 2.19.0 on OpenCloudOS 9 - -## 基本信息 -- **框架版本**:v2.19.0 -- **基础镜像**:opencloudos9-cuda-devel:12.8 -- **Python 版本**:3.11 -- **CUDA 版本**: 12.x 或 更高 - -## 构建 - -docker build -t oc9-tensorflow:2.19.0 . - -## 镜像启动命令 - -docker run -d --gpus all --name oc9-tensorflow oc9-tensorflow:2.19.0 - -## 镜像测试命令 - -docker run --rm --gpus all oc9-tensorflow:2.19.0 bash test.sh -docker run --rm --gpus all oc9-tensorflow:2.19.0 python tensor_smoke_test.py - -## 已知问题 -``` -对于如下日志输出,属于正常现象。这些日志通常不是致命错误。 -核心原因是:TensorFlow 在 import tensorflow as tf 时,会初始化 CUDA/XLA 相关组件,并注册 cuFFT、cuDNN、cuBLAS 等 GPU 插件工厂。 -日志里的意思是:这些插件工厂已经注册过一次,现在又尝试注册,所以打印了“already been registered”。 -TensorFlow 官方 GitHub 上有多个相同现象的 issue,日志内容和图片中的告警日志基本一致, -包括 Unable to register cuFFT factory、cuDNN factory、cuBLAS factory、computation placer already registered 等 -``` -如下图所示告警日志: -![告警日志](./warring_log.png) \ No newline at end of file diff --git a/frameworks/tensorflow/2.19.0/build.conf b/frameworks/tensorflow/2.19.0/build.conf deleted file mode 100644 index e0a7020614dd0eaf103411ab1c481950f6592219..0000000000000000000000000000000000000000 --- a/frameworks/tensorflow/2.19.0/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# tensorflow 2.19.0 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-tensorflow -IMAGE_TAG=2.19.0 -GPU_TEST=false \ No newline at end of file diff --git a/frameworks/tensorflow/2.19.0/tensor_smoke_test.py b/frameworks/tensorflow/2.19.0/tensor_smoke_test.py deleted file mode 100644 index 02cec134116518270c21bcf37daf410a619ca0a1..0000000000000000000000000000000000000000 --- a/frameworks/tensorflow/2.19.0/tensor_smoke_test.py +++ /dev/null @@ -1,52 +0,0 @@ -import os -os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" - -import numpy as np -import tensorflow as tf - - -def main(): - print("TensorFlow version:", tf.__version__) - - gpus = tf.config.list_physical_devices("GPU") - print("GPUs:", gpus) - - # 基础张量计算 - a = tf.constant([[1.0, 2.0], [3.0, 4.0]]) - b = tf.constant([[5.0, 6.0], [7.0, 8.0]]) - c = tf.matmul(a, b) - - print("matmul result:") - print(c.numpy()) - - expected = tf.constant([[19.0, 22.0], [43.0, 50.0]]) - tf.debugging.assert_near(c, expected) - - # 简单 Keras 模型 - x = np.array([[0.0], [1.0], [2.0], [3.0]], dtype=np.float32) - y = np.array([[1.0], [3.0], [5.0], [7.0]], dtype=np.float32) - - model = tf.keras.Sequential([ - tf.keras.layers.Input(shape=(1,)), - tf.keras.layers.Dense(1), - ]) - - model.compile( - optimizer=tf.keras.optimizers.SGD(learning_rate=0.01), - loss="mse", - ) - - history = model.fit(x, y, epochs=3, verbose=0) - - pred = model.predict(np.array([[4.0]], dtype=np.float32), verbose=0) - - assert pred.shape == (1, 1) - assert np.isfinite(pred).all() - - print("final loss:", float(history.history["loss"][-1])) - print("prediction:", float(pred[0][0])) - print("TensorFlow smoke test passed") - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/frameworks/tensorflow/2.19.0/test.sh b/frameworks/tensorflow/2.19.0/test.sh deleted file mode 100644 index cbbce1b29c54efd794c0a4fe5b99b4fc028e41fa..0000000000000000000000000000000000000000 --- a/frameworks/tensorflow/2.19.0/test.sh +++ /dev/null @@ -1,336 +0,0 @@ -#!/usr/bin/env bash -# 在容器外执行:验证指定 Docker 镜像中的 TensorFlow / Keras / CUDA 基础功能。 -# -# 用法: -# bash test_tensorflow_docker.sh [额外 docker run 参数...] -# -# 示例: -# bash test_tensorflow_docker.sh my-tensorflow:latest -# bash test_tensorflow_docker.sh my-tensorflow:latest --ipc=host -# REQUIRE_CUDA=0 bash test_tensorflow_docker.sh tensorflow-cpu:test -# EXPECTED_TF_VERSION_PREFIX=2.19 bash test_tensorflow_docker.sh my-tensorflow:latest - -set -Eeuo pipefail - -IMAGE="${1:-}" - -if [[ -z "${IMAGE}" || "${IMAGE}" == "-h" || "${IMAGE}" == "--help" ]]; then - cat <<'USAGE' -用法: - bash test.sh [额外 docker run 参数...] - -环境变量: - REQUIRE_CUDA=1|0 是否强制要求 CUDA/GPU 可用,默认 1 - GPUS=all 传给 docker run --gpus 的值,默认 all - PYTHON_BIN=python3 容器内 Python 命令,默认 python3 - DOCKER_NETWORK=none docker 网络模式,默认 none - TIMEOUT_SECONDS=180 整体测试超时时间,默认 180 秒 - EXPECTED_TF_VERSION_PREFIX=2.19 可选,检查 TensorFlow 版本前缀 - -示例: - bash test.sh registry.example.com/ai/tensorflow:2.19-cu12 - REQUIRE_CUDA=0 bash test.sh tensorflow-cpu:test - EXPECTED_TF_VERSION_PREFIX=2.19 bash test.sh my-image:tag - bash test.sh my-image:tag --ipc=host --shm-size=2g -USAGE - exit 1 -fi - -shift || true - -REQUIRE_CUDA="${REQUIRE_CUDA:-1}" -GPUS="${GPUS:-all}" -PYTHON_BIN="${PYTHON_BIN:-python3}" -DOCKER_NETWORK="${DOCKER_NETWORK:-none}" -TIMEOUT_SECONDS="${TIMEOUT_SECONDS:-180}" -EXPECTED_TF_VERSION_PREFIX="${EXPECTED_TF_VERSION_PREFIX:-}" -EXTRA_DOCKER_ARGS=("$@") - -log() { printf '\033[1;34m%s\033[0m\n' "$*"; } -ok() { printf '\033[1;32m✓ %s\033[0m\n' "$*"; } -warn() { printf '\033[1;33m! %s\033[0m\n' "$*"; } -fail() { printf '\033[1;31m✗ %s\033[0m\n' "$*" >&2; exit 1; } - -[[ "${REQUIRE_CUDA}" =~ ^[01]$ ]] || fail "REQUIRE_CUDA 只能是 1 或 0,当前值: ${REQUIRE_CUDA}" - -command -v docker >/dev/null 2>&1 || fail "未找到 docker 命令" -docker info >/dev/null 2>&1 || fail "docker daemon 不可用,请确认 Docker 服务已启动且当前用户有权限访问" - -if ! docker image inspect "${IMAGE}" >/dev/null 2>&1; then - warn "本地未找到镜像 ${IMAGE};docker run 可能会尝试拉取镜像" -fi - -DOCKER_ARGS=(run --rm -i) - -if [[ "${REQUIRE_CUDA}" == "1" ]]; then - DOCKER_ARGS+=(--gpus "${GPUS}") -fi - -DOCKER_ARGS+=( - -e "REQUIRE_CUDA=${REQUIRE_CUDA}" - -e "PYTHON_BIN=${PYTHON_BIN}" - -e "EXPECTED_TF_VERSION_PREFIX=${EXPECTED_TF_VERSION_PREFIX}" - -e "TF_CPP_MIN_LOG_LEVEL=2" -) - -DOCKER_ARGS+=("${EXTRA_DOCKER_ARGS[@]}") -DOCKER_ARGS+=("${IMAGE}" /bin/bash -s) - -log "=== TensorFlow Docker 镜像功能测试 ===" -printf '镜像: %s\n' "${IMAGE}" -printf 'CUDA 强制检查: %s\n' "${REQUIRE_CUDA}" -printf 'Docker 网络: %s\n' "${DOCKER_NETWORK}" -printf 'Python 命令: %s\n' "${PYTHON_BIN}" - -if [[ -n "${EXPECTED_TF_VERSION_PREFIX}" ]]; then - printf '期望 TensorFlow 版本前缀: %s\n' "${EXPECTED_TF_VERSION_PREFIX}" -fi - -if ((${#EXTRA_DOCKER_ARGS[@]} > 0)); then - printf '额外 docker 参数: %s\n' "${EXTRA_DOCKER_ARGS[*]}" -fi - -RUN_CMD=(docker "${DOCKER_ARGS[@]}") -echo "##############################################" -echo "${RUN_CMD} ${DOCKER_ARGS[@]}" -echo "##############################################" - -if command -v timeout >/dev/null 2>&1; then - RUN_CMD=(timeout --preserve-status "${TIMEOUT_SECONDS}s" "${RUN_CMD[@]}") -fi - -"${RUN_CMD[@]}" <<'IN_CONTAINER' -set -Eeuo pipefail - -ok() { printf '\033[1;32m✓ %s\033[0m\n' "$*"; } -warn() { printf '\033[1;33m! %s\033[0m\n' "$*"; } -fail() { printf '\033[1;31m✗ %s\033[0m\n' "$*" >&2; exit 1; } -section() { printf '\n\033[1;34m=== %s ===\033[0m\n' "$*"; } - -PY="${PYTHON_BIN:-python3}" - -if [[ -d /usr/local/cuda ]]; then - export CUDA_HOME="${CUDA_HOME:-/usr/local/cuda}" - export PATH="${CUDA_HOME}/bin:${PATH}" - export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH:-}" -fi - -export TF_CPP_MIN_LOG_LEVEL="${TF_CPP_MIN_LOG_LEVEL:-2}" - -section "1. Python 基础检查" - -command -v "${PY}" >/dev/null 2>&1 || fail "容器内未找到 Python 命令: ${PY}" -"${PY}" --version -ok "Python 可用" - -section "2. TensorFlow 导入与版本检查" - -"${PY}" - <<'PY' -import os -import platform -import sys - -import tensorflow as tf - -print("python_executable:", sys.executable) -print("platform:", platform.platform()) -print("tensorflow_version:", tf.__version__) - -expected = os.environ.get("EXPECTED_TF_VERSION_PREFIX", "").strip() -if expected: - assert tf.__version__.startswith(expected), ( - f"期望 TensorFlow 版本前缀 {expected},实际版本 {tf.__version__}" - ) - print("expected_version_prefix:", expected) -PY - -ok "TensorFlow import 正常" - -section "3. TensorFlow 构建信息检查" - -"${PY}" - <<'PY' -import tensorflow as tf - -print("tf_version:", tf.__version__) - -try: - build_info = tf.sysconfig.get_build_info() - print("build_info:") - for k in sorted(build_info.keys()): - print(f" {k}: {build_info[k]}") -except Exception as e: - print("无法读取 tf.sysconfig.get_build_info():", repr(e)) - -try: - print("is_built_with_cuda:", tf.test.is_built_with_cuda()) -except Exception as e: - print("无法读取 tf.test.is_built_with_cuda():", repr(e)) -PY - -ok "TensorFlow 构建信息读取完成" - -section "4. CUDA / GPU 环境检查" - -if [[ "${REQUIRE_CUDA:-1}" == "1" ]]; then - command -v nvidia-smi >/dev/null 2>&1 || fail "nvidia-smi 不可用;请检查宿主机 NVIDIA 驱动、nvidia-container-toolkit、docker run --gpus 参数" - - echo "nvidia-smi 摘要:" - nvidia-smi --query-gpu=name,driver_version,memory.total --format=csv,noheader || fail "nvidia-smi 执行失败" - - "${PY}" - <<'PY' -import tensorflow as tf - -gpus = tf.config.list_physical_devices("GPU") -logical_gpus = tf.config.list_logical_devices("GPU") - -print("physical_gpus:", gpus) -print("logical_gpus:", logical_gpus) - -assert len(gpus) > 0, "TensorFlow 未检测到物理 GPU" -assert len(logical_gpus) > 0, "TensorFlow 未检测到逻辑 GPU" - -for gpu in gpus: - try: - tf.config.experimental.set_memory_growth(gpu, True) - print(f"memory_growth_enabled: {gpu}") - except Exception as e: - print(f"memory_growth_skip: {gpu}, reason={e!r}") -PY - - ok "TensorFlow GPU 识别正常" - - section "5. TensorFlow GPU 实际计算检查" - - "${PY}" - <<'PY' -import tensorflow as tf - -with tf.device("/GPU:0"): - a = tf.random.normal((1024, 1024)) - b = tf.random.normal((1024, 1024)) - c = tf.matmul(a, b) - -result = c.numpy() - -assert result.shape == (1024, 1024) -assert not tf.math.reduce_any(tf.math.is_nan(c)).numpy(), "GPU 计算结果包含 NaN" - -print("gpu_matmul_shape:", result.shape) -print("gpu_matmul_mean:", float(tf.reduce_mean(c).numpy())) -PY - - ok "TensorFlow GPU 计算正常" - - if command -v nvcc >/dev/null 2>&1; then - echo "nvcc 版本:" - nvcc --version | sed -n '1,5p' - else - warn "未检测到 nvcc:运行时镜像通常不需要 nvcc,只有编译 CUDA 扩展时才需要" - fi -else - warn "REQUIRE_CUDA=0,跳过强制 CUDA / GPU 检查" -fi - -section "6. TensorFlow CPU 基础张量计算" - -"${PY}" - <<'PY' -import tensorflow as tf - -a = tf.constant([[1.0, 2.0], [3.0, 4.0]]) -b = tf.constant([[5.0, 6.0], [7.0, 8.0]]) - -c = tf.matmul(a, b) - -expected = tf.constant([[19.0, 22.0], [43.0, 50.0]]) -tf.debugging.assert_near(c, expected) - -print("matmul_result:") -print(c.numpy()) -PY - -ok "TensorFlow 基础张量计算正常" - -section "7. Keras 模型构建、训练、推理检查" - -"${PY}" - <<'PY' -import os -import tempfile - -import numpy as np -import tensorflow as tf - -np.random.seed(123) -tf.random.set_seed(123) - -# 构造简单训练数据:y = 2x + 1 -x = np.array([[0.0], [1.0], [2.0], [3.0], [4.0], [5.0]], dtype=np.float32) -y = np.array([[1.0], [3.0], [5.0], [7.0], [9.0], [11.0]], dtype=np.float32) - -model = tf.keras.Sequential([ - tf.keras.layers.Input(shape=(1,)), - tf.keras.layers.Dense(8, activation="relu"), - tf.keras.layers.Dense(1), -]) - -model.compile( - optimizer=tf.keras.optimizers.SGD(learning_rate=0.01), - loss="mse", -) - -history = model.fit(x, y, epochs=5, batch_size=2, verbose=0) - -pred = model.predict(np.array([[6.0]], dtype=np.float32), verbose=0) - -assert pred.shape == (1, 1), f"推理结果 shape 异常:{pred.shape}" -assert np.isfinite(pred).all(), "推理结果包含 NaN 或 Inf" - -print("final_loss:", float(history.history["loss"][-1])) -print("prediction_shape:", pred.shape) -print("prediction_value:", float(pred[0][0])) - -with tempfile.TemporaryDirectory() as tmp_dir: - keras_path = os.path.join(tmp_dir, "tiny_model.keras") - model.save(keras_path) - - loaded_model = tf.keras.models.load_model(keras_path) - loaded_pred = loaded_model.predict(np.array([[6.0]], dtype=np.float32), verbose=0) - - assert loaded_pred.shape == (1, 1), f"加载模型推理 shape 异常:{loaded_pred.shape}" - assert np.isfinite(loaded_pred).all(), "加载模型推理结果包含 NaN 或 Inf" - - print("keras_save_load: ok") -PY - -ok "Keras 模型训练、推理、保存、加载正常" - -section "8. tf.data 数据管道检查" - -"${PY}" - <<'PY' -import tensorflow as tf - -dataset = tf.data.Dataset.from_tensor_slices( - ( - tf.constant([[1.0], [2.0], [3.0], [4.0]]), - tf.constant([[2.0], [4.0], [6.0], [8.0]]), - ) -) - -dataset = dataset.batch(2).prefetch(tf.data.AUTOTUNE) - -batch_count = 0 -for xb, yb in dataset: - assert xb.shape[0] <= 2 - assert yb.shape[0] <= 2 - batch_count += 1 - -assert batch_count == 2, f"batch 数量异常: {batch_count}" - -print("tf_data_batch_count:", batch_count) -PY - -ok "tf.data 数据管道正常" - -section "测试结果" -ok "所有 TensorFlow 检查通过" -IN_CONTAINER - -ok "宿主机侧 docker run 验证完成" \ No newline at end of file diff --git a/frameworks/tensorflow/2.19.0/test_result.png b/frameworks/tensorflow/2.19.0/test_result.png deleted file mode 100644 index 48f15883c5c9d8cc6e2e22cd6ede0169048d2c0f..0000000000000000000000000000000000000000 Binary files a/frameworks/tensorflow/2.19.0/test_result.png and /dev/null differ diff --git a/frameworks/tensorflow/2.19.0/warring_log.png b/frameworks/tensorflow/2.19.0/warring_log.png deleted file mode 100644 index 1461c0cedad8d45c8d32554de19c341ba88d37bc..0000000000000000000000000000000000000000 Binary files a/frameworks/tensorflow/2.19.0/warring_log.png and /dev/null differ diff --git a/frameworks/tensorflow/2.21.0/Dockerfile b/frameworks/tensorflow/2.21.0/Dockerfile deleted file mode 100644 index 8def434782612f47c4349ee88d0a5adc24c81872..0000000000000000000000000000000000000000 --- a/frameworks/tensorflow/2.21.0/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ - -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="stronking 363133710@qq.com" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="TensorFlow 2.21.0 (GPU) on OpenCloudOS 9" - -ENV NVIDIA_VISIBLE_DEVICES=all \ - PYTHONUNBUFFERED=1 \ - PIP_DISABLE_PIP_VERSION_CHECK=1 \ - PIP_DEFAULT_TIMEOUT=120 - - -WORKDIR /home - -RUN --mount=type=cache,id=pip-cache-opencloudos9-cu128,target=/root/.cache/pip \ - pip install "tensorflow[and-cuda]==2.21.0" - -CMD ["python3"] \ No newline at end of file diff --git a/frameworks/tensorflow/2.21.0/README.md b/frameworks/tensorflow/2.21.0/README.md deleted file mode 100644 index 36bc11abcc366fe05d8bb2f853fa83f391cf676a..0000000000000000000000000000000000000000 --- a/frameworks/tensorflow/2.21.0/README.md +++ /dev/null @@ -1,31 +0,0 @@ -# tensorflow 2.21.0 on OpenCloudOS 9 - -## 基本信息 -- **框架版本**:v2.21.0 -- **基础镜像**:opencloudos9-cuda-devel:12.8 -- **Python 版本**:3.11 -- **CUDA 版本**: 12.x 或 更高 - -## 构建 - -docker build -t oc9-tensorflow:2.21.0 . - -## 镜像启动命令 - -docker run -d --gpus all --name oc9-tensorflow oc9-tensorflow:2.21.0 - -## 镜像测试命令 - -docker run --rm --gpus all oc9-tensorflow:2.21.0 bash test.sh -docker run --rm --gpus all oc9-tensorflow:2.21.0 python tensor_smoke_test.py - -## 已知问题 -``` -对于如下日志输出,属于正常现象。这些日志通常不是致命错误。 -核心原因是:TensorFlow 在 import tensorflow as tf 时,会初始化 CUDA/XLA 相关组件,并注册 cuFFT、cuDNN、cuBLAS 等 GPU 插件工厂。 -日志里的意思是:这些插件工厂已经注册过一次,现在又尝试注册,所以打印了“already been registered”。 -TensorFlow 官方 GitHub 上有多个相同现象的 issue,日志内容和图片中的告警日志基本一致, -包括 Unable to register cuFFT factory、cuDNN factory、cuBLAS factory、computation placer already registered 等 -``` -如下图所示告警日志: -![告警日志](./warring_log.png) \ No newline at end of file diff --git a/frameworks/tensorflow/2.21.0/build.conf b/frameworks/tensorflow/2.21.0/build.conf deleted file mode 100644 index b0255949f5a755fb67ece75bc5eeb3900eddb169..0000000000000000000000000000000000000000 --- a/frameworks/tensorflow/2.21.0/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# tensorflow 2.21.0 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-tensorflow -IMAGE_TAG=2.21.0 -GPU_TEST=false \ No newline at end of file diff --git a/frameworks/tensorflow/2.21.0/tensor_smoke_test.py b/frameworks/tensorflow/2.21.0/tensor_smoke_test.py deleted file mode 100644 index 02cec134116518270c21bcf37daf410a619ca0a1..0000000000000000000000000000000000000000 --- a/frameworks/tensorflow/2.21.0/tensor_smoke_test.py +++ /dev/null @@ -1,52 +0,0 @@ -import os -os.environ["TF_CPP_MIN_LOG_LEVEL"] = "3" - -import numpy as np -import tensorflow as tf - - -def main(): - print("TensorFlow version:", tf.__version__) - - gpus = tf.config.list_physical_devices("GPU") - print("GPUs:", gpus) - - # 基础张量计算 - a = tf.constant([[1.0, 2.0], [3.0, 4.0]]) - b = tf.constant([[5.0, 6.0], [7.0, 8.0]]) - c = tf.matmul(a, b) - - print("matmul result:") - print(c.numpy()) - - expected = tf.constant([[19.0, 22.0], [43.0, 50.0]]) - tf.debugging.assert_near(c, expected) - - # 简单 Keras 模型 - x = np.array([[0.0], [1.0], [2.0], [3.0]], dtype=np.float32) - y = np.array([[1.0], [3.0], [5.0], [7.0]], dtype=np.float32) - - model = tf.keras.Sequential([ - tf.keras.layers.Input(shape=(1,)), - tf.keras.layers.Dense(1), - ]) - - model.compile( - optimizer=tf.keras.optimizers.SGD(learning_rate=0.01), - loss="mse", - ) - - history = model.fit(x, y, epochs=3, verbose=0) - - pred = model.predict(np.array([[4.0]], dtype=np.float32), verbose=0) - - assert pred.shape == (1, 1) - assert np.isfinite(pred).all() - - print("final loss:", float(history.history["loss"][-1])) - print("prediction:", float(pred[0][0])) - print("TensorFlow smoke test passed") - - -if __name__ == "__main__": - main() \ No newline at end of file diff --git a/frameworks/tensorflow/2.21.0/test.sh b/frameworks/tensorflow/2.21.0/test.sh deleted file mode 100644 index c2fed93f16a25af247974d29f8d80998f0fb4dcc..0000000000000000000000000000000000000000 --- a/frameworks/tensorflow/2.21.0/test.sh +++ /dev/null @@ -1,336 +0,0 @@ -#!/usr/bin/env bash -# 在容器外执行:验证指定 Docker 镜像中的 TensorFlow / Keras / CUDA 基础功能。 -# -# 用法: -# bash test.sh [额外 docker run 参数...] -# -# 示例: -# bash test.sh my-tensorflow:latest -# bash test.sh my-tensorflow:latest --ipc=host -# REQUIRE_CUDA=0 bash test.sh tensorflow-cpu:test -# EXPECTED_TF_VERSION_PREFIX=2.19 bash test.sh my-tensorflow:latest - -set -Eeuo pipefail - -IMAGE="${1:-}" - -if [[ -z "${IMAGE}" || "${IMAGE}" == "-h" || "${IMAGE}" == "--help" ]]; then - cat <<'USAGE' -用法: - bash test.sh [额外 docker run 参数...] - -环境变量: - REQUIRE_CUDA=1|0 是否强制要求 CUDA/GPU 可用,默认 1 - GPUS=all 传给 docker run --gpus 的值,默认 all - PYTHON_BIN=python3 容器内 Python 命令,默认 python3 - DOCKER_NETWORK=none docker 网络模式,默认 none - TIMEOUT_SECONDS=180 整体测试超时时间,默认 180 秒 - EXPECTED_TF_VERSION_PREFIX=2.19 可选,检查 TensorFlow 版本前缀 - -示例: - bash test.sh registry.example.com/ai/tensorflow:2.19-cu12 - REQUIRE_CUDA=0 bash test.sh tensorflow-cpu:test - EXPECTED_TF_VERSION_PREFIX=2.19 bash test.sh my-image:tag - bash test.sh my-image:tag --ipc=host --shm-size=2g -USAGE - exit 1 -fi - -shift || true - -REQUIRE_CUDA="${REQUIRE_CUDA:-1}" -GPUS="${GPUS:-all}" -PYTHON_BIN="${PYTHON_BIN:-python3}" -DOCKER_NETWORK="${DOCKER_NETWORK:-none}" -TIMEOUT_SECONDS="${TIMEOUT_SECONDS:-180}" -EXPECTED_TF_VERSION_PREFIX="${EXPECTED_TF_VERSION_PREFIX:-}" -EXTRA_DOCKER_ARGS=("$@") - -log() { printf '\033[1;34m%s\033[0m\n' "$*"; } -ok() { printf '\033[1;32m✓ %s\033[0m\n' "$*"; } -warn() { printf '\033[1;33m! %s\033[0m\n' "$*"; } -fail() { printf '\033[1;31m✗ %s\033[0m\n' "$*" >&2; exit 1; } - -[[ "${REQUIRE_CUDA}" =~ ^[01]$ ]] || fail "REQUIRE_CUDA 只能是 1 或 0,当前值: ${REQUIRE_CUDA}" - -command -v docker >/dev/null 2>&1 || fail "未找到 docker 命令" -docker info >/dev/null 2>&1 || fail "docker daemon 不可用,请确认 Docker 服务已启动且当前用户有权限访问" - -if ! docker image inspect "${IMAGE}" >/dev/null 2>&1; then - warn "本地未找到镜像 ${IMAGE};docker run 可能会尝试拉取镜像" -fi - -DOCKER_ARGS=(run --rm -i) - -if [[ "${REQUIRE_CUDA}" == "1" ]]; then - DOCKER_ARGS+=(--gpus "${GPUS}") -fi - -DOCKER_ARGS+=( - -e "REQUIRE_CUDA=${REQUIRE_CUDA}" - -e "PYTHON_BIN=${PYTHON_BIN}" - -e "EXPECTED_TF_VERSION_PREFIX=${EXPECTED_TF_VERSION_PREFIX}" - -e "TF_CPP_MIN_LOG_LEVEL=2" -) - -DOCKER_ARGS+=("${EXTRA_DOCKER_ARGS[@]}") -DOCKER_ARGS+=("${IMAGE}" /bin/bash -s) - -log "=== TensorFlow Docker 镜像功能测试 ===" -printf '镜像: %s\n' "${IMAGE}" -printf 'CUDA 强制检查: %s\n' "${REQUIRE_CUDA}" -printf 'Docker 网络: %s\n' "${DOCKER_NETWORK}" -printf 'Python 命令: %s\n' "${PYTHON_BIN}" - -if [[ -n "${EXPECTED_TF_VERSION_PREFIX}" ]]; then - printf '期望 TensorFlow 版本前缀: %s\n' "${EXPECTED_TF_VERSION_PREFIX}" -fi - -if ((${#EXTRA_DOCKER_ARGS[@]} > 0)); then - printf '额外 docker 参数: %s\n' "${EXTRA_DOCKER_ARGS[*]}" -fi - -RUN_CMD=(docker "${DOCKER_ARGS[@]}") -echo "##############################################" -echo "${RUN_CMD} ${DOCKER_ARGS[@]}" -echo "##############################################" - -if command -v timeout >/dev/null 2>&1; then - RUN_CMD=(timeout --preserve-status "${TIMEOUT_SECONDS}s" "${RUN_CMD[@]}") -fi - -"${RUN_CMD[@]}" <<'IN_CONTAINER' -set -Eeuo pipefail - -ok() { printf '\033[1;32m✓ %s\033[0m\n' "$*"; } -warn() { printf '\033[1;33m! %s\033[0m\n' "$*"; } -fail() { printf '\033[1;31m✗ %s\033[0m\n' "$*" >&2; exit 1; } -section() { printf '\n\033[1;34m=== %s ===\033[0m\n' "$*"; } - -PY="${PYTHON_BIN:-python3}" - -if [[ -d /usr/local/cuda ]]; then - export CUDA_HOME="${CUDA_HOME:-/usr/local/cuda}" - export PATH="${CUDA_HOME}/bin:${PATH}" - export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH:-}" -fi - -export TF_CPP_MIN_LOG_LEVEL="${TF_CPP_MIN_LOG_LEVEL:-2}" - -section "1. Python 基础检查" - -command -v "${PY}" >/dev/null 2>&1 || fail "容器内未找到 Python 命令: ${PY}" -"${PY}" --version -ok "Python 可用" - -section "2. TensorFlow 导入与版本检查" - -"${PY}" - <<'PY' -import os -import platform -import sys - -import tensorflow as tf - -print("python_executable:", sys.executable) -print("platform:", platform.platform()) -print("tensorflow_version:", tf.__version__) - -expected = os.environ.get("EXPECTED_TF_VERSION_PREFIX", "").strip() -if expected: - assert tf.__version__.startswith(expected), ( - f"期望 TensorFlow 版本前缀 {expected},实际版本 {tf.__version__}" - ) - print("expected_version_prefix:", expected) -PY - -ok "TensorFlow import 正常" - -section "3. TensorFlow 构建信息检查" - -"${PY}" - <<'PY' -import tensorflow as tf - -print("tf_version:", tf.__version__) - -try: - build_info = tf.sysconfig.get_build_info() - print("build_info:") - for k in sorted(build_info.keys()): - print(f" {k}: {build_info[k]}") -except Exception as e: - print("无法读取 tf.sysconfig.get_build_info():", repr(e)) - -try: - print("is_built_with_cuda:", tf.test.is_built_with_cuda()) -except Exception as e: - print("无法读取 tf.test.is_built_with_cuda():", repr(e)) -PY - -ok "TensorFlow 构建信息读取完成" - -section "4. CUDA / GPU 环境检查" - -if [[ "${REQUIRE_CUDA:-1}" == "1" ]]; then - command -v nvidia-smi >/dev/null 2>&1 || fail "nvidia-smi 不可用;请检查宿主机 NVIDIA 驱动、nvidia-container-toolkit、docker run --gpus 参数" - - echo "nvidia-smi 摘要:" - nvidia-smi --query-gpu=name,driver_version,memory.total --format=csv,noheader || fail "nvidia-smi 执行失败" - - "${PY}" - <<'PY' -import tensorflow as tf - -gpus = tf.config.list_physical_devices("GPU") -logical_gpus = tf.config.list_logical_devices("GPU") - -print("physical_gpus:", gpus) -print("logical_gpus:", logical_gpus) - -assert len(gpus) > 0, "TensorFlow 未检测到物理 GPU" -assert len(logical_gpus) > 0, "TensorFlow 未检测到逻辑 GPU" - -for gpu in gpus: - try: - tf.config.experimental.set_memory_growth(gpu, True) - print(f"memory_growth_enabled: {gpu}") - except Exception as e: - print(f"memory_growth_skip: {gpu}, reason={e!r}") -PY - - ok "TensorFlow GPU 识别正常" - - section "5. TensorFlow GPU 实际计算检查" - - "${PY}" - <<'PY' -import tensorflow as tf - -with tf.device("/GPU:0"): - a = tf.random.normal((1024, 1024)) - b = tf.random.normal((1024, 1024)) - c = tf.matmul(a, b) - -result = c.numpy() - -assert result.shape == (1024, 1024) -assert not tf.math.reduce_any(tf.math.is_nan(c)).numpy(), "GPU 计算结果包含 NaN" - -print("gpu_matmul_shape:", result.shape) -print("gpu_matmul_mean:", float(tf.reduce_mean(c).numpy())) -PY - - ok "TensorFlow GPU 计算正常" - - if command -v nvcc >/dev/null 2>&1; then - echo "nvcc 版本:" - nvcc --version | sed -n '1,5p' - else - warn "未检测到 nvcc:运行时镜像通常不需要 nvcc,只有编译 CUDA 扩展时才需要" - fi -else - warn "REQUIRE_CUDA=0,跳过强制 CUDA / GPU 检查" -fi - -section "6. TensorFlow CPU 基础张量计算" - -"${PY}" - <<'PY' -import tensorflow as tf - -a = tf.constant([[1.0, 2.0], [3.0, 4.0]]) -b = tf.constant([[5.0, 6.0], [7.0, 8.0]]) - -c = tf.matmul(a, b) - -expected = tf.constant([[19.0, 22.0], [43.0, 50.0]]) -tf.debugging.assert_near(c, expected) - -print("matmul_result:") -print(c.numpy()) -PY - -ok "TensorFlow 基础张量计算正常" - -section "7. Keras 模型构建、训练、推理检查" - -"${PY}" - <<'PY' -import os -import tempfile - -import numpy as np -import tensorflow as tf - -np.random.seed(123) -tf.random.set_seed(123) - -# 构造简单训练数据:y = 2x + 1 -x = np.array([[0.0], [1.0], [2.0], [3.0], [4.0], [5.0]], dtype=np.float32) -y = np.array([[1.0], [3.0], [5.0], [7.0], [9.0], [11.0]], dtype=np.float32) - -model = tf.keras.Sequential([ - tf.keras.layers.Input(shape=(1,)), - tf.keras.layers.Dense(8, activation="relu"), - tf.keras.layers.Dense(1), -]) - -model.compile( - optimizer=tf.keras.optimizers.SGD(learning_rate=0.01), - loss="mse", -) - -history = model.fit(x, y, epochs=5, batch_size=2, verbose=0) - -pred = model.predict(np.array([[6.0]], dtype=np.float32), verbose=0) - -assert pred.shape == (1, 1), f"推理结果 shape 异常:{pred.shape}" -assert np.isfinite(pred).all(), "推理结果包含 NaN 或 Inf" - -print("final_loss:", float(history.history["loss"][-1])) -print("prediction_shape:", pred.shape) -print("prediction_value:", float(pred[0][0])) - -with tempfile.TemporaryDirectory() as tmp_dir: - keras_path = os.path.join(tmp_dir, "tiny_model.keras") - model.save(keras_path) - - loaded_model = tf.keras.models.load_model(keras_path) - loaded_pred = loaded_model.predict(np.array([[6.0]], dtype=np.float32), verbose=0) - - assert loaded_pred.shape == (1, 1), f"加载模型推理 shape 异常:{loaded_pred.shape}" - assert np.isfinite(loaded_pred).all(), "加载模型推理结果包含 NaN 或 Inf" - - print("keras_save_load: ok") -PY - -ok "Keras 模型训练、推理、保存、加载正常" - -section "8. tf.data 数据管道检查" - -"${PY}" - <<'PY' -import tensorflow as tf - -dataset = tf.data.Dataset.from_tensor_slices( - ( - tf.constant([[1.0], [2.0], [3.0], [4.0]]), - tf.constant([[2.0], [4.0], [6.0], [8.0]]), - ) -) - -dataset = dataset.batch(2).prefetch(tf.data.AUTOTUNE) - -batch_count = 0 -for xb, yb in dataset: - assert xb.shape[0] <= 2 - assert yb.shape[0] <= 2 - batch_count += 1 - -assert batch_count == 2, f"batch 数量异常: {batch_count}" - -print("tf_data_batch_count:", batch_count) -PY - -ok "tf.data 数据管道正常" - -section "测试结果" -ok "所有 TensorFlow 检查通过" -IN_CONTAINER - -ok "宿主机侧 docker run 验证完成" \ No newline at end of file diff --git a/frameworks/tensorflow/2.21.0/warring_log.png b/frameworks/tensorflow/2.21.0/warring_log.png deleted file mode 100644 index 1461c0cedad8d45c8d32554de19c341ba88d37bc..0000000000000000000000000000000000000000 Binary files a/frameworks/tensorflow/2.21.0/warring_log.png and /dev/null differ diff --git a/frameworks/transformers/5.5.0/Dockerfile b/frameworks/transformers/5.5.0/Dockerfile deleted file mode 100644 index c316b8e5b345cec693410f1bfc3ffb11233f22a9..0000000000000000000000000000000000000000 --- a/frameworks/transformers/5.5.0/Dockerfile +++ /dev/null @@ -1,19 +0,0 @@ - -FROM opencloudos/opencloudos9-cuda-devel:12.8 - -LABEL maintainer="stronking 363133710@qq.com" -LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" -LABEL org.opencontainers.image.description="Transformers 5.5.0 (GPU) on OpenCloudOS 9" - -ENV NVIDIA_VISIBLE_DEVICES=all \ - PYTHONUNBUFFERED=1 \ - PIP_DISABLE_PIP_VERSION_CHECK=1 \ - PIP_DEFAULT_TIMEOUT=120 - - -WORKDIR /home - -RUN --mount=type=cache,id=pip-cache-opencloudos9-cu128,target=/root/.cache/pip \ - pip install "transformers[torch]==5.5.0" - -RUN ["python3"] \ No newline at end of file diff --git a/frameworks/transformers/5.5.0/README.md b/frameworks/transformers/5.5.0/README.md deleted file mode 100644 index 86f19f6ee58d85afc4df1964fddd637d4f757cee..0000000000000000000000000000000000000000 --- a/frameworks/transformers/5.5.0/README.md +++ /dev/null @@ -1,20 +0,0 @@ -# Transformers 5.5.0 on OpenCloudOS 9 - -## 基本信息 -- **框架版本**:v5.5.0 -- **基础镜像**:opencloudos9-cuda-devel:12.8 -- **Python 版本**:3.11 -- **CUDA 版本**: 12.x 或 更高 - -## 构建 - -docker build -t oc9-transformers:5.5.0 . - -## 镜像启动命令 - -docker run -d --gpus all --name oc9-transformers oc9-transformers:5.5.0 - -## 镜像测试命令 - -docker run --rm --gpus all oc9-transformers:5.5.0 bash test.sh - diff --git a/frameworks/transformers/5.5.0/build.conf b/frameworks/transformers/5.5.0/build.conf deleted file mode 100644 index 347fa33f2090cfa71e8b61669fe582c3faf89527..0000000000000000000000000000000000000000 --- a/frameworks/transformers/5.5.0/build.conf +++ /dev/null @@ -1,4 +0,0 @@ -# transformers 5.5.0 on OpenCloudOS 9 (GPU) -IMAGE_NAME=oc9-transformers -IMAGE_TAG=5.5.0 -GPU_TEST=true \ No newline at end of file diff --git a/frameworks/transformers/5.5.0/test.sh b/frameworks/transformers/5.5.0/test.sh deleted file mode 100644 index 14a9b3cca48726a87a47177059c1c50aeccb6abe..0000000000000000000000000000000000000000 --- a/frameworks/transformers/5.5.0/test.sh +++ /dev/null @@ -1,233 +0,0 @@ -#!/usr/bin bash -# 在容器外执行:验证指定 Docker 镜像中的 transformers / torch / CUDA 基础功能。 -# 用法:bash test_transformers_docker.sh [额外 docker run 参数...] -# 示例:bash test_transformers_docker.sh my-transformers:latest -# 示例:REQUIRE_CUDA=0 bash test_transformers_docker.sh my-transformers:latest -# 示例:DOCKER_NETWORK=bridge bash test_transformers_docker.sh my-transformers:latest - -set -Eeuo pipefail - -IMAGE="${1:-}" -if [[ -z "${IMAGE}" || "${IMAGE}" == "-h" || "${IMAGE}" == "--help" ]]; then - cat <<'USAGE' -用法: - bash test_transformers_docker.sh [额外 docker run 参数...] - -环境变量: - REQUIRE_CUDA=1|0 是否强制要求 CUDA/GPU 可用,默认 1 - GPUS=all 传给 docker run --gpus 的值,默认 all - PYTHON_BIN=python3 容器内 Python 命令,默认 python3 - DOCKER_NETWORK=none docker 网络模式,默认 none,避免测试时联网下载模型 - TIMEOUT_SECONDS=180 整体测试超时时间,默认 180 秒 - -示例: - bash test_transformers_docker.sh registry.example.com/ai/transformers:cu121 - REQUIRE_CUDA=0 bash test_transformers_docker.sh transformers-cpu:test - DOCKER_NETWORK=bridge bash test_transformers_docker.sh my-image:tag --ipc=host -USAGE - exit 1 -fi -shift || true - -REQUIRE_CUDA="${REQUIRE_CUDA:-1}" -GPUS="${GPUS:-all}" -PYTHON_BIN="${PYTHON_BIN:-python3}" -DOCKER_NETWORK="${DOCKER_NETWORK:-none}" -TIMEOUT_SECONDS="${TIMEOUT_SECONDS:-180}" -EXTRA_DOCKER_ARGS=("$@") - -log() { printf '\033[1;34m%s\033[0m\n' "$*"; } -ok() { printf '\033[1;32m✓ %s\033[0m\n' "$*"; } -warn() { printf '\033[1;33m! %s\033[0m\n' "$*"; } -fail() { printf '\033[1;31m✗ %s\033[0m\n' "$*" >&2; exit 1; } - -[[ "${REQUIRE_CUDA}" =~ ^[01]$ ]] || fail "REQUIRE_CUDA 只能是 1 或 0,当前值: ${REQUIRE_CUDA}" - -command -v docker >/dev/null 2>&1 || fail "未找到 docker 命令" -docker info >/dev/null 2>&1 || fail "docker daemon 不可用,请确认 Docker 服务已启动且当前用户有权限访问" - -if ! docker image inspect "${IMAGE}" >/dev/null 2>&1; then - warn "本地未找到镜像 ${IMAGE};docker run 可能会尝试拉取镜像" -fi - -DOCKER_ARGS=(run --rm -i) -if [[ "${REQUIRE_CUDA}" == "1" ]]; then - DOCKER_ARGS+=(--gpus "${GPUS}") -fi -DOCKER_ARGS+=( - --network "${DOCKER_NETWORK}" - -e "REQUIRE_CUDA=${REQUIRE_CUDA}" - -e "PYTHON_BIN=${PYTHON_BIN}" - -e "TRANSFORMERS_OFFLINE=1" - -e "HF_HUB_OFFLINE=1" - -e "HF_HOME=/tmp/hf-home" -) -DOCKER_ARGS+=("${EXTRA_DOCKER_ARGS[@]}") -DOCKER_ARGS+=("${IMAGE}" /bin/bash -s) - -log "=== Transformers Docker 镜像功能测试 ===" -printf '镜像: %s\n' "${IMAGE}" -printf 'CUDA 强制检查: %s\n' "${REQUIRE_CUDA}" -printf 'Docker 网络: %s\n' "${DOCKER_NETWORK}" -printf 'Python 命令: %s\n' "${PYTHON_BIN}" -if ((${#EXTRA_DOCKER_ARGS[@]} > 0)); then - printf '额外 docker 参数: %s\n' "${EXTRA_DOCKER_ARGS[*]}" -fi - -RUN_CMD=(docker "${DOCKER_ARGS[@]}") -if command -v timeout >/dev/null 2>&1; then - RUN_CMD=(timeout --preserve-status "${TIMEOUT_SECONDS}s" "${RUN_CMD[@]}") -fi - -"${RUN_CMD[@]}" <<'IN_CONTAINER' -set -Eeuo pipefail - -ok() { printf '\033[1;32m✓ %s\033[0m\n' "$*"; } -warn() { printf '\033[1;33m! %s\033[0m\n' "$*"; } -fail() { printf '\033[1;31m✗ %s\033[0m\n' "$*" >&2; exit 1; } -section() { printf '\n\033[1;34m=== %s ===\033[0m\n' "$*"; } - -PY="${PYTHON_BIN:-python3}" - -if [[ -d /usr/local/cuda ]]; then - export CUDA_HOME="${CUDA_HOME:-/usr/local/cuda}" - export PATH="${CUDA_HOME}/bin:${PATH}" - export LD_LIBRARY_PATH="${CUDA_HOME}/lib64:${LD_LIBRARY_PATH:-}" -fi - -export TRANSFORMERS_OFFLINE="${TRANSFORMERS_OFFLINE:-1}" -export HF_HUB_OFFLINE="${HF_HUB_OFFLINE:-1}" -export HF_HOME="${HF_HOME:-/tmp/hf-home}" -mkdir -p "${HF_HOME}" - -section "1. Python 基础检查" -command -v "${PY}" >/dev/null 2>&1 || fail "容器内未找到 Python 命令: ${PY}" -"${PY}" --version -ok "Python 可用" - -section "2. Python 包导入检查" -"${PY}" - <<'PY' -import importlib -import platform -import sys - -packages = ["torch", "transformers", "tokenizers"] -print("python_executable:", sys.executable) -print("platform:", platform.platform()) - -for name in packages: - mod = importlib.import_module(name) - version = getattr(mod, "__version__", "unknown") - print(f"{name}: {version}") -PY -ok "torch / transformers / tokenizers 导入正常" - -section "3. CUDA / GPU 检查" -if [[ "${REQUIRE_CUDA:-1}" == "1" ]]; then - command -v nvidia-smi >/dev/null 2>&1 || fail "nvidia-smi 不可用;请检查宿主机 NVIDIA 驱动、nvidia-container-toolkit、docker run --gpus 参数" - nvidia-smi --query-gpu=name,driver_version,memory.total --format=csv,noheader || fail "nvidia-smi 执行失败" - - "${PY}" - <<'PY' -import torch - -assert torch.cuda.is_available(), "torch.cuda.is_available() 为 False" -print("torch_cuda_version:", torch.version.cuda) -print("gpu_count:", torch.cuda.device_count()) -print("gpu_0_name:", torch.cuda.get_device_name(0)) - -x = torch.randn(512, 512, device="cuda") -y = x @ x -torch.cuda.synchronize() -print("gpu_matmul_shape:", tuple(y.shape)) -PY - ok "CUDA / GPU 可用,且 torch GPU 计算正常" -else - warn "REQUIRE_CUDA=0,跳过强制 CUDA 检查" -fi - -section "4. Transformers 离线功能检查:tokenizer + model forward + save/load + pipeline" -"${PY}" - <<'PY' -import os -import tempfile -import torch -from transformers import ( - AutoModel, - BertConfig, - BertForMaskedLM, - BertTokenizerFast, - pipeline, -) - -require_cuda = os.environ.get("REQUIRE_CUDA", "1") == "1" -device = torch.device("cuda:0" if require_cuda else "cpu") - -with tempfile.TemporaryDirectory() as tmp_dir: - vocab_path = os.path.join(tmp_dir, "vocab.txt") - with open(vocab_path, "w", encoding="utf-8") as f: - f.write("\n".join([ - "[PAD]", "[UNK]", "[CLS]", "[SEP]", "[MASK]", - "hello", "world", "!", "transformers", "test", "good", - ])) - - tokenizer = BertTokenizerFast(vocab_file=vocab_path, do_lower_case=True) - encoded = tokenizer("hello world !", return_tensors="pt", padding=True, truncation=True) - - config = BertConfig( - vocab_size=tokenizer.vocab_size, - hidden_size=32, - num_hidden_layers=1, - num_attention_heads=4, - intermediate_size=64, - max_position_embeddings=64, - ) - - model = AutoModel.from_config(config).to(device).eval() - encoded_on_device = {k: v.to(device) for k, v in encoded.items()} - with torch.no_grad(): - outputs = model(**encoded_on_device) - - assert outputs.last_hidden_state.shape[0] == 1 - assert outputs.last_hidden_state.shape[-1] == 32 - print("forward_device:", str(device)) - print("tokenizer_vocab_size:", tokenizer.vocab_size) - print("last_hidden_state_shape:", tuple(outputs.last_hidden_state.shape)) - - save_dir = os.path.join(tmp_dir, "tiny-bert") - model.save_pretrained(save_dir) - tokenizer.save_pretrained(save_dir) - - loaded = AutoModel.from_pretrained(save_dir, local_files_only=True).to(device).eval() - with torch.no_grad(): - loaded_outputs = loaded(**encoded_on_device) - - assert loaded_outputs.last_hidden_state.shape == outputs.last_hidden_state.shape - print("local_save_load: ok") - - mlm = BertForMaskedLM(config).to(device).eval() - fill_mask = pipeline( - "fill-mask", - model=mlm, - tokenizer=tokenizer, - device=0 if device.type == "cuda" else -1, - top_k=1, - ) - - result = fill_mask("hello [MASK] !") - assert isinstance(result, list) and len(result) == 1 - assert "token_str" in result[0] - print("pipeline_fill_mask_token:", result[0]["token_str"]) -PY -ok "Transformers 离线核心功能正常" - -section "5. 可选组件提示" -if command -v nvcc >/dev/null 2>&1; then - nvcc --version | sed -n '1,4p' -else - warn "未检测到 nvcc:运行时镜像通常不需要 nvcc,只有编译 CUDA 扩展时才需要" -fi - -section "测试结果" -ok "所有检查通过" -IN_CONTAINER - -ok "宿主机侧 docker run 验证完成" \ No newline at end of file diff --git a/frameworks/transformers/5.5.0/test_result.png b/frameworks/transformers/5.5.0/test_result.png deleted file mode 100644 index b34c3c9b6d669deaef4c9c9fb2180fa18c280991..0000000000000000000000000000000000000000 Binary files a/frameworks/transformers/5.5.0/test_result.png and /dev/null differ