Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve build on docker images #84

Merged
merged 32 commits into from
Aug 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
32 commits
Select commit Hold shift + click to select a range
ce5d0ae
add the support for alignment on newline-separated plain texts
baxtree Sep 13, 2021
9aed411
upgrade tensorflow to 2.6.0 and add the gh citation
baxtree Sep 13, 2021
c9b5708
add override on the output subtitle format during batching
baxtree Sep 20, 2021
c6bdbd0
spawn processes during parallelism
baxtree Oct 12, 2021
a89218e
fix linting
baxtree Oct 12, 2021
84f5190
set max workers to one due to memory limit on ci
baxtree Oct 19, 2021
4880c37
set max workers to one due to memory limit on ci
baxtree Oct 19, 2021
7085830
switch on debugging logs
baxtree Oct 19, 2021
bdd4fd5
switch on debugging logs
baxtree Oct 19, 2021
51a26ac
upgrade coveragepy to 5.5
baxtree Oct 19, 2021
535afea
update readme
baxtree Oct 27, 2021
ed02cf4
drop the support on py3.6
baxtree Oct 27, 2021
adb08e6
rebase master
baxtree Oct 28, 2021
1efbf2d
add the manual shift mode for the subaligner cli
baxtree Feb 14, 2022
db807d2
support alignment on a single video and multiple subtitles
baxtree Feb 14, 2022
2a2c70a
fix the type checking dependencies
baxtree Feb 14, 2022
19a4f8c
bump up the python version in ci
baxtree Feb 14, 2022
4b6e3aa
skip following imports during type checking
baxtree Feb 16, 2022
224099c
try to fix type checks
baxtree Feb 16, 2022
c9c7c80
try to fix type checks
baxtree Feb 16, 2022
1d13fe4
try to fix type checks
baxtree Feb 16, 2022
545fd45
fix the linting issue
baxtree Feb 16, 2022
bfc6039
rebase master
baxtree Apr 4, 2022
d2e9801
re-add support of arch and centos7 containers
baxtree Apr 4, 2022
20e0997
support training on subtitle-embedded audiovisual files
baxtree May 9, 2022
7fa5254
add workflow dispatch to gh actions
baxtree May 9, 2022
7b3fe17
merge with master
baxtree Jul 19, 2022
ac79776
support py310 and tensorflow 2.8
baxtree Jul 19, 2022
da914c3
tidy up and bump up the version
baxtree Aug 23, 2022
ae382af
rebase development onto master
baxtree Aug 23, 2023
7be99f7
publsh multi-platform images
baxtree Aug 23, 2023
d1acda5
upgrade dependencies to support multiplatforms
baxtree Aug 25, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 18 additions & 35 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,65 +9,62 @@ jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Set up QEMU
uses: docker/setup-qemu-action@v1
uses: docker/setup-qemu-action@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: checkout repo
uses: actions/checkout@v2

- name: Log in to Docker Hub
uses: docker/login-action@v1
uses: docker/setup-buildx-action@v2

- name: Login to Docker Hub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKER_USER_NAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}

- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: baxtree/subaligner:latest


- name: Extract the tag
id: tag
run: echo ::set-output name=TAG::${GITHUB_REF/refs\/tags\/v/}

- name: Build and push the latest image
id: docker_build_latest
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: ./docker
file: "./docker/Dockerfile-Ubuntu20"
build-args: |
"RELEASE_VERSION=${{ steps.tag.outputs.TAG }}"
platforms: linux/amd64,linux/arm64
allow: network.host
github-token: ${{ github.token }}
tags: baxtree/subaligner:latest
push: true

- name: Build and push the Ubuntu 20 image
id: docker_build_u20
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: ./docker
file: "./docker/Dockerfile-Ubuntu20"
build-args: |
"RELEASE_VERSION=${{ steps.tag.outputs.TAG }}"
platforms: linux/amd64,linux/arm64
allow: network.host
github-token: ${{ github.token }}
tags: baxtree/subaligner:${{ steps.tag.outputs.TAG }}.u20
push: true

- name: Build and push the Ubuntu 22 image
id: docker_build_u22
uses: docker/build-push-action@v2
uses: docker/build-push-action@v4
with:
context: ./docker
file: "./docker/Dockerfile-Ubuntu22"
build-args: |
"RELEASE_VERSION=${{ steps.tag.outputs.TAG }}"
platforms: linux/amd64,linux/arm64
allow: network.host
github-token: ${{ github.token }}
tags: baxtree/subaligner:${{ steps.tag.outputs.TAG }}.u22
Expand All @@ -81,6 +78,7 @@ jobs:
file: "./docker/Dockerfile-Fedora34"
build-args: |
"RELEASE_VERSION=${{ steps.tag.outputs.TAG }}"
platforms: linux/amd64,linux/arm64
allow: network.host
github-token: ${{ github.token }}
tags: baxtree/subaligner:${{ steps.tag.outputs.TAG }}.fed34
Expand All @@ -94,23 +92,8 @@ jobs:
file: "./docker/Dockerfile-ArchLinux"
build-args: |
"RELEASE_VERSION=${{ steps.tag.outputs.TAG }}"
platforms: linux/amd64
allow: network.host
github-token: ${{ github.token }}
tags: baxtree/subaligner:${{ steps.tag.outputs.TAG }}.arch
push: true

