From cc8abbe0061b50dd4bc322d5a90f2eac8272d158 Mon Sep 17 00:00:00 2001 From: r0mchik Date: Tue, 3 Jun 2025 18:06:01 +0700 Subject: [PATCH] v0.0.5 --- docker-compose-dev.yaml | 37 --------- docker-compose.yaml | 48 ----------- docker-compose.yaml.save | 51 ------------ web/{ => Dockerfiles}/Dockerfile | 2 +- web/Dockerfiles/Dockerfile-dev | 24 ++++++ web/Dockerfiles/Dockerfile-gpu-cuda126-dev | 24 ++++++ web/Dockerfiles/Dockerfile-gpu-cuda128-dev | 24 ++++++ web/requirements/requirements-gpu-cuda126.txt | 81 +++++++++++++++++++ web/requirements/requirements-gpu-cuda128.txt | 81 +++++++++++++++++++ web/{ => requirements}/requirements.txt | 0 10 files changed, 235 insertions(+), 137 deletions(-) delete mode 100644 docker-compose-dev.yaml delete mode 100644 docker-compose.yaml delete mode 100644 docker-compose.yaml.save rename web/{ => Dockerfiles}/Dockerfile (92%) create mode 100644 web/Dockerfiles/Dockerfile-dev create mode 100644 web/Dockerfiles/Dockerfile-gpu-cuda126-dev create mode 100644 web/Dockerfiles/Dockerfile-gpu-cuda128-dev create mode 100644 web/requirements/requirements-gpu-cuda126.txt create mode 100644 web/requirements/requirements-gpu-cuda128.txt rename web/{ => requirements}/requirements.txt (100%) diff --git a/docker-compose-dev.yaml b/docker-compose-dev.yaml deleted file mode 100644 index b088543..0000000 --- a/docker-compose-dev.yaml +++ /dev/null @@ -1,37 +0,0 @@ -services: - web: - build: ./web - container_name: liquid-web-2 - command: > - sh -c "python manage.py collectstatic --noinput && - daphne -b 0.0.0.0 -p 8000 app.asgi:application" - volumes: - - .:/app - - ./web/media:/app/media - - ./web/staticfiles:/app/web/staticfiles - - ports: - - "8000:8000" - - depends_on: - - redis - # - vpn - redis: - image: redis:alpine - container_name: liquid-redis-2 - - volumes: - - redis_data:/data - ports: - - "6378:6378" - healthcheck: - test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ] - interval: 1s - timeout: 3s - retries: 5 - - - -volumes: - redis_data: - diff --git a/docker-compose.yaml b/docker-compose.yaml deleted file mode 100644 index ba21666..0000000 --- a/docker-compose.yaml +++ /dev/null @@ -1,48 +0,0 @@ -services: - web: - container_name: liquid_web - build: ./web - command: > - sh -c "python manage.py collectstatic --noinput && - daphne -b 0.0.0.0 -p 8106 app.asgi:application" - volumes: - - .:/app - - ./web/media:/app/media - - ./web/staticfiles:/app/web/staticfiles - - ports: - - "8106:8106" - - depends_on: - - redis - - restart: always - - # nginx: - # build: ./nginx/dev - # # image: nginx:latest - # ports: - # - "80:80" - # volumes: - # # - ./nginx/nginx.conf:/etc/nginx/nginx.conf - # - ./nginx/nginx/conf.d/nginx.conf:/etc/nginx/conf.d/nginx.conf - # depends_on: - # - web - - # restart: always - - redis: - image: redis:alpine - volumes: - - redis_data:/data - ports: - - "6378:6378" - healthcheck: - test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ] - interval: 1s - timeout: 3s - retries: 5 - restart: always - -volumes: - redis_data: \ No newline at end of file diff --git a/docker-compose.yaml.save b/docker-compose.yaml.save deleted file mode 100644 index 49a1c25..0000000 --- a/docker-compose.yaml.save +++ /dev/null @@ -1,51 +0,0 @@ -services: - web: - build: ./web - command: > - sh -c " - python manage.py collectstatic --noinput - daphne -b 0.0.0.0 -p 8000 app.asgi:application - " - volumes: - - .:/app - - ./media:/app/media - - ./static:/app/staticfiles - - ports: - - '8000:8000' - expose: - - 8000 - depends_on: - - redis - - restart: always - - nginx: - build: ./nginx - ports: - - "80:80" - volumes: - - ./static:/app/static - - ./nginx/nginx.conf:/etc/nginx/conf.d/nginx.conf - depends_on: - - web - - restart: always - - redis: - image: redis:alpine - volumes: - - redis_data:/data - ports: - - "6378:6378" - healthcheck: - test: [ "CMD-SHELL", "redis-cli ping | grep PONG" ] - interval: 1s - timeout: 3s - retries: 5 - - restart: always - -volumes: - redis_data: - diff --git a/web/Dockerfile b/web/Dockerfiles/Dockerfile similarity index 92% rename from web/Dockerfile rename to web/Dockerfiles/Dockerfile index bb294b3..162bf84 100644 --- a/web/Dockerfile +++ b/web/Dockerfiles/Dockerfile @@ -19,7 +19,7 @@ WORKDIR /app/web RUN cd /app/web && mkdir logs -COPY requirements.txt . +COPY requirements/requirements.txt . RUN pip install --no-cache-dir -r requirements.txt COPY . . COPY models ./models \ No newline at end of file diff --git a/web/Dockerfiles/Dockerfile-dev b/web/Dockerfiles/Dockerfile-dev new file mode 100644 index 0000000..7f86f3d --- /dev/null +++ b/web/Dockerfiles/Dockerfile-dev @@ -0,0 +1,24 @@ +FROM nvidia/cuda:12.8.0-cudnn-runtime-ubuntu22.04 + +# Системные зависимости +RUN apt-get update && apt-get install -y --no-install-recommends \ + ffmpeg libgl1 libglib2.0-0 gcc libsm6 libxext6 libxrender-dev \ + python3.11 python3.11-venv python3.11-dev python3-pip \ + && rm -rf /var/lib/apt/lists/* + +# Python 3.11 по умолчанию +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1 && \ + python -m pip install --upgrade pip + +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 + +WORKDIR /app/web + +# requirements +COPY requirements/requirements.txt . +RUN pip install --no-cache-dir -r requirements-gpu-cuda128.txt + +# Копируем всё +# всё из web/ — включая models, app, etc. +COPY . . \ No newline at end of file diff --git a/web/Dockerfiles/Dockerfile-gpu-cuda126-dev b/web/Dockerfiles/Dockerfile-gpu-cuda126-dev new file mode 100644 index 0000000..73608db --- /dev/null +++ b/web/Dockerfiles/Dockerfile-gpu-cuda126-dev @@ -0,0 +1,24 @@ +FROM nvidia/cuda:12.8.0-cudnn-runtime-ubuntu22.04 + +# Системные зависимости +RUN apt-get update && apt-get install -y --no-install-recommends \ + ffmpeg libgl1 libglib2.0-0 gcc libsm6 libxext6 libxrender-dev \ + python3.11 python3.11-venv python3.11-dev python3-pip \ + && rm -rf /var/lib/apt/lists/* + +# Python 3.11 по умолчанию +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1 && \ + python -m pip install --upgrade pip + +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 + +WORKDIR /app/web + +# requirements +COPY requirements/requirements-gpu-cuda126.txt . +RUN pip install --no-cache-dir -r requirements-gpu-cuda128.txt + +# Копируем всё +# всё из web/ — включая models, app, etc. +COPY . . \ No newline at end of file diff --git a/web/Dockerfiles/Dockerfile-gpu-cuda128-dev b/web/Dockerfiles/Dockerfile-gpu-cuda128-dev new file mode 100644 index 0000000..7d3c1bd --- /dev/null +++ b/web/Dockerfiles/Dockerfile-gpu-cuda128-dev @@ -0,0 +1,24 @@ +FROM nvidia/cuda:12.8.0-cudnn-runtime-ubuntu22.04 + +# Системные зависимости +RUN apt-get update && apt-get install -y --no-install-recommends \ + ffmpeg libgl1 libglib2.0-0 gcc libsm6 libxext6 libxrender-dev \ + python3.11 python3.11-venv python3.11-dev python3-pip \ + && rm -rf /var/lib/apt/lists/* + +# Python 3.11 по умолчанию +RUN update-alternatives --install /usr/bin/python python /usr/bin/python3.11 1 && \ + python -m pip install --upgrade pip + +ENV PYTHONDONTWRITEBYTECODE=1 \ + PYTHONUNBUFFERED=1 + +WORKDIR /app/web + +# requirements +COPY requirements/requirements-gpu-cuda128.txt . +RUN pip install --no-cache-dir -r requirements-gpu-cuda128.txt + +# Копируем всё +# всё из web/ — включая models, app, etc. +COPY . . \ No newline at end of file diff --git a/web/requirements/requirements-gpu-cuda126.txt b/web/requirements/requirements-gpu-cuda126.txt new file mode 100644 index 0000000..bf1b64a --- /dev/null +++ b/web/requirements/requirements-gpu-cuda126.txt @@ -0,0 +1,81 @@ +asgiref==3.8.1 +channels==4.2.2 +daphne==4.1.2 +Django==5.2 +python-dotenv==1.1.0 +sqlparse==0.5.3 +whitenoise==6.9.0 +channels_redis==4.2.0 + +# WebSocket and async dependencies +autobahn==24.4.2 +Automat==25.4.16 +constantly==23.10.4 +hyperlink==21.0.0 +incremental==24.7.2 +pyasn1==0.6.1 +pyasn1_modules==0.4.2 +service-identity==24.2.0 +Twisted==24.11.0 +txaio==23.1.1 +zope.interface==7.2 + +# Security and networking +certifi==2025.4.26 +cffi==1.17.1 +charset-normalizer==3.4.2 +cryptography==44.0.3 +idna==3.10 +pyOpenSSL==25.0.0 +requests==2.32.3 +urllib3==2.4.0 + +# Data science and visualization +attrs==25.3.0 +contourpy==1.3.2 +cycler==0.12.1 +fonttools==4.57.0 +kiwisolver==1.4.8 +matplotlib==3.10.1 +numpy==2.2.5 +pandas==2.2.3 +pyparsing==3.2.3 +python-dateutil==2.9.0.post0 +pytz==2025.2 +scipy==1.15.2 +seaborn==0.13.2 +tzdata==2025.2 + +# Computer vision and multimedia +av==14.3.0 +imageio==2.37.0 +imageio-ffmpeg==0.6.0 +moviepy==2.1.2 +opencv-python-headless==4.11.0.86 # Uncommented and fixed +proglog==0.1.11 + +# PyTorch and ML +torch==2.7.0+cu126 +torchvision==0.22.0+cu126 +torchaudio==2.7.0+cu126 +--extra-index-url https://download.pytorch.org/whl/cu126 +ultralytics==8.3.127 +ultralytics-thop==2.0.14 + +# Utilities +colorama==0.4.6 +decorator==5.2.1 +filelock==3.18.0 +fsspec==2025.3.2 +Jinja2==3.1.6 +MarkupSafe==3.0.2 +mpmath==1.3.0 +networkx==3.4.2 +packaging==25.0 +psutil==7.0.0 +py-cpuinfo==9.0.0 +PyYAML==6.0.2 +six==1.17.0 +sympy==1.14.0 +tqdm==4.67.1 +typing_extensions==4.13.2 \ No newline at end of file diff --git a/web/requirements/requirements-gpu-cuda128.txt b/web/requirements/requirements-gpu-cuda128.txt new file mode 100644 index 0000000..21f560a --- /dev/null +++ b/web/requirements/requirements-gpu-cuda128.txt @@ -0,0 +1,81 @@ +asgiref==3.8.1 +channels==4.2.2 +daphne==4.1.2 +Django==5.2 +python-dotenv==1.1.0 +sqlparse==0.5.3 +whitenoise==6.9.0 +channels_redis==4.2.0 + +# WebSocket and async dependencies +autobahn==24.4.2 +Automat==25.4.16 +constantly==23.10.4 +hyperlink==21.0.0 +incremental==24.7.2 +pyasn1==0.6.1 +pyasn1_modules==0.4.2 +service-identity==24.2.0 +Twisted==24.11.0 +txaio==23.1.1 +zope.interface==7.2 + +# Security and networking +certifi==2025.4.26 +cffi==1.17.1 +charset-normalizer==3.4.2 +cryptography==44.0.3 +idna==3.10 +pyOpenSSL==25.0.0 +requests==2.32.3 +urllib3==2.4.0 + +# Data science and visualization +attrs==25.3.0 +contourpy==1.3.2 +cycler==0.12.1 +fonttools==4.57.0 +kiwisolver==1.4.8 +matplotlib==3.10.1 +numpy==2.2.5 +pandas==2.2.3 +pyparsing==3.2.3 +python-dateutil==2.9.0.post0 +pytz==2025.2 +scipy==1.15.2 +seaborn==0.13.2 +tzdata==2025.2 + +# Computer vision and multimedia +av==14.3.0 +imageio==2.37.0 +imageio-ffmpeg==0.6.0 +moviepy==2.1.2 +opencv-python-headless==4.11.0.86 # Uncommented and fixed +proglog==0.1.11 + +# PyTorch and ML +torch==2.7.0+cu128 +torchvision==0.22.0+cu128 +torchaudio==2.7.0+cu128 +--extra-index-url https://download.pytorch.org/whl/cu128 +ultralytics==8.3.127 +ultralytics-thop==2.0.14 + +# Utilities +colorama==0.4.6 +decorator==5.2.1 +filelock==3.18.0 +fsspec==2025.3.2 +Jinja2==3.1.6 +MarkupSafe==3.0.2 +mpmath==1.3.0 +networkx==3.4.2 +packaging==25.0 +psutil==7.0.0 +py-cpuinfo==9.0.0 +PyYAML==6.0.2 +six==1.17.0 +sympy==1.14.0 +tqdm==4.67.1 +typing_extensions==4.13.2 \ No newline at end of file diff --git a/web/requirements.txt b/web/requirements/requirements.txt similarity index 100% rename from web/requirements.txt rename to web/requirements/requirements.txt