-
Notifications
You must be signed in to change notification settings - Fork 107
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consume raw/generator unmerged dump data in MSUnmerged #12059
Open
amaltaro
wants to merge
8
commits into
dmwm:master
Choose a base branch
from
amaltaro:msunmer-verbose
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
7365886
Log each step in the pipeline cleaning up RSE
amaltaro 55a73af
Fix RucioConMon gzipped response content
amaltaro cb31ddb
Return unique list of protected LFNS from wmstatsserver
amaltaro 9972a0a
Refactor filterUnmergedFiles method; drop file list/dict
amaltaro 128da10
Refactor cleanRSE method; list content recursively
amaltaro 48fdb05
fix unit tests for RucioConMon
amaltaro 9c9a4d6
Standlone script to test gfal rmdir
amaltaro f01c556
Remove sub-directories before going full scale with file deletion
amaltaro File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
457 changes: 205 additions & 252 deletions
457
src/python/WMCore/MicroService/MSUnmerged/MSUnmerged.py
Large diffs are not rendered by default.
Oops, something went wrong.
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
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
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
42 changes: 42 additions & 0 deletions
42
test/python/WMCore_t/MicroService_t/MSUnmerged_t/test_gfal.py
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,42 @@ | ||
#!/usr/bin/env python | ||
import logging | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. SELF-REMINDER: This script will be removed before merging this PR. |
||
|
||
try: | ||
import gfal2 | ||
except ImportError: | ||
# in case we do not have gfal2 installed | ||
print("FAILED to import gfal2. Use it only in emulateGfal2=True mode!!!") | ||
gfal2 = None | ||
|
||
def createGfal2Context(logLevel="normal", emulate=False): | ||
""" | ||
Create a gfal2 context object | ||
:param logLevel: string with the gfal2 log level | ||
:param emulate: boolean to be used by unit tests | ||
:return: the gfal2 context object | ||
""" | ||
if emulate: | ||
return None | ||
ctx = gfal2.creat_context() | ||
gfal2.set_verbose(gfal2.verbose_level.names[logLevel]) | ||
return ctx | ||
|
||
def testGFAL(ctx): | ||
logger = logging.getLogger() | ||
rseDirs = ["/store/unmerged/Run3Summer22EENanoAODv11/Wto2Q-3Jets_HT-200to400_TuneCP5_13p6TeV_madgraphMLM-pythia8/NANOAODSIM/126X_mcRun3_2022_realistic_postEE_v1-v3", | ||
"/store/unmerged/RunIISummer20UL18NanoAODv9/GluGluHoffshell_HToWWToENuTauNu_TuneCP5_13TeV_MCFM701-pythia8/NANOAODSIM/106X_upgrade2018_realistic_v16_L1v1-v2"] | ||
|
||
for dirPfn in rseDirs: | ||
try: | ||
# NOTE: For gfal2 rmdir() exit status of 0 is success | ||
rmdirSuccess = ctx.rmdir(dirPfn) == 0 | ||
except gfal2.GError as gfalExc: | ||
logger.warning("MISSING directory: %s, gfal code=%s", dirPfn, gfalExc.code) | ||
|
||
def main(): | ||
ctx = createGfal2Context() | ||
testGFAL(ctx) | ||
print("succeeded") | ||
|
||
if __name__ == '__main__': | ||
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
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
NOTE: I don't know how much data istream reads, but here you have two potential memory spikes, one is reading data from istream and another to parse the json. Instead, I suggest to use
which performs both steps as one, i.e. JSON can read from file object directly.