Skip to content

Commit d9ab046

Browse files
authored
[CI] Automatically refresh docker images (#4942)
1 parent 22f36e5 commit d9ab046

File tree

8 files changed

+168
-194
lines changed

8 files changed

+168
-194
lines changed

.github/workflows/docker-images.yml

+105-16
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name: Docker Image CI
33
on:
44
schedule:
55
- cron: '37 2 * * 1'
6+
67
workflow_dispatch:
78
inputs:
89
logLevel:
@@ -14,17 +15,20 @@ on:
1415
- info
1516
- warning
1617
- debug
18+
1719
# pull_request: #for debugging purposes
1820
# branches: [ "master" ]
1921

2022
jobs:
23+
2124
enable_build:
22-
if: github.repository == 'kaldi-asr/kaldi'
25+
#if: github.repository_owner == 'jtrmal' || github.repository_owner == 'kaldi-asr'
26+
if: github.repository_owner == 'kaldi-asr'
2327
runs-on: ubuntu-latest
2428
outputs:
2529
enabled: ${{ steps.set-enabled.outputs.enabled }}
2630
steps:
27-
- uses: actions/checkout@v2
31+
- uses: actions/checkout@v4
2832
with:
2933
fetch-depth: 0
3034
- name: Set enabled
@@ -38,22 +42,34 @@ jobs:
3842
enabled=true
3943
fi
4044
echo "enabled: $enabled"
41-
echo "::set-output name=enabled::${enabled}"
45+
echo "enabled=${enabled}" >> $GITHUB_OUTPUT
4246
4347
44-
docker-buildx-gpu:
48+
docker-buildx-gpu-12:
4549
needs: enable_build
4650
if: needs.enable_build.outputs.enabled == 'true' || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
4751
runs-on: ubuntu-latest
4852
steps:
49-
- uses: actions/checkout@v3
53+
- name: Maximize build space
54+
uses: AdityaGarg8/[email protected]
55+
with:
56+
remove-android: 'true'
57+
remove-dotnet: 'true'
58+
remove-haskell: 'true'
59+
remove-codeql: 'true'
60+
remove-docker-images: 'true'
61+
remove-large-packages: 'true'
62+
remove-cached-tools: 'true'
63+
remove-swapfile: 'false'
64+
verbose: 'true'
65+
- uses: actions/checkout@v4
5066
- name: Set up Docker Buildx
5167
id: buildx
52-
uses: docker/setup-buildx-action@v2
68+
uses: docker/setup-buildx-action@v3
5369
with:
5470
install: true
5571
- name: Login to DockerHub
56-
uses: docker/login-action@v2
72+
uses: docker/login-action@v3
5773
with:
5874
username: ${{ secrets.DOCKERHUB_USERNAME }}
5975
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -66,22 +82,34 @@ jobs:
6682
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
6783
- name: Build and push
6884
run: |
69-
cd docker/ubuntu18.04-cuda10.0/
70-
docker build --push --tag kaldiasr/kaldi:gpu-latest --tag kaldiasr/kaldi:gpu-ubuntu18.04-cuda10.0 --tag kaldiasr/kaldi:gpu-ubuntu18.04-cuda10.0-$(date +%F) .
85+
cd docker/ubuntu22.04-cuda12
86+
docker build --push --tag kaldiasr/kaldi:gpu-latest --tag kaldiasr/kaldi:gpu-ubuntu22.04-cuda12 --tag kaldiasr/kaldi:gpu-ubuntu22.04-cuda12-$(date +%F) .
7187
72-
docker-buildx-cpu:
88+
docker-buildx-gpu-cuda11:
7389
needs: enable_build
7490
if: needs.enable_build.outputs.enabled == 'true' || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
7591
runs-on: ubuntu-latest
7692
steps:
77-
- uses: actions/checkout@v3
93+
- name: Maximize build space
94+
uses: AdityaGarg8/[email protected]
95+
with:
96+
remove-android: 'true'
97+
remove-dotnet: 'true'
98+
remove-haskell: 'true'
99+
remove-codeql: 'true'
100+
remove-docker-images: 'true'
101+
remove-large-packages: 'true'
102+
remove-cached-tools: 'true'
103+
remove-swapfile: 'false'
104+
verbose: 'true'
105+
- uses: actions/checkout@v4
78106
- name: Set up Docker Buildx
79107
id: buildx
80-
uses: docker/setup-buildx-action@v2
108+
uses: docker/setup-buildx-action@v3
81109
with:
82110
install: true
83111
- name: Login to DockerHub
84-
uses: docker/login-action@v2
112+
uses: docker/login-action@v3
85113
with:
86114
username: ${{ secrets.DOCKERHUB_USERNAME }}
87115
password: ${{ secrets.DOCKERHUB_TOKEN }}
@@ -94,10 +122,71 @@ jobs:
94122
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
95123
- name: Build and push
96124
run: |
97-
cd docker/debian10-cpu/
125+
cd docker/ubuntu20.04-cuda11
126+
docker build --push --tag kaldiasr/kaldi:gpu-ubuntu20.04-cuda11 --tag kaldiasr/kaldi:gpu-ubuntu20.04-cuda11-$(date +%F) .
127+
128+
docker-buildx-cpu-openblas:
129+
needs: enable_build
130+
if: needs.enable_build.outputs.enabled == 'true' || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
131+
runs-on: ubuntu-latest
132+
steps:
133+
- uses: actions/checkout@v4
134+
- name: Set up Docker Buildx
135+
id: buildx
136+
uses: docker/setup-buildx-action@v3
137+
with:
138+
install: true
139+
- name: Login to DockerHub
140+
uses: docker/login-action@v3
141+
with:
142+
username: ${{ secrets.DOCKERHUB_USERNAME }}
143+
password: ${{ secrets.DOCKERHUB_TOKEN }}
144+
- name: Inspect builder
145+
run: |
146+
echo "Name: ${{ steps.buildx.outputs.name }}"
147+
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
148+
echo "Status: ${{ steps.buildx.outputs.status }}"
149+
echo "Flags: ${{ steps.buildx.outputs.flags }}"
150+
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
151+
- name: Build and push
152+
run: |
153+
cd docker/debian12-cpu/
98154
docker build --push \
99155
--tag kaldiasr/kaldi:latest \
100156
--tag kaldiasr/kaldi:cpu-latest \
101-
--tag kaldiasr/kaldi:cpu-debian10 \
102-
--tag kaldiasr/kaldi:cpu-debian10-$(date +%F) .
157+
--tag kaldiasr/kaldi:cpu-latest-openblas \
158+
--tag kaldiasr/kaldi:cpu-debian12-openblas \
159+
--tag kaldiasr/kaldi:cpu-debian12-openblas-$(date +%F) .
103160
161+
docker-buildx-cpu-mkl:
162+
needs: enable_build
163+
if: needs.enable_build.outputs.enabled == 'true' || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
164+
runs-on: ubuntu-latest
165+
steps:
166+
- uses: actions/checkout@v4
167+
- name: Set up Docker Buildx
168+
id: buildx
169+
uses: docker/setup-buildx-action@v3
170+
with:
171+
install: true
172+
- name: Login to DockerHub
173+
uses: docker/login-action@v3
174+
with:
175+
username: ${{ secrets.DOCKERHUB_USERNAME }}
176+
password: ${{ secrets.DOCKERHUB_TOKEN }}
177+
- name: Inspect builder
178+
run: |
179+
echo "Name: ${{ steps.buildx.outputs.name }}"
180+
echo "Endpoint: ${{ steps.buildx.outputs.endpoint }}"
181+
echo "Status: ${{ steps.buildx.outputs.status }}"
182+
echo "Flags: ${{ steps.buildx.outputs.flags }}"
183+
echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
184+
- name: Build and push
185+
run: |
186+
cd docker/debian12-cpu-mkl/
187+
docker build --push \
188+
--tag kaldiasr/kaldi:cpu-latest-mkl \
189+
--tag kaldiasr/kaldi:cpu-debian12-mkl \
190+
--tag kaldiasr/kaldi:cpu-debian12-mkl-$(date +%F) .
191+
192+
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
FROM debian:10
2-
LABEL maintainer="[email protected]"
1+
FROM debian:12
2+
LABEL maintainer="[email protected]"
33

44
RUN apt-get update && \
55
apt-get install -y --no-install-recommends \
66
g++ \
7+
gfortran \
78
make \
89
automake \
910
autoconf \
@@ -13,29 +14,21 @@ RUN apt-get update && \
1314
sox \
1415
libtool \
1516
git \
16-
subversion \
17-
python2.7 \
1817
python3 \
1918
zlib1g-dev \
2019
ca-certificates \
21-
gfortran \
2220
patch \
23-
ffmpeg \
24-
vim && \
21+
python-is-python3 && \
2522
rm -rf /var/lib/apt/lists/*
2623

27-
RUN ln -s /usr/bin/python3 /usr/bin/python
2824

2925
RUN git clone --depth 1 https://github.com/kaldi-asr/kaldi.git /opt/kaldi #EOL
3026
RUN cd /opt/kaldi/tools && \
31-
./extras/install_mkl.sh && \
32-
make -j $(nproc) && \
27+
./extras/install_mkl.sh && \
28+
make -j 5 && \
3329
cd /opt/kaldi/src && \
3430
./configure --shared && \
3531
make depend -j $(nproc) && \
36-
make -j $(nproc) && \
37-
find /opt/kaldi -type f \( -name "*.o" -o -name "*.la" -o -name "*.a" \) -exec rm {} \; && \
38-
find /opt/intel -type f -name "*.a" -exec rm {} \; && \
39-
find /opt/intel -type f -regex '.*\(_mc.?\|_mic\|_thread\|_ilp64\)\.so' -exec rm {} \; && \
40-
rm -rf /opt/kaldi/.git
32+
make -j 5
33+
4134
WORKDIR /opt/kaldi/

docker/debian12-cpu/Dockerfile

+34
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
FROM debian:12
2+
LABEL maintainer="[email protected]"
3+
4+
RUN apt-get update && \
5+
apt-get install -y --no-install-recommends \
6+
g++ \
7+
gfortran \
8+
make \
9+
automake \
10+
autoconf \
11+
bzip2 \
12+
unzip \
13+
wget \
14+
sox \
15+
libtool \
16+
git \
17+
python3 \
18+
zlib1g-dev \
19+
ca-certificates \
20+
patch \
21+
python-is-python3 && \
22+
rm -rf /var/lib/apt/lists/*
23+
24+
25+
RUN git clone --depth 1 https://github.com/kaldi-asr/kaldi.git /opt/kaldi #EOL
26+
RUN cd /opt/kaldi/tools && \
27+
./extras/install_openblas.sh && \
28+
make -j 5 && \
29+
cd /opt/kaldi/src && \
30+
./configure --shared --mathlib=OPENBLAS && \
31+
make depend -j $(nproc) && \
32+
make -j 5
33+
34+
WORKDIR /opt/kaldi/

docker/debian9.8-cpu/Dockerfile

-43
This file was deleted.

docker/ubuntu16.04-gpu/Dockerfile

-44
This file was deleted.

0 commit comments

Comments
 (0)