1010 DOCKER_BUILD_REPOSITORY : quay.io/unstructured-io/build-unstructured-api
1111 PACKAGE : " unstructured-api"
1212 PIPELINE_FAMILY : " general"
13- PIP_VERSION : " 25.1.1"
14- PYTHON_VERSION : " 3.12"
1513
1614jobs :
17- setup :
18- runs-on : ubuntu-latest
19- steps :
20- - uses : actions/checkout@v5
21- - uses : actions/cache@v5
22- id : virtualenv-cache
23- with :
24- path : |
25- .venv
26- key : ci-venv-${{ env.PIPELINE_FAMILY }}-${{ hashFiles('requirements/test.txt') }}
27- - name : Set up Python ${{ env.PYTHON_VERSION }}
28- uses : actions/setup-python@v6
29- with :
30- python-version : ${{ env.PYTHON_VERSION }}
31- - name : Setup virtual environment (no cache hit)
32- if : steps.virtualenv-cache.outputs.cache-hit != 'true'
33- run : |
34- python${{ env.PYTHON_VERSION }} -m venv .venv
35- source .venv/bin/activate
36- make install-ci
3715 set-short-sha :
38- runs-on : ubuntu-latest
16+ runs-on : opensource-linux-8core
3917 outputs :
4018 short_sha : ${{ steps.set_short_sha.outputs.short_sha }}
4119 steps :
@@ -45,21 +23,21 @@ jobs:
4523 build-images :
4624 strategy :
4725 matrix :
48- # arch: ["arm64", "amd64"]
49- # NOTE(luke): temporary disable arm64 since its failing the smoke test
50- arch : ["amd64"]
51- runs-on : ubuntu-latest
52- needs : [setup, set-short-sha]
26+ arch : ["arm64", "amd64"]
27+ runs-on : ${{ matrix.arch == 'arm64' && 'opensource-linux-arm64-4core' || 'opensource-linux-8core' }}
28+ needs : set-short-sha
5329 env :
5430 SHORT_SHA : ${{ needs.set-short-sha.outputs.short_sha }}
5531 DOCKER_PLATFORM : linux/${{ matrix.arch }}
5632 steps :
5733 - name : Set up Docker Buildx
5834 uses : docker/setup-buildx-action@v3
5935 with :
60- driver : ${{ matrix.arch == 'amd64' && ' docker' || 'docker-container' }}
36+ driver : docker
6137 - name : Checkout code
6238 uses : actions/checkout@v5
39+ - name : Read Python version from .python-version
40+ run : echo "PYTHON_VERSION=$(cat .python-version)" >> $GITHUB_ENV
6341 - name : Login to Quay.io
6442 uses : docker/login-action@v3
6543 with :
@@ -90,25 +68,23 @@ jobs:
9068 run : |
9169 DOCKER_BUILDKIT=1 docker buildx build --load -f Dockerfile \
9270 --platform=$DOCKER_PLATFORM \
93- --build-arg PIP_VERSION=$PIP_VERSION \
9471 --build-arg BUILDKIT_INLINE_CACHE=1 \
9572 --build-arg PIPELINE_PACKAGE=${{ env.PIPELINE_FAMILY }} \
9673 --provenance=false \
9774 --progress plain \
9875 --cache-from $DOCKER_BUILD_REPOSITORY:${{ matrix.arch }} \
9976 -t $DOCKER_BUILD_REPOSITORY:${{ matrix.arch }}-$SHORT_SHA .
100- - name : Set virtualenv cache
101- uses : actions/cache@v5
102- id : virtualenv-cache
77+ - name : Install uv
78+ uses : astral-sh/setup-uv@v5
10379 with :
104- path : |
105- .venv
106- key : ci-venv-${{ env.PIPELINE_FAMILY }}-${{ hashFiles('requirements/test.txt') }}
107- - name : Set up QEMU
108- uses : docker/setup-qemu-action@v3
80+ enable-cache : true
81+ cache-dependency-glob : " uv.lock"
82+ - name : Set up Python ${{ env.PYTHON_VERSION }}
83+ run : uv python install ${{ env.PYTHON_VERSION }}
84+ - name : Install test dependencies
85+ run : uv sync --group test --frozen
10986 - name : Test image
11087 run : |
111- source .venv/bin/activate
11288 export DOCKER_IMAGE="$DOCKER_BUILD_REPOSITORY:${{ matrix.arch }}-$SHORT_SHA"
11389 if [ "$DOCKER_PLATFORM" == "linux/arm64" ]; then
11490 SKIP_INFERENCE_TESTS=true make docker-test
12096 # write to the build repository to cache for the publish-images job
12197 docker push $DOCKER_BUILD_REPOSITORY:${{ matrix.arch }}-$SHORT_SHA
12298 publish-images :
123- runs-on : ubuntu-latest
124- needs : [setup, set-short-sha, build-images]
99+ runs-on : opensource-linux-8core
100+ needs : [set-short-sha, build-images]
125101 env :
126102 SHORT_SHA : ${{ needs.set-short-sha.outputs.short_sha }}
127103 steps :
@@ -138,25 +114,22 @@ jobs:
138114 - name : Pull AMD image
139115 run : |
140116 docker pull $DOCKER_BUILD_REPOSITORY:amd64-$SHORT_SHA
141- # - name: Pull ARM image
142- # run: |
143- # docker pull $DOCKER_BUILD_REPOSITORY:arm64-$SHORT_SHA
117+ - name : Pull ARM image
118+ run : |
119+ docker pull $DOCKER_BUILD_REPOSITORY:arm64-$SHORT_SHA
144120 - name : Push AMD and ARM tags
145121 run : |
146122 # these are used to construct the final manifest but also cache-from in subsequent runs
147123 docker tag $DOCKER_BUILD_REPOSITORY:amd64-$SHORT_SHA $DOCKER_BUILD_REPOSITORY:amd64
148124 docker push $DOCKER_BUILD_REPOSITORY:amd64
149- # docker tag $DOCKER_BUILD_REPOSITORY:arm64-$SHORT_SHA $DOCKER_BUILD_REPOSITORY:arm64
150- # docker push $DOCKER_BUILD_REPOSITORY:arm64
125+ docker tag $DOCKER_BUILD_REPOSITORY:arm64-$SHORT_SHA $DOCKER_BUILD_REPOSITORY:arm64
126+ docker push $DOCKER_BUILD_REPOSITORY:arm64
151127 - name : Push multiarch manifest
152128 run : |
153- #docker manifest create ${DOCKER_REPOSITORY}:latest $DOCKER_BUILD_REPOSITORY:amd64 $DOCKER_BUILD_REPOSITORY:arm64
154- docker manifest create ${DOCKER_REPOSITORY}:latest $DOCKER_BUILD_REPOSITORY:amd64
129+ docker manifest create ${DOCKER_REPOSITORY}:latest $DOCKER_BUILD_REPOSITORY:amd64 $DOCKER_BUILD_REPOSITORY:arm64
155130 docker manifest push $DOCKER_REPOSITORY:latest
156- #docker manifest create ${DOCKER_REPOSITORY}:$SHORT_SHA $DOCKER_BUILD_REPOSITORY:amd64 $DOCKER_BUILD_REPOSITORY:arm64
157- docker manifest create ${DOCKER_REPOSITORY}:$SHORT_SHA $DOCKER_BUILD_REPOSITORY:amd64
131+ docker manifest create ${DOCKER_REPOSITORY}:$SHORT_SHA $DOCKER_BUILD_REPOSITORY:amd64 $DOCKER_BUILD_REPOSITORY:arm64
158132 docker manifest push $DOCKER_REPOSITORY:$SHORT_SHA
159- VERSION=$(grep -m1 version preprocessing-pipeline-family.yaml | cut -d ' ' -f2)
160- #docker manifest create ${DOCKER_REPOSITORY}:$VERSION $DOCKER_BUILD_REPOSITORY:amd64 $DOCKER_BUILD_REPOSITORY:arm64
161- docker manifest create ${DOCKER_REPOSITORY}:$VERSION $DOCKER_BUILD_REPOSITORY:amd64
133+ VERSION=$(grep -oP '(?<=__version__ = ")[^"]+' prepline_general/api/__version__.py)
134+ docker manifest create ${DOCKER_REPOSITORY}:$VERSION $DOCKER_BUILD_REPOSITORY:amd64 $DOCKER_BUILD_REPOSITORY:arm64
162135 docker manifest push ${DOCKER_REPOSITORY}:$VERSION
0 commit comments