Skip to content

Commit

Permalink
updated the Dockerfiles and the pipeline for 5.0.0-beta5
Browse files Browse the repository at this point in the history
  • Loading branch information
k4yt3x committed Apr 1, 2022
1 parent 268460f commit 65c0d32
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 14 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,24 +37,42 @@ jobs:

container:
name: Build and upload container
needs:
- setup
- create-release
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: mr-smithers-excellent/docker-build-push@v5
name: Build & push the Docker image
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USER }}
password: ${{ secrets.GHCR_TOKEN }}
dockerfile: Dockerfile
image: video2x
tags: latest, ${{ needs.setup.outputs.tag }}

container-variants:
name: Build and upload variants of the container
needs:
- setup
- create-release
strategy:
matrix:
version:
- slim-alpine
- cuda
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- uses: mr-smithers-excellent/docker-build-push@v5
name: Build & push Docker image
name: Build & push the Docker image
with:
registry: ghcr.io
username: ${{ secrets.GHCR_USER }}
password: ${{ secrets.GHCR_TOKEN }}
dockerfile: Dockerfile.${{ matrix.version }}
image: video2x
tags: latest, ${{ needs.setup.outputs.tag }}-${{ matrix.version }}
tags: ${{ needs.setup.outputs.tag }}-${{ matrix.version }}
17 changes: 9 additions & 8 deletions Dockerfile.cuda → Dockerfile
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
# Name: Video2X Dockerfile (CUDA)
# Name: Video2X Dockerfile
# Creator: K4YT3X
# Date Created: February 3, 2022
# Last Modified: March 20, 2022
# Last Modified: March 28, 2022

# stage 1: build the python components into wheels
FROM docker.io/nvidia/cuda:11.6.0-runtime-ubuntu20.04 AS builder
FROM docker.io/nvidia/vulkan:1.2.133-450 AS builder
ENV DEBIAN_FRONTEND=noninteractive

COPY . /video2x
WORKDIR /video2x
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
python3-pip python3-opencv python3-pil \
python3-dev libvulkan-dev glslang-dev glslang-tools \
python3.8 python3-pip python3-opencv python3-pil \
python3.8-dev libvulkan-dev glslang-dev glslang-tools \
build-essential swig \
&& pip wheel -w /wheels wheel pdm-pep517 .

# stage 2: install wheels into the final image
FROM docker.io/nvidia/cuda:11.6.0-runtime-ubuntu20.04
FROM docker.io/nvidia/vulkan:1.2.133-450
LABEL maintainer="K4YT3X <[email protected]>" \
org.opencontainers.image.source="https://github.com/k4yt3x/video2x" \
org.opencontainers.image.description="A lossless video/GIF/image upscaler"
Expand All @@ -31,12 +31,13 @@ COPY --from=builder /wheels /wheels
COPY . /video2x
WORKDIR /video2x
RUN apt-get install -y --no-install-recommends \
python3-pip python3-dev \
python3-pip python3.8-dev \
python3-opencv python3-pil \
mesa-vulkan-drivers cuda-drivers ffmpeg \
&& pip install --no-cache-dir --no-index -f /wheels . \
&& apt-get clean \
&& rm -rf /wheels /video2x /var/lib/apt/lists/*

WORKDIR /host
ENTRYPOINT ["/usr/bin/python3", "-m", "video2x"]
USER nobody
ENTRYPOINT ["/usr/bin/python3.8", "-m", "video2x"]
4 changes: 2 additions & 2 deletions Dockerfile.slim-alpine
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
# Last Modified: March 18, 2022

# stage: build python components into heels
FROM docker.io/library/python:3.10.2-alpine3.15 AS builder
FROM docker.io/library/python:3.10.4-alpine3.15 AS builder
COPY . /video2x
WORKDIR /video2x
RUN apk add --no-cache \
Expand All @@ -15,7 +15,7 @@ RUN apk add --no-cache \
&& pip wheel -w /wheels wheel pdm-pep517 .

# stage 2: install wheels into final image
FROM docker.io/library/python:3.10.2-alpine3.15
FROM docker.io/library/python:3.10.4-alpine3.15
LABEL maintainer="K4YT3X <[email protected]>" \
org.opencontainers.image.source="https://github.com/k4yt3x/video2x" \
org.opencontainers.image.description="A lossless video/GIF/image upscaler"
Expand Down
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ dependencies = [
"opencv-python>=4.5.5.64",
"pillow>=9.0.1",
"rich>=12.0.0",
"waifu2x-ncnn-vulkan-python>=1.0.1",
"waifu2x-ncnn-vulkan-python>=1.0.2rc3",
"srmd-ncnn-vulkan-python>=1.0.2",
"realsr-ncnn-vulkan-python>=1.0.4",
"rife-ncnn-vulkan-python>=1.1.2.post3",
Expand Down

0 comments on commit 65c0d32

Please sign in to comment.