Skip to content

Commit db263d5

Browse files
authored
Merge pull request #8206 from chaen/v9.0_feat_singularityMount
feat (singularity): allow to mount local path rw
2 parents 9f4c39a + d83fa5e commit db263d5

File tree

3 files changed

+14
-3
lines changed

3 files changed

+14
-3
lines changed

docs/source/AdministratorGuide/Resources/storage.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -282,6 +282,12 @@ If the local path follows the DIRAC convention (i.e. finishes with the LFN), the
282282
{
283283
Protocol = file
284284
Path = /mnt/lustre_3/storm_3/lhcbdisk/
285+
# Note that rw is very dangerous
286+
# as it allows the payload to delete
287+
# anything in the mounted folder.
288+
# You should use this option only in
289+
# very controled environment (without user jobs as well)
290+
MountOptions = rw # ro by default
285291
Host = localhost
286292
Access = local
287293
}

src/DIRAC/FrameworkSystem/private/authorization/AuthServer.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -333,13 +333,13 @@ def create_json_request(self, request):
333333
"""Parse request. Rewrite authlib method."""
334334
return self.create_oauth2_request(request, JsonRequest, True)
335335

336-
def validate_requested_scope(self, scope, state=None):
336+
def validate_requested_scope(self, scope):
337337
"""See :func:`authlib.oauth2.rfc6749.authorization_server.validate_requested_scope`"""
338338
# We also consider parametric scope containing ":" charter
339339
extended_scope = list_to_scope(
340340
[re.sub(r":.*$", ":", s) for s in scope_to_list((scope or "").replace("+", " "))]
341341
)
342-
super().validate_requested_scope(extended_scope, state)
342+
super().validate_requested_scope(extended_scope)
343343

344344
def handle_response(self, status_code=None, payload=None, headers=None, newSession=None, delSession=None):
345345
"""Handle response

src/DIRAC/Resources/Computing/SingularityComputingElement.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,12 @@ def submitJob(self, executableFile, proxy=None, **kwargs):
387387
continue
388388

389389
mountedPath = se.getStorageParameters(protocol="file")["Value"]["Path"]
390-
bindPaths.append(f"{mountedPath}:{mountedPath}:ro")
390+
mountOptions = se.getStorageParameters(protocol="file")["Value"].get("MountOptions", "ro")
391+
if mountOptions not in ("rw", "ro"):
392+
self.log.warn(f"Unknown mount mode: {mountOptions}")
393+
continue
394+
395+
bindPaths.append(f"{mountedPath}:{mountedPath}:{mountOptions}")
391396
except KeyError:
392397
pass
393398

0 commit comments

Comments
 (0)