milvus-io / milvus

A cloud-native vector database, storage for next generation AI applications
https://milvus.io
Apache License 2.0
28.13k stars 2.71k forks source link

[Bug]: Run Milvus with GPU Support Using Docker Compose,After modifying the yaml file, an error message appears: docker-compose.yml: services.standalone Additional property gpu is not allowed #33903

Open youqugit opened 2 weeks ago

youqugit commented 2 weeks ago

Is there an existing issue for this?

Environment

- Milvus version:2.4.4
- Deployment mode(standalone or cluster):
- MQ type(rocksmq, pulsar or kafka):    
- SDK version(e.g. pymilvus v2.0.0rc2):
- OS(Ubuntu or CentOS): 
- CPU/Memory: 
- GPU: 
- Others:

Current Behavior

When I refer to the official document Run Milvus with GPU Support Using Docker Compose, I modified the yaml file to configure

gpu:
    initMemSize:
    maxMemSize:

I execute this command docker compose up -d. Then I encountered an error: validating milvus_deploy/docker-compose.yml: services.standalone Additional property gpu is not allowed

Below is the yaml file I modified:

version: '3.5'

services:
  etcd:
    container_name: milvus-etcd
    image: m.daocloud.io/quay.io/coreos/etcd:v3.5.5
    environment:
      - ETCD_AUTO_COMPACTION_MODE=revision
      - ETCD_AUTO_COMPACTION_RETENTION=1000
      - ETCD_QUOTA_BACKEND_BYTES=4294967296
      - ETCD_SNAPSHOT_COUNT=50000
    volumes:
      - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/etcd:/etcd
    command: etcd -advertise-client-urls=http://127.0.0.1:2389 -listen-client-urls http://0.0.0.0:2389 --data-dir /etcd
    healthcheck:
      test: [ "CMD", "etcdctl", "endpoint", "health" ]
      interval: 30s
      timeout: 20s
      retries: 3

  minio:
    container_name: milvus-minio
    image: m.daocloud.io/docker.io/minio/minio:RELEASE.2024-03-26T22-10-45Z
    environment:
      MINIO_ACCESS_KEY: minioadmin
      MINIO_SECRET_KEY: minioadmin
    ports:
      - "9001:9001"
      - "9000:9000"
    volumes:
      - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/minio:/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

  standalone:
    gpu:
      initMemSize: 5120
      maxMemSize: 10240
    container_name: milvus-standalone
    image: m.daocloud.io/docker.io/milvusdb/milvus:v2.4.4-gpu
    command: [ "milvus", "run", "standalone" ]
    security_opt:
      - seccomp:unconfined
    environment:
      ETCD_ENDPOINTS: etcd:2389
      MINIO_ADDRESS: minio:9000
    volumes:
      - ${DOCKER_VOLUME_DIRECTORY:-.}/volumes/milvus:/var/lib/milvus
    ports:
      - "3005:19530"
      - "9091:9091"
    deploy:
      resources:
        reservations:
          devices:
            - driver: nvidia
              capabilities: [ "gpu" ]
              device_ids: [ "0", "1", "2" ]
    depends_on:
      - "etcd"
      - "minio"

networks:
  default:
    name: milvus

Expected Behavior

Correctly configure initMemSize maxMemSize: parameters

Steps To Reproduce

No response

Milvus Log

No response

Anything else?

No response

yanliang567 commented 2 weeks ago

@youqugit I don't think docker compose supports the following configs. please retry after remove the configs below

gpu:
      initMemSize: 5120
      maxMemSize: 10240

/assign @youqugit /unassign

youqugit commented 2 weeks ago

@youqugit �I don't think docker compose supports the following configs. please retry after remove the configs below

gpu:
      initMemSize: 5120
      maxMemSize: 10240

/assign @youqugit /unassign

Thank you, where should I write the configuration shown in the picture below?

4772A903-FF12-4f34-B73B-6EAB0C7036E1
yanliang567 commented 2 weeks ago

/assign @Presburger please help to take a look /unassign

yanliang567 commented 2 weeks ago

@youqugit it is a document bug, we will update the doc immediately. For docker compose deployment, please remove the configs below in docker compose yaml.

gpu:
      initMemSize: 5120
      maxMemSize: 10240
youqugit commented 2 weeks ago

@youqugit it is a document bug, we will update the doc immediately. For docker compose deployment, please remove the configs below in docker compose yaml.

gpu:
      initMemSize: 5120
      maxMemSize: 10240

I have successfully deployed Milvus, but I would still like to know how to modify the configuration. I will wait for your documentation to be updated. In the meantime, can I refer to the "Configure Milvus with Docker Compose" section for configuration modifications?

Presburger commented 2 weeks ago

@youqugit hi, In Milvus version 2.4.1 and later (excluding 2.4.1), the memory pool settings only need to be set to a smaller value. The memory pool will only be used for the allocation of temporary variables during searches. Index loading will not go through the memory pool, which can effectively improve memory utilization. This also makes it easier to monitor memory usage. version <=2.4.1

gpu:
      initMemSize: 0
      maxMemSize: 0

will automatic use half gpu mem for init and all for max.

version>2.4.1

gpu:
      initMemSize: 1024
      maxMemSize: 2048