File tree 4 files changed +58
-0
lines changed
4 files changed +58
-0
lines changed Original file line number Diff line number Diff line change 47
47
- name : Test AMD image
48
48
run : |
49
49
DOCKER_PLATFORM="linux/amd64" DOCKER_IMAGE="$DOCKER_BUILD_REPOSITORY:amd-$SHORT_SHA" make docker-test
50
+ IMAGE_NAME=$DOCKER_BUILD_REPOSITORY:amd-$SHORT_SHA make docker-smoke-test
50
51
- name : Push AMD image
51
52
run : |
52
53
# write to the build repository to cache for the publish-images job
80
81
run : |
81
82
# only run a subset of tests on ARM, since they take a long time with emulation
82
83
DOCKER_PLATFORM="linux/arm64" DOCKER_IMAGE="$DOCKER_BUILD_REPOSITORY:arm-$SHORT_SHA" make docker-test TEST_NAME=partition/test_text.py
84
+ IMAGE_NAME=$DOCKER_BUILD_REPOSITORY:arm-$SHORT_SHA make docker-smoke-test
83
85
- name : Push ARM image
84
86
run : |
85
87
# write to the build repository to cache for the publish-images job
Original file line number Diff line number Diff line change @@ -72,6 +72,13 @@ RUN python3.8 -m pip install pip==${PIP_VERSION} && \
72
72
pip install --no-cache -r requirements/test.txt && \
73
73
pip install --no-cache -r requirements/huggingface.txt && \
74
74
pip install --no-cache -r requirements/dev.txt && \
75
+ pip install --no-cache -r requirements/ingest-azure.txt && \
76
+ pip install --no-cache -r requirements/ingest-github.txt && \
77
+ pip install --no-cache -r requirements/ingest-gitlab.txt && \
78
+ pip install --no-cache -r requirements/ingest-google-drive.txt && \
79
+ pip install --no-cache -r requirements/ingest-reddit.txt && \
80
+ pip install --no-cache -r requirements/ingest-s3.txt && \
81
+ pip install --no-cache -r requirements/ingest-wikipedia.txt && \
75
82
pip install --no-cache -r requirements/local-inference.txt && \
76
83
pip install --no-cache
"detectron2@git+https://github.com/facebookresearch/[email protected] #egg=detectron2"
77
84
Original file line number Diff line number Diff line change @@ -203,3 +203,7 @@ docker-test:
203
203
-v ${CURRENT_DIR} /test_unstructured:/home/test_unstructured \
204
204
$(DOCKER_IMAGE ) \
205
205
bash -c " pytest $( if $( TEST_NAME) ,-k $( TEST_NAME) ,) test_unstructured"
206
+
207
+ .PHONY : docker-smoke-test
208
+ docker-smoke-test :
209
+ ./scripts/docker-smoke-test.sh
Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Start the containerized repository and run ingest tests
4
+
5
+ # shellcheck disable=SC2317 # Shellcheck complains that trap functions are unreachable...
6
+
7
+ set -eux -o pipefail
8
+
9
+ CONTAINER_NAME=unstructured-smoke-test
10
+ IMAGE_NAME=" ${IMAGE_NAME:- unstructured: latest} "
11
+
12
+ # Change to the root of the repository
13
+ SCRIPT_DIR=$( cd -- " $( dirname -- " ${BASH_SOURCE[0]} " ) " & > /dev/null && pwd )
14
+ cd " $SCRIPT_DIR " /.. || exit 1
15
+
16
+ start_container () {
17
+ echo Starting container " $CONTAINER_NAME "
18
+ docker run -dt --rm --name " $CONTAINER_NAME " " $IMAGE_NAME "
19
+ }
20
+
21
+ await_container () {
22
+ echo Waiting for container to start
23
+ until [ " $( docker inspect -f ' {{.State.Status}}' $CONTAINER_NAME ) " == " running" ]; do
24
+ sleep 1
25
+ done
26
+ }
27
+
28
+ stop_container () {
29
+ echo Stopping container " $CONTAINER_NAME "
30
+ docker stop " $CONTAINER_NAME "
31
+ }
32
+
33
+ start_container
34
+
35
+ # Regardless of test result, stop the container
36
+ trap stop_container EXIT
37
+
38
+ await_container
39
+
40
+ # Run the tests
41
+ docker cp test_unstructured_ingest $CONTAINER_NAME :/home
42
+ docker exec " $CONTAINER_NAME " /bin/bash -c " /home/test_unstructured_ingest/test-ingest-wikipedia.sh"
43
+
44
+ result=$?
45
+ exit $result
You can’t perform that action at this time.
0 commit comments