- name: Build and push the CentOS 7 image
id: docker_build_el7
uses: docker/build-push-action@v2
with:
context: ./docker
file: "./docker/Dockerfile-CentOS7"
build-args: |
"RELEASE_VERSION=${{ steps.tag.outputs.TAG }}"
allow: network.host
github-token: ${{ github.token }}
tags: baxtree/subaligner:${{ steps.tag.outputs.TAG }}.el7
push: true

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
3 changes: 1 addition & 2 deletions Pipfile
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,13 @@ chardet = "~=3.0.4"
click = "==5.1"
cloudpickle = "==0.5.3"
cycler = "==0.10.0"
dask = ">=2021.10.0,<2022.1.0"
decorator = "==4.3.0"
distributed = "==1.13.0"
filelock = "<4.0.0"
google-pasta = "~=0.2"
graphviz = "==0.8.3"
HeapDict = "==1.0.0"
h5py = "<=3.6.0"
h5py = "<4.0.0"
html5lib = "==1.0b9"
hyperopt = "==0.2.4"
idna = "==2.8"
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<div align="center">
<img src="./figures/subaligner.png" alt="subaligner" width="300" />
<img src="https://raw.githubusercontent.com/baxtree/subaligner/master/figures/subaligner.png" alt="subaligner" width="300" />
</div>

