Skip to content

Commit

Permalink
build and push the dev image
Browse files Browse the repository at this point in the history
  • Loading branch information
baxtree committed Feb 24, 2025
1 parent a0a9e99 commit 2d3713c
Show file tree
Hide file tree
Showing 7 changed files with 207 additions and 71 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@ jobs:
python-version: [3.9]

steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Dependency installation
Expand Down
49 changes: 49 additions & 0 deletions .github/workflows/dockerhub-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Docker Hub Dev

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

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

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

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

- name: Free disk space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: Build and push the dev image
id: docker_build_dev
uses: docker/build-push-action@v4
with:
context: .
file: "./docker/Dockerfile-Dev"
platforms: linux/amd64,linux/arm64
allow: network.host
github-token: ${{ github.token }}
tags: baxtree/subaligner:dev
push: true
94 changes: 94 additions & 0 deletions .github/workflows/dockerhub-extra.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Docker Hub Release Extra

on:
release:
types: [ published ]
workflow_dispatch:

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

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

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

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

- name: Extract the tag
id: tag
run: |
echo "SUBALIGNER_TAG=${GITHUB_REF/refs\/tags\/v/}" >> $GITHUB_ENV
- name: Free disk space
uses: jlumbroso/free-disk-space@main
with:
tool-cache: false
android: true
dotnet: true
haskell: true
large-packages: true
docker-images: true
swap-storage: true

- name: Build and push the Ubuntu 20 image
id: docker_build_latest
uses: docker/build-push-action@v4
with:
context: .
file: "./docker/Dockerfile-Ubuntu20"
platforms: linux/amd64,linux/arm64
allow: network.host
github-token: ${{ github.token }}
tags: |
baxtree/subaligner:dev
push: true

- name: Remove the local Ubuntu 20 image
run: |
docker rmi -f baxtree/subaligner:${{ env.SUBALIGNER_TAG }}.u20
- name: Build and push the Fedora 34 image
id: docker_build_fed34
uses: docker/build-push-action@v2
with:
context: ./docker
file: "./docker/Dockerfile-Fedora34"
build-args: |
"RELEASE_VERSION=${{ env.SUBALIGNER_TAG }}"
platforms: linux/amd64,linux/arm64
allow: network.host
github-token: ${{ github.token }}
tags: baxtree/subaligner:${{ env.SUBALIGNER_TAG }}.fed34
push: true

- name: Remove the local Fedora 34 image
run: |
docker rmi -f baxtree/subaligner:${{ env.SUBALIGNER_TAG }}.fed34
- name: Build and push the ArchLinux image
id: docker_build_arch
uses: docker/build-push-action@v2
with:
context: ./docker
file: "./docker/Dockerfile-ArchLinux"
build-args: |
"RELEASE_VERSION=${{ env.SUBALIGNER_TAG }}"
platforms: linux/amd64
allow: network.host
github-token: ${{ github.token }}
tags: baxtree/subaligner:${{ env.SUBALIGNER_TAG }}.arch
push: true

- name: Remove the local ArchLinux image
run: |
docker rmi -f baxtree/subaligner:${{ env.SUBALIGNER_TAG }}.arch
74 changes: 7 additions & 67 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Docker Hub
name: Docker Hub Release

on:
release:
Expand All @@ -10,16 +10,16 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

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

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

- name: Login to Docker Hub
uses: docker/login-action@v2
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER_NAME }}
password: ${{ secrets.DOCKER_ACCESS_TOKEN }}
Expand All @@ -45,7 +45,7 @@ jobs:
uses: docker/build-push-action@v4
with:
context: ./docker
file: "./docker/Dockerfile-Ubuntu20"
file: "./docker/Dockerfile-Ubuntu22"
build-args: |
"RELEASE_VERSION=${{ env.SUBALIGNER_TAG }}"
platforms: linux/amd64,linux/arm64
Expand All @@ -54,65 +54,5 @@ jobs:
tags: |
baxtree/subaligner:latest
baxtree/subaligner:${{ env.SUBALIGNER_TAG }}
baxtree/subaligner:${{ env.SUBALIGNER_TAG }}.u20
baxtree/subaligner:${{ env.SUBALIGNER_TAG }}.u22
push: true

- name: Remove the local latest image
run: |
docker rmi -f baxtree/subaligner:latest
docker rmi -f baxtree/subaligner:${{ env.SUBALIGNER_TAG }}
docker rmi -f baxtree/subaligner:${{ env.SUBALIGNER_TAG }}.u20
- name: Build and push the Ubuntu 22 image
id: docker_build_u22
uses: docker/build-push-action@v4
with:
context: ./docker
file: "./docker/Dockerfile-Ubuntu22"
build-args: |
"RELEASE_VERSION=${{ env.SUBALIGNER_TAG }}"
platforms: linux/amd64,linux/arm64
allow: network.host
github-token: ${{ github.token }}
tags: baxtree/subaligner:${{ env.SUBALIGNER_TAG }}.u22
push: true

- name: Remove the local Ubuntu 22 image
run: |
docker rmi -f baxtree/subaligner:${{ env.SUBALIGNER_TAG }}.u22
- name: Build and push the Fedora 34 image
id: docker_build_fed34
uses: docker/build-push-action@v2
with:
context: ./docker
file: "./docker/Dockerfile-Fedora34"
build-args: |
"RELEASE_VERSION=${{ env.SUBALIGNER_TAG }}"
platforms: linux/amd64,linux/arm64
allow: network.host
github-token: ${{ github.token }}
tags: baxtree/subaligner:${{ env.SUBALIGNER_TAG }}.fed34
push: true

