-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
nextclade: check use of cache in separate script/rule
Doing this in preparation for adding version checks to the decision tree of whether we should use the Nextclade cache. Replaces download of the empty .renew file with just a check that the S3 object exists to limit shuffling of files.
- Loading branch information
1 parent
fd9d7e1
commit 055c5b7
Showing
2 changed files
with
68 additions
and
15 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
#!/bin/bash | ||
set -euo pipefail | ||
|
||
vendored="$(dirname "$0")"/../vendored | ||
|
||
main() { | ||
s3_dst="${1:?A destination s3:// URL where the renew file is hosted is required as the first argument.}" | ||
s3_src="${2:?A source s3:// URL where the fallback renew file is hosted is required as the second argument.}" | ||
# Nextclade dataset reference wildcard | ||
reference="${3:-}" | ||
if renew-flag-exists; then | ||
echo "[INFO] Found renew flag" >&2 | ||
echo "false" | ||
exit 0 | ||
fi | ||
|
||
echo "true" | ||
} | ||
|
||
renew-flag-exists() { | ||
local renew_file="nextclade${reference}.tsv.zst.renew" | ||
local dst_renew_file="${s3_dst}/${renew_file}" | ||
local src_renew_file="${s3_src}/${renew_file}" | ||
|
||
"$vendored"/s3-object-exists "${dst_renew_file}" || "$vendored"/s3-object-exists "${src_renew_file}" | ||
} | ||
|
||
main "$@" |
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