-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add docker image for icefall (#1189)
- Loading branch information
1 parent
19b942c
commit 751bb6f
Showing
7 changed files
with
376 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
# see also | ||
# https://docs.github.com/en/actions/publishing-packages/publishing-docker-images#publishing-images-to-github-packages | ||
name: Build docker image | ||
on: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: build_docker-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
build-docker-image: | ||
name: ${{ matrix.image }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
image: ["torch2.0.0-cuda11.7", "torch1.13.0-cuda11.6", "torch1.12.1-cuda11.3", "torch1.9.0-cuda10.2"] | ||
|
||
steps: | ||
# refer to https://github.com/actions/checkout | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Rename | ||
shell: bash | ||
run: | | ||
image=${{ matrix.image }} | ||
mv -v ./docker/$image.dockerfile ./Dockerfile | ||
- name: Log in to Docker Hub | ||
uses: docker/login-action@v2 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- name: Build and push | ||
uses: docker/build-push-action@v4 | ||
with: | ||
context: . | ||
file: ./Dockerfile | ||
push: true | ||
tags: k2fsa/icefall:${{ matrix.image }} |
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,66 @@ | ||
name: Run docker image | ||
on: | ||
workflow_dispatch: | ||
|
||
concurrency: | ||
group: run_docker_image-${{ github.ref }} | ||
cancel-in-progress: true | ||
|
||
jobs: | ||
run-docker-image: | ||
name: ${{ matrix.image }} | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: [ubuntu-latest] | ||
image: ["torch2.0.0-cuda11.7", "torch1.13.0-cuda11.6", "torch1.12.1-cuda11.3", "torch1.9.0-cuda10.2"] | ||
steps: | ||
# refer to https://github.com/actions/checkout | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: Run the build process with Docker | ||
uses: addnab/docker-run-action@v3 | ||
with: | ||
image: k2fsa/icefall:${{ matrix.image }} | ||
run: | | ||
uname -a | ||
cat /etc/*release | ||
nvcc --version | ||
which nvcc | ||
cuda_dir=$(dirname $(which nvcc)) | ||
echo "cuda_dir: $cuda_dir" | ||
find $cuda_dir -name libcuda.so* | ||
echo "--------------------" | ||
find / -name libcuda.so* 2>/dev/null | ||
pushd /opt/conda/lib/stubs && ln -s libcuda.so libcuda.so.1 && popd | ||
export LD_LIBRARY_PATH=/opt/conda/lib/stubs:$LD_LIBRARY_PATH | ||
echo "LD_LIBRARY_PATH $LD_LIBRARY_PATH" | ||
python3 --version | ||
which python3 | ||
echo "----------torch----------" | ||
python3 -m torch.utils.collect_env | ||
echo "----------k2----------" | ||
python3 -c "import k2; print(k2.__file__)" | ||
python3 -c "import k2; print(k2.__version__)" | ||
python3 -m k2.version | ||
echo "----------lhotse----------" | ||
python3 -c "import lhotse; print(lhotse.__file__)" | ||
python3 -c "import lhotse; print(lhotse.__version__)" | ||
echo "----------kaldifeat----------" | ||
python3 -c "import kaldifeat; print(kaldifeat.__file__)" | ||
python3 -c "import kaldifeat; print(kaldifeat.__version__)" | ||
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,62 @@ | ||
FROM pytorch/pytorch:1.12.1-cuda11.3-cudnn8-runtime | ||
|
||
ENV LC_ALL C.UTF-8 | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
ARG K2_VERSION="1.24.3.dev20230725+cuda11.3.torch1.12.1" | ||
ARG KALDIFEAT_VERSION="1.25.0.dev20230726+cuda11.3.torch1.12.1" | ||
ARG TORCHAUDIO_VERSION="0.12.1+cu113" | ||
|
||
LABEL authors="Fangjun Kuang <[email protected]>" | ||
LABEL k2_version=${K2_VERSION} | ||
LABEL kaldifeat_version=${KALDIFEAT_VERSION} | ||
LABEL github_repo="https://github.com/k2-fsa/icefall" | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
curl \ | ||
vim \ | ||
libssl-dev \ | ||
autoconf \ | ||
automake \ | ||
bzip2 \ | ||
ca-certificates \ | ||
ffmpeg \ | ||
g++ \ | ||
gfortran \ | ||
git \ | ||
libtool \ | ||
make \ | ||
patch \ | ||
sox \ | ||
subversion \ | ||
unzip \ | ||
valgrind \ | ||
wget \ | ||
zlib1g-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install dependencies | ||
RUN pip install --no-cache-dir \ | ||
torchaudio==${TORCHAUDIO_VERSION} -f https://download.pytorch.org/whl/torch_stable.html \ | ||
k2==${K2_VERSION} -f https://k2-fsa.github.io/k2/cuda.html \ | ||
git+https://github.com/lhotse-speech/lhotse \ | ||
kaldifeat==${KALDIFEAT_VERSION} -f https://csukuangfj.github.io/kaldifeat/cuda.html \ | ||
\ | ||
kaldi_native_io \ | ||
kaldialign \ | ||
kaldifst \ | ||
kaldilm \ | ||
sentencepiece>=0.1.96 \ | ||
tensorboard \ | ||
typeguard \ | ||
dill | ||
|
||
RUN git clone https://github.com/k2-fsa/icefall /workspace/icefall && \ | ||
cd /workspace/icefall && \ | ||
pip install --no-cache-dir -r requirements.txt | ||
|
||
ENV PYTHONPATH /workspace/icefall:$PYTHONPATH | ||
|
||
WORKDIR /workspace/icefall |
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,64 @@ | ||
FROM pytorch/pytorch:1.13.0-cuda11.6-cudnn8-runtime | ||
|
||
ENV LC_ALL C.UTF-8 | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
ARG K2_VERSION="1.24.3.dev20230725+cuda11.6.torch1.13.0" | ||
ARG KALDIFEAT_VERSION="1.25.0.dev20230726+cuda11.6.torch1.13.0" | ||
ARG TORCHAUDIO_VERSION="0.13.0+cu116" | ||
|
||
LABEL authors="Fangjun Kuang <[email protected]>" | ||
LABEL k2_version=${K2_VERSION} | ||
LABEL kaldifeat_version=${KALDIFEAT_VERSION} | ||
LABEL github_repo="https://github.com/k2-fsa/icefall" | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
curl \ | ||
vim \ | ||
libssl-dev \ | ||
autoconf \ | ||
automake \ | ||
bzip2 \ | ||
ca-certificates \ | ||
ffmpeg \ | ||
g++ \ | ||
gfortran \ | ||
git \ | ||
libtool \ | ||
make \ | ||
patch \ | ||
sox \ | ||
subversion \ | ||
unzip \ | ||
valgrind \ | ||
wget \ | ||
zlib1g-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install dependencies | ||
RUN pip install --no-cache-dir \ | ||
torchaudio==${TORCHAUDIO_VERSION} -f https://download.pytorch.org/whl/torch_stable.html \ | ||
k2==${K2_VERSION} -f https://k2-fsa.github.io/k2/cuda.html \ | ||
git+https://github.com/lhotse-speech/lhotse \ | ||
kaldifeat==${KALDIFEAT_VERSION} -f https://csukuangfj.github.io/kaldifeat/cuda.html \ | ||
\ | ||
kaldi_native_io \ | ||
kaldialign \ | ||
kaldifst \ | ||
kaldilm \ | ||
sentencepiece>=0.1.96 \ | ||
tensorboard \ | ||
typeguard \ | ||
dill | ||
|
||
RUN git clone https://github.com/k2-fsa/icefall /workspace/icefall && \ | ||
cd /workspace/icefall && \ | ||
pip install --no-cache-dir -r requirements.txt | ||
|
||
ENV PYTHONPATH /workspace/icefall:$PYTHONPATH | ||
|
||
ENV LD_LIBRARY_PATH /opt/conda/lib/stubs:$LD_LIBRARY_PATH | ||
|
||
WORKDIR /workspace/icefall |
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,62 @@ | ||
FROM pytorch/pytorch:1.9.0-cuda10.2-cudnn7-runtime | ||
|
||
ENV LC_ALL C.UTF-8 | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
ARG K2_VERSION="1.24.3.dev20230726+cuda10.2.torch1.9.0" | ||
ARG KALDIFEAT_VERSION="1.25.0.dev20230726+cuda10.2.torch1.9.0" | ||
ARG TORCHAUDIO_VERSION="0.9.0" | ||
|
||
LABEL authors="Fangjun Kuang <[email protected]>" | ||
LABEL k2_version=${K2_VERSION} | ||
LABEL kaldifeat_version=${KALDIFEAT_VERSION} | ||
LABEL github_repo="https://github.com/k2-fsa/icefall" | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
curl \ | ||
vim \ | ||
libssl-dev \ | ||
autoconf \ | ||
automake \ | ||
bzip2 \ | ||
ca-certificates \ | ||
ffmpeg \ | ||
g++ \ | ||
gfortran \ | ||
git \ | ||
libtool \ | ||
make \ | ||
patch \ | ||
sox \ | ||
subversion \ | ||
unzip \ | ||
valgrind \ | ||
wget \ | ||
zlib1g-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install dependencies | ||
RUN pip install --no-cache-dir \ | ||
torchaudio==${TORCHAUDIO_VERSION} -f https://download.pytorch.org/whl/torch_stable.html \ | ||
k2==${K2_VERSION} -f https://k2-fsa.github.io/k2/cuda.html \ | ||
kaldifeat==${KALDIFEAT_VERSION} -f https://csukuangfj.github.io/kaldifeat/cuda.html \ | ||
git+https://github.com/lhotse-speech/lhotse \ | ||
\ | ||
kaldi_native_io \ | ||
kaldialign \ | ||
kaldifst \ | ||
kaldilm \ | ||
sentencepiece>=0.1.96 \ | ||
tensorboard \ | ||
typeguard \ | ||
dill | ||
|
||
RUN git clone https://github.com/k2-fsa/icefall /workspace/icefall && \ | ||
cd /workspace/icefall && \ | ||
pip install --no-cache-dir -r requirements.txt | ||
|
||
ENV PYTHONPATH /workspace/icefall:$PYTHONPATH | ||
|
||
WORKDIR /workspace/icefall |
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,62 @@ | ||
FROM pytorch/pytorch:2.0.0-cuda11.7-cudnn8-runtime | ||
|
||
ENV LC_ALL C.UTF-8 | ||
|
||
ARG DEBIAN_FRONTEND=noninteractive | ||
|
||
ARG K2_VERSION="1.24.3.dev20230718+cuda11.7.torch2.0.0" | ||
ARG KALDIFEAT_VERSION="1.25.0.dev20230726+cuda11.7.torch2.0.0" | ||
ARG TORCHAUDIO_VERSION="2.0.0+cu117" | ||
|
||
LABEL authors="Fangjun Kuang <[email protected]>" | ||
LABEL k2_version=${K2_VERSION} | ||
LABEL kaldifeat_version=${KALDIFEAT_VERSION} | ||
LABEL github_repo="https://github.com/k2-fsa/icefall" | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
curl \ | ||
vim \ | ||
libssl-dev \ | ||
autoconf \ | ||
automake \ | ||
bzip2 \ | ||
ca-certificates \ | ||
ffmpeg \ | ||
g++ \ | ||
gfortran \ | ||
git \ | ||
libtool \ | ||
make \ | ||
patch \ | ||
sox \ | ||
subversion \ | ||
unzip \ | ||
valgrind \ | ||
wget \ | ||
zlib1g-dev \ | ||
&& rm -rf /var/lib/apt/lists/* | ||
|
||
# Install dependencies | ||
RUN pip install --no-cache-dir \ | ||
torchaudio==${TORCHAUDIO_VERSION} -f https://download.pytorch.org/whl/torch_stable.html \ | ||
k2==${K2_VERSION} -f https://k2-fsa.github.io/k2/cuda.html \ | ||
git+https://github.com/lhotse-speech/lhotse \ | ||
kaldifeat==${KALDIFEAT_VERSION} -f https://csukuangfj.github.io/kaldifeat/cuda.html \ | ||
\ | ||
kaldi_native_io \ | ||
kaldialign \ | ||
kaldifst \ | ||
kaldilm \ | ||
sentencepiece>=0.1.96 \ | ||
tensorboard \ | ||
typeguard \ | ||
dill | ||
|
||
RUN git clone https://github.com/k2-fsa/icefall /workspace/icefall && \ | ||
cd /workspace/icefall && \ | ||
pip install --no-cache-dir -r requirements.txt | ||
|
||
ENV PYTHONPATH /workspace/icefall:$PYTHONPATH | ||
|
||
WORKDIR /workspace/icefall |