From 69785f0d623e072a156ff4246b3dd3e13a598195 Mon Sep 17 00:00:00 2001 From: Benjamin Boudreau Date: Wed, 18 Dec 2024 10:48:12 -0500 Subject: [PATCH] chore(ci): fix executor image building --- .../publish_executor_containers.yaml | 23 ++++++++++++++++--- .github/workflows/publish_indexify_pypi.yaml | 10 ++++---- examples/pdf_document_extraction/images.py | 9 +++++--- 3 files changed, 31 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish_executor_containers.yaml b/.github/workflows/publish_executor_containers.yaml index 9176910bb..e3a789b87 100644 --- a/.github/workflows/publish_executor_containers.yaml +++ b/.github/workflows/publish_executor_containers.yaml @@ -2,6 +2,13 @@ name: Publish Example Executor Containers on: workflow_dispatch: + inputs: + indexify_version: + type: string + description: | + Indexify version to use to build the executor containers. + Note: Should ideally match the tag used for this workflow. + required: true jobs: build-and-push-docker-images: @@ -9,9 +16,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 + with: + ref: main - uses: actions/setup-python@v4 with: - python-version: "3.10" + python-version: "3.11" - name: Set up QEMU uses: docker/setup-qemu-action@v3 - name: Set up Docker Buildx @@ -23,11 +32,19 @@ jobs: password: ${{ secrets.DOCKERHUB_TOKEN }} - run: | curl -LsSf https://astral.sh/uv/install.sh | sh # install uv - uv pip install --system indexify -U - indexify-cli build-default-image + uv pip install --system 'indexify==${{ inputs.indexify_version }}' -U + indexify-cli build-default-image --python-version 3.10 docker push tensorlake/indexify-executor-default:3.10 + + indexify-cli build-default-image --python-version 3.11 docker push tensorlake/indexify-executor-default:3.11 + indexify-cli build-default-image --python-version 3.12 + docker push tensorlake/indexify-executor-default:3.12 + + indexify-cli build-default-image --python-version 3.13 + docker push tensorlake/indexify-executor-default:3.13 + indexify-cli build-image examples/pdf_document_extraction/images.py indexify-cli build-image examples/pdf_structured_extraction/workflow.py indexify-cli build-image examples/tweetsgenerator/workflow.py diff --git a/.github/workflows/publish_indexify_pypi.yaml b/.github/workflows/publish_indexify_pypi.yaml index c300f8dfa..d762f54cd 100644 --- a/.github/workflows/publish_indexify_pypi.yaml +++ b/.github/workflows/publish_indexify_pypi.yaml @@ -97,8 +97,8 @@ jobs: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - run: | - sleep 15 - pip install indexify -U - indexify-cli build-default-image - docker push tensorlake/indexify-executor-default:3.10 - docker push tensorlake/indexify-executor-default:3.11 + # wait for the indexify-cli to be available + sleep 60 + - uses: ./.github/workflows/publish_executor_containers.yaml + with: + indexify_version: ${{ needs.extract-version.outputs.version }} diff --git a/examples/pdf_document_extraction/images.py b/examples/pdf_document_extraction/images.py index 11816cd48..ca21f6435 100644 --- a/examples/pdf_document_extraction/images.py +++ b/examples/pdf_document_extraction/images.py @@ -1,14 +1,16 @@ from indexify import Image http_client_image = ( - Image(python="3.11") + Image() .name("tensorlake/pdf-blueprint-download") + .base_image(f"python:3.11-slim-bookworm") .run("pip install httpx") ) chroma_image = ( - Image(python="3.11") + Image() .name("tensorlake/blueprints-chromadb") + .base_image(f"python:3.11-slim-bookworm") .run("pip install chromadb") .run("pip install pillow") ) @@ -24,8 +26,9 @@ ) lance_image = ( - Image(python="3.11") + Image() .name("tensorlake/pdf-blueprint-lancdb") + .base_image(f"python:3.11-slim-bookworm") .run("pip install lancedb") )