Some checks failed
build_docker / build_easyocr (linux/amd64) (push) Has been cancelled
build_docker / build_easyocr (linux/arm64) (push) Has been cancelled
build_docker / build_doctr (linux/amd64) (push) Has been cancelled
build_docker / essential (push) Successful in 1s
build_docker / essential (pull_request) Successful in 1s
build_docker / build_gpu (linux/amd64) (push) Has been cancelled
build_docker / build_gpu (linux/arm64) (push) Has been cancelled
build_docker / manifest_cpu (push) Has been cancelled
build_docker / manifest_gpu (push) Has been cancelled
build_docker / build_cpu (linux/amd64) (push) Has been cancelled
build_docker / build_doctr (linux/arm64) (push) Has been cancelled
build_docker / manifest_easyocr (push) Has been cancelled
build_docker / manifest_doctr (push) Has been cancelled
build_docker / build_cpu (linux/arm64) (push) Has been cancelled
build_docker / build_cpu (linux/amd64) (pull_request) Successful in 4m56s
build_docker / build_gpu (linux/amd64) (pull_request) Has been cancelled
build_docker / build_gpu (linux/arm64) (pull_request) Has been cancelled
build_docker / manifest_cpu (pull_request) Has been cancelled
build_docker / manifest_gpu (pull_request) Has been cancelled
build_docker / build_easyocr (linux/amd64) (pull_request) Has been cancelled
build_docker / build_easyocr (linux/arm64) (pull_request) Has been cancelled
build_docker / build_doctr (linux/amd64) (pull_request) Has been cancelled
build_docker / build_doctr (linux/arm64) (pull_request) Has been cancelled
build_docker / manifest_easyocr (pull_request) Has been cancelled
build_docker / manifest_doctr (pull_request) Has been cancelled
build_docker / build_cpu (linux/arm64) (pull_request) Has been cancelled
318 lines
11 KiB
YAML
318 lines
11 KiB
YAML
name: build_docker
|
|
run-name: ${{ gitea.event.head_commit.message }}
|
|
|
|
on:
|
|
pull_request:
|
|
types:
|
|
- opened
|
|
- synchronize
|
|
push:
|
|
branches:
|
|
- main
|
|
- gpu_support
|
|
|
|
env:
|
|
PADDLE_VERSION: "3.0.0"
|
|
WHEEL_BASE_URL: "https://seryus.ddns.net/api/packages/unir/generic"
|
|
|
|
jobs:
|
|
essential:
|
|
runs-on: ubuntu-latest
|
|
outputs:
|
|
Version: 1.0.${{ gitea.run_number }}
|
|
repo: seryus.ddns.net
|
|
image_cpu: seryus.ddns.net/unir/paddle-ocr-cpu
|
|
image_gpu: seryus.ddns.net/unir/paddle-ocr-gpu
|
|
image_easyocr: seryus.ddns.net/unir/easyocr-cpu
|
|
image_doctr: seryus.ddns.net/unir/doctr-cpu
|
|
steps:
|
|
- name: Output version info
|
|
run: |
|
|
echo "## Build Info" >> $GITHUB_STEP_SUMMARY
|
|
echo "Version: 1.0.${{ gitea.run_number }}" >> $GITHUB_STEP_SUMMARY
|
|
echo "Event: ${{ gitea.event_name }}" >> $GITHUB_STEP_SUMMARY
|
|
|
|
# CPU image: Matrix build for amd64 and arm64
|
|
build_cpu:
|
|
runs-on: ubuntu-latest
|
|
needs: essential
|
|
strategy:
|
|
matrix:
|
|
platform:
|
|
- linux/amd64
|
|
- linux/arm64
|
|
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 Gitea Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ needs.essential.outputs.repo }}
|
|
username: username
|
|
password: ${{ secrets.CI_READWRITE }}
|
|
|
|
- name: Get arch suffix
|
|
id: arch
|
|
run: |
|
|
if [ "${{ matrix.platform }}" = "linux/amd64" ]; then
|
|
echo "suffix=amd64" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "suffix=arm64" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Download ARM64 wheel from Gitea packages
|
|
if: matrix.platform == 'linux/arm64'
|
|
run: |
|
|
mkdir -p src/paddle_ocr/wheels
|
|
curl -L -o src/paddle_ocr/wheels/paddlepaddle-${{ env.PADDLE_VERSION }}-cp311-cp311-linux_aarch64.whl \
|
|
"${{ env.WHEEL_BASE_URL }}/paddlepaddle-cpu-arm64/${{ env.PADDLE_VERSION }}/paddlepaddle-${{ env.PADDLE_VERSION }}-cp311-cp311-linux_aarch64.whl"
|
|
ls -la src/paddle_ocr/wheels/
|
|
|
|
- name: Build and push CPU image (${{ matrix.platform }})
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: src/paddle_ocr
|
|
file: src/paddle_ocr/Dockerfile.cpu
|
|
platforms: ${{ matrix.platform }}
|
|
push: true
|
|
tags: |
|
|
${{ needs.essential.outputs.image_cpu }}:${{ needs.essential.outputs.Version }}-${{ steps.arch.outputs.suffix }}
|
|
${{ needs.essential.outputs.image_cpu }}:${{ steps.arch.outputs.suffix }}
|
|
|
|
# GPU image: Matrix build for amd64 and arm64
|
|
build_gpu:
|
|
runs-on: ubuntu-latest
|
|
needs: essential
|
|
strategy:
|
|
matrix:
|
|
platform:
|
|
- linux/amd64
|
|
- linux/arm64
|
|
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 Gitea Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ needs.essential.outputs.repo }}
|
|
username: username
|
|
password: ${{ secrets.CI_READWRITE }}
|
|
|
|
- name: Get arch suffix
|
|
id: arch
|
|
run: |
|
|
if [ "${{ matrix.platform }}" = "linux/amd64" ]; then
|
|
echo "suffix=amd64" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "suffix=arm64" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Download ARM64 GPU wheel from Gitea packages
|
|
if: matrix.platform == 'linux/arm64'
|
|
run: |
|
|
mkdir -p src/paddle_ocr/wheels
|
|
curl -L -o src/paddle_ocr/wheels/paddlepaddle_gpu-${{ env.PADDLE_VERSION }}-cp311-cp311-linux_aarch64.whl \
|
|
"${{ env.WHEEL_BASE_URL }}/paddlepaddle-gpu-arm64/${{ env.PADDLE_VERSION }}/paddlepaddle_gpu-${{ env.PADDLE_VERSION }}-cp311-cp311-linux_aarch64.whl"
|
|
ls -la src/paddle_ocr/wheels/
|
|
|
|
- name: Build and push GPU image (${{ matrix.platform }})
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: src/paddle_ocr
|
|
file: src/paddle_ocr/Dockerfile.gpu
|
|
platforms: ${{ matrix.platform }}
|
|
push: true
|
|
tags: |
|
|
${{ needs.essential.outputs.image_gpu }}:${{ needs.essential.outputs.Version }}-${{ steps.arch.outputs.suffix }}
|
|
${{ needs.essential.outputs.image_gpu }}:${{ steps.arch.outputs.suffix }}
|
|
|
|
# Create multi-arch manifest for CPU image
|
|
manifest_cpu:
|
|
runs-on: ubuntu-latest
|
|
needs: [essential, build_cpu]
|
|
steps:
|
|
- name: Login to Gitea Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ needs.essential.outputs.repo }}
|
|
username: username
|
|
password: ${{ secrets.CI_READWRITE }}
|
|
|
|
- name: Create multi-arch manifest (CPU)
|
|
run: |
|
|
docker buildx imagetools create -t ${{ needs.essential.outputs.image_cpu }}:latest \
|
|
${{ needs.essential.outputs.image_cpu }}:amd64 \
|
|
${{ needs.essential.outputs.image_cpu }}:arm64
|
|
docker buildx imagetools create -t ${{ needs.essential.outputs.image_cpu }}:${{ needs.essential.outputs.Version }} \
|
|
${{ needs.essential.outputs.image_cpu }}:${{ needs.essential.outputs.Version }}-amd64 \
|
|
${{ needs.essential.outputs.image_cpu }}:${{ needs.essential.outputs.Version }}-arm64
|
|
|
|
# Create multi-arch manifest for GPU image
|
|
manifest_gpu:
|
|
runs-on: ubuntu-latest
|
|
needs: [essential, build_gpu]
|
|
steps:
|
|
- name: Login to Gitea Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ needs.essential.outputs.repo }}
|
|
username: username
|
|
password: ${{ secrets.CI_READWRITE }}
|
|
|
|
- name: Create multi-arch manifest (GPU)
|
|
run: |
|
|
docker buildx imagetools create -t ${{ needs.essential.outputs.image_gpu }}:latest \
|
|
${{ needs.essential.outputs.image_gpu }}:amd64 \
|
|
${{ needs.essential.outputs.image_gpu }}:arm64
|
|
docker buildx imagetools create -t ${{ needs.essential.outputs.image_gpu }}:${{ needs.essential.outputs.Version }} \
|
|
${{ needs.essential.outputs.image_gpu }}:${{ needs.essential.outputs.Version }}-amd64 \
|
|
${{ needs.essential.outputs.image_gpu }}:${{ needs.essential.outputs.Version }}-arm64
|
|
|
|
# EasyOCR image: Matrix build for amd64 and arm64
|
|
build_easyocr:
|
|
runs-on: ubuntu-latest
|
|
needs: essential
|
|
strategy:
|
|
matrix:
|
|
platform:
|
|
- linux/amd64
|
|
- linux/arm64
|
|
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 Gitea Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ needs.essential.outputs.repo }}
|
|
username: username
|
|
password: ${{ secrets.CI_READWRITE }}
|
|
|
|
- name: Get arch suffix
|
|
id: arch
|
|
run: |
|
|
if [ "${{ matrix.platform }}" = "linux/amd64" ]; then
|
|
echo "suffix=amd64" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "suffix=arm64" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Build and push EasyOCR image (${{ matrix.platform }})
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: src/easyocr_service
|
|
file: src/easyocr_service/Dockerfile
|
|
platforms: ${{ matrix.platform }}
|
|
push: true
|
|
tags: |
|
|
${{ needs.essential.outputs.image_easyocr }}:${{ needs.essential.outputs.Version }}-${{ steps.arch.outputs.suffix }}
|
|
${{ needs.essential.outputs.image_easyocr }}:${{ steps.arch.outputs.suffix }}
|
|
|
|
# DocTR image: Matrix build for amd64 and arm64
|
|
build_doctr:
|
|
runs-on: ubuntu-latest
|
|
needs: essential
|
|
strategy:
|
|
matrix:
|
|
platform:
|
|
- linux/amd64
|
|
- linux/arm64
|
|
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 Gitea Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ needs.essential.outputs.repo }}
|
|
username: username
|
|
password: ${{ secrets.CI_READWRITE }}
|
|
|
|
- name: Get arch suffix
|
|
id: arch
|
|
run: |
|
|
if [ "${{ matrix.platform }}" = "linux/amd64" ]; then
|
|
echo "suffix=amd64" >> $GITHUB_OUTPUT
|
|
else
|
|
echo "suffix=arm64" >> $GITHUB_OUTPUT
|
|
fi
|
|
|
|
- name: Build and push DocTR image (${{ matrix.platform }})
|
|
uses: docker/build-push-action@v5
|
|
with:
|
|
context: src/doctr_service
|
|
file: src/doctr_service/Dockerfile
|
|
platforms: ${{ matrix.platform }}
|
|
push: true
|
|
tags: |
|
|
${{ needs.essential.outputs.image_doctr }}:${{ needs.essential.outputs.Version }}-${{ steps.arch.outputs.suffix }}
|
|
${{ needs.essential.outputs.image_doctr }}:${{ steps.arch.outputs.suffix }}
|
|
|
|
# Create multi-arch manifest for EasyOCR image
|
|
manifest_easyocr:
|
|
runs-on: ubuntu-latest
|
|
needs: [essential, build_easyocr]
|
|
steps:
|
|
- name: Login to Gitea Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ needs.essential.outputs.repo }}
|
|
username: username
|
|
password: ${{ secrets.CI_READWRITE }}
|
|
|
|
- name: Create multi-arch manifest (EasyOCR)
|
|
run: |
|
|
docker buildx imagetools create -t ${{ needs.essential.outputs.image_easyocr }}:latest \
|
|
${{ needs.essential.outputs.image_easyocr }}:amd64 \
|
|
${{ needs.essential.outputs.image_easyocr }}:arm64
|
|
docker buildx imagetools create -t ${{ needs.essential.outputs.image_easyocr }}:${{ needs.essential.outputs.Version }} \
|
|
${{ needs.essential.outputs.image_easyocr }}:${{ needs.essential.outputs.Version }}-amd64 \
|
|
${{ needs.essential.outputs.image_easyocr }}:${{ needs.essential.outputs.Version }}-arm64
|
|
|
|
# Create multi-arch manifest for DocTR image
|
|
manifest_doctr:
|
|
runs-on: ubuntu-latest
|
|
needs: [essential, build_doctr]
|
|
steps:
|
|
- name: Login to Gitea Registry
|
|
uses: docker/login-action@v3
|
|
with:
|
|
registry: ${{ needs.essential.outputs.repo }}
|
|
username: username
|
|
password: ${{ secrets.CI_READWRITE }}
|
|
|
|
- name: Create multi-arch manifest (DocTR)
|
|
run: |
|
|
docker buildx imagetools create -t ${{ needs.essential.outputs.image_doctr }}:latest \
|
|
${{ needs.essential.outputs.image_doctr }}:amd64 \
|
|
${{ needs.essential.outputs.image_doctr }}:arm64
|
|
docker buildx imagetools create -t ${{ needs.essential.outputs.image_doctr }}:${{ needs.essential.outputs.Version }} \
|
|
${{ needs.essential.outputs.image_doctr }}:${{ needs.essential.outputs.Version }}-amd64 \
|
|
${{ needs.essential.outputs.image_doctr }}:${{ needs.essential.outputs.Version }}-arm64
|