- name: Remove the local Fedora 34 image
run: |
docker rmi -f baxtree/subaligner:${{ env.SUBALIGNER_TAG }}.fed34
- name: Build and push the ArchLinux image
id: docker_build_arch
uses: docker/build-push-action@v2
with:
context: ./docker
file: "./docker/Dockerfile-ArchLinux"
build-args: |
"RELEASE_VERSION=${{ env.SUBALIGNER_TAG }}"
platforms: linux/amd64
allow: network.host
github-token: ${{ github.token }}
tags: baxtree/subaligner:${{ env.SUBALIGNER_TAG }}.arch
push: true

- name: Remove the local ArchLinux image
run: |
docker rmi -f baxtree/subaligner:${{ env.SUBALIGNER_TAG }}.arch
2 changes: 1 addition & 1 deletion .github/workflows/lint-charts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:

steps:
- name: Checkout sources
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Helm
uses: mamezou-tech/[email protected]
Expand Down
24 changes: 24 additions & 0 deletions docker/Dockerfile-Dev
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Subaligner Dev Docker Image
FROM ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive
ENV TZ=Europe/London

RUN mkdir -p /subaligner && chmod 755 /subaligner
COPY subaligner /subaligner/subaligner
COPY pyproject.toml /subaligner

WORKDIR /subaligner

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<65.0.0\" wheel &&\
python3 -m pip install -e . &&\
python3 -m pip install -e \".[harmony]\""]
31 changes: 30 additions & 1 deletion tests/integration/feature/subaligner.feature
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,37 @@ Feature: Subaligner CLI
Examples:
| aligner | mode | subtitle-in | subtitle-out |
| subaligner_1pass | <NULL> | "test.srt" | "test_aligned.srt" |
| subaligner_1pass | <NULL> | "test.ttml" | "test_aligned.ttml" |
| subaligner_1pass | <NULL> | "test.xml" | "test_aligned.xml" |
| subaligner_1pass | <NULL> | "test.dfxp" | "test_aligned.dfxp" |
| subaligner_1pass | <NULL> | "test.vtt" | "test_aligned.vtt" |
| subaligner_1pass | <NULL> | "test.ssa" | "test_aligned.ssa" |
| subaligner_1pass | <NULL> | "test.ass" | "test_aligned.ass" |
| subaligner_1pass | <NULL> | "test.sub" | "test_aligned.sub" |
| subaligner_1pass | <NULL> | "test_mpl2.txt" | "test_mpl2_aligned.txt" |
| subaligner_1pass | <NULL> | "test.tmp" | "test_aligned.tmp" |
| subaligner_1pass | <NULL> | "test.smi" | "test_aligned.smi" |
| subaligner_1pass | <NULL> | "test.sami" | "test_aligned.sami" |
| subaligner_1pass | <NULL> | "test.stl" | "test_aligned.srt" |
| subaligner_1pass | <NULL> | "test.scc" | "test_aligned.scc" |
| subaligner_1pass | <NULL> | "test.sbv" | "test_aligned.sbv" |
| subaligner_1pass | <NULL> | "test.ytt" | "test_aligned.ytt" |
| subaligner_2pass | <NULL> | "test.srt" | "test_aligned.srt" |
| subaligner_2pass | <NULL> | "test.ttml" | "test_aligned.ttml" |
| subaligner_1pass | <NULL> | "test.xml" | "test_aligned.xml" |
| subaligner_1pass | <NULL> | "test.dfxp" | "test_aligned.dfxp" |
| subaligner_2pass | <NULL> | "test.vtt" | "test_aligned.vtt" |
| subaligner_2pass | <NULL> | "test.ssa" | "test_aligned.ssa" |
| subaligner_2pass | <NULL> | "test.ass" | "test_aligned.ass" |
| subaligner_2pass | <NULL> | "test.sub" | "test_aligned.sub" |
| subaligner_2pass | <NULL> | "test_mpl2.txt" | "test_mpl2_aligned.txt" |
| subaligner_2pass | <NULL> | "test.tmp" | "test_aligned.tmp" |
| subaligner_2pass | <NULL> | "test.smi" | "test_aligned.smi" |
| subaligner_2pass | <NULL> | "test.sami" | "test_aligned.sami" |
| subaligner_2pass | <NULL> | "test.stl" | "test_aligned.srt" |
| subaligner_2pass | <NULL> | "test.scc" | "test_aligned.scc" |
| subaligner_2pass | <NULL> | "test.sbv" | "test_aligned.sbv" |
| subaligner_2pass | <NULL> | "test.ytt" | "test_aligned.ytt" |

@with-mode @script
Scenario Outline: Test alignments with plain texts as input
Expand Down Expand Up @@ -92,7 +122,6 @@ Feature: Subaligner CLI
Examples:
| video-in | subtitle-out |
| "test.mp4" | "test_aligned.json" |
# todo: also add a scenario for transcribe

@remote-inputs
Scenario Outline: Test alignments with remote inputs
Expand Down

0 comments on commit 2d3713c

Please sign in to comment.