Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/main' into api-upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
dolfim-ibm committed Jan 24, 2025
2 parents 3d22796 + 01fc6e1 commit d64cc33
Show file tree
Hide file tree
Showing 3 changed files with 109 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
matrix:
python-version: ['3.11']
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- uses: ./.github/actions/setup-poetry
with:
python-version: ${{ matrix.python-version }}
Expand Down
105 changes: 105 additions & 0 deletions .github/workflows/images-dryrun.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
name: Dry run docling-serve image building

on:
pull_request:
branches: ["main"]

env:
GHCR_REGISTRY: ghcr.io
GHCR_DOCLING_SERVE_CPU_IMAGE_NAME: ds4sd/docling-serve-cpu
GHCR_DOCLING_SERVE_GPU_IMAGE_NAME: ds4sd/docling-serve

jobs:
build_cpu_image:
name: Build docling-serve "CPU only" container image
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write

steps:
- name: Check out the repo
uses: actions/checkout@v4

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

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Extract metadata (tags, labels) for docling-serve (CPU only) ghcr image
id: ghcr_serve_cpu_meta
uses: docker/metadata-action@v5
with:
images: ${{ env.GHCR_REGISTRY }}/${{ env.GHCR_DOCLING_SERVE_CPU_IMAGE_NAME }}

- name: Build docling-serve-cpu image
id: build-serve-cpu-ghcr
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: ${{ steps.ghcr_serve_cpu_meta.outputs.tags }}
labels: ${{ steps.ghcr_serve_cpu_meta.outputs.labels }}
platforms: linux/amd64
cache-from: type=gha
cache-to: type=gha,mode=max
file: Containerfile
build-args: |
--build-arg CPU_ONLY=true
- name: Remove Local Docker Images
run: |
docker image prune -af
build_gpu_image:
name: Build docling-serve (with GPU support) container image
runs-on: ubuntu-latest
permissions:
packages: write
contents: read
attestations: write
id-token: write

steps:
- name: Check out the repo
uses: actions/checkout@v4

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

- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Extract metadata (tags, labels) for docling-serve (GPU) ghcr image
id: ghcr_serve_gpu_meta
uses: docker/metadata-action@v5
with:
images: ${{ env.GHCR_REGISTRY }}/${{ env.GHCR_DOCLING_SERVE_GPU_IMAGE_NAME }}

- name: Build docling-serve (GPU) image
id: build-serve-gpu-ghcr
uses: docker/build-push-action@v5
with:
context: .
push: false
tags: ${{ steps.ghcr_serve_gpu_meta.outputs.tags }}
labels: ${{ steps.ghcr_serve_gpu_meta.outputs.labels }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max
file: Containerfile
build-args: |
--build-arg CPU_ONLY=false
7 changes: 3 additions & 4 deletions .github/workflows/images.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,6 @@ env:
QUAY_DOCLING_SERVE_CPU_IMAGE_NAME: ds4sd/docling-serve-cpu
QUAY_DOCLING_SERVE_GPU_IMAGE_NAME: ds4sd/docling-serve

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build_and_publish_cpu_images:
name: Push docling-serve "CPU only" container image to GHCR and QUAY
Expand Down Expand Up @@ -105,6 +101,9 @@ jobs:
file: Containerfile
build-args: |
--build-arg CPU_ONLY=true
- name: Remove Local Docker Images
run: |
docker image prune -af
build_and_publish_gpu_images:
name: Push docling-serve (with GPU support) container image to GHCR and QUAY
Expand Down

0 comments on commit d64cc33

Please sign in to comment.