mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2025-08-31 20:33:52 +00:00
fix: docker smoke test on build (#457)
This commit is contained in:
parent
ef9fb79ed4
commit
ee52a749c3
4
.github/workflows/docker-publish.yml
vendored
4
.github/workflows/docker-publish.yml
vendored
@ -47,7 +47,7 @@ jobs:
|
||||
- name: Test AMD image
|
||||
run: |
|
||||
DOCKER_PLATFORM="linux/amd64" DOCKER_IMAGE="$DOCKER_BUILD_REPOSITORY:amd-$SHORT_SHA" make docker-test
|
||||
IMAGE_NAME=$DOCKER_BUILD_REPOSITORY:amd-$SHORT_SHA make docker-smoke-test
|
||||
DOCKER_IMAGE=$DOCKER_BUILD_REPOSITORY:amd-$SHORT_SHA make docker-smoke-test
|
||||
- name: Push AMD image
|
||||
run: |
|
||||
# write to the build repository to cache for the publish-images job
|
||||
@ -81,7 +81,7 @@ jobs:
|
||||
run: |
|
||||
# only run a subset of tests on ARM, since they take a long time with emulation
|
||||
DOCKER_PLATFORM="linux/arm64" DOCKER_IMAGE="$DOCKER_BUILD_REPOSITORY:arm-$SHORT_SHA" make docker-test TEST_NAME=partition/test_text.py
|
||||
IMAGE_NAME=$DOCKER_BUILD_REPOSITORY:arm-$SHORT_SHA make docker-smoke-test
|
||||
DOCKER_IMAGE=$DOCKER_BUILD_REPOSITORY:arm-$SHORT_SHA make docker-smoke-test
|
||||
- name: Push ARM image
|
||||
run: |
|
||||
# write to the build repository to cache for the publish-images job
|
||||
|
2
Makefile
2
Makefile
@ -205,4 +205,4 @@ docker-test:
|
||||
|
||||
.PHONY: docker-smoke-test
|
||||
docker-smoke-test:
|
||||
IMAGE_NAME=${DOCKER_IMAGE} ./scripts/docker-smoke-test.sh
|
||||
DOCKER_IMAGE=${DOCKER_IMAGE} ./scripts/docker-smoke-test.sh
|
||||
|
@ -3,14 +3,14 @@
|
||||
set -euo pipefail
|
||||
DOCKER_REPOSITORY="${DOCKER_REPOSITORY:-quay.io/unstructured-io/unstructured}"
|
||||
PIP_VERSION="${PIP_VERSION:-22.2.1}"
|
||||
DOCKER_IMAGE_NAME="${DOCKER_IMAGE_NAME:-unstructured:dev}"
|
||||
DOCKER_IMAGE="${DOCKER_IMAGE:-unstructured:dev}"
|
||||
|
||||
DOCKER_BUILD_CMD=(docker buildx build --load -f Dockerfile \
|
||||
--build-arg PIP_VERSION="$PIP_VERSION" \
|
||||
--build-arg BUILDKIT_INLINE_CACHE=1 \
|
||||
--progress plain \
|
||||
--cache-from "$DOCKER_REPOSITORY":latest \
|
||||
-t "$DOCKER_IMAGE_NAME" .)
|
||||
-t "$DOCKER_IMAGE" .)
|
||||
|
||||
# only build for specific platform if DOCKER_BUILD_PLATFORM is set
|
||||
if [ -n "${DOCKER_BUILD_PLATFORM:-}" ]; then
|
||||
|
@ -7,7 +7,7 @@
|
||||
set -eux -o pipefail
|
||||
|
||||
CONTAINER_NAME=unstructured-smoke-test
|
||||
IMAGE_NAME="${IMAGE_NAME:-unstructured:latest}"
|
||||
DOCKER_IMAGE="${DOCKER_IMAGE:-unstructured:dev}"
|
||||
|
||||
# Change to the root of the repository
|
||||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
||||
@ -15,7 +15,7 @@ cd "$SCRIPT_DIR"/.. || exit 1
|
||||
|
||||
start_container() {
|
||||
echo Starting container "$CONTAINER_NAME"
|
||||
docker run -dt --rm --name "$CONTAINER_NAME" "$IMAGE_NAME"
|
||||
docker run -dt --rm --name "$CONTAINER_NAME" "$DOCKER_IMAGE"
|
||||
}
|
||||
|
||||
await_container() {
|
||||
|
Loading…
x
Reference in New Issue
Block a user