Download all images per gbifID with -NN suffix, plus circuit breaker …#34
Draft
Jiahao419 wants to merge 1 commit into
Draft
Download all images per gbifID with -NN suffix, plus circuit breaker …#34Jiahao419 wants to merge 1 commit into
Jiahao419 wants to merge 1 commit into
Conversation
…and IIIF support - Save each gbifID's images as <id>-00.jpg, <id>-01.jpg... and mark a gbifID processed only when every image succeeds (partial failures go to failed_ids for retry). - Add hierarchical storage path (<base>/<prefix1>/<prefix2>/<id>-NN.jpg) to avoid millions of files in a single directory. - Add a per-host circuit breaker (threshold 500) and a timed cooldown for 429/timeout responses, so one bad host can't block the whole run. - Parse IIIF manifests into direct image URLs (1600/1200/800 variants). - On startup, retry IDs from failed_ids.txt first; remove them only on full success. - Drop the duplicate-check against legacy datasets; disable it for now. - .gitignore: exclude local scratch files (backups, dry runs, sorted/ merged checkpoint copies).
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This is a consolidation of changes I made to
image_install_parallel.pywhile taking over the pipeline. The new SQLite-tracked downloader in gardoslab/herbaria-data#1 is based on this same logic — opening this PR mainly to record the work in the original repo's history, as Tom suggested.What changed
<gbifID>-00.jpg,<gbifID>-01.jpg, etc. A gbifID is written toprocessed_ids.txtonly when all of its images succeed; partial failures go tofailed_ids.txtfor retry.<base>/<id[:3]>/<id[3:6]>/<id>-NN.jpg— to avoid millions of files in a single directory.swbiodiversity.org,mnhn.fr) can't block the whole run.failed_ids.txtare tried before new ones; an ID is removed fromfailed_idsonly on full success.GBIF-F24,harvard-herbaria) — it was loading thosemultimedia.txtfiles at startup, which contributed to the early memory issues..gitignore: exclude local scratch files (backups, dry runs, sorted/merged checkpoint copies).Status
-l mem_per_core=8G; no code change needed.