diff --git a/src/docker-registry/README.zh.md b/src/docker-registry/README.zh.md new file mode 100644 index 0000000..b8bd3a3 --- /dev/null +++ b/src/docker-registry/README.zh.md @@ -0,0 +1,14 @@ +# Docker 镜像仓库 + +请参考教程 [搭建私有 Docker 镜像仓库](https://docs.alexsun.top/public/ops/docker/docker-registry/)。 + +需要先 [给服务器生成一张证书](https://docs.alexsun.top/public/blog/2024-06/certs-maker.html),然后将证书放到服务器上的 `certs/` 文件夹下面,请使用 PEM 格式的证书。 + +配置 `.env` 文件: + +```bash +REGISTRY_HTTP_TLS_CERTIFICATE=xxxxxx.crt +REGISTRY_HTTP_TLS_KEY=xxxxxx.key +``` + +使用 `OTEL_TRACES_EXPORTER=none` 停用观测。 diff --git a/src/docker-registry/config.yml b/src/docker-registry/config.yml new file mode 100644 index 0000000..f768136 --- /dev/null +++ b/src/docker-registry/config.yml @@ -0,0 +1,27 @@ +version: 0.1 +log: + level: debug + fields: + service: registry + environment: development +storage: + delete: + enabled: false # Change to true to enable deletion of images + cache: + blobdescriptor: inmemory + filesystem: + rootdirectory: /var/lib/registry + tag: + concurrencylimit: 5 +http: + addr: :5000 + debug: + addr: :5001 + prometheus: + enabled: true + path: /metrics +health: + storagedriver: + enabled: true + interval: 10s + threshold: 3 diff --git a/src/docker-registry/docker-compose.yaml b/src/docker-registry/docker-compose.yaml new file mode 100644 index 0000000..e010662 --- /dev/null +++ b/src/docker-registry/docker-compose.yaml @@ -0,0 +1,40 @@ +x-default: &default + restart: unless-stopped + volumes: + - &localtime /etc/localtime:/etc/localtime:ro + - &timezone /etc/timezone:/etc/timezone:ro + logging: + driver: json-file + options: + max-size: 100m + +services: + registry: + <<: *default + image: registry:${REGISTRY_VERSION:-3.0.0} + volumes: + - *localtime + - *timezone + - ./certs:/certs:ro + - ./config.yml:/etc/distribution/config.yml:ro + - registry:/var/lib/registry + environment: + REGISTRY_AUTH: ${REGISTRY_AUTH:-htpasswd} + REGISTRY_AUTH_HTPASSWD_REALM: ${REGISTRY_AUTH_HTPASSWD_REALM:-Registry Realm} + REGISTRY_AUTH_HTPASSWD_PATH: ${REGISTRY_AUTH_HTPASSWD_PATH:-/certs/passwd} + REGISTRY_HTTP_TLS_CERTIFICATE: ${REGISTRY_HTTP_TLS_CERTIFICATE} + REGISTRY_HTTP_TLS_KEY: ${REGISTRY_HTTP_TLS_KEY} + OTEL_TRACES_EXPORTER: ${OTEL_TRACES_EXPORTER:-none} + ports: + - ${REGISTRY_PORT:-5000}:5000 + deploy: + resources: + limits: + cpus: '1.0' + memory: 1G + reservations: + cpus: '0.1' + memory: 128M + +volumes: + registry: diff --git a/src/milvus-standalone-embed/docker-compose.yaml b/src/milvus-standalone-embed/docker-compose.yaml index 0d6c55f..603c207 100644 --- a/src/milvus-standalone-embed/docker-compose.yaml +++ b/src/milvus-standalone-embed/docker-compose.yaml @@ -27,9 +27,9 @@ services: - ./embed_etcd.yaml:/milvus/configs/embed_etcd.yaml - ./user.yaml:/milvus/configs/user.yaml ports: - - "${MILVUS_PORT_HTTP:-19530}:19530" - - "${MILVUS_PORT_WEBUI:-9091}:9091" - - "${MILVUS_PORT_ETCD:-2379}:2379" + - "${MILVUS_PORT_OVERRIDE_HTTP:-19530}:19530" + - "${MILVUS_PORT_OVERRIDE_WEBUI:-9091}:9091" + - "${MILVUS_PORT_OVERRIDE_ETCD:-2379}:2379" healthcheck: test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"] interval: 30s @@ -40,10 +40,10 @@ services: deploy: resources: limits: - cpus: '2' + cpus: '2.0' memory: 4G reservations: - cpus: '1' + cpus: '1.0' memory: 2G attu: @@ -54,7 +54,7 @@ services: environment: - MILVUS_URL=${MILVUS_URL:-milvus-standalone-embed:19530} ports: - - "${ATTU_PORT:-8000}:3000" + - "${ATTU_OVERRIDE_PORT:-8000}:3000" deploy: resources: limits: diff --git a/src/milvus-standalone/README.zh.md b/src/milvus-standalone/README.zh.md new file mode 100644 index 0000000..d4faa17 --- /dev/null +++ b/src/milvus-standalone/README.zh.md @@ -0,0 +1,11 @@ +# Milvus + +Milvus 是一个开源的向量数据库,专为处理大规模向量数据而设计。它支持高效的相似性搜索和分析,广泛应用于机器学习、深度学习和人工智能等领域。 + +```bash +docker compose up -d +``` + +参见 [使用 Docker Compose 运行 Milvus (Linux)](https://milvus.io/docs/zh/install_standalone-docker-compose.md)。 + +如果需要身份验证,请访问 [官方文档](https://milvus.io/docs/zh/authenticate.md) 了解如何配置。 diff --git a/src/milvus-standalone/docker-compose.yaml b/src/milvus-standalone/docker-compose.yaml new file mode 100644 index 0000000..c36fae9 --- /dev/null +++ b/src/milvus-standalone/docker-compose.yaml @@ -0,0 +1,120 @@ +x-default: &default + restart: unless-stopped + volumes: + - &localtime /etc/localtime:/etc/localtime:ro + - &timezone /etc/timezone:/etc/timezone:ro + logging: + driver: json-file + options: + max-size: 100m + +services: + etcd: + <<: *default + image: quay.io/coreos/etcd:${ETCD_VERSION:-v3.5.18} + environment: + - ETCD_AUTO_COMPACTION_MODE=revision + - ETCD_AUTO_COMPACTION_RETENTION=1000 + - ETCD_QUOTA_BACKEND_BYTES=4294967296 + - ETCD_SNAPSHOT_COUNT=50000 + volumes: + - *localtime + - *timezone + - etcd_data:/etcd + command: etcd -advertise-client-urls=http://etcd:2379 -listen-client-urls http://0.0.0.0:2379 --data-dir /etcd + healthcheck: + test: ["CMD", "etcdctl", "endpoint", "health"] + interval: 30s + timeout: 20s + retries: 3 + deploy: + resources: + limits: + cpus: '0.25' + memory: 256M + reservations: + cpus: '0.1' + memory: 128M + + minio: + <<: *default + image: minio/minio:${MINIO_VERSION:-RELEASE.2024-12-18T13-15-44Z} + environment: + MINIO_ACCESS_KEY: ${MINIO_ACCESS_KEY:-minioadmin} + MINIO_SECRET_KEY: ${MINIO_SECRET_KEY:-minioadmin} + ports: + - "${MINIO_PORT_OVERRIDE_WEBUI:-9001}:9001" + - "${MINIO_PORT_OVERRIDE_API:-9000}:9000" + volumes: + - *localtime + - *timezone + - minio_data:/minio_data + command: minio server /minio_data --console-address ":9001" + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9000/minio/health/live"] + interval: 30s + timeout: 20s + retries: 3 + deploy: + resources: + limits: + cpus: '0.5' + memory: 512M + reservations: + cpus: '0.1' + memory: 256M + + milvus-standalone: + <<: *default + image: milvusdb/milvus:${MILVUS_VERSION:-v2.6.2} + command: ["milvus", "run", "standalone"] + security_opt: + - seccomp:unconfined + environment: + ETCD_ENDPOINTS: etcd:2379 + MINIO_ADDRESS: minio:9000 + MQ_TYPE: woodpecker + volumes: + - milvus_data:/var/lib/milvus + healthcheck: + test: ["CMD", "curl", "-f", "http://localhost:9091/healthz"] + interval: 30s + start_period: 90s + timeout: 20s + retries: 3 + ports: + - "${MILVUS_PORT_OVERRIDE_HTTP:-19530}:19530" + - "${MILVUS_PORT_OVERRIDE_WEBUI:-9091}:9091" + depends_on: + - etcd + - minio + deploy: + resources: + limits: + cpus: '2.0' + memory: 4G + reservations: + cpus: '1.0' + memory: 2G + + attu: + <<: *default + image: zilliz/attu:${ATTU_VERSION:-v2.6.0} + profiles: + - attu + environment: + - MILVUS_URL=${MILVUS_URL:-milvus-standalone:19530} + ports: + - "${ATTU_PORT_OVERRIDE:-8000}:3000" + deploy: + resources: + limits: + cpus: '0.25' + memory: 256M + reservations: + cpus: '0.1' + memory: 128M + +volumes: + etcd_data: + minio_data: diff --git a/src/mineru-v2/Dockerfile b/src/mineru-v2/Dockerfile deleted file mode 100644 index d6d1604..0000000 --- a/src/mineru-v2/Dockerfile +++ /dev/null @@ -1,27 +0,0 @@ -# Use the official vllm image for gpu with Ampere architecture and above (Compute Capability>=8.0) -# Compute Capability version query (https://developer.nvidia.com/cuda-gpus) -FROM vllm/vllm-openai:v0.10.1.1 - -# Use the official vllm image for gpu with Turing architecture and below (Compute Capability<8.0) -# FROM vllm/vllm-openai:v0.10.2 - -# Install libgl for opencv support & Noto fonts for Chinese characters -RUN apt-get update && \ - apt-get install -y \ - fonts-noto-core \ - fonts-noto-cjk \ - fontconfig \ - libgl1 && \ - fc-cache -fv && \ - apt-get clean && \ - rm -rf /var/lib/apt/lists/* - -# Install mineru latest -RUN python3 -m pip install -U 'mineru[core]' --break-system-packages && \ - python3 -m pip cache purge - -# Download models and update the configuration file -RUN /bin/bash -c "mineru-models-download -s huggingface -m all" - -# Set the entry point to activate the virtual environment and run the command line tool -ENTRYPOINT ["/bin/bash", "-c", "export MINERU_MODEL_SOURCE=local && exec \"$@\"", "--"] diff --git a/src/mineru-v2/docker-compose.yaml b/src/mineru-v2/docker-compose.yaml index 4ee8ec0..0e04ca1 100644 --- a/src/mineru-v2/docker-compose.yaml +++ b/src/mineru-v2/docker-compose.yaml @@ -36,7 +36,7 @@ services: container_name: mineru-vllm-server profiles: ["vllm-server"] ports: - - ${MINERU_PORT_OVERRIDE_30000:-30000}:30000 + - ${MINERU_PORT_OVERRIDE_VLLM:-30000}:30000 entrypoint: mineru-vllm-server command: - --host 0.0.0.0