Repository navigation
Run the crawler benchmark with only Docker and python3 - #674
Open
blueheron786 wants to merge 6 commits into
Open
blueheron786 wants to merge 6 commits into
blueheron786 wants to merge 6 commits into
Conversation
The compose runner now needs nothing but the standard library, so
benchmark.py runs on its own with any python3 3.9+, with no uv, Rust or
build. deploy/crawler/benchmark.sh downloads it and runs it in the
crawler's directory, so a volunteer can run:
curl -fsSL https://raw.githubusercontent.com/mwmbl/mwmbl/main/deploy/crawler/benchmark.sh | sh
The process runner, which needs psutil, redis and python-dotenv, moves to
benchmark_process.py and is imported only when chosen. make optimize uses
the system python3.
Fixes #672
No functional changes to the crawler.
…mark.py for 3.9 Fixes #672 No functional changes to the crawler.
Codecov Report❌ Patch coverage is
📢 Thoughts on this report? Let us know! |
The process runner now runs the crawler with the Python the benchmark runs under, with the checkout on PYTHONPATH, so it no longer fails with 'No module named mwmbl'. It explains a missing checkout or package instead of a traceback, and deploy/crawler/benchmark-requirements.txt lists what it imports. Fixes #672 No functional changes to the crawler.
The script always downloaded benchmark.py from main, so a checkout ran main's older benchmark, which needs psutil, requests and an installed mwmbl. In a checkout it now runs the file beside it and downloads only when piped from curl. Fixes #672 No functional changes to the crawler.
A user outside the docker group got a failure from deep inside the benchmark. The script now checks 'docker info' first, and tells them to join the docker group, or that the daemon is not running. Fixes #672 No functional changes to the crawler.
Remove --exhaustive and the climbing search: the benchmark now tries every combination of the process and thread counts. Fixes #672 No functional changes to the crawler.
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.
Fixes #672. Builds on #669 (based on its branch).
What changed
mwmbl/crawler/benchmark.pyis now standard-library only for the compose runner, and runs on Python 3.9+ (macOS's system python3), so it needs no uv, Rust or build. Ruff lints it as py39.mwmbl/crawler/benchmark_process.py, imported only when--runner processis chosen.deploy/crawler/benchmark.shchecks for python3/docker compose, downloadsbenchmark.pyand runs it, so a volunteer can run, in their crawler directory:curl -fsSL https://raw.githubusercontent.com/mwmbl/mwmbl/main/deploy/crawler/benchmark.sh | shmake optimizeuses the system python3.--env-fileis passed todocker composeinstead of loaded with python-dotenv; a missing compose file gets a clear error.Docs: mwmbl/crawler/README.md, and the book (blueheron786/book branch
benchmark-no-build).Verification
make check,test/test_crawler_benchmark.py(56 passed), including a new test that runs the file withpython -S(no site-packages).benchmark.py --helpand the missing-compose-file path under a real Python 3.9 with-S.benchmark.shwithMWMBL_BENCHMARK_URL=file://...; shellcheck anddash -nclean; temp file cleaned up.Reviewed by subagents (code, security, trust & safety, holistic): no blockers; fixed truncated-download guard, trap handling, py39 lint. Open: memory check uses host RAM (not the Docker Desktop VM's) on macOS — pre-existing.