[![Build Status](https://github.com/baxtree/subaligner/actions/workflows/ci-pipeline.yml/badge.svg?branch=master)](https://github.com/baxtree/subaligner/actions/workflows/ci-pipeline.yml?query=branch%3Amaster) ![Codecov](https://img.shields.io/codecov/c/github/baxtree/subaligner)
Expand Down
2 changes: 0 additions & 2 deletions docker/Dockerfile-ArchLinux
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ RUN ["/bin/bash", "-c", "pacman --noconfirm -Syu &&\
/usr/sbin/pyenv install 3.8.12 &&\
/usr/sbin/pyenv local 3.8.12 &&\
ln -s /root/.pyenv/versions/3.8.12/bin/python /usr/bin/python &&\
python -m venv venv &&\
source venv/bin/activate &&\
python -m pip install --upgrade pip &&\
python -m pip install wheel &&\
python -m pip install \"subaligner==${RELEASE_VERSION}\" &&\
Expand Down
43 changes: 24 additions & 19 deletions docker/Dockerfile-CentOS7
Original file line number Diff line number Diff line change
@@ -1,25 +1,30 @@
# Subaligner CentOS 7 Docker Image
From centos:7
From centos:8

ARG RELEASE_VERSION

ENV RELEASE_VERSION=${RELEASE_VERSION}

RUN ["/bin/bash", "-c", "yum install -y epel-release &&\
yum update -y &&\
yum groupinstall -y \"Development Tools\" &&\
rpm -Uvh http://li.nux.ro/download/nux/dextop/el7/x86_64/nux-dextop-release-0-5.el7.nux.noarch.rpm &&\
yum install -y openssl-devel bzip2-devel libffi-devel xz-devel &&\
yum install -y wget &&\
yum install -y ffmpeg &&\
yum install -y espeak espeak-devel &&\
yum install -y libsndfile-devel &&\
yum install -y gcc &&\
wget https://www.python.org/ftp/python/3.8.12/Python-3.8.12.tgz &&\
tar xvf Python-3.8.12.tgz &&\
cd Python-3.8.12 &&\
./configure --enable-optimizations &&\
make altinstall &&\
python3.8 -m pip install --upgrade pip &&\
python3.8 -m pip install \"subaligner==${RELEASE_VERSION}\" &&\
python3.8 -m pip install \"subaligner[harmony]==${RELEASE_VERSION}\""]
RUN cd /etc/yum.repos.d/
RUN sed -i 's/mirrorlist/#mirrorlist/g' /etc/yum.repos.d/CentOS-*
RUN sed -i 's|#baseurl=http://mirror.centos.org|baseurl=http://vault.centos.org|g' /etc/yum.repos.d/CentOS-*

RUN ["/bin/bash", "-c", "dnf install -y epel-release dnf-utils &&\
dnf upgrade -y openssl-libs bind-export-libs &&\
dnf config-manager --set-enabled powertools &&\
dnf install -y https://download1.rpmfusion.org/free/el/rpmfusion-free-release-8.noarch.rpm &&\
dnf install -y ffmpeg &&\
dnf install -y espeak-ng &&\
ln -s /usr/lib64/libespeak-ng.so.1 /usr/lib64/libespeak.so &&\
dnf install -y libsndfile-devel &&\
dnf install -y python3 &&\
dnf install -y gcc &&\
dnf install -y python3-wheel &&\
dnf install -y python3-devel &&\
dnf install -y python3-pip &&\
dnf makecache &&\
dnf upgrade python3-pip &&\
python3 -m pip install --upgrade pip &&\
python3 -m pip install --upgrade setuptools wheel &&\
python3 -m pip install \"subaligner==${RELEASE_VERSION}\" &&\
python3 -m pip install \"subaligner[llm]==${RELEASE_VERSION}\""]
2 changes: 0 additions & 2 deletions docker/Dockerfile-Debian11
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ RUN ["/bin/bash", "-c", "apt -y update &&\
apt -y install python3-tk &&\
apt -y install python3-pip &&\
apt -y install python3-venv &&\
python3 -m venv .venv &&\
source .venv/bin/activate &&\
python3 -m pip install --upgrade pip &&\
python3 -m pip install \"subaligner==${RELEASE_VERSION}\" &&\
python3 -m pip install \"subaligner[harmony]==${RELEASE_VERSION}\""]
1 change: 1 addition & 0 deletions docker/Dockerfile-Ubuntu20
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ RUN ["/bin/bash", "-c", "apt-get -y update &&\
apt-get -y install ffmpeg &&\
apt-get -y install espeak libespeak1 libespeak-dev espeak-data &&\
apt-get -y install libsndfile-dev &&\
apt-get -y install libhdf5-dev &&\
apt-get -y install python3-dev &&\
apt-get -y install python3-tk &&\
apt-get -y install python3-pip &&\
Expand Down
2 changes: 2 additions & 0 deletions docker/Dockerfile-Ubuntu22
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,11 @@ RUN ["/bin/bash", "-c", "apt-get -y update &&\
apt-get -y install ffmpeg &&\
apt-get -y install espeak libespeak1 libespeak-dev espeak-data &&\
apt-get -y install libsndfile-dev &&\
apt-get -y install libhdf5-dev &&\
apt-get -y install python3-dev &&\
apt-get -y install python3-tk &&\
apt-get -y install python3-pip &&\
python3 -m pip install --upgrade pip &&\
python3 -m pip install --upgrade setuptools wheel &&\
python3 -m pip install \"subaligner==${RELEASE_VERSION}\" &&\
python3 -m pip install \"subaligner[harmony]==${RELEASE_VERSION}\""]
6 changes: 0 additions & 6 deletions docker/docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,6 @@ services:
dockerfile: Dockerfile-CentOS7
image: baxtree/subaligner:${SUBALIGNER_VERSION}.el7

subaligner-ubuntu18:
build:
context: ./
dockerfile: Dockerfile-Ubuntu18
image: baxtree/subaligner:${SUBALIGNER_VERSION}.u18

subaligner-ubuntu20:
build:
context: ./
Expand Down
3 changes: 1 addition & 2 deletions requirements-arm64.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,14 @@ chardet==3.0.4
click==5.1
cloudpickle~=1.6.0
cycler==0.10.0
dask>=2021.10.0,<2022.1.0
decorator==4.3.0
distributed==1.13.0
filelock<4.0.0
google-auth-oauthlib==0.4.2
google-pasta~=0.2
graphviz==0.8.3
HeapDict==1.0.0
h5py<=4.0.0
h5py<4.0.0
html5lib==1.0b9
hyperopt==0.2.4
idna==2.8
Expand Down
3 changes: 1 addition & 2 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,13 @@ chardet~=3.0.4
click==5.1
cloudpickle~=1.6.0
cycler==0.10.0
dask>=2021.10.0,<2022.1.0
decorator==4.3.0
distributed==1.13.0
filelock<4.0.0
google-pasta~=0.2
graphviz==0.8.3
HeapDict==1.0.0
h5py<=3.6.0
h5py<4.0.0
html5lib==1.0b9
hyperopt==0.2.4
idna==2.8
Expand Down
6 changes: 1 addition & 5 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
with open("README.md") as readme_file:
readme = readme_file.read()

if machine() == "arm64":
if sys.platform == "darwin" and machine() == "arm64":
with open("requirements-arm64.txt") as requirements_file:
requirements = requirements_file.read().splitlines()[::-1]
else:
Expand Down Expand Up @@ -50,10 +50,6 @@ def get_tag(self):
python = f"py{sys.version_info.major}{sys.version_info.minor}"
if sys.platform == "darwin" and architecture == "arm64":
os_arch = "macosx_11_0_arm64"
elif sys.platform == "win32":
os_arch = "win32" if architecture == "32bit" else "win_amd64"
# elif sys.platform == "linux":
# os_arch = f"manylinux_2_17_{architecture}"
else:
os_arch = "any"
return python, "none", os_arch
Expand Down
2 changes: 1 addition & 1 deletion site/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
"sklearn",
"tensorflow",
"pysubs2",
"cchardet",
"chardet",
"captionstransformer",
"bs4",
"transformers",
Expand Down
Loading