-
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
MSOutput: read RelVal output data policy from configuration #11024
Conversation
@haozturk @bbilin could you please review the RelVal output data placement policy defined in this PR: dmwm/deployment#1130 I am planning to change the implementation of this PR, but I would appreciate if you could confirm that the RelVal policy is sound. Thanks |
Jenkins results:
|
Jenkins results:
|
Jenkins results:
|
@amaltaro sorry for the latency in replying. For the moment we are running all the relval chains at CERN, so there is no need to add FNAL to the rules. We would hence suggest for all the tiers you mention to be stored only at CERN. Many thanks, B. for PdmV |
Jenkins results:
|
Jenkins results:
|
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.
Thanks for this PR @amaltaro. I do like the idea for separating the whole RelVal policy generation as a separate class. I've left few comments inline, which may be worth taking a look. None of them is a showstopper. Mostly requests for adding few lines for code documentation.
self.msConfig.setdefault("dbsUrl", "https://cmsweb-prod.cern.ch/dbs/prod/global/DBSReader") | ||
allDBSDatatiers = getDataTiers(self.msConfig['dbsUrl']) | ||
allDiskRSEs = self.rucio.evaluateRSEExpression("*", returnTape=False) | ||
self.relvalPolicy = RelValPolicy(self.msConfig.get("relvalPolicy", []), |
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.
I'd say this configuration check here:
self.msConfig.get("relvalPolicy", [])
would be good to have as a separate default assignment like the rest msConfig
fields.
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.
It would be good also to have a simple Note either in the docstring or as an inline comment about what should this list contain.
This module will contain the RelVal output data placement policy, where | ||
destinations will be decided according to the dataset datatier. | ||
""" | ||
def __init__(self, policyDesc, listDatatiers, listRSEs, logger=None): |
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.
Could you please add a doc string or a note explaining what would be the expected input to the init method?
:param policyDesc: list of dictionaries with the policy definition | ||
:param validDBSTiers: list with existent DBS datatiers | ||
:param validDiskRSEs: list with existent Rucio Disk RSEs | ||
:return: raise an exception if any validation fails |
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.
If the method does not return a value, I would format this line as:
No return value. The method raises an exception if any validation fails instead
or something similar.
msg = "The RelVal output data placement policy is not in the expected data type. " | ||
msg += "Type expected: list, while the current data type is: {}. ".format(type(policyDesc)) | ||
msg += "This critical ERROR must be fixed." | ||
raise RelValPolicyException(msg) from None |
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.
Once this is raised during the parameter validation process here, is there a place in the MSOutput
module code to handle this exception, or it is left to be treated as a general exception and just the proper messages to be logged?
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.
In case it fails, it's supposed to fail the MSOutput object initialization. Meaning, the service will crash until someone spots the problem.
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.
That's fair.
Thanks
# validate the datatier | ||
if not isinstance(item['datatier'], str): | ||
msg = "The 'datatier' parameter must be a string, not {}.".format(type(item['datatier'])) | ||
raise RelValPolicyException(msg) from None |
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.
Same question as above. And also for the few similar cases bellow.
validate the RSE name as well Create RelValPolicy module; revert MSOutput changes fix __str__ method to use json.dumps instead set number of copies according to number of destinations fix attribute name apply Todors suggestions
remake unit tests added stringification unit test
Jenkins results:
|
Thanks for the review, Todor. I think I either answered or fixed the comments/requests you made. If it looks good to you, could you please buy us some time and:
|
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.
This is looking pretty good.
Thanks @amaltaro
FYI I have also updated the documentation: https://github.com/dmwm/WMCore/wiki/ReqMgr2-MicroService-Output#relval-disk-policy |
perfect, thanks Alan! |
Fixes #10106
Status
ready
Description
This PR provides the following:
In addition to this, it also removes an obsolete use of the
tapePledges
configuration attribute.Is it backward compatible (if not, which system it affects?)
YES
Related PRs
None
External dependencies / deployment changes
Deployment changes: dmwm/deployment#1130
services_config: https://gitlab.cern.ch/cmsweb-k8s/services_config/-/merge_requests/131 and https://gitlab.cern.ch/cmsweb-k8s/services_config/-/merge_requests/130