-
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
Add code to insert transition record; code re-factoring #11915
Conversation
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.
Instead of updating this script which requires direct access to the mongodb cluster, I would suggest to provide such changes under: https://github.com/dmwm/WMCore/blob/master/bin/adhoc-scripts/updatePileupObjects.py
Jenkins results:
|
Alan, I added code to |
2638989
to
351705b
Compare
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.
Valentin, in addition to the comments along the code, please also update the PR description (as now you are providing changes to 2 scripts).
:param dryrun: option to run dry-run mode (boolean) | ||
:return: nothing | ||
""" | ||
with open(fin, 'r', encoding='utf-8') as istream: |
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 looks like that with the current changes, we should stop making fin
required in this script, no? In other words, I see 2 scenarios:
a) we provide a json file as input and write (update) them in the database
b) we do not provide a json file, fetch documents via MSPileup, update them in memory and persist them back in the database.
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 think both options are valid use-case and I adjusted the code to support them both.
dcc10ce
to
dd61fb3
Compare
Alan, I updated the code and description, please have a final look. |
Jenkins results:
|
Jenkins results:
|
Jenkins results:
|
Jenkins results:
|
Alan, upon testing the script against testbed I found new flaws in its logic. The main issue was the following:
The last step did a wrong thing since when we provided a document with already existing transition record the MSPileup code itself run the logic to use last transition record to create custom pileup name, etc. This is why I saw documents with such kind of structures:
In other words, we should never pass all record for the update and only pass those which have not had any transition record. I fixed this and other issue. The other issue I found is when I tried to use I left my last commits without squashing that you can easily review them. Please do that: |
Jenkins results:
|
Jenkins results:
|
@vkuznet Valentin, if I understood this statement right: and the example of transition records keeping the same container fraction of EDIT: Can you please create a new GH issue to track this? |
Yes, it seems it is bug in server side, but I can't be sure since I don't know which code is deployed on testbed. We had so many issues/PRs that it is frankly possible we run not the latest version which may not have this issue. Said that, I agree to file new issue to check this. |
Valentin, you can check the service version through this REST API: and see what changes went in through the CHANGES file: Said that, testbed is running In summary, the services version we have in testbed (and production) are supposed to have 100% of this feature. |
Upon further investigation, now I see that in fact, the reported here transition records #11915 (comment) are correctly created since the entire MSPileup record contains container fraction 0.5 while I send a document with transition record 1.0. That's why we start see growth of transition records. But other existing records where container fraction was 1.0 have not had this issue. The remaining mystery for me right now how empty DN appears. |
Ok, now I understand where empty DN comes from too. It comes from |
Jenkins results:
|
Alan, I don't know what else needs to be done here, but I removed default DN since it can be provided as external parameter to the script. Therefore, I request final review and if you're satisfied I can squash changes for the merge. |
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.
Everything looks good to me, but I would like to first update the transition records with this script, before we actually merge it.
It looks like testbed has the expected transition record now, right? Do I understand it right that first we need to upgrade MSPileup, before we can actually update the production records?
Cmsweb testbed have already transition records. But the MSPileupData code checks if transition record is in place, see https://github.com/dmwm/WMCore/blob/master/src/python/WMCore/MicroService/MSPileup/MSPileupData.py#L259, before allowing the update. Therefore, I think we first need transition record to be in place in production MongoDB then we can setup new code. |
Okay. Can you then update the production records with the script provided in this PR? Once we verify that, we can merge it. |
per our discussion on MM, I'll wait until further notice to update production MSPileup records. |
Before merging it, please squash the commits. @vkuznet |
@vkuznet just a reminder about squashing commits. |
Alan, I made a mistake locally by squashing other parts within this PR, so you have two options:
Sorry about mistake. |
No problem. Please create a new PR and write that it superseeds this one. |
Due to mistake during squash local procedure (I squashed an additional changes not relevant to this PR) I created a new PR#11947 which supersede this PR. |
Superseeded by #11947 |
Fixes #11914
Status
ready
Description
Update ad-hoc scripts to create initial transition record for MSPileup records. There are two scripts:
adjustMongoDocs.py
to communicate with MongoDB directlyupdatePileupObjects.py
to communicate with MongoDB backend via MSPileup REST APIHere is how each script can be called:
Is it backward compatible (if not, which system it affects?)
YES
Related PRs
part of meta #11537
External dependencies / deployment changes
pymongo client