Client for the SandboxStore. Will connect to the WorkloadManagement/SandboxStore service.

class DIRAC.WorkloadManagementSystem.Client.SandboxStoreClient.SandboxStoreClient(rpcClient=None, transferClient=None, smdb=False, **kwargs)

Bases: object

__init__(rpcClient=None, transferClient=None, smdb=False, **kwargs)


  • rpcClient (object) – SandboxStore service client (None by default)

  • transferClient (object) – client to upload/download sandboxes (None by default)

  • smdb (object) – SandboxMetadataDB object, or True if SandboxMetadataDB is to be instantiated for direct access or False if no direct access to the SandboxMetadataDB is done (default)

assignSandboxesToJob(jobId, sbList, ownerName='', ownerGroup='')

Assign sandboxes to a job. sbList must be a list of sandboxes and relation types sbList = [ ( “SB:SEName|SEPFN”, “Input” ), ( “SB:SEName|SEPFN”, “Output” ) ]

downloadSandbox(sbLocation, destinationDir='', inMemory=False, unpack=True)

Download a sandbox file and keep it in bundled form

downloadSandboxForJob(jobId, sbType, destinationPath='', inMemory=False, unpack=True)

Download SB for a job


Unassign SB to a job

uploadFilesAsSandbox(fileList, sizeLimit=0, assignTo=None)

Send files in the fileList to a Sandbox service for the given jobID. This is the preferable method to upload sandboxes.

a fileList item can be:
  • a string, which is an lfn name

  • a file name (real), that is supposed to be on disk, in the current directory

  • a fileObject that should be a BytesIO type of object


assignTo (-) – Dict containing { ‘Job:<jobid>’ : ‘<sbType>’, … }

uploadFilesAsSandboxForJob(fileList, jobId, sbType, sizeLimit=0)

Upload SB for a job