Skip to content

Commit

Permalink
feat(website): remove emptiness check following LAPIS changes (#2112)
Browse files Browse the repository at this point in the history
  • Loading branch information
theosanderson authored Jun 19, 2024
1 parent 85d71e8 commit 801fa2b
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 31 deletions.
51 changes: 21 additions & 30 deletions kubernetes/loculus/silo_import_job.sh
Original file line number Diff line number Diff line change
Expand Up @@ -109,39 +109,30 @@ download_data() {
}

preprocessing() {
# TODO: #1489 Remove emptiness test once https://github.com/GenSpectrum/LAPIS-SILO/issues/244 fixed
rough_size_of_empty_zstd_file="12"
size_of_data=$(stat -c %s "$new_input_data")
if [ "$size_of_data" -gt "$rough_size_of_empty_zstd_file" ]; then
echo "data.ndjson.zst is not empty ($size_of_data bytes), starting preprocessing"

rm -f "$silo_input_data"

# This is necessary because the silo preprocessing is configured to expect the input data
# at /preprocessing/input/data.ndjson.zst
cp "$new_input_data" "$silo_input_data"

set +e
time /app/siloApi --preprocessing
exit_code=$?
set -e

if [ $exit_code -ne 0 ]; then
echo "SiloApi command failed with exit code $exit_code, cleaning up and exiting."
delete_all_input # Delete input so that we don't skip preprocessing next time due to hash equality
exit $exit_code
else
echo "SiloApi command succeeded"
echo "Removing touchfile $new_input_touchfile to indicate successful processing"
rm -f "$new_input_touchfile"
fi
echo "Starting preprocessing"

echo "preprocessing for $current_timestamp done"
else
echo "empty data.ndjson.zst ($size_of_data bytes), deleting all input"
delete_all_input
rm -f "$silo_input_data"

# This is necessary because the silo preprocessing is configured to expect the input data
# at /preprocessing/input/data.ndjson.zst
cp "$new_input_data" "$silo_input_data"

set +e
time /app/siloApi --preprocessing
exit_code=$?
set -e

if [ $exit_code -ne 0 ]; then
echo "SiloApi command failed with exit code $exit_code, cleaning up and exiting."
delete_all_input # Delete input so that we don't skip preprocessing next time due to hash equality
exit $exit_code
else
echo "SiloApi command succeeded"
echo "Removing touchfile $new_input_touchfile to indicate successful processing"
rm -f "$new_input_touchfile"
fi

echo "preprocessing for $current_timestamp done"
echo
}

Expand Down
2 changes: 1 addition & 1 deletion website/src/components/SearchPage/SearchFullUI.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -319,7 +319,7 @@ export const InnerSearchFullUI = ({
(aggregatedHook.error?.response?.status === 503 ? (
<div className='p-3 rounded-lg text-lg text-gray-700 text-italic'>
{' '}
The database is currently empty.
The retrieval database is currently initializing – please check back later.
</div>
) : (
<div className='bg-red-400 p-3 rounded-lg'>
Expand Down

0 comments on commit 801fa2b

Please sign in to comment.