-
Notifications
You must be signed in to change notification settings - Fork 295
79 lines (68 loc) · 2.46 KB
/
build-cpu-docker.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: build-cpu-docker
on:
workflow_dispatch:
concurrency:
group: build-cpu-docker-${{ github.ref }}
cancel-in-progress: true
jobs:
build-cpu-docker:
name: py${{ matrix.python-version }} torch${{ matrix.torch-version }} v${{ matrix.version }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.8", "3.9", "3.10"]
torch-version: ["1.13.0", "1.13.1", "2.0.0", "2.0.1", "2.1.0", "2.1.1", "2.1.2"]
k2-version: ["1.24.4.dev20231220"]
kaldifeat-version: ["1.25.3.dev20231221"]
version: ["1.1"]
steps:
# refer to https://github.com/actions/checkout
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Free space
shell: bash
run: |
df -h
rm -rf /opt/hostedtoolcache
df -h
- name: 'Login to GitHub Container Registry'
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build docker Image
shell: bash
run: |
cd .github/scripts/docker
torch_version=${{ matrix.torch-version }}
# see https://pytorch.org/audio/stable/installation.html#compatibility-matrix
if [[ $torch_version == 1.13.0 ]]; then
torchaudio_version=0.13.0
elif [[ $torch_version == 1.13.1 ]]; then
torchaudio_version=0.13.1
elif [[ $torch_version == 2.0.0 ]]; then
torchaudio_version=2.0.1
elif [[ $torch_version == 2.0.1 ]]; then
torchaudio_version=2.0.2
else
torchaudio_version=$torch_version
fi
echo "torch_version: $torch_version"
echo "torchaudio_version: $torchaudio_version"
version=${{ matrix.version }}
tag=ghcr.io/k2-fsa/icefall:cpu-py${{ matrix.python-version }}-torch${{ matrix.torch-version }}-v$version
echo "tag: $tag"
docker build \
-t $tag \
--build-arg PYTHON_VERSION=${{ matrix.python-version }} \
--build-arg TORCH_VERSION=$torch_version \
--build-arg TORCHAUDIO_VERSION=$torchaudio_version \
--build-arg K2_VERSION=${{ matrix.k2-version }} \
--build-arg KALDIFEAT_VERSION=${{ matrix.kaldifeat-version }} \
.
docker image ls
docker push $tag