Add diagnosis APIs to MediaWiki benchmark#552
Open
marziehlenjaniMeta wants to merge 1 commit intofacebookresearch:v2-betafrom
Open
Add diagnosis APIs to MediaWiki benchmark#552marziehlenjaniMeta wants to merge 1 commit intofacebookresearch:v2-betafrom
marziehlenjaniMeta wants to merge 1 commit intofacebookresearch:v2-betafrom
Conversation
Summary:
This diff adds reusable pre-flight diagnostic checks and centralizes diagnosis
merging at the framework level, so all benchmarks benefit automatically.
**1. Shared check functions (`packages/common/diagnosis_utils.py`)**
Added two reusable check functions to the shared diagnosis API:
- `check_file_descriptor_limit()`: verifies ulimit is sufficient, with optional
auto-fix that records the change under `notable_auto_fixes`
- `check_selinux()`: detects SELinux Enforcing mode (causes HHVM segfaults)
These join existing `check_ipv6_hostname()` and `check_port_available()`.
**2. Generic pre-flight CLI (`packages/common/preflight_checks.py`)**
A reusable script callable from any benchmark's bash runner:
- Accepts `--benchmark <name>` and `--min-fds <N>` for per-benchmark config
- Runs SELinux, IPv6 hostname, and file descriptor checks
- Fixes inverted `check_ipv6_hostname` usage (returns True when IPv6 is
detected, not necessarily broken — should not gate `all_ok`)
**3. Framework-level diagnosis merge (`benchpress/cli/commands/run.py`)**
After `job.run()`, `run.py` now automatically merges DiagnosisRecorder records
(failures + auto-fixes) into metrics via `DIAGNOSIS_FILE_PATH`. Every benchmark
gets diagnosis merging for free — no per-benchmark merge code needed. Removed
the now-redundant `merge_failure_to_results()` call from tao_bench's
`run_autoscale.py`.
**4. MediaWiki integration**
- `run.sh`: Calls common `preflight_checks.py` before benchmark; raises
`ulimit -n` in bash so child processes (HHVM, nginx, wrk) inherit the limit
- `jobs.yml`: Added `-U {auto_fix_ulimit}` arg with default `auto_fix_ulimit=1`
to all 5 mediawiki job entries
Differential Revision: D98805269
|
@marziehlenjaniMeta has exported this pull request. If you are a Meta employee, you can view the originating Diff in D98805269. |
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.
Summary:
This diff adds reusable pre-flight diagnostic checks and centralizes diagnosis
merging at the framework level, so all benchmarks benefit automatically.
1. Shared check functions (
packages/common/diagnosis_utils.py)Added two reusable check functions to the shared diagnosis API:
check_file_descriptor_limit(): verifies ulimit is sufficient, with optionalauto-fix that records the change under
notable_auto_fixescheck_selinux(): detects SELinux Enforcing mode (causes HHVM segfaults)These join existing
check_ipv6_hostname()andcheck_port_available().2. Generic pre-flight CLI (
packages/common/preflight_checks.py)A reusable script callable from any benchmark's bash runner:
--benchmark <name>and--min-fds <N>for per-benchmark configcheck_ipv6_hostnameusage (returns True when IPv6 isdetected, not necessarily broken — should not gate
all_ok)3. Framework-level diagnosis merge (
benchpress/cli/commands/run.py)After
job.run(),run.pynow automatically merges DiagnosisRecorder records(failures + auto-fixes) into metrics via
DIAGNOSIS_FILE_PATH. Every benchmarkgets diagnosis merging for free — no per-benchmark merge code needed. Removed
the now-redundant
merge_failure_to_results()call from tao_bench'srun_autoscale.py.4. MediaWiki integration
run.sh: Calls commonpreflight_checks.pybefore benchmark; raisesulimit -nin bash so child processes (HHVM, nginx, wrk) inherit the limitjobs.yml: Added-U {auto_fix_ulimit}arg with defaultauto_fix_ulimit=1to all 5 mediawiki job entries
Differential Revision: D98805269