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 Analysis Tape Recall activity #802

Merged
merged 2 commits into from
May 22, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions src/policy/CMSRucioPolicy/algorithms/auto_approve.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,15 @@ def global_approval(rule, did, session) -> bool:
:returns: True if the rule should be auto approved, False otherwise
"""

auto_approve_activity = 'User AutoApprove'
auto_approve_activities = ["User AutoApprove", "Analysis TapeRecall"]

# All checks are performed at rule creation
# The approval conditions are define in _check_for_auto_approve_eligibility function in the permissions module
# Check activity is User AutoApprove
# Analysis TapeRecall is also auto approved - This is used by CRAB to recall data from tape on behalf of the user
# The accounting is handled in crabserver

if rule['activity'] == auto_approve_activity:
if rule["activity"] in auto_approve_activities:
return True

return False
3 changes: 3 additions & 0 deletions src/policy/CMSRucioPolicy/permission.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,6 +322,9 @@ def perm_add_rule(issuer, kwargs, *, session: "Optional[Session]" = None):
if kwargs["activity"] == "User AutoApprove":
return _check_for_auto_approve_eligibility(issuer, rses, kwargs, session=session)

if kwargs["activity"] == "Analysis TapeRecall" and issuer.external == "crab_tape_recall":
return True

# Anyone can use _Temp RSEs if a lifetime is set and under a month
all_temp = True
for rse in rses:
Expand Down
4 changes: 3 additions & 1 deletion src/policy/CMSRucioPolicy/schema.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,9 @@
"Production Input", "Production Output",
"Analysis Input", "Analysis Output", "Staging",
"T0 Export", "T0 Tape", "Upload/Download (Job)",
"Upload/Download (User)", "User AutoApprove", "User Subscriptions", "Data Challenge"]}
"Upload/Download (User)", "User AutoApprove",
"User Subscriptions", "Data Challenge", "Analysis TapeRecall"]}


SCOPE_LENGTH = 25

Expand Down