Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 0 additions & 2 deletions .data/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions .data/datashare/.gitignore

This file was deleted.

2 changes: 0 additions & 2 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
old_temporal_manager
.data
.github
.venv
docs
Expand Down
110 changes: 110 additions & 0 deletions .github/workflows/publish_asr_worker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
name: Publish asr-worker

on:
workflow_dispatch:
push:
tags:
- 'asr-worker-*'

jobs:
publish-io-worker:
runs-on: ubuntu-latest
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: icij/asr-transcription-io-worker
tags: |
type=match,pattern=asr-worker-(.*),group=1

- 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:
# You'll need to set these secrets
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push image
uses: docker/build-push-action@v7
with:
target: io-worker
context: "{{defaultContext}}:asr-worker"
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

publish-preprocessing-worker:
runs-on: ubuntu-latest
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: icij/asr-transcription-preprocessing-worker

- 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:
# You'll need to set these secrets
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push image
uses: docker/build-push-action@v7
with:
target: preprocessing-worker
context: "{{defaultContext}}:asr-worker"
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

publish-inference-gpu-worker:
runs-on: ubuntu-latest
steps:
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: icij/asr-transcription-inference-gpu-worker

- 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:
# You'll need to set these secrets
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Build and push image
uses: docker/build-push-action@v7
with:
target: inference-gpu-worker
context: "{{defaultContext}}:asr-worker"
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: false
6 changes: 3 additions & 3 deletions .github/workflows/test_asr_worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
branches: [ 'main' ]
pull_request:
paths:
- 'datashare-python'
- 'asr-worker'
- 'datashare-python/**'
- 'asr-worker/**'

# TODO: leverage some caching here
jobs:
Expand Down Expand Up @@ -50,7 +50,7 @@ jobs:
- name: Run tests
run: |
cd asr-worker
uv sync --frozen --all-extras
uv sync --verbose --frozen --extra preprocessing --extra inference --extra cpu --dev
uv run --frozen python -m pytest --timeout=180 -vvv --cache-clear --show-capture=all -r A

concurrency:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_datashare_python.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [ 'main' ]
pull_request:
paths:
- 'datashare-python'
- 'datashare-python/**'

# TODO: leverage some caching here
jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_doc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [ 'main' ]
pull_request:
paths:
- 'docs'
- 'docs/**'

# TODO: leverage some caching here
jobs:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/test_translation_worker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
branches: [ 'main' ]
pull_request:
paths:
- 'translation-worker'
- 'translation-worker/**'

# TODO: leverage some caching here
jobs:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/test_worker_template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ on:
branches: [ 'main' ]
pull_request:
paths:
- 'datashare-python'
- 'worker-template'
- 'datashare-python/**'
- 'worker-template/**'

# TODO: leverage some caching here
jobs:
Expand Down
105 changes: 0 additions & 105 deletions Dockerfile

This file was deleted.

3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
lock-dist:
./scripts/lock-dist.sh ${project}

create-venv:
[ -d .venv ] || uv venv --python 3.13

Expand Down
80 changes: 80 additions & 0 deletions asr-worker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
FROM python:3.13-slim-trixie AS builder

RUN apt update && \
apt install -y --no-install-recommends build-essential g++ && \
rm -rf /var/lib/apt/lists/*


FROM python:3.13-slim-trixie AS asr-worker-builder

ENV PYTHONUNBUFFERED=1
ENV UV_HTTP_TIMEOUT=300
ENV UV_LINK_MODE=copy
ENV UV_COMPILE_BYTECODE=1
ENV UV_NO_DEV=1

COPY --from=ghcr.io/astral-sh/uv:0.11.6 /uv /uvx /bin/

WORKDIR /app


FROM asr-worker-builder AS io-worker
# Install deps first to optimize layer cache
RUN --mount=type=cache,target=~/.cache/uv \
--mount=type=bind,source=uv.dist.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync -v --frozen --no-editable --no-install-project

# Then copy code
ADD uv.dist.lock ./uv.lock
ADD pyproject.toml README.md ./
ADD asr_worker ./asr_worker/
ADD entrypoints/io_worker.sh ./entrypoints/io_worker.sh

# Then install service

RUN cd asr_worker && uv sync -v --frozen --no-editable
RUN rm -rf ~/.cache/pip $(uv cache dir)

ENTRYPOINT ["entrypoints/io_worker.sh"]


FROM asr-worker-builder AS preprocessing-worker
# Install deps first to optimize layer cache
RUN --mount=type=cache,target=~/.cache/uv \
--mount=type=bind,source=uv.dist.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync -v --frozen --no-editable --no-install-project --extra preprocessing

# Then copy code
ADD uv.dist.lock ./uv.lock
ADD pyproject.toml README.md ./
ADD asr_worker ./asr_worker/
ADD entrypoints/preprocessing_worker.sh ./entrypoints/preprocessing_worker.sh

# Then install service
RUN cd asr_worker && uv sync -v --frozen --no-editable --extra preprocessing
RUN rm -rf ~/.cache/pip $(uv cache dir)

ENTRYPOINT ["entrypoints/preprocessing_worker.sh"]


FROM asr-worker-builder AS inference-gpu-worker
RUN apt-get update && apt-get install -y build-essential
# Install deps first to optimize layer cache
RUN --mount=type=cache,target=~/.cache/uv \
--mount=type=bind,source=uv.dist.lock,target=uv.lock \
--mount=type=bind,source=pyproject.toml,target=pyproject.toml \
uv sync -v --frozen --no-editable --no-install-project --extra inference --extra gpu

# Then copy code
ADD uv.dist.lock ./uv.lock
ADD pyproject.toml README.md ./
ADD asr_worker ./asr_worker/
ADD entrypoints/inference_gpu_worker.sh ./entrypoints/inference_gpu_worker.sh

# Then install service
RUN cd asr_worker && uv sync -v --frozen --no-editable --extra inference
RUN rm -rf ~/.cache/pip $(uv cache dir)

ENTRYPOINT ["entrypoints/inference_gpu_worker.sh"]
Loading
Loading