Harden the CRAB backend with the DSProd production lessons - #311
Open
kandrosov wants to merge 5 commits into
Open
Harden the CRAB backend with the DSProd production lessons#311kandrosov wants to merge 5 commits into
kandrosov wants to merge 5 commits into
Conversation
…ter sandbox preflight, tolerant persistence
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
Ports the CRAB lessons from the DSProd 115k-job production (cms-flaf/DSProd #5, #6, #7, #11, #16, #17, #18, #19) into FLAF's central CRAB layer, and fixes two related defects on the shared HTCondor path found while auditing against them.
Changes
Status and polling (
FLAFCrabJobManager, new)crab statusresponse is retried (3×, 15 s apart), then that task's jobs are reported pending — one message per task instead of one error per job — and the workflow raises only after 10 consecutive unreadable polls. Previously a single such response failed every job of the task, skipped the whole poll iteration (no resubmission), and killed the workflow afterpoll_fails= 5 occurrences.poll_intervalthrough the MRO, so the CrabWorkflow class default never won (same trapparallel_jobshad).crab.poll_interval/--poll-intervaloverride.Credentials and files
HOME=$TMPDIR/flaf_crab_home_<uid>: CRAB rewrites~/.crab3on every command, and with$HOMEon AFS a multi-day production dies the moment the AFS token lapses. A generatedcrabwrapper additionally runs every subcommand exceptsubmitfrom that home, socrab.logstays out of the working area (submitkeeps its cwd — the generated config namesscriptExe/inputFilesrelative to it).crabin is now built insetup_job_manager— once, with an actionable error — instead of lazily inside each submission, where a failure surfaces as a per-jobdummy_job_id/ "unknown job id" storm half an hour later.--print-statusand completeness checks do not build the sandbox.CreateVomsProxyno longer deletes a short-lived proxy at instantiation: on a CRAB worker that deleted the ~23:59 h delegated proxy and failed every remote-storage call in the job. The renewal policy lives incomplete(); batch nodes accept any valid delegated proxy and refuse to create one.Submission at scale
refill_fraction × parallel_jobsis still achievable, and released immediately once running + waiting can no longer fill one. The free-slot rule was permanently open in any part-filled pool, so each poll's retry handful became its own tiny CRAB task.--no-pollbypasses the gate (its documented one-shot resubmission must not be parked).max_runtime/n_cpusare excluded fromreq()propagation: a requiring task's resources no longer silently cap what it requires (e.g. a 2 h / 1 CPU plot task capping the 5 h / 2 CPU merge jobs). CLI per-task values still reach that task's branches (workflow↔branch conversion is unaffected), and explicitreq(..., max_runtime=...)pins keep working._uses_bundles()returns False underLAW_JOB_HOME. Grouped jobs evaluateworkflow_requires()on the worker with the forwarded--bundleflag; a transient false-incomplete could previously trigger a rebuild of the tarball other jobs were downloading.Site selection (
run_tools/crab_sites.py, new)Site.whitelistprecedence overSite.blacklist, so with the defaultT1_*/T2_*/T3_*globs every configured exclusion was silently void. Excluded sites are now removed from the whitelist itself; a glob covering an excluded site is expanded from the CRIC processing-site list (computeunitsentries — cvmfs SITECONF also lists storage endpoints, which the CRAB server refuses). The list is cached 24 h per analysis; CRIC is only consulted when something is actually excluded. Blacklist entries may be globs too.crab status, keyed by the per-attempt job id — law's poll attaches per-jobextrapositionally, sosite_historyinjob_datacan sit on the wrong job when several CRAB projects are live). A site whose recent jobs mostly fail, measured over jobs sent (ended + in flight) and judged against the other sites' record, is kept out of the next CRAB task. Tunable viacrab.auto_blacklist; one black-hole worker node otherwise eats a production at ~250 jobs/hour.crab.ignore_global_blacklist(opt-in) waives CMS's own blacklist of known-broken sites.Testing
test/test_crab_hardening.py: 56 unit tests, each encoding a production failure mode (unreadable status, retry parking, wave-gate scenarios incl. the tail, glob blacklists, black-hole quarantine with baseline exclusion, delegated-proxy survival,req()isolation, worker bundle guard).BaseRemoteWorkflowProxy.poll()/submit()loop was driven with the new proxy through 600 randomized scenarios (pool sizes 1–50, refill 0.0–1.0, failures, retries, resumed runs, mid-runparallel_jobschanges) — no hangs, outcomes identical to stock law with fewer, larger CRAB tasks.run_ci_test.shchain on CRAB (HH_bbtautau, Run3_2022EE — 5-minute cadence, nocrab.logoutside/tmp,unsubmitted: 0throughout, whitelist globs intact) and on HTCondor for HH_bbtautau, HH_bbWW and H_mumu, with per-task resource isolation verified in the generated JDLs (AnaTupleFileTask40 h/4 CPU,AnaTupleMergeTask48 h/2 CPU,HistTupleProducerTask5 h/4 CPU — each its own default, no leakage), plus a HelloWorld CRAB smoke covering the sandbox preflight.mkdocs build --strictpasses; docs updated in this PR (docs/workflow/crab.mddocumented the old blacklist semantics backwards,docs/workflow/arguments.mddescribed a refill guarantee the old rule never delivered).Notes
mainindependently of this PR:defineControlRegions(HH_bbWW Implement plotting task #111) referencesTwoStageDNN_M{mp}_*columns that only theTwoStageDNNpayload produces, so any config without that payload crashes at HistTuple production. Validated here with that hunk temporarily reverted.