-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
8 changed files
with
165 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# Define the CUDA SDK version you need | ||
ARG CUDA_IMAGE="12.1.1-devel-ubuntu22.04" | ||
FROM nvidia/cuda:${CUDA_IMAGE} | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
WORKDIR /app | ||
|
||
RUN apt-get update && apt-get upgrade -y \ | ||
&& apt-get install -y git build-essential \ | ||
python3 python3-pip python3.10-venv libpq-dev gcc wget \ | ||
ocl-icd-opencl-dev opencl-headers clinfo \ | ||
libclblast-dev libopenblas-dev \ | ||
&& mkdir -p /etc/OpenCL/vendors && echo "libnvidia-opencl.so.1" > /etc/OpenCL/vendors/nvidia.icd | ||
|
||
# Create a virtual environment and activate it | ||
RUN python3 -m venv /opt/venv | ||
ENV PATH="/opt/venv/bin:$PATH" | ||
|
||
# Install Python dependencies from requirements.txt | ||
COPY requirements.txt . | ||
RUN pip install --upgrade pip && \ | ||
pip install --no-cache-dir -r requirements.txt | ||
|
||
# Running nltk setup as you mentioned | ||
RUN python3.10 -c "import nltk; nltk.download('punkt')" && \ | ||
python3.10 -c "import nltk; nltk.download('averaged_perceptron_tagger')" | ||
|
||
# Copy the application code | ||
COPY . . | ||
|
||
ENV CUDA_DOCKER_ARCH=all | ||
ENV LLAMA_CUBLAS=1 | ||
|
||
RUN CMAKE_ARGS="-DLLAMA_CUBLAS=on" pip install llama-cpp-python==0.2.7 --force-reinstall --upgrade --no-cache-dir | ||
|
||
# Make necessary scripts executable | ||
RUN chmod +x ./entrypoint.sh ./wait-for-it.sh ./install_tool_dependencies.sh ./entrypoint_celery.sh | ||
|
||
# Set environment variable to point to the custom libllama.so | ||
# ENV LLAMA_CPP_LIB=/app/llama.cpp/libllama.so | ||
|
||
EXPOSE 8001 | ||
|
||
CMD ["./entrypoint.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,97 @@ | ||
version: '3.8' | ||
services: | ||
backend: | ||
volumes: | ||
- "./:/app" | ||
- "/home/ubuntu/models/vicuna-7B-v1.5-GGUF/vicuna-7b-v1.5.Q5_K_M.gguf:/app/local_model_path" | ||
build: | ||
context: . | ||
dockerfile: Dockerfile-gpu | ||
depends_on: | ||
- super__redis | ||
- super__postgres | ||
networks: | ||
- super_network | ||
command: ["/app/wait-for-it.sh", "super__postgres:5432","-t","60","--","/app/entrypoint.sh"] | ||
deploy: | ||
resources: | ||
reservations: | ||
devices: | ||
- driver: nvidia | ||
count: all | ||
capabilities: [gpu] | ||
|
||
celery: | ||
volumes: | ||
- "./:/app" | ||
- "${EXTERNAL_RESOURCE_DIR:-./workspace}:/app/ext" | ||
- "/home/ubuntu/models/vicuna-7B-v1.5-GGUF/vicuna-7b-v1.5.Q5_K_M.gguf:/app/local_model_path" | ||
build: | ||
context: . | ||
dockerfile: Dockerfile-gpu | ||
depends_on: | ||
- super__redis | ||
- super__postgres | ||
networks: | ||
- super_network | ||
command: ["/app/entrypoint_celery.sh"] | ||
deploy: | ||
resources: | ||
reservations: | ||
devices: | ||
- driver: nvidia | ||
count: all | ||
capabilities: [gpu] | ||
gui: | ||
build: | ||
context: ./gui | ||
args: | ||
NEXT_PUBLIC_API_BASE_URL: "/api" | ||
networks: | ||
- super_network | ||
# volumes: | ||
# - ./gui:/app | ||
# - /app/node_modules/ | ||
# - /app/.next/ | ||
super__redis: | ||
image: "redis/redis-stack-server:latest" | ||
networks: | ||
- super_network | ||
# uncomment to expose redis port to host | ||
# ports: | ||
# - "6379:6379" | ||
volumes: | ||
- redis_data:/data | ||
|
||
super__postgres: | ||
image: "docker.io/library/postgres:15" | ||
environment: | ||
- POSTGRES_USER=superagi | ||
- POSTGRES_PASSWORD=password | ||
- POSTGRES_DB=super_agi_main | ||
volumes: | ||
- superagi_postgres_data:/var/lib/postgresql/data/ | ||
networks: | ||
- super_network | ||
# uncomment to expose postgres port to host | ||
# ports: | ||
# - "5432:5432" | ||
|
||
proxy: | ||
image: nginx:stable-alpine | ||
ports: | ||
- "3000:80" | ||
networks: | ||
- super_network | ||
depends_on: | ||
- backend | ||
- gui | ||
volumes: | ||
- ./nginx/default.conf:/etc/nginx/conf.d/default.conf | ||
|
||
networks: | ||
super_network: | ||
driver: bridge | ||
volumes: | ||
superagi_postgres_data: | ||
redis_data: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters