forked from Unstructured-IO/unstructured
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: install all extras in Dockerfile (Unstructured-IO#419)
* Adds step to install all extras * Adds smoke test of wikipedia ingest to validate in CI
- Loading branch information
1 parent
32c79ca
commit 59785e4
Showing
4 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
#!/bin/bash | ||
|
||
# Start the containerized repository and run ingest tests | ||
|
||
# shellcheck disable=SC2317 # Shellcheck complains that trap functions are unreachable... | ||
|
||
set -eux -o pipefail | ||
|
||
CONTAINER_NAME=unstructured-smoke-test | ||
IMAGE_NAME="${IMAGE_NAME:-unstructured:latest}" | ||
|
||
# Change to the root of the repository | ||
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd ) | ||
cd "$SCRIPT_DIR"/.. || exit 1 | ||
|
||
start_container() { | ||
echo Starting container "$CONTAINER_NAME" | ||
docker run -dt --rm --name "$CONTAINER_NAME" "$IMAGE_NAME" | ||
} | ||
|
||
await_container() { | ||
echo Waiting for container to start | ||
until [ "$(docker inspect -f '{{.State.Status}}' $CONTAINER_NAME)" == "running" ]; do | ||
sleep 1 | ||
done | ||
} | ||
|
||
stop_container() { | ||
echo Stopping container "$CONTAINER_NAME" | ||
docker stop "$CONTAINER_NAME" | ||
} | ||
|
||
start_container | ||
|
||
# Regardless of test result, stop the container | ||
trap stop_container EXIT | ||
|
||
await_container | ||
|
||
# Run the tests | ||
docker cp test_unstructured_ingest $CONTAINER_NAME:/home | ||
docker exec "$CONTAINER_NAME" /bin/bash -c "/home/test_unstructured_ingest/test-ingest-wikipedia.sh" | ||
|
||
result=$? | ||
exit $result |