mirror of
https://github.com/Unstructured-IO/unstructured.git
synced 2025-08-19 22:27:40 +00:00

- resolves an issue where occasionally deltalake writer results in SIGABRT event though the writer finished writing table properly on linux - this is first observed in ingest test - Putting the writer into a process mitigates this problem by forcing python to finish the deltalake rust backend to finish its tasks ## test To test this it is best to setup an instance on a Linux system since the problem has only been observed on Linux so far. Run ```bash PYTHONPATH=. ./unstructured/ingest/main.py delta-table --num-processes 2 --metadata-exclude coordinates,filename,file_directory,metadata.data_source.date_processed,metadata.last_modified,metadata.date_created,metadata.detection_class_prob,metadata.parent_id,metadata.category_depth --table-uri ../tables/delta/ --preserve-downloads --verbose delta-table --write-column json_data --mode overwrite --table-uri file:///tmp/delta ``` Without this fix occasionally we'd encounter `SIGABTR`. --------- Co-authored-by: ryannikolaidis <1208590+ryannikolaidis@users.noreply.github.com>
73 lines
2.1 KiB
Bash
Executable File
73 lines
2.1 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
|
|
set -eu -o pipefail
|
|
|
|
SCRIPT_DIR=$( cd -- "$( dirname -- "${BASH_SOURCE[0]}" )" &> /dev/null && pwd )
|
|
cd "$SCRIPT_DIR"/.. || exit 1
|
|
|
|
# NOTE(crag): sets number of tesseract threads to 1 which may help with more reproducible outputs
|
|
export OMP_THREAD_LIMIT=1
|
|
|
|
scripts=(
|
|
'test-ingest-s3.sh'
|
|
'test-ingest-azure.sh'
|
|
'test-ingest-box.sh'
|
|
'test-ingest-discord.sh'
|
|
'test-ingest-dropbox.sh'
|
|
'test-ingest-github.sh'
|
|
'test-ingest-gitlab.sh'
|
|
'test-ingest-google-drive.sh'
|
|
'test-ingest-wikipedia.sh'
|
|
'test-ingest-biomed-api.sh'
|
|
'test-ingest-biomed-path.sh'
|
|
'test-ingest-local.sh'
|
|
'test-ingest-slack.sh'
|
|
'test-ingest-against-api.sh'
|
|
'test-ingest-gcs.sh'
|
|
'test-ingest-onedrive.sh'
|
|
'test-ingest-outlook.sh'
|
|
'test-ingest-elasticsearch.sh'
|
|
'test-ingest-confluence-diff.sh'
|
|
'test-ingest-confluence-large.sh'
|
|
'test-ingest-airtable-diff.sh'
|
|
# NOTE(ryan): This test is disabled because it is triggering too many requests to the API
|
|
# 'test-ingest-airtable-large.sh'
|
|
'test-ingest-local-single-file.sh'
|
|
'test-ingest-local-single-file-with-encoding.sh'
|
|
'test-ingest-local-single-file-with-pdf-infer-table-structure.sh'
|
|
'test-ingest-notion.sh'
|
|
'test-ingest-delta-table.sh'
|
|
'test-ingest-salesforce.sh'
|
|
'test-ingest-jira.sh'
|
|
## NOTE(yuming): The following test should be put after any tests with --preserve-downloads option
|
|
'test-ingest-pdf-fast-reprocess.sh'
|
|
'test-ingest-sharepoint.sh'
|
|
)
|
|
|
|
CURRENT_SCRIPT="none"
|
|
|
|
function print_last_run() {
|
|
if [ "$CURRENT_SCRIPT" != "none" ]; then
|
|
echo "Last ran script: $CURRENT_SCRIPT"
|
|
fi
|
|
}
|
|
|
|
trap print_last_run EXIT
|
|
|
|
for script in "${scripts[@]}"; do
|
|
CURRENT_SCRIPT=$script
|
|
if [[ "$CURRENT_SCRIPT" == "test-ingest-notion.sh" ]]; then
|
|
echo "--------- RUNNING SCRIPT $script --- IGNORING FAILURES"
|
|
set +e
|
|
echo "Running ./test_unstructured_ingest/$script"
|
|
./test_unstructured_ingest/"$script"
|
|
set -e
|
|
echo "--------- FINISHED SCRIPT $script ---------"
|
|
else
|
|
echo "--------- RUNNING SCRIPT $script ---------"
|
|
echo "Running ./test_unstructured_ingest/$script"
|
|
./test_unstructured_ingest/"$script"
|
|
echo "--------- FINISHED SCRIPT $script ---------"
|
|
fi
|
|
done
|