PilotWrapper

Module holding function(s) creating the pilot wrapper.

This is a DIRAC-free module, so it could possibly be used also outside of DIRAC installations.

The main client of this module is the SiteDirector, that invokes the functions here more or less like this:

pilotFiles = getPilotFiles() pilotFilesCompressedEncodedDict = getPilotFilesCompressedEncodedDict(pilotFiles) localPilot = pilotWrapperScript(pilotFilesCompressedEncodedDict,

pilotOptions, pilotExecDir)

_writePilotWrapperFile(localPilot=localPilot)

DIRAC.WorkloadManagementSystem.Utilities.PilotWrapper.getPilotFiles(pilotFilesDir=None, pilotFilesLocation=None)

get the pilot files to be sent in a local directory (this is for pilot3 files)

Parameters:
  • pilotFilesDir (basestring) – the directory where to store the pilot files
  • pilotFilesLocation (basestring) – URL from where to the pilot files
Returns:

list of pilot files (full path)

Return type:

list

DIRAC.WorkloadManagementSystem.Utilities.PilotWrapper.getPilotFilesCompressedEncodedDict(pilotFiles, proxy=None)
this function will return the dictionary of pilot files names : encodedCompressedContent
that we are going to send
Parameters:
  • pilotFiles (list) – list of pilot files
  • proxy (basestring) – proxy
DIRAC.WorkloadManagementSystem.Utilities.PilotWrapper.pilotWrapperScript(pilotFilesCompressedEncodedDict=None, pilotOptions='', pilotExecDir='', envVariables=None)

Returns the content of the pilot wrapper script.

The pilot wrapper script is a bash script that invokes the system python. Linux only.
Parameters:
  • pilotFilesCompressedEncodedDict (dict) – this is a possible dict of name:compressed+encoded content files. the proxy can be part of this, and of course the pilot files
  • pilotOptions (basestring) – options with which to start the pilot
  • pilotExecDir (basestring) – pilot execution directory
Returns:

content of the pilot wrapper

Return type:

basestring