Skip to content
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: 6 additions & 0 deletions src/DIRAC/WorkloadManagementSystem/ConfigTemplate.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -126,6 +126,8 @@ Services
BasePath = /opt/dirac/storage/sandboxes
# If true, uploads the sandbox via diracx on an S3 storage
UseDiracXBackend = False
# If true, all sandbox operations use diracx exclusively and local purging is disabled
UseDiracXBackendOnly = False
Authorization
{
Default = authenticated
Expand All @@ -144,6 +146,10 @@ Services
MaxThreads = 200
MaxSandboxSizeMiB = 10
BasePath = /opt/dirac/storage/sandboxes
# If true, uploads the sandbox via diracx on an S3 storage
UseDiracXBackend = False
# If true, all sandbox operations use diracx exclusively and local purging is disabled
UseDiracXBackendOnly = False
Authorization
{
Default = authenticated
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ def initializeHandler(cls, serviceInfoDict):
def initializeRequest(self):
self.__localSEName = self.getCSOption("LocalSE", "SandboxSE")
self._useDiracXBackend = self.getCSOption("UseDiracXBackend", False)
self._useDiracXBackendOnly = self.getCSOption("UseDiracXBackendOnly", False)
self._maxUploadBytes = self.getCSOption("MaxSandboxSizeMiB", 10) * 1048576
if self._useDiracXBackendOnly:
return
# Execute the purge once every 1000 calls
SandboxStoreHandler.__purgeCount += 1
if SandboxStoreHandler.__purgeCount > 1000:
Expand Down Expand Up @@ -97,7 +100,7 @@ def _getFromClient(self, fileId, token, fileSize, fileHelper=None, data=""):
vo = credDict.get("VO", Registry.getVOForGroup(credDict["group"]))

disabledVOs = gConfig.getValue("/DiracX/DisabledVOs", [])
if self._useDiracXBackend and vo not in disabledVOs:
if self._useDiracXBackendOnly or (self._useDiracXBackend and vo not in disabledVOs):
gLogger.info("Forwarding to DiracX")
with tempfile.TemporaryFile(mode="w+b") as tar_fh:
result = fileHelper.networkToDataSink(tar_fh, maxFileSize=self._maxUploadBytes)
Expand Down
Loading