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

Adjust scopes in Rucio wrapper and MSPileupTasks to support proper data placement of custom containers #11938

Merged
merged 1 commit into from
Mar 26, 2024

Conversation

vkuznet
Copy link
Contributor

@vkuznet vkuznet commented Mar 19, 2024

Fixes #11937.

Status

ready

Description

Fix scope usage in rucio client APIs. In details:

  • pass scope in to some methods in the Rucio wrapper module
  • when attaching DIDs, always assume the DIDs belong to the cms scope

In addition, further fixes to MSPileupTasks, such as:

  • when getting blocks from custom container, use the custom scope
  • whenever attaching DIDs to a custom container, pass in the custom scope as well
  • lastly, whenever creating a replication rule for custom container, use the custom scope.

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

YES

Related PRs

#11921

External dependencies / deployment changes

@vkuznet vkuznet self-assigned this Mar 19, 2024
@cmsdmwmbot
Copy link

Jenkins results:

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

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

@vkuznet vkuznet changed the title Adjust scopes Adjust scopes in Rucio wrapper and MSPileupTasks to support proper data placement of custom containers Mar 19, 2024
@amaltaro
Copy link
Contributor

@vkuznet Valentin, even though you haven't requested for a review yet, I wanted to mention 2 points:

  1. please update the docstring for the method isContainer, given that now we have a new parameter
  2. in the attachDIDs method, as we discussed, whenever a flat list of block names are provided, we will assume it to be part of the cms scope.

@cmsdmwmbot
Copy link

Jenkins results:

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

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

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
  • Python3 Pylint check: failed
    • 15 warnings and errors that must be fixed
    • 23 warnings
    • 41 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 1 comments to review

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

@vkuznet vkuznet requested a review from amaltaro March 21, 2024 15:23
@vkuznet
Copy link
Contributor Author

vkuznet commented Mar 21, 2024

@vkuznet Valentin, even though you haven't requested for a review yet, I wanted to mention 2 points:

  1. please update the docstring for the method isContainer, given that now we have a new parameter
  2. in the attachDIDs method, as we discussed, whenever a flat list of block names are provided, we will assume it to be part of the cms scope.

Alan, I don't see need for docstring update in isContainer since it already has scope parameter. Please clarify this request in your review. For item 2 it is already in this PR.

@cmsdmwmbot
Copy link

Jenkins results:

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

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

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: succeeded
    • 1 tests no longer failing
    • 1 changes in unstable tests
  • Python3 Pylint check: failed
    • 15 warnings and errors that must be fixed
    • 23 warnings
    • 41 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 1 comments to review

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

@cmsdmwmbot
Copy link

Jenkins results:

  • Python3 Unit tests: failed
    • 1 new failures
    • 1 tests no longer failing
    • 1 changes in unstable tests
  • Python3 Pylint check: failed
    • 16 warnings and errors that must be fixed
    • 23 warnings
    • 41 comments to review
  • Pylint py3k check: succeeded
  • Pycodestyle check: succeeded
    • 1 comments to review

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

@cmsdmwmbot
Copy link

Jenkins results:

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

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14987/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, please find a couple of comments along the code.
As requested during the WMCore meeting today, please also update the initial description of the PR with the relevant information.

dids = [{'scope': scope, 'name': did} for did in dids]
newDIDs = []
for did in dids:
if '#' in did:
Copy link
Contributor

Choose a reason for hiding this comment

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

Is there any reason to implement this check for block here? I would simply write it as we discussed last week, e.g.:

dids = [{'scope': 'cms', 'name': did} for did in dids]

and add a comment that, if DIDs need to be attached against a different scope, further development is needed.

Copy link
Contributor Author

@vkuznet vkuznet Mar 25, 2024

Choose a reason for hiding this comment

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

I think it is correct check since blocks must be always be in CMS scope while datasets (rucio container) may not. Since we should acknowledge given scope to this function I provided correct behavior, i.e. in input scope can be either cms or custom one and we should follow what is provided. Your suggestion will break this.

Copy link
Contributor

Choose a reason for hiding this comment

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

We don't attach container to containers. So setting cms scope for those dids is fine.

Copy link
Contributor Author

@vkuznet vkuznet Mar 25, 2024

Choose a reason for hiding this comment

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

Alan, please scan Rucio.py code to see where attachDIDs is used, e.g. createBlock, createReplicas APIs. The latter have specific scope input parameter, therefore I do not know how it will affect the other use-cases. I provided safest and correct way to follow the given scope and only make exception for dids which are CMS blocks.

Copy link
Contributor

Choose a reason for hiding this comment

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

I really would like to avoid checking for a block by verifying the existence of the # symbol, which is a fragile logic. That's the reason I am suggesting to simply set it to cms instead.

createBlock --> attaches blocks
createReplicas --> attaches files/replicas. So hardwiring it to cms is as good as the current logic, but cleaner.

Copy link
Contributor Author

@vkuznet vkuznet Mar 25, 2024

Choose a reason for hiding this comment

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

I'll not argue anymore, but I made my point. Said that, the code now has changed to use your proposal and I added proper comment. Please refresh the PR to see last commit: 53fcc3e

src/python/WMCore/Services/Rucio/Rucio.py Outdated Show resolved Hide resolved
@cmsdmwmbot
Copy link

Jenkins results:

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

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

@cmsdmwmbot
Copy link

Jenkins results:

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

Details at https://cmssdt.cern.ch/dmwm-jenkins/view/All/job/DMWM-WMCore-PR-test/14989/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.

Changes are looking good to me, Valentin. Can you please squash all of these commits?

@vkuznet
Copy link
Contributor Author

vkuznet commented Mar 25, 2024

commits are squashed

@cmsdmwmbot
Copy link

Jenkins results:

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

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

@amaltaro
Copy link
Contributor

It looks like you missed the PR description. I just updated it accordingly.

@amaltaro amaltaro merged commit cbdf0fc into dmwm:master Mar 26, 2024
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Wrong usage of scopes in Rucio wrapper and MSPileupTasks
3 participants