From f4e607125481e4bb3bc2f0bee937837b243b0b3d Mon Sep 17 00:00:00 2001 From: Roberts Slisans Date: Mon, 7 Oct 2024 23:21:18 +0300 Subject: [PATCH] convert dockerfile to uv install --- .github/workflows/publish-docker-image.yaml | 2 +- Dockerfile | 39 ++++++++++----------- 2 files changed, 20 insertions(+), 21 deletions(-) diff --git a/.github/workflows/publish-docker-image.yaml b/.github/workflows/publish-docker-image.yaml index 502c149e..9e56952b 100644 --- a/.github/workflows/publish-docker-image.yaml +++ b/.github/workflows/publish-docker-image.yaml @@ -3,7 +3,7 @@ name: Create and publish a Docker image # Configures this workflow to run every time a change is pushed to the branch called `release`. on: push: - branches: ['main'] + branches: ['installation-upgrades'] # temporary # Defines two custom environment variables for the workflow. These are used for the Container registry domain, and a name for the Docker image that this workflow builds. env: diff --git a/Dockerfile b/Dockerfile index 3ef5b3a0..d8592232 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,19 +16,16 @@ ENV PATH="/root/.nvm/versions/node/v${NODE_VERSION}/bin/:${PATH}" RUN node --version RUN npm --version -# Setup venv -RUN pip3 install --no-cache-dir virtualenv -RUN virtualenv /venv ENV VIRTUAL_ENV=/venv -RUN python3 -m venv $VIRTUAL_ENV -ENV PATH="$VIRTUAL_ENV/bin:$PATH" +# Install uv +ADD --chmod=755 https://astral.sh/uv/install.sh /install.sh +RUN /install.sh && rm /install.sh # Define PyTorch version ENV TORCH_VERSION=2.3.1 -# Version 24 is broken due to fairseq -RUN pip3 install --no-cache-dir --upgrade pip==23.3.2 setuptools && \ - pip3 install --no-cache-dir torch==$TORCH_VERSION torchvision torchaudio +ENV PATH="/root/.cargo/bin:$PATH" +RUN uv pip install --no-cache-dir setuptools torch==$TORCH_VERSION torchvision torchaudio # Set working directory WORKDIR /app @@ -40,18 +37,20 @@ RUN git clone https://github.com/rsxdalv/tts-generation-webui.git WORKDIR /app/tts-generation-webui # Install all requirements -RUN pip3 install --no-cache-dir torch==$TORCH_VERSION -r requirements.txt -RUN pip3 install --no-cache-dir torch==$TORCH_VERSION -r requirements_bark_hubert_quantizer.txt -RUN pip3 install --no-cache-dir torch==$TORCH_VERSION -r requirements_rvc.txt -RUN pip3 install --no-cache-dir torch==$TORCH_VERSION -r requirements_audiocraft_0.txt -RUN pip3 install --no-cache-dir torch==$TORCH_VERSION -r requirements_audiocraft.txt -RUN pip3 install --no-cache-dir torch==$TORCH_VERSION -r requirements_styletts2.txt -RUN pip3 install --no-cache-dir torch==$TORCH_VERSION -r requirements_vall_e.txt -RUN pip3 install --no-cache-dir torch==$TORCH_VERSION -r requirements_maha_tts.txt -RUN pip3 install --no-cache-dir torch==$TORCH_VERSION -r requirements_stable_audio.txt -# RUN pip3 install --no-cache-dir torch==$TORCH_VERSION hydra-core==1.3.2 -RUN pip3 install --no-cache-dir torch==$TORCH_VERSION nvidia-ml-py - +RUN uv pip install --no-cache-dir torch==$TORCH_VERSION -r requirements.txt +RUN uv pip install --no-cache-dir torch==$TORCH_VERSION -r requirements_bark_hubert_quantizer.txt +RUN uv pip install --no-cache-dir torch==$TORCH_VERSION -r requirements_rvc.txt +RUN uv pip install --no-cache-dir torch==$TORCH_VERSION -r requirements_audiocraft_0.txt +RUN uv pip install --no-cache-dir torch==$TORCH_VERSION -r requirements_audiocraft.txt +RUN uv pip install --no-cache-dir torch==$TORCH_VERSION -r requirements_styletts2.txt +RUN uv pip install --no-cache-dir torch==$TORCH_VERSION -r requirements_vall_e.txt +RUN uv pip install --no-cache-dir torch==$TORCH_VERSION -r requirements_maha_tts.txt +RUN uv pip install --no-cache-dir torch==$TORCH_VERSION -r requirements_stable_audio.txt +# RUN uv pip install --no-cache-dir torch==$TORCH_VERSION hydra-core==1.3.2 +RUN uv pip install --no-cache-dir torch==$TORCH_VERSION nvidia-ml-py + + +# add postgres & run setup # Build the React UI RUN cd react-ui && npm install && npm run build