fix: docker smoke test on build (#457)

This commit is contained in:
ryannikolaidis 2023-04-06 10:03:42 -07:00 committed by GitHub
parent ef9fb79ed4
commit ee52a749c3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 7 additions and 7 deletions

View File

@ -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

View File

@ -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

View File

@ -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

View File

@ -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() {