diff --git a/test/compose/ai/docker-compose.yml b/test/compose/ai/docker-compose.yml index 08e5c3a..e96a41e 100644 --- a/test/compose/ai/docker-compose.yml +++ b/test/compose/ai/docker-compose.yml @@ -2,14 +2,13 @@ volumes: open_webui: {} chromadb: {} - ollama: {} services: open_webui: image: ghcr.io/open-webui/open-webui:main depends_on: - chromadb - - ollama + # - ollama environment: - CHROMA_HTTP_PORT=8000 - CHROMA_HTTP_HOST=chromadb @@ -28,6 +27,8 @@ services: - open_webui:/app/backend/data ports: - "8080:8080" + extra_hosts: + - "host.docker.internal:host-gateway" chromadb: hostname: chromadb @@ -40,18 +41,3 @@ services: - PERSIST_DIRECTORY=/chroma/chroma ports: - "8000:8000" - - ollama: - image: ollama/ollama:latest - hostname: ollama - volumes: - - ollama:/root/.ollama - ports: - - "11434:11434" - deploy: - resources: - reservations: - devices: - - driver: nvidia - count: all - capabilities: [gpu] diff --git a/test/container/openwebui/dockerfile b/test/container/openwebui/dockerfile new file mode 100644 index 0000000..4e71d47 --- /dev/null +++ b/test/container/openwebui/dockerfile @@ -0,0 +1,28 @@ +--- +volumes: + ollama: {} + +services: + ollama: + container_name: ollama + image: ollama/ollama:latest + hostname: ollama + runtime: nvidia + devices: + - nvidia.com/gpu=all + environment: + - NVIDIA_VISIBLE_DEVICES=all + - NVIDIA_DRIVER_CAPABILITIES=compute,utility + - CUDA_VISIBLE_DEVICES=0 + - LOG_LEVEL=debug + volumes: + - ai_ollama:/root/.ollama + ports: + - "11434:11434" + deploy: + resources: + reservations: + devices: + - driver: nvidia + count: all + capabilities: [gpu] \ No newline at end of file diff --git a/test/image/Dockerfile b/test/image/Dockerfile new file mode 100644 index 0000000..d0d9ba6 --- /dev/null +++ b/test/image/Dockerfile @@ -0,0 +1,25 @@ +# Use the CentOS 7 based CUDA image +FROM nvidia/cuda:11.3.1-base-centos7 + +# Set the working directory +WORKDIR /opt/ollama + +# Update the system and install necessary packages. CentOS 7 uses yum. +# Note: The '--nogpgcheck' option can be used if you face GPG key issues, but it's better to resolve these properly. +RUN yum update -y && \ + yum install -y curl + +# Download and install Ollama +RUN curl -L https://ollama.com/download/ollama-linux-amd64 -o /usr/bin/ollama && \ + chmod +x /usr/bin/ollama + +ENV LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64 +ENV NVIDIA_DRIVER_CAPABILITIES=compute,utility +ENV NVIDIA_VISIBLE_DEVICES=all +ENV OLLAMA_HOST=0.0.0.0:11434 +EXPOSE 11434 +# Set the entrypoint +ENTRYPOINT [ "/usr/bin/ollama" ] + +# Default command +CMD ["serve"] \ No newline at end of file