Parcourir la source

Update docker container

Lengyue il y a 2 ans
Parent
commit
3ec16024dd
4 fichiers modifiés avec 23 ajouts et 19 suppressions
  1. 1 0
      .dockerignore
  2. 1 2
      docker-compose.dev.yml
  3. 19 16
      dockerfile
  4. 2 1
      pyproject.toml

+ 1 - 0
.dockerignore

@@ -2,3 +2,4 @@ results
 data
 *.filelist
 /data_server/target
+checkpoints

+ 1 - 2
docker-compose.dev.yml

@@ -5,8 +5,7 @@ services:
     build: .
     container_name: fish-speech
     volumes:
-      - ./data:/exp/data
-      - ./raw_data:/exp/raw_data
+      - ./:/exp
     deploy:
       resources:
         reservations:

+ 19 - 16
dockerfile

@@ -1,39 +1,42 @@
-FROM nvcr.io/nvidia/pytorch:23.09-py3
+FROM nvcr.io/nvidia/pytorch:24.02-py3
 
 # Install system dependencies
 ENV DEBIAN_FRONTEND=noninteractive
 RUN apt-get update && apt-get install -y git curl build-essential ffmpeg libsm6 libxext6 libjpeg-dev \
-    zlib1g-dev aria2 zsh openssh-server sudo python3.10-venv && \
+    zlib1g-dev aria2 zsh openssh-server sudo python3.10-venv protobuf-compiler && \
     apt-get clean && rm -rf /var/lib/apt/lists/*
 
-# Install s5cmd
-RUN curl -L https://github.com/peak/s5cmd/releases/download/v2.2.0/s5cmd_2.2.0_Linux-64bit.tar.gz | tar xvz -C /tmp && \
-    mv /tmp/s5cmd /usr/local/bin/s5cmd && s5cmd --help
-
-# Install code server and zsh
-RUN wget -c https://github.com/coder/code-server/releases/download/v4.5.1/code-server_4.5.1_amd64.deb && \
-    dpkg -i ./code-server_4.5.1_amd64.deb && \
-    code-server --install-extension ms-python.python && \
-    rm ./code-server_4.5.1_amd64.deb && \
-    sh -c "$(curl https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" "" --unattended
+# Install zsh
+RUN sh -c "$(curl https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)" "" --unattended
 
 # Set zsh as default shell
 RUN chsh -s /usr/bin/zsh
 ENV SHELL=/usr/bin/zsh
 
+# Setup torchaudio
+RUN git clone https://github.com/pytorch/audio --recursive --depth 1 && \
+    cd audio && pip install -v --no-use-pep517 . && \
+    cd .. && rm -rf audio && python -c "import torchaudio; print(torchaudio.__version__)"
+
 # Setup flash-attn
 RUN pip3 install --upgrade pip && \
     pip3 install ninja packaging && \
-    pip3 install git+https://github.com/Dao-AILab/flash-attention.git
+    FLASH_ATTENTION_FORCE_BUILD=TRUE pip3 install git+https://github.com/Dao-AILab/flash-attention.git
+
+# Test flash-attn
+RUN python3 -c "from flash_attn import flash_attn_varlen_func"
 
 # Project Env
 WORKDIR /exp
-COPY . .
+COPY pyproject.toml ./
+COPY data_server ./data_server
+COPY fish_speech ./fish_speech
 
 # Setup rust-data-server
 RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y && \
-    cd data_server && $HOME/.cargo/bin/cargo build --release
+    cd data_server && $HOME/.cargo/bin/cargo build --release && cp target/release/data_server /usr/local/bin/ && \
+    cd .. && rm -rf data_server && data_server --help
 
-RUN pip3 install -e .
+RUN pip3 install -e . && pip uninstall -y fish-speech && rm -rf fish_speech
 
 CMD /bin/zsh

+ 2 - 1
pyproject.toml

@@ -36,7 +36,8 @@ dependencies = [
     "nnAudio>=0.3.2",
     "loralib>=0.1.2",
     "natsort>=8.4.0",
-    "cn2an>=0.5.22"
+    "cn2an>=0.5.22",
+    "pyrootutils>=1.0.4"
 ]
 
 [project.optional-dependencies]