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

Rucio list parent dids #9935

Merged
merged 1 commit into from
Sep 24, 2020
Merged

Conversation

germanfgv
Copy link
Contributor

Builds towards fixing #9623

Status

ready

Description

Wrapper for Rucio API's list_parent_dids()

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

YES

Related PRs

As stated in #9933, we need to list parent DIDs for each block

External dependencies / deployment changes

No

@germanfgv germanfgv requested a review from amaltaro September 24, 2020 10:00
@cmsdmwmbot
Copy link

Jenkins results:

  • Unit tests: succeeded
  • Pylint check: failed
    • 1 warnings and errors that must be fixed
    • 12 warnings
    • 6 comments to review
  • Pycodestyle check: succeeded
    • 6 comments to review
  • Python3 compatibility checks: succeeded

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

@amaltaro
Copy link
Contributor

@germanfgv just to make sure we have the correct concept of parent in the context of Rucio.

  • a file has a block parent, basically the block which the file belongs to
  • a block has a container (or multiple, if we start creating customized containers), basically the container which the block belongs to
    is that correct?

In that case, if I call this API list_parent_dids with a block name. Does it look for all the rules locking the parent container? Or it lists all rules of the parent container AND the rules for this block?

@germanfgv
Copy link
Contributor Author

@germanfgv just to make sure we have the correct concept of parent in the context of Rucio.

  • a file has a block parent, basically the block which the file belongs to
  • a block has a container (or multiple, if we start creating customized containers), basically the container which the block belongs to
    is that correct?

In that case, if I call this API list_parent_dids with a block name. Does it look for all the rules locking the parent container? Or it lists all rules of the parent container AND the rules for this block?

list_parent_dids does not look for rules, it looks for parent DIDs. If you call this API with a block name, it will return a list of dictionaries, each one describing a parent container. If you call this API with a file name, it will return a dictionary describing the parent block (not sure if a file can belong to multiple blocks).

In order to list all the rules locking the parent container of a block, I will use listParentDIDs to get the parent container and then use listDataRules to get its rules.

@amaltaro
Copy link
Contributor

Sorry, I don't know how I came up with rules here(!)
Your answer clarifies my question though. Thanks

@germanfgv
Copy link
Contributor Author

I could have created a method using both list_parent_dids and list_did_rules to directly get the parents's rules, but I decided against that. My reasoning was that being able to list parent DIDs may be useful for other purposes in RucioInjector.py, so I created listParentDIDs. @amaltaro Do you agree with this?

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.

@germanfgv code looks good to me. And I agree in separating these APIs for dids and rules too.
I asked a question in the code though, other than that it's good to go from my side.

Actually, I would ask you to implement a unit test for it. But since I'm working on a few other unit tests for this Rucio wrapper, I can take care of that.

src/python/WMCore/Services/Rucio/Rucio.py Show resolved Hide resolved
@amaltaro
Copy link
Contributor

Thanks German

@amaltaro amaltaro merged commit 6283a94 into dmwm:master Sep 24, 2020
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.

3 participants