From e9f68d3bf36d7ff720d960c52f809d6fcc9cd759 Mon Sep 17 00:00:00 2001 From: fengbeihong Date: Fri, 1 May 2026 22:34:18 +0800 Subject: [PATCH] feat: add chroma 1.5.5 container image for OC9 --- frameworks/chromadb/1.5.5/Dockerfile | 10 +++++++ frameworks/chromadb/1.5.5/README.md | 17 +++++++++++ frameworks/chromadb/1.5.5/build.conf | 4 +++ frameworks/chromadb/1.5.5/test.sh | 42 ++++++++++++++++++++++++++++ 4 files changed, 73 insertions(+) create mode 100644 frameworks/chromadb/1.5.5/Dockerfile create mode 100644 frameworks/chromadb/1.5.5/README.md create mode 100644 frameworks/chromadb/1.5.5/build.conf create mode 100644 frameworks/chromadb/1.5.5/test.sh diff --git a/frameworks/chromadb/1.5.5/Dockerfile b/frameworks/chromadb/1.5.5/Dockerfile new file mode 100644 index 0000000..45594e9 --- /dev/null +++ b/frameworks/chromadb/1.5.5/Dockerfile @@ -0,0 +1,10 @@ +FROM opencloudos/opencloudos9-minimal:latest + +LABEL maintainer="fengbeihong fengbeihong@gmail.com" +LABEL org.opencontainers.image.source="https://gitee.com/OpenCloudOS/ai-agent-container" +LABEL org.opencontainers.image.description="chromadb on OpenCloudOS 9" + +RUN dnf install -y python3.11 python3.11-pip && dnf clean all +RUN pip3.11 install chromadb==1.5.5 + +CMD ["python3.11"] \ No newline at end of file diff --git a/frameworks/chromadb/1.5.5/README.md b/frameworks/chromadb/1.5.5/README.md new file mode 100644 index 0000000..29b1f81 --- /dev/null +++ b/frameworks/chromadb/1.5.5/README.md @@ -0,0 +1,17 @@ +# chromadb on OpenCloudOS 9 + +## 基本信息 +- **框架版本**:1.5.5 +- **基础镜像**:opencloudos9-minimal +- **Python 版本**:3.11 +- **CUDA 版本**:N/A + +## 构建 + +docker build -t oc9-chromadb:1.5.5 . + +## 使用示例 + +docker run --rm oc9-chromadb:1.5.5 python3 -c "import chromadb; print(chromadb.__version__)" + +## 已知问题 diff --git a/frameworks/chromadb/1.5.5/build.conf b/frameworks/chromadb/1.5.5/build.conf new file mode 100644 index 0000000..a8a6cae --- /dev/null +++ b/frameworks/chromadb/1.5.5/build.conf @@ -0,0 +1,4 @@ +# chromadb 1.5.5 on OpenCloudOS 9 +IMAGE_NAME="oc9-chromadb" +IMAGE_TAG=1.5.5 +GPU_TEST=false \ No newline at end of file diff --git a/frameworks/chromadb/1.5.5/test.sh b/frameworks/chromadb/1.5.5/test.sh new file mode 100644 index 0000000..78942d1 --- /dev/null +++ b/frameworks/chromadb/1.5.5/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +set -e + +IMAGE="${1:?ERROR: 缺少镜像参数。用法: bash test.sh }" + +echo "=== 基础功能测试 ===" + +# 1. 验证框架可正常导入 +echo -n "检查 import... " +sudo docker run --rm "$IMAGE" python3 -c "import chromadb; print(chromadb.__version__)" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } + +# 2. 验证核心功能(按框架实际情况编写) +echo -n "检查核心功能... " +sudo docker run --rm "$IMAGE" python3 -c " +import chromadb +client = chromadb.Client() +collection = client.create_collection(name='test_demo_collection') +collection.add( + documents=[ + '我喜欢吃苹果', + '我喜欢喝牛奶', + '今天天气很好', + '学习编程很有趣' + ], + metadatas=[ + {'category': 'food'}, + {'category': 'food'}, + {'category': 'weather'}, + {'category': 'study'} + ], + ids=['id1', 'id2', 'id3', 'id4'] +) +results = collection.query( + query_texts=['我想吃水果'], + n_results=2 +) +assert results['documents'][0][0] == '我喜欢吃苹果' + +print('核心功能正常') +" && echo "✓ 通过" || { echo "✗ 失败"; exit 1; } + +echo "=== 所有测试通过 ===" \ No newline at end of file -- Gitee