Skip to content
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 customName to JSON data and adhoc script #11769

Merged
merged 1 commit into from
Nov 20, 2023

Conversation

vkuznet
Copy link
Contributor

@vkuznet vkuznet commented Oct 16, 2023

Fixes #11737

Status

ready

Description

Add customName to adhoc script and to JSON data documents used in pileup creation.

Is it backward compatible (if not, which system it affects?)

YES

Related PRs

#11765

External dependencies / deployment changes

@vkuznet vkuznet self-assigned this Oct 16, 2023
@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: failed
    • 1 new failures
    • 1 changes in unstable tests
  • Python3 Pylint check: failed
    • 5 warnings and errors that must be fixed
    • 2 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14557/artifact/artifacts/PullRequestReport.html

@vkuznet
Copy link
Contributor Author

vkuznet commented Oct 16, 2023

Alan, Todor, I made initial changes which are ready to review. I see one WQ test failing which I think is not related to this PR. Please review and provide your feedback of what else need to be done.

Copy link
Contributor

@amaltaro amaltaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valentin, I left a few comments for your consideration along the code.

The missing piece here is (from the ticket description):
"""
fetch all the MSPileup documents from MongoDB and update them to have the customName field as well
this has to be done for integration and production (perhaps for development databases as well?)
"""

but I think it would be premature to make it right now and I'd rather first see some extra developments of this feature going in.

bin/adhoc-scripts/createPileupObjects.py Outdated Show resolved Hide resolved
bin/adhoc-scripts/createPileupObjects.py Outdated Show resolved Hide resolved
@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 1 changes in unstable tests
  • Python3 Pylint check: succeeded
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14561/artifact/artifacts/PullRequestReport.html

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: failed
    • 1 new failures
  • Python3 Pylint check: succeeded
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14562/artifact/artifacts/PullRequestReport.html

Copy link
Contributor

@amaltaro amaltaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Valentin, did you miss the ad-hoc script?
In addition, we will need to update all the documents in MongoDB with the new field, but before that can be performed, I think we need to deploy the new pileup document schema implemented in:
#11765

is that correct?

@vkuznet
Copy link
Contributor Author

vkuznet commented Nov 14, 2023

@amaltaro , which ad-hoc script? I reverted the changes to ad-hoc scripts per your original feedback. I'm confused, please clarify it further.

Regarding MongoDB documents, again I'm confused. In my view there is no need to update any MongoDB documents per-se since new attribute field is optional, i.e. if old document does not have it is fine. For new documents it may be present. Please clarify your comment on this subject as well.

@amaltaro
Copy link
Contributor

@amaltaro , which ad-hoc script? I reverted the changes to ad-hoc scripts per your original feedback. I'm confused, please clarify it further.

Oh, you are right! The user does not need to provide customName field as it is optional.

Regarding the MongoDB documents, I think we should make it mandatory over there to ensure that all the documents are compliant with a schema. Hence the description in the GH issue asking those documents to be updated.

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 2 changes in unstable tests
  • Python3 Pylint check: failed
    • 2 warnings and errors that must be fixed
    • 6 comments to review
  • Pylint py3k check: failed
    • 2 errors and warnings that should be fixed
  • Pycodestyle check: succeeded
    • 1 comments to review

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14627/artifact/artifacts/PullRequestReport.html

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 3 changes in unstable tests
  • Python3 Pylint check: succeeded
    • 6 comments to review
  • Pylint py3k check: failed
    • 2 errors and warnings that should be fixed
  • Pycodestyle check: succeeded

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14628/artifact/artifacts/PullRequestReport.html

@vkuznet
Copy link
Contributor Author

vkuznet commented Nov 15, 2023

@amaltaro, I added a new script to make adjustments to MongoDB documents which I named adjustMongoDocs.py. I tested this script using local DB and it can be applied to change docs in testbed and production MongoDB. Please review this PR again to make your mind and let me know if I can proceed with changing docs in preproduction (and then in production). The script contains example how it should be run.

Copy link
Contributor

@amaltaro amaltaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Other than one comment left along the code, everything else looks good to me.
Can you please squash those commits in 1 or 2 commits only?

In addition, please clarify either in the script docstring or in the PR description itself on how exactly to run that script. As I understand it, it needs to be executed either from the MongoDB k8s cluster or from a backend pod running in k8s (e.g., MSOutput).

Lastly, please go ahead and update the ms-pileup documents in testbed. Once we are about to converge with these in production, we can then update the production documents as well.

bin/adhoc-scripts/adjustMongoDocs.py Outdated Show resolved Hide resolved
@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 3 tests no longer failing
  • Python3 Pylint check: succeeded
    • 6 comments to review
  • Pylint py3k check: failed
    • 2 errors and warnings that should be fixed
  • Pycodestyle check: succeeded

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14629/artifact/artifacts/PullRequestReport.html

Copy link
Contributor

@amaltaro amaltaro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Once testbed documents have been updated, we can get this merged. Thanks

bin/adhoc-scripts/adjustMongoDocs.py Outdated Show resolved Hide resolved
@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 3 tests no longer failing
    • 1 changes in unstable tests
  • Python3 Pylint check: succeeded
    • 6 comments to review
  • Pylint py3k check: failed
    • 2 errors and warnings that should be fixed
  • Pycodestyle check: succeeded

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14631/artifact/artifacts/PullRequestReport.html

@vkuznet
Copy link
Contributor Author

vkuznet commented Nov 16, 2023

Regarding fixing records on testbed and production, we can't do it until #11765 will be in place on both servers since we rigorously check records and since customName is a new attribute fixing records now will cause failure in service since such name is not present in current (deployed) codebase.

@amaltaro amaltaro merged commit 2b3b696 into dmwm:master Nov 20, 2023
2 of 4 checks passed
@amaltaro
Copy link
Contributor

@vkuznet Valentin, now that cmsweb-testbed is running with the relevant customName code, can you please update the MSPileup documents in cmsweb-testbed MongoDB? Thanks

@vkuznet
Copy link
Contributor Author

vkuznet commented Nov 21, 2023

I modified records in testbed but still haven't had time to perform integration test.

@amaltaro
Copy link
Contributor

@vkuznet Thanks Valentin! For the integration tests, perhaps we can wait for other features to get inserted into MSPileup - e.g. automatic creation of new DIDs and block/file attachment. This will make the integration tests easier to be performed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

MSPileup: update documents in MongoDB with the customName attribute
3 participants