Skip to content

Commit 59529b9

Browse files
committed
Docker workflow
Signed-off-by: George Zelenfroind <[email protected]>
1 parent 813785e commit 59529b9

File tree

2 files changed

+116
-0
lines changed

2 files changed

+116
-0
lines changed

.github/workflows/docker_pull.yml

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
name: Docker Build and Test
2+
3+
on:
4+
pull_request:
5+
branches: [ "main" ]
6+
workflow_dispatch:
7+
8+
permissions:
9+
contents: read
10+
11+
jobs:
12+
build-and-test:
13+
runs-on: ubuntu-latest
14+
15+
steps:
16+
- name: Checkout code
17+
uses: actions/checkout@v3
18+
19+
- name: Set up Docker Buildx
20+
uses: docker/setup-buildx-action@v2
21+
22+
- name: Build Docker image
23+
run: |
24+
docker build -t sdp-test-image:${{ github.sha }} -f docker/Dockerfile .
25+
26+
- name: Run test tests
27+
run: |
28+
docker run --rm \
29+
-v ${{ github.workspace }}:/workspace \
30+
-w /workspace \
31+
sdp-test-image:${{ github.sha }} \
32+
bash -c "python -m pytest tests/test_utils.py -v"
33+
34+
# - name: Run more tests
35+
# run: |
36+
# docker run --rm \
37+
# -v ${{ github.workspace }}:/workspace \
38+
# -w /workspace \
39+
# sdp-test-image:${{ github.sha }} \
40+
# bash -c "python -m pytest tests/ --junitxml=pytest.xml --cov=sdp --cov-report=xml"
41+
42+
- name: Get test results
43+
if: always()
44+
uses: actions/upload-artifact@v3
45+
with:
46+
name: test-results
47+
path: |
48+
pytest.xml
49+
coverage.xml

docker/Dockerfile

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
FROM pytorch/pytorch:2.3.1-cuda12.1-cudnn8-devel
2+
ARG DEBIAN_FRONTEND=noninteractive
3+
ENV TZ=America/Los_Angeles
4+
# Install basics
5+
RUN apt-get update && apt-get install -y --no-install-recommends \
6+
build-essential \
7+
bzip2 \
8+
ca-certificates \
9+
cmake \
10+
curl \
11+
ffmpeg \
12+
g++ \
13+
git \
14+
htop \
15+
imagemagick \
16+
libegl1 \
17+
libegl1-mesa-dev \
18+
libgl1 \
19+
libgl1-mesa-dev \
20+
libgles2 \
21+
libgles2-mesa-dev \
22+
libglvnd-dev \
23+
libglvnd0 \
24+
libglx0 \
25+
libnss3-dev \
26+
libopenexr-dev \
27+
libx264-dev \
28+
ninja-build \
29+
sox \
30+
libsox-fmt-mp3 \
31+
tmux \
32+
unzip \
33+
vim \
34+
wget
35+
36+
# Update pip
37+
RUN pip install --upgrade pip
38+
39+
# Clone the NeMo SDP repository
40+
WORKDIR /src
41+
RUN git clone https://github.com/NVIDIA/NeMo-speech-data-processor.git
42+
43+
# Install all requirements from requirements folder
44+
WORKDIR /src/NeMo-speech-data-processor
45+
RUN find requirements/ -name "*.txt" -exec pip install -r {} \;
46+
47+
# Install additional dependencies
48+
RUN pip install transformers accelerate ndjson torchaudio pyannote-audio jupyter notebook
49+
RUN pip install flash-attn --no-build-isolation
50+
RUN pip install https://github.com/LahiLuk/YouTokenToMe/archive/master.zip
51+
RUN pip install git+https://github.com/m-bain/whisperx.git --upgrade
52+
RUN wget https://github.com/state-spaces/mamba/releases/download/v2.2.2/mamba_ssm-2.2.2+cu118torch2.1cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
53+
RUN pip install mamba_ssm-2.2.2+cu118torch2.1cxx11abiFALSE-cp310-cp310-linux_x86_64.whl
54+
RUN pip install megatron-core transformer_engine[pytorch]
55+
56+
# Update NeMo to allow timestamps
57+
RUN git clone https://github.com/NVIDIA/NeMo.git /src/NeMo/
58+
WORKDIR /src/NeMo
59+
RUN git reset --hard 0547550ad803fce1e4a019f92e9c59f4c902e7e0
60+
RUN ./reinstall.sh
61+
RUN pip install python-swiftclient ffmpeg-python
62+
63+
# Set working directory back to NeMo-speech-data-processor
64+
WORKDIR /src/NeMo-speech-data-processor
65+
66+
# Set up entrypoint
67+
CMD ["bash"]

0 commit comments

Comments
 (0)