feat: New container images (#68)

Signed-off-by: Michele Dolfi <dol@zurich.ibm.com>
This commit is contained in:
Michele Dolfi
2025-02-26 12:49:20 +01:00
committed by GitHub
parent 343b985287
commit 7e6d9cdef3
4 changed files with 60 additions and 68 deletions

View File

@@ -8,36 +8,34 @@ concurrency:
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
build_cpu_image: build_image:
name: Build docling-serve "CPU only" container image name: Build ${{ matrix.spec.name }} container image
permissions: strategy:
packages: write matrix:
contents: read spec:
attestations: write - name: ds4sd/docling-serve
id-token: write build_args: |
UV_SYNC_EXTRA_ARGS=--no-extra cu124 --no-extra cpu
uses: ./.github/workflows/job-image.yml platforms: linux/amd64, linux/arm64
with: - name: ds4sd/docling-serve-cpu
publish: false
build_args: | build_args: |
UV_SYNC_EXTRA_ARGS=--no-extra cu124 UV_SYNC_EXTRA_ARGS=--no-extra cu124
ghcr_image_name: ds4sd/docling-serve-cpu platforms: linux/amd64, linux/arm64
quay_image_name: "" - name: ds4sd/docling-serve-cu124
build_gpu_image:
name: Build docling-serve (with GPU support) container image
permissions:
packages: write
contents: read
attestations: write
id-token: write
uses: ./.github/workflows/job-image.yml
with:
publish: false
build_args: | build_args: |
UV_SYNC_EXTRA_ARGS=--no-extra cpu UV_SYNC_EXTRA_ARGS=--no-extra cpu
platforms: linux/amd64 platforms: linux/amd64
ghcr_image_name: ds4sd/docling-serve
permissions:
packages: write
contents: read
attestations: write
id-token: write
uses: ./.github/workflows/job-image.yml
with:
publish: false
build_args: ${{ matrix.spec.build_args }}
ghcr_image_name: ${{ matrix.spec.name }}
quay_image_name: "" quay_image_name: ""
platforms: ${{ matrix.spec.platforms }}

View File

@@ -7,54 +7,41 @@ on:
release: release:
types: [published] types: [published]
# env:
# GHCR_REGISTRY: ghcr.io
# # GHCR_DOCLING_SERVE_CPU_IMAGE_NAME: ds4sd/docling-serve-cpu
# # GHCR_DOCLING_SERVE_GPU_IMAGE_NAME: ds4sd/docling-serve
# QUAY_REGISTRY: quay.io
# # QUAY_DOCLING_SERVE_CPU_IMAGE_NAME: ds4sd/docling-serve-cpu
# # QUAY_DOCLING_SERVE_GPU_IMAGE_NAME: ds4sd/docling-serve
concurrency: concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true cancel-in-progress: true
jobs: jobs:
build_and_publish_cpu_images: build_and_publish_images:
name: Push docling-serve "CPU only" container image to GHCR and QUAY name: Build and push ${{ matrix.spec.name }} container image to GHCR and QUAY
permissions: strategy:
packages: write matrix:
contents: read spec:
attestations: write - name: ds4sd/docling-serve
id-token: write build_args: |
secrets: inherit UV_SYNC_EXTRA_ARGS=--no-extra cu124 --no-extra cpu
platforms: linux/amd64, linux/arm64
uses: ./.github/workflows/job-image.yml - name: ds4sd/docling-serve-cpu
with:
publish: true
environment: registry-creds
build_args: | build_args: |
UV_SYNC_EXTRA_ARGS=--no-extra cu124 UV_SYNC_EXTRA_ARGS=--no-extra cu124
ghcr_image_name: ds4sd/docling-serve-cpu platforms: linux/amd64, linux/arm64
quay_image_name: ds4sd/docling-serve-cpu - name: ds4sd/docling-serve-cu124
build_and_publish_gpu_images:
name: Push docling-serve (with GPU support) container image to GHCR and QUAY
permissions:
packages: write
contents: read
attestations: write
id-token: write
secrets: inherit
uses: ./.github/workflows/job-image.yml
with:
publish: true
environment: registry-creds
build_args: | build_args: |
UV_SYNC_EXTRA_ARGS=--no-extra cpu UV_SYNC_EXTRA_ARGS=--no-extra cpu
platforms: linux/amd64 platforms: linux/amd64
ghcr_image_name: ds4sd/docling-serve
quay_image_name: ds4sd/docling-serve
permissions:
packages: write
contents: read
attestations: write
id-token: write
secrets: inherit
uses: ./.github/workflows/job-image.yml
with:
publish: true
environment: registry-creds
build_args: ${{ matrix.spec.build_args }}
ghcr_image_name: ${{ matrix.spec.name }}
quay_image_name: ${{ matrix.spec.name }}
platforms: ${{ matrix.spec.platforms }}

View File

@@ -28,11 +28,7 @@ on:
env: env:
GHCR_REGISTRY: ghcr.io GHCR_REGISTRY: ghcr.io
# GHCR_DOCLING_SERVE_CPU_IMAGE_NAME: ds4sd/docling-serve-cpu
# GHCR_DOCLING_SERVE_GPU_IMAGE_NAME: ds4sd/docling-serve
QUAY_REGISTRY: quay.io QUAY_REGISTRY: quay.io
# QUAY_DOCLING_SERVE_CPU_IMAGE_NAME: ds4sd/docling-serve-cpu
# QUAY_DOCLING_SERVE_GPU_IMAGE_NAME: ds4sd/docling-serve
jobs: jobs:
image: image:
@@ -136,6 +132,10 @@ jobs:
file: Containerfile file: Containerfile
build-args: ${{ inputs.build_args }} build-args: ${{ inputs.build_args }}
# - name: Inspect the image details
# run: |
# echo "${{ steps.ghcr_push.outputs.metadata }}"
- name: Remove Local Docker Images - name: Remove Local Docker Images
run: | run: |
docker image prune -af docker image prune -af

View File

@@ -24,6 +24,13 @@ action-lint-file:
md-lint-file: md-lint-file:
$(CMD_PREFIX) touch .markdown-lint $(CMD_PREFIX) touch .markdown-lint
.PHONY: docling-serve-image
docling-serve-image: Containerfile
$(ECHO_PREFIX) printf " %-12s Containerfile\n" "[docling-serve]"
$(CMD_PREFIX) docker build --load --build-arg "UV_SYNC_EXTRA_ARGS=--no-extra cu124 --no-extra cpu" -f Containerfile -t ghcr.io/ds4sd/docling-serve:$(TAG) .
$(CMD_PREFIX) docker tag ghcr.io/ds4sd/docling-serve:$(TAG) ghcr.io/ds4sd/docling-serve:main
$(CMD_PREFIX) docker tag ghcr.io/ds4sd/docling-serve:$(TAG) quay.io/ds4sd/docling-serve:main
.PHONY: docling-serve-cpu-image .PHONY: docling-serve-cpu-image
docling-serve-cpu-image: Containerfile ## Build docling-serve "cpu only" container image docling-serve-cpu-image: Containerfile ## Build docling-serve "cpu only" container image
$(ECHO_PREFIX) printf " %-12s Containerfile\n" "[docling-serve CPU]" $(ECHO_PREFIX) printf " %-12s Containerfile\n" "[docling-serve CPU]"
@@ -31,12 +38,12 @@ docling-serve-cpu-image: Containerfile ## Build docling-serve "cpu only" contain
$(CMD_PREFIX) docker tag ghcr.io/ds4sd/docling-serve-cpu:$(TAG) ghcr.io/ds4sd/docling-serve-cpu:main $(CMD_PREFIX) docker tag ghcr.io/ds4sd/docling-serve-cpu:$(TAG) ghcr.io/ds4sd/docling-serve-cpu:main
$(CMD_PREFIX) docker tag ghcr.io/ds4sd/docling-serve-cpu:$(TAG) quay.io/ds4sd/docling-serve-cpu:main $(CMD_PREFIX) docker tag ghcr.io/ds4sd/docling-serve-cpu:$(TAG) quay.io/ds4sd/docling-serve-cpu:main
.PHONY: docling-serve-gpu-image .PHONY: docling-serve-cu124-image
docling-serve-gpu-image: Containerfile ## Build docling-serve container image with GPU support docling-serve-cu124-image: Containerfile ## Build docling-serve container image with GPU support
$(ECHO_PREFIX) printf " %-12s Containerfile\n" "[docling-serve with GPU]" $(ECHO_PREFIX) printf " %-12s Containerfile\n" "[docling-serve with Cuda 12.4]"
$(CMD_PREFIX) docker build --load --build-arg "UV_SYNC_EXTRA_ARGS=--no-extra cpu" -f Containerfile --platform linux/amd64 -t ghcr.io/ds4sd/docling-serve:$(TAG) . $(CMD_PREFIX) docker build --load --build-arg "UV_SYNC_EXTRA_ARGS=--no-extra cpu" -f Containerfile --platform linux/amd64 -t ghcr.io/ds4sd/docling-serve-cu124:$(TAG) .
$(CMD_PREFIX) docker tag ghcr.io/ds4sd/docling-serve:$(TAG) ghcr.io/ds4sd/docling-serve:main $(CMD_PREFIX) docker tag ghcr.io/ds4sd/docling-serve-cu124:$(TAG) ghcr.io/ds4sd/docling-serve-cu124:main
$(CMD_PREFIX) docker tag ghcr.io/ds4sd/docling-serve:$(TAG) quay.io/ds4sd/docling-serve:main $(CMD_PREFIX) docker tag ghcr.io/ds4sd/docling-serve-cu124:$(TAG) quay.io/ds4sd/docling-serve-cu124:main
.PHONY: action-lint .PHONY: action-lint
action-lint: .action-lint ## Lint GitHub Action workflows action-lint: .action-lint ## Lint GitHub Action workflows